Fast Fourier transform: Difference between revisions

m
Bug fix for the optimized version.
(→‎{{header|Perl 6}}: give terser functional version, along with its drawback and fix)
m (Bug fix for the optimized version.)
Line 392:
// Better optimized but less intuitive
// !!! Warning : in some cases this code make result different from not optimased version above (need to fix bug)
// The bug is now fixed @2017/05/30
void fft(CArray &x)
{
Line 397 ⟶ 398:
unsigned int N = x.size(), k = N, n;
double thetaT = 3.14159265358979323846264338328L / N;
Complex phiT = Complex(cos(thetaT), -sin(thetaT)), T;
while (k > 1)
{
Anonymous user