/* AQ.H xref: input: output: stdout does - Globally adaptive quadrature - Header file does - Globally adaptive quadrature - Kronrod 7-point rule (Gauss-Legendre n=3). - univariate integration over finite intervals */ /************************************************************/ double AdaptQuad (double f(double), double a, double b, double abserr, double relerr, double maxneval, int* rc, int* neval, double* ehat); /* Globally adaptive quadrature over a finite interval Uses a 7-point Gauss-Legendre-Kronrod as the basic building block. Input: f = function to be integrated a, b = limits of integration, a < b works properly abserr = absolute error tolerance relerr = relative error tolerance maxneval= max acceptable # of function evaluations f(x) Output: returns value of integral, *rc <- 1 if converged, 0 otherwise, *neval <- # function evaluations *ehat <- error estimate (error := true - estimate) */