XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ qng()

void qng ( double(*)(double)  f,
double  a,
double  b,
double  epsabs,
double  epsrel,
double *  result,
double *  abserr,
int *  neval,
int *  info 
)

Finite interval automatic quadrature (21/43/87 point Gauss-Kronrod rule)

Purpose
This routine computes I = integral of f over [a, b], satisfying the requested accuracy, where f is a given function defined by a user supplied subroutine.
The appropriate one is automatically selected from 21, 43 or 87 point Gauss-Kronrod rules to satisfy the requested accuracy.
Parameters
[in]fThe user supplied subroutine which calculates the integrand function f(x) defined as follows.
double f(double x)
{
return computed f(x) value
}
[in]aLower limit of integration.
[in]bUpper limit of integration.
[in]epsabsAbsolute accuracy requested. The requested accuracy is assumed to be satisfied if abserr <= max(epsabs, epsrel*|result|)).
[in]epsrelRelative accuracy requested.
The requested accuracy is assumed to be satisfied if abserr <= max(epsabs, epsrel*|result|)).
If epsabs <= 0 and epsrel < 50*eps, epsrel is assumed to be 50*eps, where eps is the machine precision.
[out]resultApproximation to I = integral of f over [a, b].
[out]abserrEstimate of the modulus of the absolute error, which should equal or exceed the true error.
[out]nevalNumber of integrand evaluations.
[out]info= 0: Successful exit
= 1: The maximum number of steps has been executed. The integral is probably too difficult to be computed by qng.
Reference
SLATEC (QUADPACK)