qawse Subroutine

public subroutine qawse(f, a, b, alfa, beta, integr, epsabs, epsrel, limit, result, abserr, neval, ier, alist, blist, rlist, elist, iord, last)

QAWSE estimates integrals with algebraico-logarithmic endpoint singularities.

Discussion:

This routine calculates an approximation RESULT to an integral I = integral of F(X) * W(X) over (a,b), where W(X) shows a singular behavior at the endpoints, hopefully satisfying: | I - RESULT | <= max ( epsabs, epsrel * |I| ).

Author:

Robert Piessens, Elise de Doncker-Kapenger, Christian Ueberhuber, David Kahaner

Reference:

Robert Piessens, Elise de Doncker-Kapenger, Christian Ueberhuber, David Kahaner, QUADPACK, a Subroutine Package for Automatic Integration, Springer Verlag, 1983

Parameters:

Input, external real F, the name of the function routine, of the form function f ( x ) real f real x which evaluates the integrand function.

Input, real A, B, the limits of integration.

Input, real ALFA, BETA, parameters used in the weight function. ALFA and BETA should be greater than -1.

Input, integer INTEGR, indicates which weight function is used: = 1 (x-a)alfa*(b-x)beta = 2 (x-a)alfa*(b-x)betalog(x-a) = 3 (x-a)alfa(b-x)beta*log(b-x) = 4 (x-a)alfa(b-x)betalog(x-a)*log(b-x)

Input, real EPSABS, EPSREL, the absolute and relative accuracy requested.

Input, integer LIMIT, an upper bound on the number of subintervals in the partition of (A,B), LIMIT >= 2. If LIMIT < 2, the routine will end with IER = 6.

Output, real RESULT, the estimated value of the integral.

Output, real ABSERR, an estimate of || I - RESULT ||.

Output, integer NEVAL, the number of times the integral was evaluated.

       ier    - integer
                ier = 0 normal and reliable termination of the
                        routine. it is assumed that the requested
                        accuracy has been achieved.
                ier > 0 abnormal termination of the routine
                        the estimates for the integral and error
                        are less reliable. it is assumed that the
                        requested accuracy has not been achieved.
                    = 1 maximum number of subdivisions allowed
                        has been achieved. one can allow more
                        subdivisions by increasing the value of
                        limit. however, if this yields no
                        improvement it is advised to analyze the
                        integrand, in order to determine the
                        integration difficulties which prevent
                        the requested tolerance from being
                        achieved. in case of a jump discontinuity
                        or a local singularity of algebraico-
                        logarithmic type at one or more interior
                        points of the integration range, one
                        should proceed by splitting up the
                        interval at these points and calling the
                        integrator on the subranges.
                    = 2 the occurrence of roundoff error is
                        detected, which prevents the requested
                        tolerance from being achieved.
                    = 3 extremely bad integrand behavior occurs
                        at some points of the integration
                        interval.
                    = 6 the input is invalid, because
                        b <= a or alfa <= (-1) or beta <= (-1) or
                        integr < 1 or integr > 4, or
                        epsabs < 0 and epsrel < 0,
                        or limit < 2.
                        result, abserr, neval, rlist(1), elist(1),
                        iord(1) and last are set to zero.
                        alist(1) and blist(1) are set to a and b
                        respectively.

Workspace, real ALIST(LIMIT), BLIST(LIMIT), contains in entries 1 through LAST the left and right ends of the partition subintervals.

Workspace, real RLIST(LIMIT), contains in entries 1 through LAST the integral approximations on the subintervals.

Workspace, real ELIST(LIMIT), contains in entries 1 through LAST the absolute error estimates on the subintervals.

       iord   - integer
                vector of dimension at least limit, the first k
                elements of which are pointers to the error
                estimates over the subintervals, so that
                elist(iord(1)), ..., elist(iord(k)) with k = last
                if last <= (limit/2+2), and k = limit+1-last
                otherwise, form a decreasing sequence.

Output, integer LAST, the number of subintervals actually produced in the subdivision process.

Local parameters:

      alist     - list of left end points of all subintervals
                  considered up to now
      blist     - list of right end points of all subintervals
                  considered up to now
      rlist(i)  - approximation to the integral over
                  (alist(i),blist(i))
      elist(i)  - error estimate applying to rlist(i)
      maxerr    - pointer to the interval with largest error
                  estimate
      errmax    - elist(maxerr)
      area      - sum of the integrals over the subintervals
      errsum    - sum of the errors over the subintervals
      errbnd    - requested accuracy max(epsabs,epsrel*
                  abs(result))
      *****1    - variable for the left subinterval
      *****2    - variable for the right subinterval
      last      - index for subdivision

Arguments

Type IntentOptional Attributes Name
procedure(scalar_func) :: f
real :: a
real :: b
real :: alfa
real :: beta
integer :: integr
real :: epsabs
real :: epsrel
integer :: limit
real :: result
real :: abserr
integer :: neval
integer :: ier
real :: alist(limit)
real :: blist(limit)
real :: rlist(limit)
real :: elist(limit)
integer :: iord(limit)
integer :: last

Contents