More on why simple approximations work
A few weeks ago I wrote several blog posts about very simple approximations that are surprisingly accurate. These approximations are valid over a limited range, but with range reduction they can be used over the full range of the functions.
In this post I want to look again at
and
Pade approximationIt turns out that the approximations above are both Pade approximants [1], rational functions that match the first few terms of the power series of the function being approximated.
First few" means up to degree m + n where m is the degree of the numerator and n is the degree of the denominator. In our examples, m = n = 1, and so the series terms up to order 2 match.
LuckThe approximations I wrote about before were derived by solving for a constant that made the approximation error vanish at the ends of the interval of interest. Note that there's no interval in the definition of a Pade approximant.
Also, the constants that I derived were rounded in order to have something easy to compute mentally. The approximation for log, for example, works out to have a factor of 2.0413, but I rounded it to 2 for convenience.
And yet the end result is exactly was exactly a Pade approximant.
ExpFirst let's look at the exponential function. We can see that the series for our approximation and for exp match up to x^2.
The error in the Pade approximation for exp is less than the error in the 2nd order power series approximation for all x less than around 0.78.
LogHere again we see that our function and our approximation have series that agree up to the x^2 terms.
The error in the Pade approximation for log is less than the error in the 2nd order power series approximation for all x
[1] The other approximations I presented in that series are not Pade approximations.
The post More on why simple approximations work first appeared on John D. Cook.