summaryrefslogtreecommitdiffstats
path: root/lib/msun/ld80
diff options
context:
space:
mode:
authorkargl <kargl@FreeBSD.org>2013-06-03 17:36:26 +0000
committerkargl <kargl@FreeBSD.org>2013-06-03 17:36:26 +0000
commit9b5da9961260ea6402d6dfb925c5b6f9a2bddaa7 (patch)
tree3f3a346b5bdac14ec0b91442af654b15686f4403 /lib/msun/ld80
parentdba06374217a6547a34dc39484ad849d19ba5e5b (diff)
downloadFreeBSD-src-9b5da9961260ea6402d6dfb925c5b6f9a2bddaa7.zip
FreeBSD-src-9b5da9961260ea6402d6dfb925c5b6f9a2bddaa7.tar.gz
* Rename the polynomial coefficients from P2, P3, ... to A2, A3, ....
The names now coincide with the name used in PTP Tang's paper. * Rename the variable from s to tbl to better reflect that this is a table, and to be consistent with the naming scheme in s_exp2l.c Reviewed by: bde (as part of larger diff)
Diffstat (limited to 'lib/msun/ld80')
-rw-r--r--lib/msun/ld80/s_expl.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/msun/ld80/s_expl.c b/lib/msun/ld80/s_expl.c
index ab0f2bf..0fa5c91 100644
--- a/lib/msun/ld80/s_expl.c
+++ b/lib/msun/ld80/s_expl.c
@@ -78,11 +78,11 @@ L2 = -3.2819649005320973e-13, /* -0x1718432a1b0e26.0p-94 */
* |exp(x) - p(x)| < 2**-77.2
* (0.002708 is ln2/(2*INTERVALS) rounded up a little).
*/
-P2 = 0.5,
-P3 = 1.6666666666666119e-1, /* 0x15555555555490.0p-55 */
-P4 = 4.1666666666665887e-2, /* 0x155555555554e5.0p-57 */
-P5 = 8.3333354987869413e-3, /* 0x1111115b789919.0p-59 */
-P6 = 1.3888891738560272e-3; /* 0x16c16c651633ae.0p-62 */
+A2 = 0.5,
+A3 = 1.6666666666666119e-1, /* 0x15555555555490.0p-55 */
+A4 = 4.1666666666665887e-2, /* 0x155555555554e5.0p-57 */
+A5 = 8.3333354987869413e-3, /* 0x1111115b789919.0p-59 */
+A6 = 1.3888891738560272e-3; /* 0x16c16c651633ae.0p-62 */
/*
* 2^(i/INTERVALS) for i in [0,INTERVALS] is represented by two values where
@@ -96,8 +96,7 @@ P6 = 1.3888891738560272e-3; /* 0x16c16c651633ae.0p-62 */
static const struct {
double hi;
double lo;
-/* XXX should rename 's'. */
-} s[INTERVALS] = {
+} tbl[INTERVALS] = {
0x1p+0, 0x0p+0,
0x1.0163da9fb3335p+0, 0x1.b61299ab8cdb7p-54,
0x1.02c9a3e778060p+0, 0x1.dcdef95949ef4p-53,
@@ -284,14 +283,14 @@ expl(long double x)
twopkp10000 = v.e;
}
- /* Evaluate expl(midpoint[n2] + r1 + r2) = s[n2] * expl(r1 + r2). */
+ /* Evaluate expl(midpoint[n2] + r1 + r2) = tbl[n2] * expl(r1 + r2). */
/* Here q = q(r), not q(r1), since r1 is lopped like L1. */
t45 = r * P5 + P4;
z = r * r;
t23 = r * P3 + P2;
q = r2 + z * t23 + z * z * t45 + z * z * z * P6;
- t = (long double)s[n2].lo + s[n2].hi;
- t = s[n2].lo + t * (q + r1) + s[n2].hi;
+ t = (long double)tbl[n2].lo + tbl[n2].hi;
+ t = tbl[n2].lo + t * (q + r1) + tbl[n2].hi;
/* Scale by 2**k. */
if (k >= LDBL_MIN_EXP) {
OpenPOWER on IntegriCloud