# NAG CL Interfacee01rbc (dim1_​ratnl_​eval)

## 1Purpose

e01rbc evaluates continued fractions of the form produced by e01rac.

## 2Specification

 #include
 void e01rbc (Integer m, const double a[], const double u[], double x, double *f, NagError *fail)
The function may be called by the names: e01rbc, nag_interp_dim1_ratnl_eval or nag_1d_ratnl_eval.

## 3Description

e01rbc 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$. e01rbc is intended to be used to evaluate the continued fraction representation (of an interpolatory rational function) produced by e01rac.
Graves–Morris P R and Hopkins T R (1981) Reliable rational interpolation Numer. Math. 36 111–128

## 5Arguments

1: $\mathbf{m}$Integer Input
On entry: $m$, the number of terms in the continued fraction.
Constraint: ${\mathbf{m}}\ge 1$.
2: $\mathbf{a}\left[{\mathbf{m}}\right]$const double Input
On entry: ${\mathbf{a}}\left[\mathit{j}-1\right]$ must be set to the value of the parameter ${a}_{\mathit{j}}$ in the continued fraction, for $\mathit{j}=1,2,\dots ,m$.
3: $\mathbf{u}\left[{\mathbf{m}}\right]$const double Input
On entry: ${\mathbf{u}}\left[\mathit{j}-1\right]$ must be set to the value of the parameter ${u}_{\mathit{j}}$ in the continued fraction, for $\mathit{j}=1,2,\dots ,m-1$. (The element ${\mathbf{u}}\left[m-1\right]$ is not used).
4: $\mathbf{x}$double Input
On entry: the value of $x$ at which the continued fraction is to be evaluated.
5: $\mathbf{f}$double * Output
On exit: the value of the continued fraction corresponding to the value of $x$.
6: $\mathbf{fail}$NagError * Input/Output
The NAG error argument (see Section 7 in the Introduction to the NAG Library CL Interface).

## 6Error Indicators and Warnings

NE_ALLOC_FAIL
Dynamic memory allocation failed.
See Section 3.1.2 in the Introduction to the NAG Library CL Interface for further information.
On entry, argument $〈\mathit{\text{value}}〉$ had an illegal value.
NE_INTERNAL_ERROR
An internal error has occurred in this function. Check the function call and any array sizes. If the call is correct then please contact NAG for assistance.
See Section 7.5 in the Introduction to the NAG Library CL Interface for further information.
NE_NO_LICENCE
Your licence key may have expired or may not have been installed correctly.
See Section 8 in the Introduction to the NAG Library CL Interface for further information.
NE_POLE_PRESENT
x corresponds to a pole of $R\left(x\right)$, or is very close. ${\mathbf{x}}=〈\mathit{\text{value}}〉$.

## 7Accuracy

See Section 7 in e01rac.

## 8Parallelism and Performance

e01rbc is not threaded in any implementation.

The time taken by e01rbc is approximately proportional to $m$.

## 10Example

This example reads in the arguments ${a}_{j}$ and ${u}_{j}$ of a continued fraction (as determined by the example for e01rac) and evaluates the continued fraction at a point $x$.

### 10.1Program Text

Program Text (e01rbce.c)

### 10.2Program Data

Program Data (e01rbce.d)

### 10.3Program Results

Program Results (e01rbce.r)