News for hackers. Stuff that matters.
Re:16-bit math look-up tables – the unexpected power of scal... by jacobolus on Saturday April 01, 2017 @05:15PM (#14014227)
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.
Re:16-bit math look-up tables – the unexpected power of scal... by adrianratnapala on Saturday April 01, 2017 @05:44PM (#14014345)
Couldn't you do better by only using the range [0, π/4] and noting that sin(x) = cos(x - π/2)?
Re:16-bit math look-up tables – the unexpected power of scal... by jacobolus on Saturday April 01, 2017 @06:10PM (#14014457)
Sure, then you can get away with an even smaller degree polynomial.
Re:16-bit math look-up tables – the unexpected power of scal... by sehugg on Sunday April 02, 2017 @08:48AM (#14016950)
FWIW, Applesoft for the 6502 uses a 5th order poly.