This is not a NAG routine, but a routine in Figaro's GEN library. It converts the vector of Chebyshev coefficients into a vector of coefficients of an ordinary polynomial. This is particularly useful when these are to be written to output files. In future the routine will still be needed to read old files that contain Chebyshev coefficients.
This routine is mentioned here really, because it has an equivalent in SLATEC named PDA_DPCOEF. PDA_DPCOEF is more general, in that it returns coefficients for a Taylor series, i.e. a polynomial in (XX-X0) for given expansion point X0.
The old code would look like
INTEGER I, K, K2, NROWS
DOUBLE PRECISION A1(NROWS,K+1)
DOUBLE PRECISION A2(K2+1), C(K2+1)
DO 1 I = 1, K2+1
A2(I) = A1(K2+1,I)
1 CONTINUE
CALL GEN_CHB2NO( K2, MIN(X()), MAX(X()), A2, C )
This would be replaced by
INTEGER K, K2, IFAIL
DOUBLE PRECISION A3( 3*M + 3*(K+1) )
DOUBLE PRECISION C(K2+1)
IFAIL = 0
CALL PDA_DPCOEF( K2, 0D0, C, A3, IFAIL )
IF ( IFAIL .NE. 0 ) THEN
An error has occurred
END IF
Just in case you are tempted to evaluate the polynomial yourself rather than use PDA_DP1VLU, here is a piece of code to get P = f(XX):
INTEGER I, K2
DOUBLE PRECISION XX, P
DOUBLE PRECISION C(K2+1)
P = C(K2+1)
DO 2 I = K2, 1, -1
P = P * XX
P = P + C(I)
2 CONTINUE
PDA [1ex