Debian Codegraph @

external/gsl/gsl_fft__hc_pass_5.c

raw symbols SCIP
1 /* fft/hc_pass_5.c
2 *
3 * Copyright (C) 1996, 1997, 1998, 1999, 2000, 2007 Brian Gough
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3 of the License, or (at
8 * your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20 static void
21 FUNCTIONcxx . . $ `./templates_on.h:227:9`!(fft_halfcomplex,pass_5) (const BASEcxx . . $ `./templates_on.h:65:9`! in[],
22 const size_t istride,
23 BASEcxx . . $ `./templates_on.h:65:9`! out[],
24 const size_t ostride,
25 const size_t product,
26 const size_t n,
27 const TYPEcxx . . $ `./templates_on.h:228:9`!(gsl_complex) twiddle1[],
28 const TYPEcxx . . $ `./templates_on.h:228:9`!(gsl_complex) twiddle2[],
29 const TYPEcxx . . $ `./templates_on.h:228:9`!(gsl_complex) twiddle3[],
30 const TYPEcxx . . $ `./templates_on.h:228:9`!(gsl_complex) twiddle4[])
31 {
32
33 size_t k, k1;
34 size_t factor, q, m, product_1;
35
36 const ATOMICcxx . . $ `./templates_on.h:67:9`! sina = sin (2.0 * M_PIcxx . . $ `<external>/11263917310783833665/math.h:1121:10`! / 5.0);
37 const ATOMICcxx . . $ `./templates_on.h:67:9`! sinb = sin (2.0 * M_PIcxx . . $ `<external>/11263917310783833665/math.h:1121:10`! / 10.0);
38
39 factor = 5;
40 m = n / factor;
41 q = n / product;
42 product_1 = product / factor;
43
44 for (k1 = 0; k1 < product_1; k1++)
45 {
46 const size_t from0 = 5 * k1 * q;
47 const size_t from1 = from0 + 2 * q - 1;
48 const size_t from2 = from1 + 2 * q;
49
50 const ATOMICcxx . . $ `./templates_on.h:67:9`! z0_real = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from0);
51 const ATOMICcxx . . $ `./templates_on.h:67:9`! z1_real = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from1);
52 const ATOMICcxx . . $ `./templates_on.h:67:9`! z1_imag = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from1 + 1);
53 const ATOMICcxx . . $ `./templates_on.h:67:9`! z2_real = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from2);
54 const ATOMICcxx . . $ `./templates_on.h:67:9`! z2_imag = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from2 + 1);
55
56 const ATOMICcxx . . $ `./templates_on.h:67:9`! t1_real = 2 * (z1_real + z2_real);
57 const ATOMICcxx . . $ `./templates_on.h:67:9`! t2_real = 2 * (sqrt (5.0) / 4.0) * (z1_real - z2_real);
58 const ATOMICcxx . . $ `./templates_on.h:67:9`! t3_real = z0_real - t1_real / 4.0;
59 const ATOMICcxx . . $ `./templates_on.h:67:9`! t4_real = t2_real + t3_real;
60 const ATOMICcxx . . $ `./templates_on.h:67:9`! t5_real = -t2_real + t3_real;
61 const ATOMICcxx . . $ `./templates_on.h:67:9`! t6_imag = 2 * (sina * z1_imag + sinb * z2_imag);
62 const ATOMICcxx . . $ `./templates_on.h:67:9`! t7_imag = 2 * (sinb * z1_imag - sina * z2_imag);
63
64 const ATOMICcxx . . $ `./templates_on.h:67:9`! x0_real = z0_real + t1_real;
65 const ATOMICcxx . . $ `./templates_on.h:67:9`! x1_real = t4_real - t6_imag;
66 const ATOMICcxx . . $ `./templates_on.h:67:9`! x2_real = t5_real - t7_imag;
67 const ATOMICcxx . . $ `./templates_on.h:67:9`! x3_real = t5_real + t7_imag;
68 const ATOMICcxx . . $ `./templates_on.h:67:9`! x4_real = t4_real + t6_imag;
69
70 const size_t to0 = q * k1;
71 const size_t to1 = to0 + m;
72 const size_t to2 = to1 + m;
73 const size_t to3 = to2 + m;
74 const size_t to4 = to3 + m;
75
76 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to0) = x0_real;
77 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to1) = x1_real;
78 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to2) = x2_real;
79 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to3) = x3_real;
80 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to4) = x4_real;
81 }
82
83 if (q == 1)
84 return;
85
86 for (k = 1; k < (q + 1) / 2; k++)
87 {
88 const ATOMICcxx . . $ `./templates_on.h:67:9`! w1_real = GSL_REALcxx . . $ `external/gsl/gsl_complex.h:88:9`!(twiddle1[k - 1]);
89 const ATOMICcxx . . $ `./templates_on.h:67:9`! w1_imag = GSL_IMAGcxx . . $ `external/gsl/gsl_complex.h:89:9`!(twiddle1[k - 1]);
90 const ATOMICcxx . . $ `./templates_on.h:67:9`! w2_real = GSL_REALcxx . . $ `external/gsl/gsl_complex.h:88:9`!(twiddle2[k - 1]);
91 const ATOMICcxx . . $ `./templates_on.h:67:9`! w2_imag = GSL_IMAGcxx . . $ `external/gsl/gsl_complex.h:89:9`!(twiddle2[k - 1]);
92 const ATOMICcxx . . $ `./templates_on.h:67:9`! w3_real = GSL_REALcxx . . $ `external/gsl/gsl_complex.h:88:9`!(twiddle3[k - 1]);
93 const ATOMICcxx . . $ `./templates_on.h:67:9`! w3_imag = GSL_IMAGcxx . . $ `external/gsl/gsl_complex.h:89:9`!(twiddle3[k - 1]);
94 const ATOMICcxx . . $ `./templates_on.h:67:9`! w4_real = GSL_REALcxx . . $ `external/gsl/gsl_complex.h:88:9`!(twiddle4[k - 1]);
95 const ATOMICcxx . . $ `./templates_on.h:67:9`! w4_imag = GSL_IMAGcxx . . $ `external/gsl/gsl_complex.h:89:9`!(twiddle4[k - 1]);
96
97 for (k1 = 0; k1 < product_1; k1++)
98 {
99 const size_t from0 = 5 * k1 * q + 2 * k - 1;
100 const size_t from1 = from0 + 2 * q;
101 const size_t from2 = from1 + 2 * q;
102 const size_t from3 = 5 * k1 * q - 2 * k + 2 * q - 1;
103 const size_t from4 = from3 + 2 * q;
104
105 const ATOMICcxx . . $ `./templates_on.h:67:9`! z0_real = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from0);
106 const ATOMICcxx . . $ `./templates_on.h:67:9`! z0_imag = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from0 + 1);
107
108 const ATOMICcxx . . $ `./templates_on.h:67:9`! z1_real = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from1);
109 const ATOMICcxx . . $ `./templates_on.h:67:9`! z1_imag = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from1 + 1);
110
111 const ATOMICcxx . . $ `./templates_on.h:67:9`! z2_real = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from2);
112 const ATOMICcxx . . $ `./templates_on.h:67:9`! z2_imag = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from2 + 1);
113
114 const ATOMICcxx . . $ `./templates_on.h:67:9`! z3_real = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from4);
115 const ATOMICcxx . . $ `./templates_on.h:67:9`! z3_imag = -VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from4 + 1);
116
117 const ATOMICcxx . . $ `./templates_on.h:67:9`! z4_real = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from3);
118 const ATOMICcxx . . $ `./templates_on.h:67:9`! z4_imag = -VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from3 + 1);
119
120 /* compute x = W(5) z */
121
122 /* t1 = z1 + z4 */
123 const ATOMICcxx . . $ `./templates_on.h:67:9`! t1_real = z1_real + z4_real;
124 const ATOMICcxx . . $ `./templates_on.h:67:9`! t1_imag = z1_imag + z4_imag;
125
126 /* t2 = z2 + z3 */
127 const ATOMICcxx . . $ `./templates_on.h:67:9`! t2_real = z2_real + z3_real;
128 const ATOMICcxx . . $ `./templates_on.h:67:9`! t2_imag = z2_imag + z3_imag;
129
130 /* t3 = z1 - z4 */
131 const ATOMICcxx . . $ `./templates_on.h:67:9`! t3_real = z1_real - z4_real;
132 const ATOMICcxx . . $ `./templates_on.h:67:9`! t3_imag = z1_imag - z4_imag;
133
134 /* t4 = z2 - z3 */
135 const ATOMICcxx . . $ `./templates_on.h:67:9`! t4_real = z2_real - z3_real;
136 const ATOMICcxx . . $ `./templates_on.h:67:9`! t4_imag = z2_imag - z3_imag;
137
138 /* t5 = t1 + t2 */
139 const ATOMICcxx . . $ `./templates_on.h:67:9`! t5_real = t1_real + t2_real;
140 const ATOMICcxx . . $ `./templates_on.h:67:9`! t5_imag = t1_imag + t2_imag;
141
142 /* t6 = (sqrt(5)/4)(t1 - t2) */
143 const ATOMICcxx . . $ `./templates_on.h:67:9`! t6_real = (sqrt (5.0) / 4.0) * (t1_real - t2_real);
144 const ATOMICcxx . . $ `./templates_on.h:67:9`! t6_imag = (sqrt (5.0) / 4.0) * (t1_imag - t2_imag);
145
146 /* t7 = z0 - ((t5)/4) */
147 const ATOMICcxx . . $ `./templates_on.h:67:9`! t7_real = z0_real - t5_real / 4.0;
148 const ATOMICcxx . . $ `./templates_on.h:67:9`! t7_imag = z0_imag - t5_imag / 4.0;
149
150 /* t8 = t7 + t6 */
151 const ATOMICcxx . . $ `./templates_on.h:67:9`! t8_real = t7_real + t6_real;
152 const ATOMICcxx . . $ `./templates_on.h:67:9`! t8_imag = t7_imag + t6_imag;
153
154 /* t9 = t7 - t6 */
155 const ATOMICcxx . . $ `./templates_on.h:67:9`! t9_real = t7_real - t6_real;
156 const ATOMICcxx . . $ `./templates_on.h:67:9`! t9_imag = t7_imag - t6_imag;
157
158 /* t10 = sin(2 pi/5) t3 + sin(2 pi/10) t4 */
159 const ATOMICcxx . . $ `./templates_on.h:67:9`! t10_real = sina * t3_real + sinb * t4_real;
160 const ATOMICcxx . . $ `./templates_on.h:67:9`! t10_imag = sina * t3_imag + sinb * t4_imag;
161
162 /* t11 = sin(2 pi/10) t3 - sin(2 pi/5) t4 */
163 const ATOMICcxx . . $ `./templates_on.h:67:9`! t11_real = sinb * t3_real - sina * t4_real;
164 const ATOMICcxx . . $ `./templates_on.h:67:9`! t11_imag = sinb * t3_imag - sina * t4_imag;
165
166 /* x0 = z0 + t5 */
167 const ATOMICcxx . . $ `./templates_on.h:67:9`! x0_real = z0_real + t5_real;
168 const ATOMICcxx . . $ `./templates_on.h:67:9`! x0_imag = z0_imag + t5_imag;
169
170 /* x1 = t8 + i t10 */
171 const ATOMICcxx . . $ `./templates_on.h:67:9`! x1_real = t8_real - t10_imag;
172 const ATOMICcxx . . $ `./templates_on.h:67:9`! x1_imag = t8_imag + t10_real;
173
174 /* x2 = t9 + i t11 */
175 const ATOMICcxx . . $ `./templates_on.h:67:9`! x2_real = t9_real - t11_imag;
176 const ATOMICcxx . . $ `./templates_on.h:67:9`! x2_imag = t9_imag + t11_real;
177
178 /* x3 = t9 - i t11 */
179 const ATOMICcxx . . $ `./templates_on.h:67:9`! x3_real = t9_real + t11_imag;
180 const ATOMICcxx . . $ `./templates_on.h:67:9`! x3_imag = t9_imag - t11_real;
181
182 /* x4 = t8 - i t10 */
183 const ATOMICcxx . . $ `./templates_on.h:67:9`! x4_real = t8_real + t10_imag;
184 const ATOMICcxx . . $ `./templates_on.h:67:9`! x4_imag = t8_imag - t10_real;
185
186 const size_t to0 = k1 * q + 2 * k - 1;
187 const size_t to1 = to0 + m;
188 const size_t to2 = to1 + m;
189 const size_t to3 = to2 + m;
190 const size_t to4 = to3 + m;
191
192 /* apply twiddle factors */
193
194 /* to0 = 1 * x0 */
195 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to0) = x0_real;
196 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to0 + 1) = x0_imag;
197
198 /* to1 = w1 * x1 */
199 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to1) = w1_real * x1_real - w1_imag * x1_imag;
200 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to1 + 1) = w1_real * x1_imag + w1_imag * x1_real;
201
202 /* to2 = w2 * x2 */
203 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to2) = w2_real * x2_real - w2_imag * x2_imag;
204 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to2 + 1) = w2_real * x2_imag + w2_imag * x2_real;
205
206 /* to3 = w3 * x3 */
207 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to3) = w3_real * x3_real - w3_imag * x3_imag;
208 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to3 + 1) = w3_real * x3_imag + w3_imag * x3_real;
209
210 /* to4 = w4 * x4 */
211 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to4) = w4_real * x4_real - w4_imag * x4_imag;
212 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to4 + 1) = w4_real * x4_imag + w4_imag * x4_real;
213 }
214 }
215
216 if (q % 2 == 1)
217 return;
218
219 for (k1 = 0; k1 < product_1; k1++)
220 {
221 const size_t from0 = 5 * k1 * q + q - 1;
222 const size_t from1 = from0 + 2 * q;
223 const size_t from2 = from1 + 2 * q;
224
225 const ATOMICcxx . . $ `./templates_on.h:67:9`! z0_real = 2 * VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from0);
226 const ATOMICcxx . . $ `./templates_on.h:67:9`! z0_imag = 2 * VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from0 + 1);
227
228 const ATOMICcxx . . $ `./templates_on.h:67:9`! z1_real = 2 * VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from1);
229 const ATOMICcxx . . $ `./templates_on.h:67:9`! z1_imag = 2 * VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from1 + 1);
230
231 const ATOMICcxx . . $ `./templates_on.h:67:9`! z2_real = VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(in,istride,from2);
232
233 const ATOMICcxx . . $ `./templates_on.h:67:9`! t1_real = z0_real + z1_real;
234 const ATOMICcxx . . $ `./templates_on.h:67:9`! t2_real = (t1_real / 4.0) - z2_real;
235 const ATOMICcxx . . $ `./templates_on.h:67:9`! t3_real = (sqrt (5.0) / 4.0) * (z0_real - z1_real);
236 const ATOMICcxx . . $ `./templates_on.h:67:9`! t4_real = sinb * z0_imag + sina * z1_imag;
237 const ATOMICcxx . . $ `./templates_on.h:67:9`! t5_real = sina * z0_imag - sinb * z1_imag;
238 const ATOMICcxx . . $ `./templates_on.h:67:9`! t6_real = t3_real + t2_real;
239 const ATOMICcxx . . $ `./templates_on.h:67:9`! t7_real = t3_real - t2_real;
240
241 const ATOMICcxx . . $ `./templates_on.h:67:9`! x0_real = t1_real + z2_real;
242 const ATOMICcxx . . $ `./templates_on.h:67:9`! x1_real = t6_real - t4_real;
243 const ATOMICcxx . . $ `./templates_on.h:67:9`! x2_real = t7_real - t5_real;
244 const ATOMICcxx . . $ `./templates_on.h:67:9`! x3_real = -t7_real - t5_real;
245 const ATOMICcxx . . $ `./templates_on.h:67:9`! x4_real = -t6_real - t4_real;
246
247 const size_t to0 = k1 * q + q - 1;
248 const size_t to1 = to0 + m;
249 const size_t to2 = to1 + m;
250 const size_t to3 = to2 + m;
251 const size_t to4 = to3 + m;
252
253 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to0) = x0_real;
254 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to1) = x1_real;
255 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to2) = x2_real;
256 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to3) = x3_real;
257 VECTORcxx . . $ `external/gsl/gsl_fft__complex_internal.h:6:9`!(out,ostride,to4) = x4_real;
258 }
259 return;
260 }