diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-03-19 22:07:43 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-03-19 22:07:43 -0400 |
commit | 97721a5508415a2f10eb068e022093811c9ff8be (patch) | |
tree | 88e9ce153895ad949576fa7ce1eeee4b02286479 /src/math/atanhf.c | |
parent | acb744921b73f5a73803e533e5e4a4896d164a26 (diff) | |
parent | 0cbb65479147ecdaa664e88cc2a5a925f3de502f (diff) | |
download | musl-97721a5508415a2f10eb068e022093811c9ff8be.tar.gz musl-97721a5508415a2f10eb068e022093811c9ff8be.tar.xz musl-97721a5508415a2f10eb068e022093811c9ff8be.zip |
Merge remote branch 'nsz/master'
Diffstat (limited to 'src/math/atanhf.c')
-rw-r--r-- | src/math/atanhf.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/math/atanhf.c b/src/math/atanhf.c index 9c65dc7f..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 = 0.5f*log1pf(t + t*x/(one-x)); + t = 0.5f*log1pf(t + t*x/(1.0f-x)); } else - t = 0.5f*log1pf((x+x)/(one-x)); + t = 0.5f*log1pf((x+x)/(1.0f-x)); if (hx >= 0) return t; return -t; |