NAG FL Interface
e01rbf (dim1_​ratnl_​eval)

Settings help

FL Name Style:


FL Specification Language:


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
R(x)=a1+Rm(x)  
where
Ri(x)=am-i+ 2(x-um-i+ 1) 1+Ri- 1(x) ,   for ​ i=m,m- 1,,2.  
and
R1(x)=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: a(m) Real (Kind=nag_wp) array Input
On entry: a(j) 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) array Input
On entry: u(j) must be set to the value of the parameter uj in the continued fraction, for j=1,2,,m-1. (The element u(m) 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 to set behaviour on detection of an error; these values have no effect when no error is detected.
A value of 0 causes the printing of an error message and program execution will be halted; otherwise program execution continues. A value of -1 means that an error message is printed while a value of 1 means that it is not.
If halting is not appropriate, the value -1 or 1 is recommended. If message printing is undesirable, then the value 1 is recommended. Otherwise, the value 0 is recommended. 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 R(x), 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)