code 31059;
real procedure ODDCHEPOLSUM(N,X,A);
value N,X;integer N;real X;array A;
comment ODDCHEPOLSUM:=A[0]T[1](X)+A[1]T[3](X)+....+A[N]T[2N+1](X);
if N=0 then ODDCHEPOLSUM:=X*A[0] else
if N=1 then ODDCHEPOLSUM:=X*(A[0]+A[1]*(4*X*X-3)) else
begin
integer K;
real H,R,S,Y;
Y:=4*X*X-2;
R:=A[N];
H:=A[N-1]+R*Y;
for K:=N-2 step -1 until 0 do
begin
S:=R;
R:=H;
H:=A[K]+R*Y-S;
end K;
ODDCHEPOLSUM:=X*(H-R);
end ODDCHEPOLSUM;
eop