Skip to content

Commit 9ae907a

Browse files
gunjjoshimarton78
authored andcommitted
refactor: use separate constant M_SQRT8
1 parent 1e139d9 commit 9ae907a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

fftpack.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,10 @@ static double dmax(double a, double b) { return a < b ? b : a; }
8484
#define M_SQRT2 1.41421356237309504880 /* sqrt(2) */
8585
#endif
8686

87+
#ifndef M_SQRT8
88+
#define M_SQRT8 2.82842712474619009760 /* sqrt(8) */
89+
#endif
90+
8791

8892
/* translated by f2c (version 20061008), and slightly edited */
8993

@@ -2303,7 +2307,7 @@ void cosqb(integer n, real *x, real *wsave)
23032307
x[1] *= 4.f;
23042308
} else if (n == 2) {
23052309
x1 = (x[1] + x[2]) * 4.f;
2306-
x[2] = 2 * M_SQRT2 * (x[1] - x[2]);
2310+
x[2] = M_SQRT8 * (x[1] - x[2]);
23072311
x[1] = x1;
23082312
} else {
23092313
cosqb1(n, &x[1], &wsave[1], &wsave[n + 1]);

test_fftpack_float

116 KB
Binary file not shown.

0 commit comments

Comments
 (0)