John D. Cook 6/3/2026

Naively summing an alternating series

Read Original

This article discusses the pitfalls of naively implementing the exponential function's power series for negative arguments, specifically exp(-20). It demonstrates how alternating series with large initial terms cause catastrophic cancellation and loss of precision, resulting in inaccurate results. The author explains the underlying floating-point limitations and suggests using 1/exp(20) as a simple workaround. The content is a technical tutorial focused on numerical analysis, programming, and mathematics, relevant to IT/technology.

Naively summing an alternating series

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week

No top articles yet