D02UZF (PDF version)
D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

D02UZF

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

D02UZF returns the value of the kth Chebyshev polynomial evaluated at a point x-1,1. D02UZF is primarily a utility routine for use by the Chebyshev boundary value problem solvers.

2  Specification

SUBROUTINE D02UZF ( K, X, T, IFAIL)
INTEGER  K, IFAIL
REAL (KIND=nag_wp)  X, T

3  Description

D02UZF returns the value, T, of the kth Chebyshev polynomial evaluated at a point x-1,1; that is, T=cosk×arccosx.

4  References

Trefethen L N (2000) Spectral Methods in MATLAB SIAM

5  Arguments

1:     K – INTEGERInput
On entry: the order of the Chebyshev polynomial.
Constraint: K0.
2:     X – REAL (KIND=nag_wp)Input
On entry: the point at which to evaluate the polynomial.
Constraint: -1.0X1.0.
3:     T – REAL (KIND=nag_wp)Output
On exit: the value, T, of the Chebyshev polynomial order k evaluated at x.
4:     IFAIL – INTEGERInput/Output
On entry: IFAIL must be set to 0, -1​ or ​1. If you are unfamiliar with this argument you should refer to Section 3.4 in How to Use the NAG Library and its Documentation 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
On entry, K=value.
Constraint: K0.
IFAIL=2
On entry, X=value.
Constraint: -1.0X1.0.
IFAIL=-99
An unexpected error has been triggered by this routine. Please contact NAG.
See Section 3.9 in How to Use the NAG Library and its Documentation for further information.
IFAIL=-399
Your licence key may have expired or may not have been installed correctly.
See Section 3.8 in How to Use the NAG Library and its Documentation for further information.
IFAIL=-999
Dynamic memory allocation failed.
See Section 3.7 in How to Use the NAG Library and its Documentation for further information.

7  Accuracy

The accuracy should be close to machine precision.

8  Parallelism and Performance

D02UZF is not threaded in any implementation.

9  Further Comments

None.

10  Example

A set of Chebyshev coefficients is obtained for the function x+exp-x defined on -0.24×π,0.5×π using D02UCF. At each of a set of new grid points in the domain of the function D02UZF is used to evaluate each Chebshev polynomial in the series representation. The values obtained are multiplied to the Chebyshev coefficients and summed to obtain approximations to the given function at the new grid points.

10.1  Program Text

Program Text (d02uzfe.f90)

10.2  Program Data

Program Data (d02uzfe.d)

10.3  Program Results

Program Results (d02uzfe.r)


D02UZF (PDF version)
D02 Chapter Contents
D02 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2016