From 11020620813b828917bc31b4636d8a142f7a564a Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 5 Feb 2020 09:40:11 -0500 Subject: 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. --- src/complex/catanf.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/complex/catanf.c') diff --git a/src/complex/catanf.c b/src/complex/catanf.c index e10d9c09..ef3907a5 100644 --- a/src/complex/catanf.c +++ b/src/complex/catanf.c @@ -87,29 +87,17 @@ float complex catanf(float complex z) x = crealf(z); y = cimagf(z); - if ((x == 0.0f) && (y > 1.0f)) - goto ovrf; - x2 = x * x; a = 1.0f - x2 - (y * y); - if (a == 0.0f) - goto ovrf; t = 0.5f * atan2f(2.0f * x, a); w = _redupif(t); t = y - 1.0f; a = x2 + (t * t); - if (a == 0.0f) - goto ovrf; t = y + 1.0f; a = (x2 + (t * t))/a; - w = w + (0.25f * logf (a)) * I; - return w; - -ovrf: - // FIXME - w = MAXNUMF + MAXNUMF * I; + w = CMPLXF(w, 0.25f * logf(a)); return w; } -- cgit 1.4.1