diff options
author | Rich Felker <dalias@aerifal.cx> | 2020-02-05 09:40:11 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2020-02-05 09:40:11 -0500 |
commit | 11020620813b828917bc31b4636d8a142f7a564a (patch) | |
tree | b1a7fc40034bdeef3ac191bb4ca6797c6b6b046d /src/complex/catanl.c | |
parent | 329e79299daaa994b8e75941331a1093051ea5d9 (diff) | |
download | musl-11020620813b828917bc31b4636d8a142f7a564a.tar.gz |
fix incorrect results for catanf and catanl with some inputs
catan was fixed in 10e4bd3780050e75b72aac5d85c31816419bb17d but the
same bug in catanf and catanl was overlooked. the patch is completely
analogous.
Diffstat (limited to 'src/complex/catanl.c')
-rw-r--r-- | src/complex/catanl.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/src/complex/catanl.c b/src/complex/catanl.c index a9fc02db..e62526c0 100644 --- a/src/complex/catanl.c +++ b/src/complex/catanl.c @@ -97,30 +97,18 @@ long double complex catanl(long double complex z) x = creall(z); y = cimagl(z); - if ((x == 0.0L) && (y > 1.0L)) - goto ovrf; - x2 = x * x; a = 1.0L - x2 - (y * y); - if (a == 0.0L) - goto ovrf; t = atan2l(2.0L * x, a) * 0.5L; w = redupil(t); t = y - 1.0L; a = x2 + (t * t); - if (a == 0.0L) - goto ovrf; t = y + 1.0L; a = (x2 + (t * t)) / a; - w = w + (0.25L * logl(a)) * I; - return w; - -ovrf: - // FIXME - w = LDBL_MAX + LDBL_MAX * I; + w = CMPLXF(w, 0.25L * logl(a)); return w; } #endif |