1 hour ago · Science · hide · 0 comments

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,…

No comments yet. Log in to reply on the Fediverse. Comments will appear here.