quadgr.RdGaussian 12-point quadrature with Richardson extrapolation.
quadgr(f, a, b, tol = .Machine$double.eps^(1/2), ...)quadgr uses a 12-point Gauss-Legendre quadrature.
The error estimate is based on successive interval bisection. Richardson
extrapolation accelerates the convergence for some integrals, especially
integrals with endpoint singularities.
Through some preprocessing infinite intervals can also be handled.
List with value and rel.err.
gaussLegendre
## Dilogarithm function
flog <- function(t) log(1-t)/t
quadgr(flog, 1, 0, tol = 1e-12)
#> $value
#> [1] 1.644934
#>
#> $rel.err
#> [1] 1.982858e-13
#>
# value
# 1.6449340668482 , is pi^2/6 = 1.64493406684823
# rel.err
# 2.07167616395054e-13