next up previous index
Next: E409 Summation of Up: CERNLIB Previous: E407 Summation of

E408 Conversion of Chebyshev to Power and Power to Chebyshev Series

Routine ID: E408
Author(s): K.S. KölbigLibrary: MATHLIB
Submitter: Submitted: 15.02.1994
Language: FortranRevised:

Subroutine subprograms RCHPWS, RPWCHS and DCHPWS, DPWCHS perform the conversion of a finite Chebyshev series to a finite power series (i.e. a polynomial) and vice versa.

Thus, given the coefficients cj , (j=0,1,...,n) of a finite Chebyshev series, RCHPWS and DCHWPS calculate the coefficients aj , (j=0,1,...,n) of the equivalent polynomial:

c0+c1T1(x)+...+cnTn(x) = a0+a1x+...+anxn.

Conversely, given the coefficients aj , (j=0,1,...,n) of a power series, RPWCHS and DPWCHS calculate the coefficients cj , (j=0,1,...,n) of the equivalent finite Chebyshev series:

a0+a1x+...+anxn = c0+c1T1(x)+...+cnTn(x).

In both cases, Tj(x) is the Chebyshev polynomial of degree j.

Note that sometimes the constant term in the Chebyshev series is defined differently, i.e. c0/2 instead of c0 . Here, the definition of Ref. 1 is used.

On computers other than CDC or Cray, only the double-precision versions DCHPWS and DPWCHS are available. On CDC and Cray computers, only the single-precision versions RCHPWS and RPWCHS are available.

Structure:

SUBROUTINE subprograms
User Entry Names: RCHPWS, RPWCHS, DCHPWS, DPWCHS
Files referenced: Unit 6

Usage:

For t=R (type REAL), t=D (type DOUBLE PRECISION),

    CALL tCHPWS(N,C,A)
N
( INTEGER) Degree n of last Chebyshev polynomial in the expansion.
C
(type according to t) One-dimensional array of dimension (0:d), where d ≥N . On entry, C must contain the coefficients cj , (j=0,1,...,n) of the Chebyshev expansion.
A
(type according to t) One-dimensional array of dimension (0:d), where d ≥N . On exit, A contains the coefficients aj , (j=0,1,...,n) of the power series expansion.
    CALL tPWCHS(N,A,C)
N
( INTEGER) Degree n of the polynomial.
A
(type according to t) One-dimensional array of dimension (0:d), where 0 ≥N . On entry, A must contain the coefficients aj , (j=0,1,...,n) of the polynomial.
C
(type according to t) One-dimensional array of dimension (0:d), where 0 ≥N . On exit, C contains the coefficients cj , (j=0,1,...,n) of the Chebyshev expansion.

Error handling:

Error E408.1: N<0 or N>100 .
A message is written on Unit 6, unless subroutine MTLSET (N002) has been called.

References:

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

E409



next up previous index
Next: E409 Summation of Up: CERNLIB Previous: E407 Summation of


Janne Saarela
Mon Apr 3 15:06:23 METDST 1995