summaryrefslogtreecommitdiff
path: root/src/complex/catanl.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/catanl.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/catanl.c')
-rw-r--r--src/complex/catanl.c24
1 files changed, 1 insertions, 23 deletions
diff --git a/src/complex/catanl.c b/src/complex/catanl.c
index e62526c0..cd2d2b00 100644
--- a/src/complex/catanl.c
+++ b/src/complex/catanl.c
@@ -67,28 +67,6 @@ long double complex catanl(long double complex z)
return catan(z);
}
#else
-static const long double PIL = 3.141592653589793238462643383279502884197169L;
-static const long double DP1 = 3.14159265358979323829596852490908531763125L;
-static const long double DP2 = 1.6667485837041756656403424829301998703007e-19L;
-static const long double DP3 = 1.8830410776607851167459095484560349402753e-39L;
-
-static long double redupil(long double x)
-{
- long double t;
- long i;
-
- t = x / PIL;
- if (t >= 0.0L)
- t += 0.5L;
- else
- t -= 0.5L;
-
- i = t; /* the multiple */
- t = i;
- t = ((x - t * DP1) - t * DP2) - t * DP3;
- return t;
-}
-
long double complex catanl(long double complex z)
{
long double complex w;
@@ -101,7 +79,7 @@ long double complex catanl(long double complex z)
a = 1.0L - x2 - (y * y);
t = atan2l(2.0L * x, a) * 0.5L;
- w = redupil(t);
+ w = t;
t = y - 1.0L;
a = x2 + (t * t);