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/logf.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/logf.c')
-rw-r--r-- | src/math/logf.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/math/logf.c b/src/math/logf.c index 285ee615..a4ed697b 100644 --- a/src/math/logf.c +++ b/src/math/logf.c @@ -52,7 +52,7 @@ float logf(float x) i = (ix + (0x95f64<<3)) & 0x800000; SET_FLOAT_WORD(x, ix|(i^0x3f800000)); /* normalize x or x/2 */ k += i>>23; - f = x - (float)1.0; + f = x - 1.0f; if ((0x007fffff & (0x8000 + ix)) < 0xc000) { /* -2**-9 <= f < 2**-9 */ if (f == zero) { if (k == 0) @@ -60,13 +60,13 @@ float logf(float x) dk = (float)k; return dk*ln2_hi + dk*ln2_lo; } - R = f*f*((float)0.5 - (float)0.33333333333333333*f); + R = f*f*(0.5f - 0.33333333333333333f*f); if (k == 0) return f-R; dk = (float)k; return dk*ln2_hi - ((R-dk*ln2_lo)-f); } - s = f/((float)2.0+f); + s = f/(2.0f + f); dk = (float)k; z = s*s; i = ix-(0x6147a<<3); @@ -77,7 +77,7 @@ float logf(float x) i |= j; R = t2 + t1; if (i > 0) { - hfsq = (float)0.5*f*f; + hfsq = 0.5f * f * f; if (k == 0) return f - (hfsq-s*(hfsq+R)); return dk*ln2_hi - ((hfsq-(s*(hfsq+R)+dk*ln2_lo))-f); |