Research Article

On Fast and Stable Implementation of Clenshaw-Curtis and Fejér-Type Quadrature Rules

Algorithm 5

function a = fejer2idst(f,N)            % coefficients for Fejérs  second rule
x  = cos(pi(1:N+1)/(N+2));            % Filippi points
fx = feval(f,x).sin(pi(1:N+1)/(N+2));      % f evaluated at  these points
a = idst(fx);                     % Chebyshev coefficients