3 ms·
Here was Apollo’s sine/cosine code, a 5th degree polynomial which clearly had its coefficients optimized for minimax relative error (presumably by the Remez alg
by jacobolus 6y ago
Here was Apollo’s sine/cosine code, a 5th degree polynomial which clearly had its coefficients optimized for minimax relative error (presumably by the Remez algorithm):
https://fermatslibrary.com/s/apollo-11-implementation-of-trigonometric-functions https://fermatslibrary.com/s/apollo-11-implementation-of-tri...
Here’s a comparison between its relative error vs. a 5th degree Taylor series (if you use high precision arithmetic; I’m sure on the machine itself rounding errors made things a bit choppier). In the worst case for the Taylor series the relative error is about 45 times lower in the optimized polynomial:
https://www.desmos.com/calculator/aelh9kf9ms https://www.desmos.com/calculator/aelh9kf9ms