s_exp2Bias
global · fastmath
- Address
0x803058· 8 bytes, up to0x80305f- Type
double- Meaning
- Holds 1023.0, added to the exponent before the integer split
- Confidence
- verified, proof one
- Finding
- fastmath#software-exp2
Finding: Software exp2 in fastmath
0x454d40(x) (cdecl, ret 8, result in st0) returns 2^x for x from −1021 to 1026.
S = x + 1023.0, n = low32(__ftol(S)) − 1, frac = S − (double)(uint64){n, 0} in [1, 2).
i is the top six mantissa bits of frac; rf is frac with them cleared. The result is
P(rf)·(2^n·T[i]): 2^n is the double with high dword n << 20 and low dword 0, T[i] = 2^(i/64)
is at 0x8029e0, and P(r) = (c0 + r·c1) + ((c2 + r·c3) + (c4 + r·c5)·r²)·r², c0 to c5 the doubles
from 0x803028. For unsigned n > 0x7ff: +∞ if n is positive as an int, else 0.0.
The derivation is in the doc.