3 /* k is such that k*ln2 has minimal error */
4 static const uint32_t k = 2043;
5 static const double kln2 = 0x1.62066151add8bp+10;
7 /* exp(x)/2 when x >= log(DBL_MAX) */
8 double __expo2(double x)
12 /* note that k is odd and scale*scale overflows */
13 INSERT_WORDS(scale, (0x3ff + k/2) << 20, 0);
14 /* exp(x - k ln2) * 2**(k-1) */
15 return exp(x - kln2) * scale * scale;