summaryrefslogtreecommitdiff
path: root/src/complex/catanf.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2024-08-15 10:07:36 -0400
committerRich Felker <dalias@aerifal.cx>2024-08-16 11:51:53 -0400
commite1b57ede3ecad17e8f3c4e59f7fb0df1d5a6b2f4 (patch)
tree9991d9b7a2c02f2ddc5108842631a89ed0791cc6 /src/complex/catanf.c
parentca4e632df42a41aaaf9445a0cfaa939d50a565b8 (diff)
downloadmusl-e1b57ede3ecad17e8f3c4e59f7fb0df1d5a6b2f4.tar.gz
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.
Diffstat (limited to 'src/complex/catanf.c')
-rw-r--r--src/complex/catanf.c28
1 files changed, 1 insertions, 27 deletions
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);