84 halF[2] = {0.5,-0.5,},
86 twom1000= 9.33263618503218878990e-302,
87 o_threshold= 7.09782712893383973096e+02,
88 u_threshold= -7.45133219101941108420e+02,
89 ln2HI[2] ={ 6.93147180369123816490e-01,
90 -6.93147180369123816490e-01,},
91 ln2LO[2] ={ 1.90821492927058770002e-10,
92 -1.90821492927058770002e-10,},
93 invln2 = 1.44269504088896338700e+00,
94 P1 = 1.66666666666666019037e-01,
95 P2 = -2.77777777770155933842e-03,
96 P3 = 6.61375632143793436117e-05,
97 P4 = -1.65339022054652515390e-06,
98 P5 = 4.13813679705723846039e-08;
108 double y,hi=0,lo=0,c,t;
117 if(hx >= 0x40862E42) {
119 if(((hx&0xfffff)|
__LO(x))!=0)
121 else return (xsb==0)? x:0.0;
123 if(x > o_threshold)
return huge*huge;
124 if(x < u_threshold)
return twom1000*twom1000;
128 if(hx > 0x3fd62e42) {
129 if(hx < 0x3FF0A2B2) {
130 hi = x-ln2HI[xsb]; lo=ln2LO[xsb]; k = 1-xsb-xsb;
132 k = (int)(invln2*x+halF[xsb]);
139 else if(hx < 0x3e300000) {
140 if(huge+x>
one)
return one+x;
146 c = x - t*(P1+t*(P2+t*(P3+t*(P4+t*P5))));
147 if(k==0)
return one-((x*c)/(c-2.0)-x);
148 else y =
one-((lo-(x*c)/(2.0-c))-hi);
153 __HI(y) += ((k+1000)<<20);