 Gauss-Legendre quadrature is optimal in a very narrow sense for computing integrals of a function "f" over , since no other quadrature rule integrates all degree polynomials exactly when using "n" sample points.However, this measure of accuracy is not generally a very useful one---polynomials are very simple to integrate and this argument does not by itself guarantee better accuracy on integrating other functions.Clenshaw-Curtis quadrature is based on approximating "f" by a polynomial interpolant at Chebyshev nodes and integrates polynomials of degree up to "n" exactly when given "n" samples.