Skip to main content

oxifft/dft/codelets/composite/
functions_2.rs

1//! Auto-generated module
2//!
3//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
4
5#![allow(clippy::approx_constant)] // Precomputed twiddle factors for FFT
6#![allow(clippy::unreadable_literal)] // Precomputed FFT twiddle factors
7
8use crate::dft::codelets::simd;
9use crate::kernel::{Complex, Float};
10
11use super::functions::{dft5, notw_12};
12
13/// Optimized DFT of size 60.
14///
15/// Uses 4×15 mixed-radix decomposition.
16/// sign: -1 for forward, +1 for inverse
17#[inline]
18pub fn notw_60<T: Float>(x: &mut [Complex<T>], sign: i32) {
19    debug_assert!(x.len() >= 60);
20    let sign_t = if sign < 0 { -T::ONE } else { T::ONE };
21    let mut t: [Complex<T>; 60] = [Complex::zero(); 60];
22    for j in 0..15 {
23        let a0 = x[j];
24        let a1 = x[j + 15];
25        let a2 = x[j + 30];
26        let a3 = x[j + 45];
27        let s02 = a0 + a2;
28        let d02 = a0 - a2;
29        let s13 = a1 + a3;
30        let d13 = a1 - a3;
31        let rot_d13 = Complex::new(sign_t * d13.im, -sign_t * d13.re);
32        t[j] = s02 + s13;
33        t[j + 15] = d02 - rot_d13;
34        t[j + 30] = s02 - s13;
35        t[j + 45] = d02 + rot_d13;
36    }
37    let cos_60: [T; 46] = [
38        T::ONE,
39        T::from_f64(0.9945218953682733),
40        T::from_f64(0.9781476007338057),
41        T::from_f64(0.9510565162951535),
42        T::from_f64(0.9135454576426009),
43        T::from_f64(0.8660254037844387),
44        T::from_f64(0.8090169943749474),
45        T::from_f64(0.7431448254773942),
46        T::from_f64(0.6691306063588582),
47        T::from_f64(0.5877852522924731),
48        T::from_f64(0.5),
49        T::from_f64(0.4067366430758002),
50        T::from_f64(0.30901699437494745),
51        T::from_f64(0.20791169081775934),
52        T::from_f64(0.10452846326765346),
53        T::ZERO,
54        T::from_f64(-0.10452846326765346),
55        T::from_f64(-0.20791169081775934),
56        T::from_f64(-0.30901699437494745),
57        T::from_f64(-0.4067366430758002),
58        T::from_f64(-0.5),
59        T::from_f64(-0.5877852522924731),
60        T::from_f64(-0.6691306063588582),
61        T::from_f64(-0.7431448254773942),
62        T::from_f64(-0.8090169943749474),
63        T::from_f64(-0.8660254037844387),
64        T::from_f64(-0.9135454576426009),
65        T::from_f64(-0.9510565162951535),
66        T::from_f64(-0.9781476007338057),
67        T::from_f64(-0.9945218953682733),
68        -T::ONE,
69        T::from_f64(-0.9945218953682733),
70        T::from_f64(-0.9781476007338057),
71        T::from_f64(-0.9510565162951535),
72        T::from_f64(-0.9135454576426009),
73        T::from_f64(-0.8660254037844387),
74        T::from_f64(-0.8090169943749474),
75        T::from_f64(-0.7431448254773942),
76        T::from_f64(-0.6691306063588582),
77        T::from_f64(-0.5877852522924731),
78        T::from_f64(-0.5),
79        T::from_f64(-0.4067366430758002),
80        T::from_f64(-0.30901699437494745),
81        T::from_f64(-0.20791169081775934),
82        T::from_f64(-0.10452846326765346),
83        T::ZERO,
84    ];
85    let sin_60: [T; 46] = [
86        T::ZERO,
87        T::from_f64(0.10452846326765346),
88        T::from_f64(0.20791169081775934),
89        T::from_f64(0.30901699437494745),
90        T::from_f64(0.4067366430758002),
91        T::from_f64(0.5),
92        T::from_f64(0.5877852522924731),
93        T::from_f64(0.6691306063588582),
94        T::from_f64(0.7431448254773942),
95        T::from_f64(0.8090169943749474),
96        T::from_f64(0.8660254037844387),
97        T::from_f64(0.9135454576426009),
98        T::from_f64(0.9510565162951535),
99        T::from_f64(0.9781476007338057),
100        T::from_f64(0.9945218953682733),
101        T::ONE,
102        T::from_f64(0.9945218953682733),
103        T::from_f64(0.9781476007338057),
104        T::from_f64(0.9510565162951535),
105        T::from_f64(0.9135454576426009),
106        T::from_f64(0.8660254037844387),
107        T::from_f64(0.8090169943749474),
108        T::from_f64(0.7431448254773942),
109        T::from_f64(0.6691306063588582),
110        T::from_f64(0.5877852522924731),
111        T::from_f64(0.5),
112        T::from_f64(0.4067366430758002),
113        T::from_f64(0.30901699437494745),
114        T::from_f64(0.20791169081775934),
115        T::from_f64(0.10452846326765346),
116        T::ZERO,
117        T::from_f64(-0.10452846326765346),
118        T::from_f64(-0.20791169081775934),
119        T::from_f64(-0.30901699437494745),
120        T::from_f64(-0.4067366430758002),
121        T::from_f64(-0.5),
122        T::from_f64(-0.5877852522924731),
123        T::from_f64(-0.6691306063588582),
124        T::from_f64(-0.7431448254773942),
125        T::from_f64(-0.8090169943749474),
126        T::from_f64(-0.8660254037844387),
127        T::from_f64(-0.9135454576426009),
128        T::from_f64(-0.9510565162951535),
129        T::from_f64(-0.9781476007338057),
130        T::from_f64(-0.9945218953682733),
131        -T::ONE,
132    ];
133    for k1 in 1..4 {
134        for k2 in 1..15 {
135            let k = k1 * k2;
136            let c = cos_60[k];
137            let s = sin_60[k];
138            let idx = k1 * 15 + k2;
139            let tw = t[idx];
140            t[idx] = Complex::new(
141                tw.re * c - sign_t * tw.im * s,
142                sign_t * tw.re * s + tw.im * c,
143            );
144        }
145    }
146    let sqrt3_2 = T::from_f64(0.8660254037844387);
147    let half = T::from_f64(0.5);
148    let c15_1 = T::from_f64(0.9135454576426009);
149    let s15_1 = T::from_f64(0.4067366430758002);
150    let c15_2 = T::from_f64(0.6691306063588582);
151    let s15_2 = T::from_f64(0.7431448254773942);
152    let c15_3 = T::from_f64(0.309_016_994_374_947_4);
153    let s15_3 = T::from_f64(0.9510565162951535);
154    let c15_4 = T::from_f64(-0.10452846326765346);
155    let s15_4 = T::from_f64(0.9945218953682733);
156    let c15_6 = T::from_f64(-0.8090169943749474);
157    let s15_6 = T::from_f64(0.5877852522924731);
158    let c15_8 = T::from_f64(-0.9781476007338057);
159    let s15_8 = T::from_f64(-0.20791169081775934);
160    for k1 in 0..4 {
161        let base = k1 * 15;
162        let mut tmp: [Complex<T>; 15] = [Complex::zero(); 15];
163        for j in 0..5 {
164            let a0 = t[base + j];
165            let a1 = t[base + j + 5];
166            let a2 = t[base + j + 10];
167            let sum = a0 + a1 + a2;
168            let d1 = a1 - a2;
169            let d2 = a0 - (a1 + a2).scale(half);
170            let rot_re = -sign_t * sqrt3_2 * d1.im;
171            let rot_im = -sign_t * sqrt3_2 * d1.re;
172            tmp[j] = sum;
173            tmp[j + 5] = Complex::new(d2.re + rot_re, d2.im - rot_im);
174            tmp[j + 10] = Complex::new(d2.re - rot_re, d2.im + rot_im);
175        }
176        let tw = tmp[6];
177        tmp[6] = Complex::new(
178            tw.re * c15_1 - sign_t * tw.im * s15_1,
179            sign_t * tw.re * s15_1 + tw.im * c15_1,
180        );
181        let tw = tmp[7];
182        tmp[7] = Complex::new(
183            tw.re * c15_2 - sign_t * tw.im * s15_2,
184            sign_t * tw.re * s15_2 + tw.im * c15_2,
185        );
186        let tw = tmp[8];
187        tmp[8] = Complex::new(
188            tw.re * c15_3 - sign_t * tw.im * s15_3,
189            sign_t * tw.re * s15_3 + tw.im * c15_3,
190        );
191        let tw = tmp[9];
192        tmp[9] = Complex::new(
193            tw.re * c15_4 - sign_t * tw.im * s15_4,
194            sign_t * tw.re * s15_4 + tw.im * c15_4,
195        );
196        let tw = tmp[11];
197        tmp[11] = Complex::new(
198            tw.re * c15_2 - sign_t * tw.im * s15_2,
199            sign_t * tw.re * s15_2 + tw.im * c15_2,
200        );
201        let tw = tmp[12];
202        tmp[12] = Complex::new(
203            tw.re * c15_4 - sign_t * tw.im * s15_4,
204            sign_t * tw.re * s15_4 + tw.im * c15_4,
205        );
206        let tw = tmp[13];
207        tmp[13] = Complex::new(
208            tw.re * c15_6 - sign_t * tw.im * s15_6,
209            sign_t * tw.re * s15_6 + tw.im * c15_6,
210        );
211        let tw = tmp[14];
212        tmp[14] = Complex::new(
213            tw.re * c15_8 - sign_t * tw.im * s15_8,
214            sign_t * tw.re * s15_8 + tw.im * c15_8,
215        );
216        for row in 0..3 {
217            let row_base = row * 5;
218            let input: [Complex<T>; 5] = [
219                tmp[row_base],
220                tmp[row_base + 1],
221                tmp[row_base + 2],
222                tmp[row_base + 3],
223                tmp[row_base + 4],
224            ];
225            let output = dft5(&input, sign_t);
226            for col in 0..5 {
227                x[(row + col * 3) * 4 + k1] = output[col];
228            }
229        }
230    }
231}
232/// Optimized DFT of size 72.
233///
234/// Uses 9×8 mixed-radix decomposition with inlined dft9.
235/// sign: -1 for forward, +1 for inverse
236#[inline]
237pub fn notw_72<T: Float>(x: &mut [Complex<T>], sign: i32) {
238    debug_assert!(x.len() >= 72);
239    let sign_t = if sign < 0 { -T::ONE } else { T::ONE };
240    let mut t: [Complex<T>; 72] = [Complex::zero(); 72];
241    let sqrt3_2 = T::from_f64(0.8660254037844387);
242    let half = T::from_f64(0.5);
243    let c1_9 = T::from_f64(0.766044443118978);
244    let s1_9 = T::from_f64(0.6427876096865393);
245    let c2_9 = T::from_f64(0.17364817766693041);
246    let s2_9 = T::from_f64(0.984807753012208);
247    let c4_9 = T::from_f64(-0.9396926207859084);
248    let s4_9 = T::from_f64(0.3420201433256687);
249    for j in 0..8 {
250        let a0 = x[j];
251        let a1 = x[j + 8];
252        let a2 = x[j + 16];
253        let a3 = x[j + 24];
254        let a4 = x[j + 32];
255        let a5 = x[j + 40];
256        let a6 = x[j + 48];
257        let a7 = x[j + 56];
258        let a8 = x[j + 64];
259        let sum0 = a0 + a3 + a6;
260        let d1_0 = a3 - a6;
261        let d2_0 = a0 - (a3 + a6).scale(half);
262        let rot_re0 = -sign_t * sqrt3_2 * d1_0.im;
263        let rot_im0 = -sign_t * sqrt3_2 * d1_0.re;
264        let t0 = sum0;
265        let t3 = Complex::new(d2_0.re + rot_re0, d2_0.im - rot_im0);
266        let t6 = Complex::new(d2_0.re - rot_re0, d2_0.im + rot_im0);
267        let sum1 = a1 + a4 + a7;
268        let d1_1 = a4 - a7;
269        let d2_1 = a1 - (a4 + a7).scale(half);
270        let rot_re1 = -sign_t * sqrt3_2 * d1_1.im;
271        let rot_im1 = -sign_t * sqrt3_2 * d1_1.re;
272        let t1 = sum1;
273        let t4 = Complex::new(d2_1.re + rot_re1, d2_1.im - rot_im1);
274        let t7 = Complex::new(d2_1.re - rot_re1, d2_1.im + rot_im1);
275        let sum2 = a2 + a5 + a8;
276        let d1_2 = a5 - a8;
277        let d2_2 = a2 - (a5 + a8).scale(half);
278        let rot_re2 = -sign_t * sqrt3_2 * d1_2.im;
279        let rot_im2 = -sign_t * sqrt3_2 * d1_2.re;
280        let t2 = sum2;
281        let t5 = Complex::new(d2_2.re + rot_re2, d2_2.im - rot_im2);
282        let t8 = Complex::new(d2_2.re - rot_re2, d2_2.im + rot_im2);
283        let tw4 = Complex::new(
284            t4.re * c1_9 - sign_t * t4.im * s1_9,
285            sign_t * t4.re * s1_9 + t4.im * c1_9,
286        );
287        let tw5 = Complex::new(
288            t5.re * c2_9 - sign_t * t5.im * s2_9,
289            sign_t * t5.re * s2_9 + t5.im * c2_9,
290        );
291        let tw7 = Complex::new(
292            t7.re * c2_9 - sign_t * t7.im * s2_9,
293            sign_t * t7.re * s2_9 + t7.im * c2_9,
294        );
295        let tw8 = Complex::new(
296            t8.re * c4_9 - sign_t * t8.im * s4_9,
297            sign_t * t8.re * s4_9 + t8.im * c4_9,
298        );
299        let sum_r0 = t0 + t1 + t2;
300        let d1_r0 = t1 - t2;
301        let d2_r0 = t0 - (t1 + t2).scale(half);
302        let rot_re_r0 = -sign_t * sqrt3_2 * d1_r0.im;
303        let rot_im_r0 = -sign_t * sqrt3_2 * d1_r0.re;
304        let sum_r1 = t3 + tw4 + tw5;
305        let d1_r1 = tw4 - tw5;
306        let d2_r1 = t3 - (tw4 + tw5).scale(half);
307        let rot_re_r1 = -sign_t * sqrt3_2 * d1_r1.im;
308        let rot_im_r1 = -sign_t * sqrt3_2 * d1_r1.re;
309        let sum_r2 = t6 + tw7 + tw8;
310        let d1_r2 = tw7 - tw8;
311        let d2_r2 = t6 - (tw7 + tw8).scale(half);
312        let rot_re_r2 = -sign_t * sqrt3_2 * d1_r2.im;
313        let rot_im_r2 = -sign_t * sqrt3_2 * d1_r2.re;
314        t[j] = sum_r0;
315        t[8 + j] = sum_r1;
316        t[16 + j] = sum_r2;
317        t[24 + j] = Complex::new(d2_r0.re + rot_re_r0, d2_r0.im - rot_im_r0);
318        t[32 + j] = Complex::new(d2_r1.re + rot_re_r1, d2_r1.im - rot_im_r1);
319        t[40 + j] = Complex::new(d2_r2.re + rot_re_r2, d2_r2.im - rot_im_r2);
320        t[48 + j] = Complex::new(d2_r0.re - rot_re_r0, d2_r0.im + rot_im_r0);
321        t[56 + j] = Complex::new(d2_r1.re - rot_re_r1, d2_r1.im + rot_im_r1);
322        t[64 + j] = Complex::new(d2_r2.re - rot_re_r2, d2_r2.im + rot_im_r2);
323    }
324    #[rustfmt::skip]
325    let cos_72: [T; 57] = [
326        T::ONE,
327        T::from_f64(0.9961946980917455),
328        T::from_f64(0.984807753012208),
329        T::from_f64(0.9659258262890683),
330        T::from_f64(0.9396926207859084),
331        T::from_f64(0.9063077870366499),
332        T::from_f64(0.8660254037844387),
333        T::from_f64(0.8191520442889918),
334        T::from_f64(0.766044443118978),
335        T::from_f64(0.7071067811865476),
336        T::from_f64(0.6427876096865394),
337        T::from_f64(0.573_576_436_351_046),
338        T::from_f64(0.5),
339        T::from_f64(0.42261826174069944),
340        T::from_f64(0.3420201433256687),
341        T::from_f64(0.25881904510252074),
342        T::from_f64(0.17364817766693041),
343        T::from_f64(0.08715574274765814),
344        T::ZERO,
345        T::from_f64(-0.08715574274765814),
346        T::from_f64(-0.17364817766693041),
347        T::from_f64(-0.25881904510252074),
348        T::from_f64(-0.3420201433256687),
349        T::from_f64(-0.42261826174069944),
350        T::from_f64(-0.5),
351        T::from_f64(-0.573_576_436_351_046),
352        T::from_f64(-0.6427876096865394),
353        T::from_f64(-0.7071067811865476),
354        T::from_f64(-0.766044443118978),
355        T::from_f64(-0.8191520442889918),
356        T::from_f64(-0.8660254037844387),
357        T::from_f64(-0.9063077870366499),
358        T::from_f64(-0.9396926207859084),
359        T::from_f64(-0.9659258262890683),
360        T::from_f64(-0.984807753012208),
361        T::from_f64(-0.9961946980917455),
362        -T::ONE,
363        T::from_f64(-0.9961946980917455),
364        T::from_f64(-0.984807753012208),
365        T::from_f64(-0.9659258262890683),
366        T::from_f64(-0.9396926207859084),
367        T::from_f64(-0.9063077870366499),
368        T::from_f64(-0.8660254037844387),
369        T::from_f64(-0.8191520442889918),
370        T::from_f64(-0.766044443118978),
371        T::from_f64(-0.7071067811865476),
372        T::from_f64(-0.6427876096865394),
373        T::from_f64(-0.573_576_436_351_046),
374        T::from_f64(-0.5),
375        T::from_f64(-0.42261826174069944),
376        T::from_f64(-0.3420201433256687),
377        T::from_f64(-0.25881904510252074),
378        T::from_f64(-0.17364817766693041),
379        T::from_f64(-0.08715574274765814),
380        T::ZERO,
381        T::from_f64(0.08715574274765814),
382        T::from_f64(0.17364817766693041),
383    ];
384    #[rustfmt::skip]
385    let sin_72: [T; 57] = [
386        T::ZERO,
387        T::from_f64(0.08715574274765817),
388        T::from_f64(0.17364817766693033),
389        T::from_f64(0.25881904510252074),
390        T::from_f64(0.3420201433256687),
391        T::from_f64(0.42261826174069944),
392        T::from_f64(0.5),
393        T::from_f64(0.573_576_436_351_046),
394        T::from_f64(0.6427876096865393),
395        T::from_f64(0.7071067811865476),
396        T::from_f64(0.766044443118978),
397        T::from_f64(0.8191520442889918),
398        T::from_f64(0.8660254037844387),
399        T::from_f64(0.9063077870366499),
400        T::from_f64(0.9396926207859084),
401        T::from_f64(0.9659258262890683),
402        T::from_f64(0.984807753012208),
403        T::from_f64(0.9961946980917455),
404        T::ONE,
405        T::from_f64(0.9961946980917455),
406        T::from_f64(0.984807753012208),
407        T::from_f64(0.9659258262890683),
408        T::from_f64(0.9396926207859084),
409        T::from_f64(0.9063077870366499),
410        T::from_f64(0.8660254037844387),
411        T::from_f64(0.8191520442889918),
412        T::from_f64(0.766044443118978),
413        T::from_f64(0.7071067811865476),
414        T::from_f64(0.6427876096865394),
415        T::from_f64(0.573_576_436_351_046),
416        T::from_f64(0.5),
417        T::from_f64(0.42261826174069944),
418        T::from_f64(0.3420201433256687),
419        T::from_f64(0.25881904510252074),
420        T::from_f64(0.17364817766693033),
421        T::from_f64(0.08715574274765817),
422        T::ZERO,
423        T::from_f64(-0.08715574274765817),
424        T::from_f64(-0.17364817766693033),
425        T::from_f64(-0.25881904510252074),
426        T::from_f64(-0.3420201433256687),
427        T::from_f64(-0.42261826174069944),
428        T::from_f64(-0.5),
429        T::from_f64(-0.573_576_436_351_046),
430        T::from_f64(-0.6427876096865394),
431        T::from_f64(-0.7071067811865476),
432        T::from_f64(-0.766044443118978),
433        T::from_f64(-0.8191520442889918),
434        T::from_f64(-0.8660254037844387),
435        T::from_f64(-0.9063077870366499),
436        T::from_f64(-0.9396926207859084),
437        T::from_f64(-0.9659258262890683),
438        T::from_f64(-0.984807753012208),
439        T::from_f64(-0.9961946980917455),
440        -T::ONE,
441        T::from_f64(-0.9961946980917455),
442        T::from_f64(-0.984807753012208),
443    ];
444    for k1 in 1..9 {
445        for k2 in 1..8 {
446            let k = k1 * k2;
447            let c = cos_72[k];
448            let s = sin_72[k];
449            let idx = k1 * 8 + k2;
450            let tw = t[idx];
451            t[idx] = Complex::new(
452                tw.re * c - sign_t * tw.im * s,
453                sign_t * tw.re * s + tw.im * c,
454            );
455        }
456    }
457    for k1 in 0..9 {
458        let base = k1 * 8;
459        simd::notw_8_dispatch(&mut t[base..base + 8], sign);
460    }
461    for k1 in 0..9 {
462        let base = k1 * 8;
463        for k2 in 0..8 {
464            x[k2 * 9 + k1] = t[base + k2];
465        }
466    }
467}
468/// Optimized DFT of size 96.
469///
470/// Uses 8×12 mixed-radix decomposition for better SIMD utilization.
471/// sign: -1 for forward, +1 for inverse
472#[inline]
473pub fn notw_96<T: Float>(x: &mut [Complex<T>], sign: i32) {
474    debug_assert!(x.len() >= 96);
475    let sign_t = if sign < 0 { -T::ONE } else { T::ONE };
476    let mut t: [Complex<T>; 96] = [Complex::zero(); 96];
477    for j in 0..12 {
478        let mut temp8: [Complex<T>; 8] = [
479            x[j],
480            x[j + 12],
481            x[j + 24],
482            x[j + 36],
483            x[j + 48],
484            x[j + 60],
485            x[j + 72],
486            x[j + 84],
487        ];
488        simd::notw_8_dispatch(&mut temp8, sign);
489        for k1 in 0..8 {
490            t[k1 * 12 + j] = temp8[k1];
491        }
492    }
493    #[rustfmt::skip]
494    let cos_96: [T; 78] = [
495        T::ONE,
496        T::from_f64(0.9978589232386035),
497        T::from_f64(0.9914448613738104),
498        T::from_f64(0.9807852804032304),
499        T::from_f64(0.9659258262890683),
500        T::from_f64(0.9469301294951057),
501        T::from_f64(0.9238795325112867),
502        T::from_f64(0.8968727415326884),
503        T::from_f64(0.8660254037844387),
504        T::from_f64(0.831469612302545),
505        T::from_f64(0.7933533402912352),
506        T::from_f64(0.7518398074789774),
507        T::from_f64(0.7071067811865476),
508        T::from_f64(0.6593458151000688),
509        T::from_f64(0.6087614290087207),
510        T::from_f64(0.5555702330196022),
511        T::from_f64(0.5),
512        T::from_f64(0.44228869021900125),
513        T::from_f64(0.38268343236508984),
514        T::from_f64(0.3214394653031617),
515        T::from_f64(0.25881904510252074),
516        T::from_f64(0.19509032201612828),
517        T::from_f64(0.1305261922200516),
518        T::from_f64(0.06540312923014327),
519        T::ZERO,
520        T::from_f64(-0.06540312923014327),
521        T::from_f64(-0.1305261922200516),
522        T::from_f64(-0.19509032201612828),
523        T::from_f64(-0.25881904510252074),
524        T::from_f64(-0.3214394653031617),
525        T::from_f64(-0.38268343236508984),
526        T::from_f64(-0.44228869021900125),
527        T::from_f64(-0.5),
528        T::from_f64(-0.5555702330196022),
529        T::from_f64(-0.6087614290087207),
530        T::from_f64(-0.6593458151000688),
531        T::from_f64(-0.7071067811865476),
532        T::from_f64(-0.7518398074789774),
533        T::from_f64(-0.7933533402912352),
534        T::from_f64(-0.831469612302545),
535        T::from_f64(-0.8660254037844387),
536        T::from_f64(-0.8968727415326884),
537        T::from_f64(-0.9238795325112867),
538        T::from_f64(-0.9469301294951057),
539        T::from_f64(-0.9659258262890683),
540        T::from_f64(-0.9807852804032304),
541        T::from_f64(-0.9914448613738104),
542        T::from_f64(-0.9978589232386035),
543        -T::ONE,
544        T::from_f64(-0.9978589232386035),
545        T::from_f64(-0.9914448613738104),
546        T::from_f64(-0.9807852804032304),
547        T::from_f64(-0.9659258262890683),
548        T::from_f64(-0.9469301294951057),
549        T::from_f64(-0.9238795325112867),
550        T::from_f64(-0.8968727415326884),
551        T::from_f64(-0.8660254037844387),
552        T::from_f64(-0.831469612302545),
553        T::from_f64(-0.7933533402912352),
554        T::from_f64(-0.7518398074789774),
555        T::from_f64(-0.7071067811865476),
556        T::from_f64(-0.6593458151000688),
557        T::from_f64(-0.6087614290087207),
558        T::from_f64(-0.5555702330196022),
559        T::from_f64(-0.5),
560        T::from_f64(-0.44228869021900125),
561        T::from_f64(-0.38268343236508984),
562        T::from_f64(-0.3214394653031617),
563        T::from_f64(-0.25881904510252074),
564        T::from_f64(-0.19509032201612828),
565        T::from_f64(-0.1305261922200516),
566        T::from_f64(-0.06540312923014327),
567        T::ZERO,
568        T::from_f64(0.06540312923014327),
569        T::from_f64(0.1305261922200516),
570        T::from_f64(0.19509032201612828),
571        T::from_f64(0.25881904510252074),
572        T::from_f64(0.3214394653031617),
573    ];
574    #[rustfmt::skip]
575    let sin_96: [T; 78] = [
576        T::ZERO,
577        T::from_f64(0.06540312923014327),
578        T::from_f64(0.1305261922200516),
579        T::from_f64(0.19509032201612828),
580        T::from_f64(0.25881904510252074),
581        T::from_f64(0.3214394653031617),
582        T::from_f64(0.38268343236508984),
583        T::from_f64(0.44228869021900125),
584        T::from_f64(0.5),
585        T::from_f64(0.5555702330196022),
586        T::from_f64(0.6087614290087207),
587        T::from_f64(0.6593458151000688),
588        T::from_f64(0.7071067811865476),
589        T::from_f64(0.7518398074789774),
590        T::from_f64(0.7933533402912352),
591        T::from_f64(0.831469612302545),
592        T::from_f64(0.8660254037844387),
593        T::from_f64(0.8968727415326884),
594        T::from_f64(0.9238795325112867),
595        T::from_f64(0.9469301294951057),
596        T::from_f64(0.9659258262890683),
597        T::from_f64(0.9807852804032304),
598        T::from_f64(0.9914448613738104),
599        T::from_f64(0.9978589232386035),
600        T::ONE,
601        T::from_f64(0.9978589232386035),
602        T::from_f64(0.9914448613738104),
603        T::from_f64(0.9807852804032304),
604        T::from_f64(0.9659258262890683),
605        T::from_f64(0.9469301294951057),
606        T::from_f64(0.9238795325112867),
607        T::from_f64(0.8968727415326884),
608        T::from_f64(0.8660254037844387),
609        T::from_f64(0.831469612302545),
610        T::from_f64(0.7933533402912352),
611        T::from_f64(0.7518398074789774),
612        T::from_f64(0.7071067811865476),
613        T::from_f64(0.6593458151000688),
614        T::from_f64(0.6087614290087207),
615        T::from_f64(0.5555702330196022),
616        T::from_f64(0.5),
617        T::from_f64(0.44228869021900125),
618        T::from_f64(0.38268343236508984),
619        T::from_f64(0.3214394653031617),
620        T::from_f64(0.25881904510252074),
621        T::from_f64(0.19509032201612828),
622        T::from_f64(0.1305261922200516),
623        T::from_f64(0.06540312923014327),
624        T::ZERO,
625        T::from_f64(-0.06540312923014327),
626        T::from_f64(-0.1305261922200516),
627        T::from_f64(-0.19509032201612828),
628        T::from_f64(-0.25881904510252074),
629        T::from_f64(-0.3214394653031617),
630        T::from_f64(-0.38268343236508984),
631        T::from_f64(-0.44228869021900125),
632        T::from_f64(-0.5),
633        T::from_f64(-0.5555702330196022),
634        T::from_f64(-0.6087614290087207),
635        T::from_f64(-0.6593458151000688),
636        T::from_f64(-0.7071067811865476),
637        T::from_f64(-0.7518398074789774),
638        T::from_f64(-0.7933533402912352),
639        T::from_f64(-0.831469612302545),
640        T::from_f64(-0.8660254037844387),
641        T::from_f64(-0.8968727415326884),
642        T::from_f64(-0.9238795325112867),
643        T::from_f64(-0.9469301294951057),
644        T::from_f64(-0.9659258262890683),
645        T::from_f64(-0.9807852804032304),
646        T::from_f64(-0.9914448613738104),
647        T::from_f64(-0.9978589232386035),
648        -T::ONE,
649        T::from_f64(-0.9978589232386035),
650        T::from_f64(-0.9914448613738104),
651        T::from_f64(-0.9807852804032304),
652        T::from_f64(-0.9659258262890683),
653        T::from_f64(-0.9469301294951057),
654    ];
655    for k1 in 1..8 {
656        for k2 in 1..12 {
657            let k = k1 * k2;
658            let c = cos_96[k];
659            let s = sin_96[k];
660            let idx = k1 * 12 + k2;
661            let tw = t[idx];
662            t[idx] = Complex::new(
663                tw.re * c - sign_t * tw.im * s,
664                sign_t * tw.re * s + tw.im * c,
665            );
666        }
667    }
668    for k1 in 0..8 {
669        let base = k1 * 12;
670        notw_12(&mut t[base..base + 12], sign);
671    }
672    for k1 in 0..8 {
673        let base = k1 * 12;
674        for k2 in 0..12 {
675            x[k2 * 8 + k1] = t[base + k2];
676        }
677    }
678}