E406: Chebyshev Series Coefficients of a Function

Author(s): T. Håvie Library: MATHLIB
Submitter: K.S. Kölbig Submitted: 24.01.1986
Language: Fortran Revised: 01.12.1994

Subroutine subprograms RCHECF, DCHECF and QCHECF calculate coefficients for a finite sum of Chebyshev polynomials approximating a function f(x) over an interval tex2html_wrap_inline109 to accuracy tex2html_wrap_inline111 . It returns an integer n and coefficients tex2html_wrap_inline115 such that the sum

equation44

where t = (2x - a - b)/(b - a) and tex2html_wrap_inline119 is the Chebyshev polynomial of degree j, satisfies for tex2html_wrap_inline123 the relation

equation47

Subsequent evaluation of the approximation (1) can be done by calling CHSUM (E407) with the appropriate value of its argument MODE.

On computers other than CDC and Cray, only the double- and quadruple-precision versions DCHECF and QCHECF are available. On CDC and Cray computers, only the single- and double-precision versions RCHECF and DCHECF are available.

Structure:

SUBROUTINE subprogram
User Entry Names: RCHECF, DCHECF, QCHECF
Obsolete User Entry Names: CHECF tex2html_wrap_inline125 RCHECF
Files Referenced: Unit 6
External References: MTLMTR, ABEND, user-supplied FUNCTION subprogram

Usage:

For tex2html_wrap_inline127 (type REAL), tex2html_wrap_inline129 (type DOUBLE PRECISION), tex2html_wrap_inline131 (type REAL*16),

    CALL tCHECF(F,A,B,EPS,C,N,DELTA)
F
(type according to t) Name of a user-supplied FUNCTION subprogram, declared EXTERNAL in the calling program.
A,B
(type according to t) End-points a,b of the approximation interval.
EPS
(type according to t) Requested accuracy.
C
(type according to t) One-dimensional array with dimension (0:d), tex2html_wrap_inline135 . On exit, tex2html_wrap_inline137 .
N
(INTEGER) On exit, N is equal to the subscript of the last computed coefficient.
DELTA
(type according to t) On exit, DELTA is such that the relation tex2html_wrap_inline139 is almost certainly true for tex2html_wrap_inline141 . (See Error Handling.)

Method:

The interval [a,b] is subdivided successively into sets of subintervals of length tex2html_wrap_inline145 . After each subdivision the orthogonality properties of the Chebyshev polynomials with respect to summation over equally-spaced points are used to compute two sets of approximate values of the coefficients tex2html_wrap_inline147 : one set computed using the end-points of the subintervals, and one set using the mid-points. The mean of these two values is taken as the best estimate of the tex2html_wrap_inline149 , which are then tested to see (a) whether certain rate-of-convergence criteria are satisfied, (b) whether there is some n for which the sum for j>n of the available tex2html_wrap_inline155 is less than tex2html_wrap_inline157 . If both conditions are satisfied the subroutine terminates.

Error handling:

Error E406.1: If the requested accuracy cannot be obtained with 65 coefficients (i.e., tex2html_wrap_inline159 ) a message is written on Unit 6, unless subroutine MTLSET (N002) has been called. In this case, values of tex2html_wrap_inline161 computed from (1) with tex2html_wrap_inline163 should still be in error by less than DELTA.

Notes:

  1. This subroutine is intended for use with functions f(x) which can be computed to full machine accuracy, and which are sufficiently smooth to ensure fairly rapid decrease of the tex2html_wrap_inline167 with increasing j. Functions defined by experimental data can usually be approximated better by least-squares methods, using ordinary polynomials.
  2. Note that some authors use a different definition for the constant term in (1), i.e. tex2html_wrap_inline171 instead of tex2html_wrap_inline173 . Here, the definition of Ref. 1 is used.

References:

  1. Y.L. Luke, Mathematical functions and their approximations, (Academic Press, New York 1975)
tex2html_wrap_inline175

Michel Goossens Wed Jun 5 03:37:01 METDST 1996