benilla-re systems structs docs

s_exp2Table

global · fastmath

Address
0x8029e0 · 512 bytes, up to 0x802bdf
Type
double[64]
Meaning
Holds 2 to the i/64 for i from 0 to 63, indexed by the top six mantissa bits
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.