100 0.5, -0.5,
101 },
102 ln2HI[2] = {
103 6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */
104 -6.93147180369123816490e-01, /* 0xbfe62e42, 0xfee00000 */
105 },
106 ln2LO[2] = {
107 1.90821492927058770002e-10, /* 0x3dea39ef, 0x35793c76 */
108 -1.90821492927058770002e-10, /* 0xbdea39ef, 0x35793c76 */
109 },
110 invln2 = 1.44269504088896338700e+00, /* 0x3ff71547, 0x652b82fe */
111 P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */
112 P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */
113 P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */
114 P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
115 P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
116 /* INDENT ON */
117
118 double
119 __k_cexp(double x, int *n) {
120 double hi, lo, c, t;
121 int k, xsb;
122 unsigned hx, lx;
123
124 hx = HI_WORD(x); /* high word of x */
125 lx = LO_WORD(x); /* low word of x */
126 xsb = (hx >> 31) & 1; /* sign bit of x */
127 hx &= 0x7fffffff; /* high word of |x| */
128
129 /* filter out non-finite argument */
130 if (hx >= 0x40e86a00) { /* if |x| > 50000 */
131 if (hx >= 0x7ff00000) {
132 *n = 1;
133 if (((hx & 0xfffff) | lx) != 0)
134 return (x + x); /* NaN */
135 else
136 return ((xsb == 0) ? x : 0.0);
137 /* exp(+-inf)={inf,0} */
138 }
139 *n = (xsb == 0) ? 50000 : -50000;
140 return (one + ln2LO[1] * ln2LO[1]); /* generate inexact */
|
100 0.5, -0.5,
101 },
102 ln2HI[2] = {
103 6.93147180369123816490e-01, /* 0x3fe62e42, 0xfee00000 */
104 -6.93147180369123816490e-01, /* 0xbfe62e42, 0xfee00000 */
105 },
106 ln2LO[2] = {
107 1.90821492927058770002e-10, /* 0x3dea39ef, 0x35793c76 */
108 -1.90821492927058770002e-10, /* 0xbdea39ef, 0x35793c76 */
109 },
110 invln2 = 1.44269504088896338700e+00, /* 0x3ff71547, 0x652b82fe */
111 P1 = 1.66666666666666019037e-01, /* 0x3FC55555, 0x5555553E */
112 P2 = -2.77777777770155933842e-03, /* 0xBF66C16C, 0x16BEBD93 */
113 P3 = 6.61375632143793436117e-05, /* 0x3F11566A, 0xAF25DE2C */
114 P4 = -1.65339022054652515390e-06, /* 0xBEBBBD41, 0xC5D26BF1 */
115 P5 = 4.13813679705723846039e-08; /* 0x3E663769, 0x72BEA4D0 */
116 /* INDENT ON */
117
118 double
119 __k_cexp(double x, int *n) {
120 double hi = 0.0L, lo = 0.0L, c, t;
121 int k, xsb;
122 unsigned hx, lx;
123
124 hx = HI_WORD(x); /* high word of x */
125 lx = LO_WORD(x); /* low word of x */
126 xsb = (hx >> 31) & 1; /* sign bit of x */
127 hx &= 0x7fffffff; /* high word of |x| */
128
129 /* filter out non-finite argument */
130 if (hx >= 0x40e86a00) { /* if |x| > 50000 */
131 if (hx >= 0x7ff00000) {
132 *n = 1;
133 if (((hx & 0xfffff) | lx) != 0)
134 return (x + x); /* NaN */
135 else
136 return ((xsb == 0) ? x : 0.0);
137 /* exp(+-inf)={inf,0} */
138 }
139 *n = (xsb == 0) ? 50000 : -50000;
140 return (one + ln2LO[1] * ln2LO[1]); /* generate inexact */
|