nag_1d_pade (e02rac) (PDF version)
e02 Chapter Contents
e02 Chapter Introduction
NAG C Library Manual

NAG Library Function Document

nag_1d_pade (e02rac)

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

nag_1d_pade (e02rac) calculates the coefficients in a Padé approximant to a function from its user-supplied Maclaurin expansion.

2  Specification

#include <nag.h>
#include <nage02.h>
void  nag_1d_pade (Integer ia, Integer ib, const double c[], double a[], double b[], NagError *fail)

3  Description

Given a power series
c0+c1x+c2x2++cl+mxl+m+
nag_1d_pade (e02rac) uses the coefficients ci, for i=0,1,,l+m, to form the l/m Padé approximant of the form
a0+a1x+a2x2++alxl b0+b1x+b2x2++bmxm
with b0 defined to be unity. The two sets of coefficients aj, for j=0,1,,l, and bk, for k=0,1,,m, in the numerator and denominator are calculated by direct solution of the Padé equations (see Graves–Morris (1979)); these values are returned through the argument list unless the approximant is degenerate.
Padé approximation is a useful technique when values of a function are to be obtained from its Maclaurin expansion but convergence of the series is unacceptably slow or even nonexistent. It is based on the hypothesis of the existence of a sequence of convergent rational approximations, as described in Baker and Graves–Morris (1981) and Graves–Morris (1979).
Unless there are reasons to the contrary (as discussed in Chapter 4, Section 2, Chapters 5 and 6 of Baker and Graves–Morris (1981)), one normally uses the diagonal sequence of Padé approximants, namely
m/m,m=0,1,2,.
Subsequent evaluation of the approximant at a given value of x may be carried out using nag_1d_pade_eval (e02rbc).

4  References

Baker G A Jr and Graves–Morris P R (1981) Padé approximants, Part 1: Basic theory encyclopaedia of Mathematics and its Applications Addison–Wesley
Graves–Morris P R (1979) The numerical calculation of Padé approximants Padé Approximation and its Applications. Lecture Notes in Mathematics (ed L Wuytack) 765 231–245 Adison–Wesley

5  Arguments

1:     iaIntegerInput
2:     ibIntegerInput
On entry: ia must specify l+1 and ib must specify m+1, where l and m are the degrees of the numerator and denominator of the approximant, respectively.
Constraint: ia1 and ib1.
3:     c[ia+ib-1]const doubleInput
On entry: c[i-1] must specify, for i=1,2,,l+m+1, the coefficient of xi-1 in the given power series.
4:     a[ia]doubleOutput
On exit: a[j], for j=1,2,,l+1, contains the coefficient aj in the numerator of the approximant.
5:     b[ib]doubleOutput
On exit: b[k], for k=1,2,,m+1, contains the coefficient bk in the denominator of the approximant.
6:     failNagError *Input/Output
The NAG error argument (see Section 3.6 in the Essential Introduction).

6  Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
NE_BAD_PARAM
On entry, argument value had an illegal value.
NE_DEGENERATE
The Pade approximant is degenerate.
NE_INT
On entry, ia=value.
Constraint: ia1.
On entry, ib=value.
Constraint: ib1.
NE_INT_2
On entry, ib=value and ia=value.
Constraint: ia1 and ib1.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.

7  Accuracy

The solution should be the best possible to the extent to which the solution is determined by the input coefficients. It is recommended that you determine the locations of the zeros of the numerator and denominator polynomials, both to examine compatibility with the analytic structure of the given function and to detect defects. (Defects are nearby pole-zero pairs; defects close to x=0.0 characterise ill-conditioning in the construction of the approximant.) Defects occur in regions where the approximation is necessarily inaccurate. The example program calls nag_zeros_real_poly (c02agc) to determine the above zeros.
It is easy to test the stability of the computed numerator and denominator coefficients by making small perturbations of the original Maclaurin series coefficients (e.g., cl or cl+m). These questions of intrinsic error of the approximants and computational error in their calculation are discussed in Chapter 2 of Baker and Graves–Morris (1981).

8  Further Comments

The time taken is approximately proportional to m3.

9  Example

This example calculates the 4/4 Padé approximant of ex (whose power-series coefficients are first stored in the array c). The poles and zeros are then calculated to check the character of the 4/4 Padé approximant.

9.1  Program Text

Program Text (e02race.c)

9.2  Program Data

None.

9.3  Program Results

Program Results (e02race.r)


nag_1d_pade (e02rac) (PDF version)
e02 Chapter Contents
e02 Chapter Introduction
NAG C Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2012