Lines Matching +full:high +full:- +full:accuracy
1 /*-
2 * SPDX-License-Identifier: BSD-3-Clause
47 * r will be represented as r := z+c for better accuracy.
51 * exp(r) = 1 + r + r*R1/(2-R1),
53 * R1 = x - x^2*(p1+x^2*(p2+x^2*(p3+x^2*(p4+p5*x^2)))).
59 * exp(-INF)= 0;
62 * Accuracy:
68 p1 = 1.6666666666666660e-01, /* 0x3fc55555, 0x55555553 */
69 p2 = -2.7777777777564776e-03, /* 0xbf66c16c, 0x16c0ac3c */
70 p3 = 6.6137564717940088e-05, /* 0x3f11566a, 0xb5c2ba0d */
71 p4 = -1.6534060280704225e-06, /* 0xbebbbd53, 0x273e8fb7 */
72 p5 = 4.1437773411069054e-08; /* 0x3e663f2a, 0x09c94b6c */
75 ln2hi = 0x1.62e42fee00000p-1, /* High 32 bits round-down. */
76 ln2lo = 0x1.a39ef35793c76p-33; /* Next 53 bits round-to-nearst. */
80 lntiny = -0x1.77af8ebeae354p9, /* (DBL_MIN_EXP - 53 - 10) * log(2.) */
96 /* argument reduction: x --> x - k*ln2 */ in __exp__D()
101 * Express (x + c) - k * ln2 as hi - lo. in __exp__D()
102 * Let x = hi - lo rounded. in __exp__D()
104 hi = x - k * ln2hi; /* Exact. */ in __exp__D()
105 lo = k * ln2lo - c; in __exp__D()
106 x = hi - lo; in __exp__D()
110 c = x - z * (p1 + z * (p2 + z * (p3 + z * (p4 + in __exp__D()
112 c = (x * c) / (2 - c); in __exp__D()
114 return (ldexp(1 + (hi - (lo - c)), k)); in __exp__D()
116 /* exp(-INF) is 0. exp(-big) underflows to 0. */ in __exp__D()
117 return (isfinite(x) ? ldexp(1., -5000) : 0); in __exp__D()