Skip to main content

Module lut

Module lut 

Source
Expand description

Lookup-table trigonometry.

Alternative to crate::fast_math’s polynomial approximations: a 256-entry sin table (1KB), computed at compile time via a Taylor-series const fn so no runtime initialization is needed. Trades accuracy (~2% error) for speed on cores without hardware sin/cos or an FPU.

Functions§

fast_cos_i16
Fast cosine using the lookup table (cos(x) = sin(x + pi/2)).
fast_sin_i16
Fast sine using the lookup table.