Julia port of Gander & Gautschi (2000) quadrature routines
Author tbeason
0 Stars
Updated Last
3 Years Ago
Started In
May 2020


Lifecycle Build Status codecov.io

QuadGG.jl provides a pure Julia implementation of the MATLAB quadrature routines from Gander & Gautschi (2000) "Adaptive Quadrature -- Revisited".

The first is an adaptive Gauss-Lobatto method, while the second is an adaptive Simpson's rule. The Gauss-Lobatto routine seems to be the preferred method of the two.


There are two exported functions: adaptlob for the adaptive Gauss-Lobatto routine and adaptsim for the adaptive Simpson's rule.

using QuadGG

adaptlob(x->x^2,0,1) #  == 1/3
adaptlob(sqrt,0,1;tol=1e-16) #  == 2/3

adaptsim(x->x^2,0,1) #  == 1/3
adaptsim(sqrt,0,1;tol=1e-16) #  == 2/3

Alternative Packages

I wrote this package (ported the code is more like it) so that I could take advantage of a particular feature of the problem I was solving. QuadGK.jl and HCubature.jl offer additional features compared to this library and are likely better choices for general numerical integration problems.

The biggest conceptual difference from QuadGK.jl is that the Gauss-Lobatto scheme does evaluate the integral at the interval endpoints and they use different adaptive sampling techniques. The QuadGK.jl methods are very lean, therefore if your integrand is really smooth they can integrate pretty much instantly. This package would use many more function evaluations in those cases. For more difficult integrals, the speed differences between the package are not so great (and sometimes this package is faster).