diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2002-06-14 03:03:01 +0400 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2002-06-14 03:03:01 +0400 |
commit | a47e66ae3a33750f37505df1a4871fe84438ca34 (patch) | |
tree | 0c5aac4b2ad52f145cd11044c4dd2f934a141292 /newlib | |
parent | 04229a06ac07682c29d8d53c362858e612ea1afd (diff) |
2002-06-13 Stephen L. Moshier <steve@moshier.net>
* libm/math/e_pow.c (__ieee754_pow): Fix case whereby
x is close to -1.0 and y is very large to use ax (absolute value)
instead of x.
* libm/math/ef_pow.c (__ieee754_powf): Ditto.
Diffstat (limited to 'newlib')
-rw-r--r-- | newlib/ChangeLog | 9 | ||||
-rw-r--r-- | newlib/libm/math/e_pow.c | 2 | ||||
-rw-r--r-- | newlib/libm/math/ef_pow.c | 2 |
3 files changed, 11 insertions, 2 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index c51adc4de..5eb6ac4e1 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,12 @@ +2002-06-13 Stephen L. Moshier <steve@moshier.net> + + * libm/math/e_pow.c (__ieee754_pow): Fix case whereby + x is close to -1.0 and y is very large to use ax (absolute value) + instead of x. + * libm/math/ef_pow.c (__ieee754_powf): Ditto. + +Thu Jun 13 19:23:40 2002 J"orn Rennecke <joern.rennecke@superh.com> + Thu Jun 13 19:23:40 2002 J"orn Rennecke <joern.rennecke@superh.com> * libc/machine/sh/strcpy.S (strcpy, __SHMEDIA__ code): diff --git a/newlib/libm/math/e_pow.c b/newlib/libm/math/e_pow.c index 240a18613..55b5f7f5b 100644 --- a/newlib/libm/math/e_pow.c +++ b/newlib/libm/math/e_pow.c @@ -196,7 +196,7 @@ ivln2_l = 1.92596299112661746887e-08; /* 0x3E54AE0B, 0xF85DDF44 =1/ln2 tail*/ if(ix>0x3ff00000) return (hy>0)? huge*huge:tiny*tiny; /* now |1-x| is tiny <= 2**-20, suffice to compute log(x) by x-x^2/2+x^3/3-x^4/4 */ - t = x-1; /* t has 20 trailing zeros */ + t = ax-1; /* t has 20 trailing zeros */ w = (t*t)*(0.5-t*(0.3333333333333333333333-t*0.25)); u = ivln2_h*t; /* ivln2_h has 21 sig. bits */ v = t*ivln2_l-w*ivln2; diff --git a/newlib/libm/math/ef_pow.c b/newlib/libm/math/ef_pow.c index e50cc58b3..8b1fc18b7 100644 --- a/newlib/libm/math/ef_pow.c +++ b/newlib/libm/math/ef_pow.c @@ -137,7 +137,7 @@ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/ if(ix>0x3f800007) return (hy>0)? huge*huge:tiny*tiny; /* now |1-x| is tiny <= 2**-20, suffice to compute log(x) by x-x^2/2+x^3/3-x^4/4 */ - t = x-1; /* t has 20 trailing zeros */ + t = ax-1; /* t has 20 trailing zeros */ w = (t*t)*((float)0.5-t*((float)0.333333333333-t*(float)0.25)); u = ivln2_h*t; /* ivln2_h has 16 sig. bits */ v = t*ivln2_l-w*ivln2; |