NAG FL Interface
e01rbf (dim1_​ratnl_​eval)

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 <nag.h>
void  e01rbf_ (const Integer *m, const double a[], const double u[], const double *x, double *f, Integer *ifail)
The routine may be called by the names e01rbf or nagf_interp_dim1_ratnl_eval.

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 Integer Input
On entry: m, the number of terms in the continued fraction.
Constraint: m1.
2: am Real (Kind=nag_wp) array Input
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) array Input
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 Integer Input/Output
On entry: ifail must be set to 0, -1 or 1. If you are unfamiliar with this argument you should refer to Section 4 in the Introduction to the NAG Library FL Interface 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
x corresponds to a pole of Rx, or is very close. x=value.
ifail=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 7 in the Introduction to the NAG Library FL Interface for further information.
ifail=-399
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library FL Interface for further information.
ifail=-999
Dynamic memory allocation failed.
See Section 9 in the Introduction to the NAG Library FL Interface 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)