3 ms·
It’s probably a generally better idea to use a polynomial approximation if you have a floating point unit; a degree 8 polynomial for sin(x) on the range [0, π/2
by jacobolus 10y ago
It’s probably a generally better idea to use a polynomial approximation if you have a floating point unit; a degree 8 polynomial for sin(x) on the range [0, π/2] gets you to just about the limits of single precision floating point. If you only need about 4 digits of precision, you can use a degree 5 polynomial.
- adrianratnapala 10y agoCouldn't you do better by only using the range [0, π/4] and noting that sin(x) = cos(x - π/2)?
- jacobolus 10y agoSure, then you can get away with an even smaller degree polynomial.
- sehugg 10y agoFWIW, Applesoft for the 6502 uses a 5th order poly.