NAG Library Routine Document

e01rbf (dim1_ratnl_eval)

 Contents

    1  Purpose
    7  Accuracy

1
Purpose

e01rbf evaluates continued fractions of the form produced by e01raf.

2
Specification

Fortran Interface
Subroutine e01rbf ( m, a, u, x, f, ifail)
Integer, Intent (In):: m
Integer, Intent (Inout):: ifail
Real (Kind=nag_wp), Intent (In):: a(m), u(m), x
Real (Kind=nag_wp), Intent (Out):: f
C Header Interface
#include nagmk26.h
void  e01rbf_ (const Integer *m, const double a[], const double u[], const double *x, double *f, Integer *ifail)

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
Arguments

1:     m – IntegerInput
On entry: m, the number of terms in the continued fraction.
Constraint: m1.
2:     am – 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:     um – 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 argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation 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 argument, 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.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7
Accuracy

See Section 7 in e01raf.

8
Parallelism and Performance

e01rbf is not threaded in any implementation.

9
Further Comments

The time taken by e01rbf is approximately proportional to m.

10
Example

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

10.1
Program Text

Program Text (e01rbfe.f90)

10.2
Program Data

Program Data (e01rbfe.d)

10.3
Program Results

Program Results (e01rbfe.r)

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