|
|
◆ 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] | f | The user supplied subroutine which calculates the integrand function f(x) defined as follows. double f(double x)
{
return computed f(x) value
}
|
| [in] | a | Lower limit of integration. |
| [in] | b | Upper limit of integration. |
| [in] | epsabs | Absolute accuracy requested. The requested accuracy is assumed to be satisfied if abserr <= max(epsabs, epsrel*|result|)). |
| [in] | epsrel | Relative 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] | result | Approximation to I = integral of f over [a, b]. |
| [out] | abserr | Estimate of the modulus of the absolute error, which should equal or exceed the true error. |
| [out] | neval | Number 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)
|