benilla-re systems structs docs

s_doubleInfinity

global · unassigned

Address
0x875e90 · 8 bytes, up to 0x875e97
Type
double
Meaning
Holds +inf as a double, the result log2 and exp2 return at their limits
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.