X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fmath%2Fatanhf.c;h=2be780bbb06e23d62938b4b498a161a93f9b83fe;hp=2efbd79c9ef89fe6bf1511eaa09b03296be890ec;hb=2ad9cf52eb9fea12a19bcf893828e1361a0b6546;hpb=b69f695acedd4ce2798ef9ea28d834ceccc789bd diff --git a/src/math/atanhf.c b/src/math/atanhf.c index 2efbd79c..2be780bb 100644 --- a/src/math/atanhf.c +++ b/src/math/atanhf.c @@ -15,8 +15,7 @@ #include "libm.h" -static const float one = 1.0, huge = 1e30; -static const float zero = 0.0; +static const float huge = 1e30; float atanhf(float x) { @@ -28,15 +27,15 @@ float atanhf(float x) if (ix > 0x3f800000) /* |x| > 1 */ return (x-x)/(x-x); if (ix == 0x3f800000) - return x/zero; - if (ix < 0x31800000 && huge+x > zero) /* x < 2**-28 */ + return x/0.0f; + if (ix < 0x31800000 && huge+x > 0.0f) /* x < 2**-28 */ return x; SET_FLOAT_WORD(x, ix); if (ix < 0x3f000000) { /* x < 0.5 */ t = x+x; - t = (float)0.5*log1pf(t + t*x/(one-x)); + t = 0.5f*log1pf(t + t*x/(1.0f-x)); } else - t = (float)0.5*log1pf((x+x)/(one-x)); + t = 0.5f*log1pf((x+x)/(1.0f-x)); if (hx >= 0) return t; return -t;