The Taylor series of the exponential function,

provides reasonable approximations to the function near zero: for example, with we get

The quality of approximation not being spectacular, one can try to improve it by using rational functions instead of polynomials. In view of the identity

one can get with . The improvement is substantial for negative :

Having rational approximation of the form makes perfect sense, because such approximants obey the same functional equation as the exponential function itself. We cannot hope to satisfy other functional equations like by functions simpler than .

However, the polynomial is **not optimal** for approximation except for . For degree , the optimal choice is . In the same plot window as above, the graph of is indistinguishable from .

This is a Padé approximant to the exponential function. One way to obtain such approximants is to replace the Taylor series with continued fraction, using long division:

Terminating the expansion after an even number of apprearances gives a Padé approximant of the above form.

This can be compared to replacing the decimal expansion of number :

with the continued fraction expansion

which, besides greater accuracy, has a regular pattern: 121 141 161 181 …

The numerators of the (diagonal) Padé approximants to the exponential function happen to have a closed form:

which shows that for every fixed , the coefficient of converges to as . The latter is precisely the Taylor coefficient of .

In practice, a recurrence relation is probably the easiest way to get these numerators: begin with and , and after that use . This relation can be derived from the recurrence relations for the convergents of a generalized continued fraction . Namely, and . Only the first relation is actually needed here.

Using the recurrence relation, we get

(so, not all coefficients have numerator 1…)

The quality of approximation to is best seen on logarithmic scale: i.e., how close is to ? Here is this comparison using .

For comparison, the Taylor polynomial of fifth degree, also on logarithmic scale: where .