hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_fit_pade_eval (e02rb)

Purpose

nag_fit_pade_eval (e02rb) evaluates a rational function at a user-supplied point, given the numerator and denominator coefficients.

Syntax

[ans, ifail] = e02rb(a, b, x, 'ia', ia, 'ib', ib)
[ans, ifail] = nag_fit_pade_eval(a, b, x, 'ia', ia, 'ib', ib)

Description

Given a real value xx and the coefficients ajaj, for j = 0,1,,lj=0,1,,l and bkbk, for k = 0,1,,mk=0,1,,m, nag_fit_pade_eval (e02rb) evaluates the rational function
(j = 0lajxj)/(k = 0mbkxk).
j=0lajxj k=0mbkxk .
using nested multiplication (see Conte and de Boor (1965)).
A particular use of nag_fit_pade_eval (e02rb) is to compute values of the Padé approximants determined by nag_fit_pade_app (e02ra).

References

Conte S D and de Boor C (1965) Elementary Numerical Analysis McGraw–Hill
Peters G and Wilkinson J H (1971) Practical problems arising in the solution of polynomial equations J. Inst. Maths. Applics. 8 16–35

Parameters

Compulsory Input Parameters

1:     a(ia) – double array
ia, the dimension of the array, must satisfy the constraint ia1ia1.
a(j + 1)aj+1, for j = 1,2,,l + 1j=1,2,,l+1, must contain the value of the coefficient ajaj in the numerator of the rational function.
2:     b(ib) – double array
ib, the dimension of the array, must satisfy the constraint ib1ib1.
b(k + 1)bk+1, for k = 1,2,,m + 1k=1,2,,m+1, must contain the value of the coefficient bkbk in the denominator of the rational function.
Constraint: if ib = 1ib=1, b(1)0.0b10.0.
3:     x – double scalar
The point xx at which the rational function is to be evaluated.

Optional Input Parameters

1:     ia – int64int32nag_int scalar
Default: The dimension of the array a.
The value of l + 1l+1, where ll is the degree of the numerator.
Constraint: ia1ia1.
2:     ib – int64int32nag_int scalar
Default: The dimension of the array b.
The value of m + 1m+1, where mm is the degree of the denominator.
Constraint: ib1ib1.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

1:     ans – double scalar
The result of evaluating the rational function at the given point xx.
2:     ifail – int64int32nag_int scalar
ifail = 0ifail=0 unless the function detects an error (see [Error Indicators and Warnings]).

Error Indicators and Warnings

Errors or warnings detected by the function:
  ifail = 1ifail=1
The rational function is being evaluated at or near a pole.
  ifail = 2ifail=2
On entry,ia < 1ia<1,
orib < 1ib<1,
orb(1) = 0.0b1=0.0 when ib = 1ib=1 (so the denominator is identically zero).

Accuracy

A running error analysis for polynomial evaluation by nested multiplication using the recurrence suggested by Kahan (see Peters and Wilkinson (1971)) is used to detect whether you are attempting to evaluate the approximant at or near a pole.

Further Comments

The time taken is approximately proportional to l + ml+m.

Example

function nag_fit_pade_eval_example
a = [1;
     0.5;
     0.1071428571428577;
     0.011904761904762;
     0.0005952380952381046];
b = [1;
     -0.5;
     0.1071428571428566;
     -0.01190476190476179;
     0.0005952380952380861];
x = 0.1;
[ans, ifail] = nag_fit_pade_eval(a, b, x)
 

ans =

    1.1052


ifail =

                    0


function e02rb_example
a = [1;
     0.5;
     0.1071428571428577;
     0.011904761904762;
     0.0005952380952381046];
b = [1;
     -0.5;
     0.1071428571428566;
     -0.01190476190476179;
     0.0005952380952380861];
x = 0.1;
[ans, ifail] = e02rb(a, b, x)
 

ans =

    1.1052


ifail =

                    0



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013