119 days ago · Science · hide · Fediverse post

Calculus professors with no experience in numerical computing will tell students that computers calculate trig functions with power series. They don’t. I worked on the implementation of trig functions in hardware, and I can assure you we didn’t just use power series. Power series are an excellent way calculate functions near the center of the series, such as computing sine for small angles. But the further you get from the center, the less useful power series are. Let’s suppose you want to calculate cos(200) using the power series for cosine. The nth term of that series is (−1)n x2n / (2n)! This is an alternating series, and so the error in truncating the series after n terms is bounded by the size of the n+1 term, if you’ve gone far enough out in the series that the terms are monotonically decreasing in absolute value. To calculate cos(200) to machine precision, i.e. with an error of less than 2−52, we’d need to sum the series up to n where | 2002n+2 / (2n + 2)! | < 2−52 Actually,…

Commenting on Bubbles has been removed. Why? If you want to talk about this post, write to the author, use the comments on their blog if it has them, or reply with a "RE:" post on your own blog. Suggestions? feedback@bubbles.town