Ask ordinary software developers how to code an exponential function (that is, ex) and most will tell you to simply write an expression in their favorite high level language. But a significant slice of Hackaday readers will program tiny machines down to the bare metal or need more speed or precision than available with a customary implementation. [Pseduorandom] knows quite a few ways to do the calculation, and while it isn’t light reading for the math-phobic, it is an interesting tour.
The paper covers a variety of ways to calculate the function ranging from various Taylor series approximations, Lagrange interpolation, and Chebyshev interpolation. The paper is someone abstract, but there are Python and C++ examples to help make it concrete.
The paper does cover a bit about why you might want to compute ex, but, honestly, we still love the Better Explained post about how it relates to any continually growing process. If you missed it, you can see the related video, below. We sure wish our math teachers had explained this to us.
We have to admit, if we had ever learned about some of these methods, we’ve forgotten them. But it is easier to get interested in this math when you aren’t having to cram it in right before a final exam.