Wynn's Epsilon Algorithm for transforming symbolic SymPy expressions
Author J-Revell
3 Stars
Updated Last
3 Years Ago
Started In
March 2019


Travis Appveyor

A package to facilitate the calculation of epsilon () table structures, derived from Wynn's recursive epsilon algorithm. The components of the epsilon table are commonly used within the calculation of sequence transformations.

Suppose we are presented with a series, , with component terms , and partial sums ,


Wynn's epsilon algorithm computes the following recursive scheme: ,


, for

, for

, for

The resulting table of values is known as the epsilon table.

Epsilon table values with an even -th index, i.e. , are commonly used to compute rational sequence transformations and extrapolations, such as Shank's Transforms, and Pade Approximants.

Example usage: computing the epsilon table for exp(x)

The first 5 terms of the Taylor series expansion for are . The epsilon table can be generated in the manner below:

using SymPy
using Wynn
# or, if not registered with package repository
# using .Wynn

@syms x
# first 5 terms of the Taylor series expansion of exp(x)
s = [1, x, x^2/2, x^3/6, x^4/24]

etable = EpsilonTable(s).etable

Retrieving the epsilon table value corresponding to is done by

etable[i, j]

Alternatively, the same term can be calculated without generating the entire epsilon table using the epsilon function which is much more efficient.

epsilon(s, (i, j))

Further usage: computing the R[2/2] Pade Approximant of exp(x)

Suppose we wanted to approximate (around ) using a rational Pade Approximant . The pade approximant is known to correspond to the epsilon table value . Computing the R[2/2] Pade approximant is thus equivalent to ,

R = etable[0,4]

which yields

Comparing accuracy, for :

(Native Julia function)

(First 5 terms of Taylor series)

(Pade R[2/2] approximation)

It can be seen that as x moves away from 0, the Pade approximant is more accurate than the corresponding Taylor series.

Used By Packages

No packages found.