Settings help

CL Name Style:

## 1Purpose

e02rbc evaluates a rational function at a user-supplied point, given the numerator and denominator coefficients.

## 2Specification

 #include
 void e02rbc (const double a[], Integer ia, const double b[], Integer ib, double x, double *ans, NagError *fail)
The function may be called by the names: e02rbc, nag_fit_pade_eval or nag_1d_pade_eval.

## 3Description

Given a real value $x$ and the coefficients ${a}_{j}$, for $\mathit{j}=0,1,\dots ,l$ and ${b}_{k}$, for $\mathit{k}=0,1,\dots ,m$, e02rbc evaluates the rational function
 $∑j=0lajxj ∑k=0mbkxk .$
using nested multiplication (see Conte and de Boor (1965)).
A particular use of e02rbc is to compute values of the Padé approximants determined by e02rac.
Conte S D and de Boor C (1965) Elementary Numerical Analysis McGraw–Hill
Peters G and Wilkinson J H (1971) Practical problems arising in the solution of polynomial equations J. Inst. Maths. Applics. 8 16–35

## 5Arguments

1: $\mathbf{a}\left[{\mathbf{ia}}\right]$const double Input
On entry: ${\mathbf{a}}\left[\mathit{j}\right]$, for $\mathit{j}=1,2,\dots ,l+1$, must contain the value of the coefficient ${a}_{\mathit{j}}$ in the numerator of the rational function.
2: $\mathbf{ia}$Integer Input
On entry: the value of $l+1$, where $l$ is the degree of the numerator.
Constraint: ${\mathbf{ia}}\ge 1$.
3: $\mathbf{b}\left[{\mathbf{ib}}\right]$const double Input
On entry: ${\mathbf{b}}\left[\mathit{k}\right]$, for $\mathit{k}=1,2,\dots ,m+1$, must contain the value of the coefficient ${b}_{k}$ in the denominator of the rational function.
Constraint: if ${\mathbf{ib}}=1$, ${\mathbf{b}}\left[0\right]\ne 0.0$.
4: $\mathbf{ib}$Integer Input
On entry: the value of $m+1$, where $m$ is the degree of the denominator.
Constraint: ${\mathbf{ib}}\ge 1$.
5: $\mathbf{x}$double Input
On entry: the point $x$ at which the rational function is to be evaluated.
6: $\mathbf{ans}$double * Output
On exit: the result of evaluating the rational function at the given point $x$.
7: $\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_INT
On entry, ${\mathbf{ia}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ia}}\ge 1$.
On entry, ${\mathbf{ib}}=⟨\mathit{\text{value}}⟩$.
Constraint: ${\mathbf{ib}}\ge 1$.
NE_INT_ARRAY
The first ib entries in b are zero: ${\mathbf{ib}}=⟨\mathit{\text{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
Evaluation at or near a pole.

## 7Accuracy

A running error analysis for polynomial evaluation by nested multiplication using the recurrence suggested by Kahan (see Peters and Wilkinson (1971)) is used to detect whether you are attempting to evaluate the approximant at or near a pole.

## 8Parallelism and Performance

e02rbc is not threaded in any implementation.

The time taken is approximately proportional to $l+m$.

## 10Example

This example first calls e02rac to calculate the $4/4$ Padé approximant to ${e}^{x}$, and then uses e02rbc to evaluate the approximant at $x=0.1,0.2,\dots ,1.0$.

### 10.1Program Text

Program Text (e02rbce.c)

None.

### 10.3Program Results

Program Results (e02rbce.r)
{"ft_lang_label":"__label__en","ft_lang_prob":0.87012583,"math_prob":0.9958362,"size":1006,"snap":"2021-31-2021-39","text_gpt3_token_len":214,"char_repetition_ratio":0.11077844,"word_repetition_ratio":0.12820514,"special_character_ratio":0.19681908,"punctuation_ratio":0.07602339,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99965954,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2021-09-16T10:12:59Z\",\"WARC-Record-ID\":\"<urn:uuid:d1f1b2b6-8f73-4746-809c-1e0a58e7cde4>\",\"Content-Length\":\"40283\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:4b6cf110-044a-4af1-aebd-48ac2e4f0a1c>\",\"WARC-Concurrent-To\":\"<urn:uuid:c9c34384-ef7a-4255-8973-3c26654745e2>\",\"WARC-IP-Address\":\"78.129.168.4\",\"WARC-Target-URI\":\"https://www.nag.com/numeric/nl/nagdoc_latest/clhtml/e02/e02rbc.html\",\"WARC-Payload-Digest\":\"sha1:MTQD6DQVSF76RX6ELHEUJQK3OG73XHLK\",\"WARC-Block-Digest\":\"sha1:6XXIV2Q7G6ZTETXZ4MXRC4HL6RWEPEUK\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2021/CC-MAIN-2021-39/CC-MAIN-2021-39_segments_1631780053493.41_warc_CC-MAIN-20210916094919-20210916124919-00695.warc.gz\"}"}