Skip to main content

fast_log2f

Function fast_log2f 

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

Fast log2 approximation. Max relative error ~3e-7. Input must be > 0.

Uses integer bit manipulation on f32 with a Padé approximant for the fractional part. Matches libjxl’s FastLog2f from fast_math-inl.h.