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/expf.c | |
parent | acb744921b73f5a73803e533e5e4a4896d164a26 (diff) | |
parent | 0cbb65479147ecdaa664e88cc2a5a925f3de502f (diff) | |
download | musl-97721a5508415a2f10eb068e022093811c9ff8be.tar.gz musl-97721a5508415a2f10eb068e022093811c9ff8be.tar.bz2 musl-97721a5508415a2f10eb068e022093811c9ff8be.tar.xz musl-97721a5508415a2f10eb068e022093811c9ff8be.zip |
Merge remote branch 'nsz/master'
Diffstat (limited to 'src/math/expf.c')
-rw-r--r-- | src/math/expf.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/math/expf.c b/src/math/expf.c index f706ac5d..3c3e2ab9 100644 --- a/src/math/expf.c +++ b/src/math/expf.c @@ -16,7 +16,6 @@ #include "libm.h" static const float -one = 1.0, halF[2] = {0.5,-0.5,}, huge = 1.0e+30, o_threshold = 8.8721679688e+01, /* 0x42b17180 */ @@ -72,8 +71,8 @@ float expf(float x) STRICT_ASSIGN(float, x, hi - lo); } else if(hx < 0x39000000) { /* |x|<2**-14 */ /* raise inexact */ - if (huge+x > one) - return one + x; + if (huge+x > 1.0f) + return 1.0f + x; } else k = 0; @@ -85,8 +84,8 @@ float expf(float x) SET_FLOAT_WORD(twopk, 0x3f800000+((k+100)<<23)); c = x - t*(P1+t*P2); if (k == 0) - return one - ((x*c)/(c - 2.0f) - x); - y = one - ((lo - (x*c)/(2.0f - c)) - hi); + return 1.0f - ((x*c)/(c - 2.0f) - x); + y = 1.0f - ((lo - (x*c)/(2.0f - c)) - hi); if (k < -125) return y*twopk*twom100; if (k == 128) |