Skip to main content

fast_powf_unit

Function fast_powf_unit 

pub fn fast_powf_unit(x: f64, exponent: f64) -> f64
Expand description

Fast approximation of x^exponent for x ∈ [0, 1] and exponent ∈ (0, 2).

Uses a quadratic polynomial: x - (1 - exponent) * x * (1 - x). Accurate to <1% for exponents near 1.0 (e.g., 0.92 for VCO saw curvature). Cost: 2 multiplies + 2 adds vs powf’s ~50-100ns general exponentiation.

For exponents far from 1.0, use fast_exp(exponent * fast_ln(x)) instead.