C++ routine for Gauss-Legendre quadrature