Skip to main content

exp

Function exp 

Source
pub fn exp(x: f32) -> f32
Expand description

e^x, accurate to 4.2e-6 relative over [-20, 20] (measured, not claimed — the degree-5 polynomial is the limit, and the two implementations this replaced both documented ~1e-7, which was optimistic).

Clamped to [-87, 88]: outside that the f32 result is 0 or infinite anyway, and an unclamped exponent write would produce a denormal or garbage rather than a saturated value.