4 ms·
I remember my amazement watching our CS teacher in highschool expand the sine function into its Taylor series. I just couldn't wrap my head around the idea tha
by Tade0 9y ago
I remember my amazement watching our CS teacher in highschool expand the sine function into its Taylor series.
I just couldn't wrap my head around the idea that you could simply calculate this using basic arithmetic operations.
One thing I learned from this experience was that these functions are expensive to calculate and it's actually pretty easy to write your own, faster but less precise implementation.
- kevin_thibedeau 9y agoCORDIC is cheap and fundamentally simpler than Taylor series since it works on the essential principal of unit circle rotations that the trigonometric functions derive from. It isn't just a close enough approximation.
- Const-me 9y agoTaylor series are slower than minimax polynomial approximations. Here’s a C++ implementation of minimax approximations for some popular functions, with good license (boost): https://www.geometrictools.com/Source/Functions.html https://www.geometrictools.com/Source/Functions.html