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

## Padé approximation

It turns out that the approximations above are both Padé 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.

## Luck

The 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 Padé 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 Padé approximant.

## Exp

First let’s look at the exponential function. We can see that the series for our approximation and for exp match up to *x*².

The error in the Padé approximation for exp is less than the error in the 2nd order power series approximation for all *x* less than around 0.78.

## Log

Here again we see that our function and our approximation have series that agree up to the *x*² terms.

The error in the Padé 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 Padé approximations.