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

◆ qaws_r()

void qaws_r ( double  a,
double  b,
double  alfa,
double  beta,
int  integr,
double  epsabs,
double  epsrel,
int  limit,
double *  result,
double *  abserr,
int *  neval,
int *  last,
double  work[],
int  lwork,
int  iwork[],
int *  info,
double *  xx,
double  yy,
int *  irev 
)

Finite interval adaptive quadrature for singular functions (25-point Clenshaw-Curtis and 15-point Gauss-Kronrod rule) (reverse communication version)

Purpose
The routine calculates an approximation result to a definite integral I = integral of f(x)*w(x) over [a, b] satisfying the requested accuracy, where the weight function w(x) has algebraic-logarithmic singularities at the end points of an integration region. See parameter integr.
Result is obtained by the adaptive integration applying a 25-point modified Clenshaw-Curtis rule and a 15-point Gauss-Kronrod rule to satisfy the requested accuracy.
Parameters
[in]aLower limit of integration.
[in]bUpper limit of integration.
[in]alfaParameter alpha in the weight function. (alfa > -1)
[in]betaParameter beta in the weight function. (beta > -1)
[in]integrIndicates which weight function is to be used.
= 1: w(x) = (x - a)^alpha * (b - x)^beta
= 2: w(x) = (x - a)^alpha * (b - x)^beta * ln(x - a)
= 3: w(x) = (x - a)^alpha * (b - x)^beta * ln(b - x)
= 4: w(x) = (x - a)^alpha * (b - x)^beta * ln(x - a) * ln(b - x)
[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.
[in]limitMaximum number of subintervals in the partition of the given integration interval [a, b]. (limit >= 2)
[out]resultApproximation to I = integral of f*w 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]lastNumber of subintervals produced in the subdivision process.
[out]work[]Array work[lwork]
Work array.
work[0], ..., work[last-1]: Left end points of the subintervals in the partition of [a, b].
work[limit], ..., work[limit+last-1]: Right end poits of the subintervals.
work[2*limit], ..., work[2*limit+last-1]: The integral approximations over the subintervals.
work[3*limit], ..., work[3*limit+last-1]: The error estimates over the subintervals.
[in]lworkThe length of work[]. (lwork >= 4*limit)
[out]iwork[]Array iwork[liwork] (liwork >= limit)
Work array.
The first k elements contain pointers to the error estimates over the subintervals, such that work[3*limit+iwork[0]-1], ..., work[3*limit+iwork[k-1]-1] form a decreasing sequence with k = last if last <= limit/2+2, and k = limit+1-last otherwise.
[out]info= 0: Successful exit
= -1: The argument a (or b) had an illegal value (a >= b)
= -3: The argument alfa had an illegal value (alfa <= -1)
= -4: The argument beta had an illegal value (beta <= -1)
= -5: The argument integr had an illegal value (integr < 1 or integr > 4)
= -8: The argument limit had an illegal value (limit < 2)
= -14: The argument lwork had an illegal value (lwork < 4*limit)
= 1: Maximum number of subdivisions allowed has been reached
= 2: Requested tolerance cannot be achieved due to roundoff error
= 3: Bad integrand behavior found in the integration interval
[out]xxirev = 1 to 60: xx contains the abscissa where the function value should be evaluated and given in the next call.
[in]yyirev = 1 to 60: The function value f(xx) should be given in yy in the next call.
[in,out]irevControl variable for reverse communication.
[in] Before first call, irev should be initialized to zero. On succeeding calls, irev should not be altered.
[out] If irev is not zero, complete the following tasks and call this routine again without changing irev.
= 0: Computation finished.
= 1 to 60: User should set the function value at xx in yy. Do not alter any variables other than yy.
Reference
SLATEC (QUADPACK)