Previous topic

scipy.misc.logsumexp

Next topic

scipy.misc.toimage

scipy.misc.pade

scipy.misc.pade(an, m)[source]

Return Pade approximation to a polynomial as the ratio of two polynomials.

Parameters:

an : (N,) array_like

Taylor series coefficients.

m : int

The order of the returned approximating polynomials.

Returns:

p, q : Polynomial class

The pade approximation of the polynomial defined by an is p(x)/q(x).

Examples

>>> from scipy import misc
>>> e_exp = [1.0, 1.0, 1.0/2.0, 1.0/6.0, 1.0/24.0, 1.0/120.0]
>>> p, q = misc.pade(e_exp, 2)
>>> e_exp.reverse()
>>> e_poly = np.poly1d(e_exp)

Compare e_poly(x) and the pade approximation p(x)/q(x)

>>> e_poly(1)
2.7166666666666668
>>> p(1)/q(1)
2.7179487179487181