X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fcomplex%2Fcatanf.c;h=ef3907a5069e245d52b11078f072ab113828ce19;hb=4f893997e4738faf6dde8320b304298340f51cd2;hp=8533bde397fba574164335268dd839a650ef4756;hpb=b69f695acedd4ce2798ef9ea28d834ceccc789bd;p=musl diff --git a/src/complex/catanf.c b/src/complex/catanf.c index 8533bde3..ef3907a5 100644 --- a/src/complex/catanf.c +++ b/src/complex/catanf.c @@ -53,7 +53,7 @@ * IEEE -10,+10 30000 2.3e-6 5.2e-8 */ -#include "libm.h" +#include "complex_impl.h" #define MAXNUMF 1.0e38F @@ -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; }