An Error Analysis of the Modified Clenshaw Method for Evaluating Chebyshev and Fourier Series