diff options
author | bde <bde@FreeBSD.org> | 2008-02-14 10:23:51 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2008-02-14 10:23:51 +0000 |
commit | 30aa45f24bdd40449d3297b08a7214d362264c2c (patch) | |
tree | eecd0f2848ca3fb211d860c67e20841017768b81 /lib/msun/src | |
parent | 73c193c7ba88117b3900b03b2c49dc0b8e76219a (diff) | |
download | FreeBSD-src-30aa45f24bdd40449d3297b08a7214d362264c2c.zip FreeBSD-src-30aa45f24bdd40449d3297b08a7214d362264c2c.tar.gz |
Fix the hi+lo decomposition for 2/(3ln2). The decomposition needs to
be into 12+24 bits of precision for extra-precision multiplication,
but was into 13+24 bits. On i386 with -O1 the bug was hidden by
accidental extra precision, but on amd64, in 2^32 trials the bug
caused about 200000 errors of more than 1 ulp, with a maximum error
of about 80 ulps. Now the maximum error in 2^32 trials on amd64
is 0.8573 ulps. It is still 0.8316 ulps on i386 with -O1.
The nearby decomposition of 1/ln2 and the decomposition of 2/(3ln2) in
the double precision version seem to be sub-optimal but not broken.
Diffstat (limited to 'lib/msun/src')
-rw-r--r-- | lib/msun/src/e_powf.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/msun/src/e_powf.c b/lib/msun/src/e_powf.c index fe256a3..466ed72 100644 --- a/lib/msun/src/e_powf.c +++ b/lib/msun/src/e_powf.c @@ -46,8 +46,8 @@ lg2_h = 6.93145752e-01, /* 0x3f317200 */ lg2_l = 1.42860654e-06, /* 0x35bfbe8c */ ovt = 4.2995665694e-08, /* -(128-log2(ovfl+.5ulp)) */ cp = 9.6179670095e-01, /* 0x3f76384f =2/(3ln2) */ -cp_h = 9.6179199219e-01, /* 0x3f763800 =head of cp */ -cp_l = 4.7017383622e-06, /* 0x369dc3a0 =tail of cp_h */ +cp_h = 9.6191406250e-01, /* 0x3f764000 =12b cp */ +cp_l = -1.1736857402e-04, /* 0xb8f623c6 =tail of cp_h */ ivln2 = 1.4426950216e+00, /* 0x3fb8aa3b =1/ln2 */ ivln2_h = 1.4426879883e+00, /* 0x3fb8aa00 =16b 1/ln2*/ ivln2_l = 7.0526075433e-06; /* 0x36eca570 =1/ln2 tail*/ |