Clenshaw_M := proc(c,n,t) # -------------------------------------------------------------- # # PUPPOSE # # This Maple 6 procedure uses Clenshaw's algorithm to # efficiently compute the Chebyshev sum # 1/2c[0]*T0(t) + c[1]*T1(t) + c[2]*T2(t) +...+ c[n]*Tn(t) # for a given array of n+1 Chebyshev coefficients # c = [c[0],c[0],c[2], ... , c[n]] # and argument t in the interval [-1,1]. # # USAGE # # y = Clenshaw_M(c,n,t) # # FILE NAME # # Clenshaw_M.txt # # DATE # # October 12, 2000 # # PROGRAMMER # # Dr. F.G. Lether # Dept. Math. # Univ. Georgia # Athens, Georgia 30602 USA # # email: fglether@math.uga.edu # # REMARK # # The simple implementation of Clenshaw's original algorithm # in the code below DOES NOT employ the more complex and # slightly more accurate Reincsh modification of Clenshaw's # method as investigated by Oliver in the reference: # # Oliver, J.(1977), An Error Analysis of the Modified Clenshaw # Method for Evaluating Chebyshev and Fourier Series, J. Inst. # Maths. Appl. (JIMA) 20, 379-391 # # -------------------------------------------------------------- # local twot,u0,u1,u2,k,ChebySum; twot := t + t; u0 := 0; u1 := 0; for k from n to 0 by -1 do u2 := u1; u1 := u0; u0 := twot*u1 - u2 + c[k]; od; ChebySum := 0.5*(u0 - u2); end: