From e1b57ede3ecad17e8f3c4e59f7fb0df1d5a6b2f4 Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Thu, 15 Aug 2024 10:07:36 -0400 Subject: catan: remove no-op reduction mod pi and unused code the output of atan2 is already in the correct range and does not need further reduction. the MAXNUM macros were both unused and incorrect. --- src/complex/catanf.c | 28 +--------------------------- 1 file changed, 1 insertion(+), 27 deletions(-) (limited to 'src/complex/catanf.c') diff --git a/src/complex/catanf.c b/src/complex/catanf.c index 1d569f2d..faaa907a 100644 --- a/src/complex/catanf.c +++ b/src/complex/catanf.c @@ -55,32 +55,6 @@ #include "complex_impl.h" -#define MAXNUMF 1.0e38F - -static const double DP1 = 3.140625; -static const double DP2 = 9.67502593994140625E-4; -static const double DP3 = 1.509957990978376432E-7; - -static const float float_pi = M_PI; - -static float _redupif(float xx) -{ - float x, t; - long i; - - x = xx; - t = x/float_pi; - if (t >= 0.0f) - t += 0.5f; - else - t -= 0.5f; - - i = t; /* the multiple */ - t = i; - t = ((x - t * DP1) - t * DP2) - t * DP3; - return t; -} - float complex catanf(float complex z) { float complex w; @@ -93,7 +67,7 @@ float complex catanf(float complex z) a = 1.0f - x2 - (y * y); t = 0.5f * atan2f(2.0f * x, a); - w = _redupif(t); + w = t; t = y - 1.0f; a = x2 + (t * t); -- cgit v1.2.1