92 #ifdef POK_NEEDS_LIBMATH
94 #include "math_private.h"
98 halF[2] = {0.5,-0.5,},
100 twom1000= 9.33263618503218878990e-302,
101 o_threshold= 7.09782712893383973096e+02,
102 u_threshold= -7.45133219101941108420e+02,
103 ln2HI[2] ={ 6.93147180369123816490e-01,
104 -6.93147180369123816490e-01,},
105 ln2LO[2] ={ 1.90821492927058770002e-10,
106 -1.90821492927058770002e-10,},
107 invln2 = 1.44269504088896338700e+00,
108 P1 = 1.66666666666666019037e-01,
109 P2 = -2.77777777770155933842e-03,
110 P3 = 6.61375632143793436117e-05,
111 P4 = -1.65339022054652515390e-06,
112 P5 = 4.13813679705723846039e-08;
116 __ieee754_exp(
double x)
129 if(hx >= 0x40862E42) {
133 if(((hx&0xfffff)|lx)!=0)
135 else return (xsb==0)? x:0.0;
137 if(x > o_threshold)
return huge*huge;
138 if(x < u_threshold)
return twom1000*twom1000;
142 if(hx > 0x3fd62e42) {
143 if(hx < 0x3FF0A2B2) {
144 hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb;
146 k = invln2*x+halF[xsb];
153 else if(hx < 0x3e300000) {
154 if(huge+x>one)
return one+x;
160 c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
161 if(k==0)
return one-((x*c)/(c-2.0)-x);
162 else y = one-((lo-(x*c)/(2.0-c))-hi);
166 SET_HIGH_WORD(y,hy+(k<<20));
171 SET_HIGH_WORD(y,hy+((k+1000)<<20));