E01RBF (PDF version)
E01 Chapter Contents
E01 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

E01RBF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

+ Contents

    1  Purpose
    7  Accuracy

1  Purpose

E01RBF evaluates continued fractions of the form produced by E01RAF.

2  Specification

SUBROUTINE E01RBF ( M, A, U, X, F, IFAIL)
INTEGER  M, IFAIL
REAL (KIND=nag_wp)  A(M), U(M), X, F

3  Description

E01RBF evaluates the continued fraction
Rx=a1+Rmx
where
Rix=am-i+ 2x-um-i+ 1 1+Ri- 1x ,   for ​ i=m,m- 1,,2.
and
R1x=0
for a prescribed value of x. E01RBF is intended to be used to evaluate the continued fraction representation (of an interpolatory rational function) produced by E01RAF.

4  References

Graves–Morris P R and Hopkins T R (1981) Reliable rational interpolation Numer. Math. 36 111–128

5  Parameters

1:     M – INTEGERInput
On entry: m, the number of terms in the continued fraction.
Constraint: M1.
2:     A(M) – REAL (KIND=nag_wp) arrayInput
On entry: Aj must be set to the value of the parameter aj in the continued fraction, for j=1,2,,m.
3:     U(M) – REAL (KIND=nag_wp) arrayInput
On entry: Uj must be set to the value of the parameter uj in the continued fraction, for j=1,2,,m-1. (The element Um is not used).
4:     X – REAL (KIND=nag_wp)Input
On entry: the value of x at which the continued fraction is to be evaluated.
5:     F – REAL (KIND=nag_wp)Output
On exit: the value of the continued fraction corresponding to the value of x.
6:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this parameter you should refer to Section 3.3 in the Essential Introduction for details.
For environments where it might be inappropriate to halt program execution when an error is detected, the value -1​ or ​1 is recommended. If the output of error messages is undesirable, then the value 1 is recommended. Otherwise, if you are not familiar with this parameter, the recommended value is 0. When the value -1​ or ​1 is used it is essential to test the value of IFAIL on exit.
On exit: IFAIL=0 unless the routine detects an error or a warning has been flagged (see Section 6).

6  Error Indicators and Warnings

If on entry IFAIL=0 or -1, explanatory error messages are output on the current error message unit (as defined by X04AAF).
Errors or warnings detected by the routine:
IFAIL=1
The value of X corresponds to a pole of Rx or is so close that an overflow is likely to ensue.

7  Accuracy

See Section 7 in E01RAF.

8  Further Comments

The time taken by E01RBF is approximately proportional to m.

9  Example

This example reads in the parameters aj and uj of a continued fraction (as determined by the example for E01RAF) and evaluates the continued fraction at a point x.

9.1  Program Text

Program Text (e01rbfe.f90)

9.2  Program Data

Program Data (e01rbfe.d)

9.3  Program Results

Program Results (e01rbfe.r)


E01RBF (PDF version)
E01 Chapter Contents
E01 Chapter Introduction
NAG Library Manual

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