
Provided by the routine are woefully pessimistic. We still achieve 1e-15 precision, with an error estimate of 1e-10.įor essentially all analytic integrands bounded on the domain, the error estimates Q = gauss_kronrod :: integrate ( f1, 0, std :: numeric_limits :: infinity (), 5, 1e-9, & error ) Of the estimate, so if we integrate with a tolerance of 1e-9: Seen above, for smooth functions, the precision achieved is often double that In this case the requested tolerance was almost certainly set too low: as we've This yields an actual error of zero, against an estimate of 4e-15. Q = gauss_kronrod :: integrate ( f1, 0, std :: numeric_limits :: infinity (), 5, 1e-14, & error ) Integration, and set the desired relative error to 1e-14 against a maximum However, instead of continuing with ever more points, lets switch to adaptive This yields an absolute error of 3e-15 against an estimate of 1e-8, which isĪbout as good as we're going to get at double precision Q = gauss_kronrod :: integrate ( f1, 0, std :: numeric_limits :: infinity (), 0, 0, & error ) To the estimated error of 5e-3: this is fairly typical, with the differenceīetween Gauss and Gauss-Kronrod schemes being much higher than the actual error.īefore moving on to adaptive quadrature, lets try again with more points, inįact with the largest Gauss-Kronrod scheme we have cached (30/61): This yields Q = 1.25348207361, which has an absolute error of 1e-4 compared We'll start off with a one shot (ie non-adaptive) integration, and keep trackĭouble error double Q = gauss_kronrod :: integrate ( f1, 0, std :: numeric_limits :: infinity (), 0, 0, & error ) Singularities, please refer to the double-exponential For difficult functions, or those with end point Quadrature, they should be chosen for the integration of smooth functions with The integration routines provided here will perform either adaptive or non-adaptive Of order n, he could integrate polynomials of order 3n+1. Kronrod discovered that by adding n+1 nodes (computedįrom the zeros of the Legendre-Stieltjes polynomials) to a Gaussian quadrature This allows an a posterioriĮrror estimate to be provided while still preserving exponential convergence. The order of polynomials that can be integrated exactly. In such a way that all previous function evaluations can be reused, while increasing
#Abscissa quadrature point how to#
Kronrod considered the problem of how to interleave nodes into a Gaussian quadrature Orders, so 3n+1 function evaluations must be performed. Polynomials (nodes of the Gaussian quadrature) are never the same for different However, this is not optimal, as the zeros of the Legendre It is possible to compute a Gaussian quadrature of order nĪnd another of order (say) 2n+1, and use the differenceĪs an error estimate. Some form of interval splitting) cannot answer this question. Problem becomes how to estimate the remainder. Instead, transcendental and numericallyĭefined functions are integrated via Gaussian quadrature, and the defining However, integration of polynomials is trivial, so The idea behind Gaussian quadrature is to choose n nodesĪnd weights in such a way that polynomials of order 2n-1Īre integrated exactly. Which yields 0.2106572512258069881080923020669, which is accurate to 5e-28.Gauss-Kronrod quadrature is an extension of Gaussian quadrature which providesĪn a posteriori error estimate for the integral. #include namespace boost cpp_bin_float_quad Q2 = gauss :: integrate ( f2, 0, 1 )
