diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-03-16 21:01:34 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-03-16 21:01:34 -0400 |
commit | 93a50a26cd0f9efc59cc83daae7b2d916b327ab1 (patch) | |
tree | ada41a23c4b01f27d1d2cf8cd88948b061aa8f61 /src/math/powf.c | |
parent | 2cbb24bba39ad3529315098b5619b6fec078eb82 (diff) | |
parent | 40305f74bd70a575ce73260227ed3b64e0625b13 (diff) | |
download | musl-93a50a26cd0f9efc59cc83daae7b2d916b327ab1.tar.gz musl-93a50a26cd0f9efc59cc83daae7b2d916b327ab1.tar.bz2 musl-93a50a26cd0f9efc59cc83daae7b2d916b327ab1.tar.xz musl-93a50a26cd0f9efc59cc83daae7b2d916b327ab1.zip |
Merge remote branch 'nsz/master'
Diffstat (limited to 'src/math/powf.c')
-rw-r--r-- | src/math/powf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/math/powf.c b/src/math/powf.c index e322ff28..01aced0e 100644 --- a/src/math/powf.c +++ b/src/math/powf.c @@ -70,7 +70,7 @@ float powf(float x, float y) /* y != zero: result is NaN if either arg is NaN */ if (ix > 0x7f800000 || iy > 0x7f800000) - return (x+0.0F) + (y+0.0F); + return (x+0.0f) + (y+0.0f); /* determine if y is an odd int when x < 0 * yisint = 0 ... y is not an integer @@ -145,7 +145,7 @@ float powf(float x, float y) /* now |1-x| is tiny <= 2**-20, suffice to compute log(x) by x-x^2/2+x^3/3-x^4/4 */ t = ax - 1; /* t has 20 trailing zeros */ - w = (t*t)*((float)0.5-t*((float)0.333333333333-t*(float)0.25)); + w = (t*t)*(0.5f - t*(0.333333333333f - t*0.25f)); u = ivln2_h*t; /* ivln2_h has 16 sig. bits */ v = t*ivln2_l - w*ivln2; t1 = u + v; @@ -193,10 +193,10 @@ float powf(float x, float y) r = s2*s2*(L1+s2*(L2+s2*(L3+s2*(L4+s2*(L5+s2*L6))))); r += s_l*(s_h+s); s2 = s_h*s_h; - t_h = (float)3.0 + s2 + r; + t_h = 3.0f + s2 + r; GET_FLOAT_WORD(is, t_h); SET_FLOAT_WORD(t_h, is & 0xfffff000); - t_l = r - ((t_h - (float)3.0) - s2); + t_l = r - ((t_h - 3.0f) - s2); /* u+v = s*(1+...) */ u = s_h*t_h; v = s_l*t_h + t_l*s; |