fast_math

Function exp2_raw

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

Compute a fast approximation to 2x for -151 ≤ x ≤ 151.

This will return unspecified nonsense if x does not satisfy those requirements. Use exp2 if correct handling is required (at the expense of some speed).

The maximum relative error for inputs for which the result is normal (x ≥ -128) is less than 0.011. For x < -128, the relative error in the (subnormal) result can be as large as 1.