hide long namesshow long names
hide short namesshow short names
Integer type:  int32  int64  nag_int  show int32  show int32  show int64  show int64  show nag_int  show nag_int

PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

NAG Toolbox: nag_sum_withdraw_chebyshev (c06db)

Purpose

nag_sum_withdraw_chebyshev (c06db) returns the value of the sum of a Chebyshev series through the function name.
Note: this function is scheduled to be withdrawn, please see c06db in Advice on Replacement Calls for Withdrawn/Superseded Routines..

Syntax

[result] = c06db(x, c, s, 'n', n)
[result] = nag_sum_withdraw_chebyshev(x, c, s, 'n', n)

Description

nag_sum_withdraw_chebyshev (c06db) evaluates the sum of a Chebyshev series of one of three forms according to the value of the parameter s:
s = 1 :
n
0.5c1 + cjTj1(x),
j = 2
s = 2 :
n
0.5c1 + cjT2j2(x),
j = 2
s = 3 :
n
cjT2j1(x)
j = 1
s=1: 0.5 c1 + j=2 n cj T j-1 (x) , s=2: 0.5 c1 + j=2 n cj T 2j-2 (x) , s=3: j=1 n cj T 2j-1 (x)
where xx lies in the range 1.0 x 1.0 -1.0 x 1.0 . Here Tr (x) Tr (x)  is the Chebyshev polynomial of order rr in xx, defined by cos(ry) cos(ry)  where cosy = x cosy=x .
The method used is based upon a three-term recurrence relation; for details see Clenshaw (1962).

References

Clenshaw C W (1962) Chebyshev Series for Mathematical Functions Mathematical tables HMSO

Parameters

Compulsory Input Parameters

1:     x – double scalar
The argument xx of the series.
Constraint: 1.0 x 1.0-1.0 x 1.0.
2:     c(n) – double array
c(j)cj must contain the coefficient cjcj of the Chebyshev series, for j = 1,2,,nj=1,2,,n.
3:     s – int64int32nag_int scalar
Must have the value 11, 22 or 33 according to whether the series is general, even or odd respectively (see Section [Description]). For all other values of s, the function behaves as though s = 2s=2.

Optional Input Parameters

1:     n – int64int32nag_int scalar
Default: The dimension of the array c.
nn, the number of terms in the series.

Input Parameters Omitted from the MATLAB Interface

None.

Output Parameters

1:     result – double scalar
The result of the function.

Error Indicators and Warnings

If an error is detected in an input parameter nag_sum_withdraw_chebyshev (c06db) will act as if a soft noisy exit has been requested (see Section [Soft Fail Option] in the (essin)).

Accuracy

There may be a loss of significant figures due to cancellation between terms. However, provided that nn is not too large, nag_sum_withdraw_chebyshev (c06db) yields results which differ little from the best attainable for the available machine precision.

Further Comments

The time taken increases with nn.
nag_sum_withdraw_chebyshev (c06db) has been prepared in the present form to complement a number of integral equation solving functions which use Chebyshev series methods, e.g., nag_inteq_fredholm2_split (d05aa) and nag_inteq_fredholm2_smooth (d05ab).

Example

function nag_sum_withdraw_chebyshev_example
x = 0.5;
c = [1;
     1;
     0.5;
     0.25];
s = int64(1);
[result] = nag_sum_withdraw_chebyshev(x, c, s)
 

result =

    0.5000


function c06db_example
x = 0.5;
c = [1;
     1;
     0.5;
     0.25];
s = int64(1);
[result] = c06db(x, c, s)
 

result =

    0.5000



PDF version (NAG web site, 64-bit version, 64-bit version)
Chapter Contents
Chapter Introduction
NAG Toolbox

© The Numerical Algorithms Group Ltd, Oxford, UK. 2009–2013