These functions approximate the integral of a real valued function over a
semi-infinite interval, using the Gauss-Laguerre Quadrature method of
specified order.
| a, b, Result | Subroutine | 
| Short-precision real | SGLGQ | 
| Long-precision real | DGLGQ | 
| Fortran | SGLGQ | DGLGQ (subf, a, b, n) | 
| C and C++ | sglgq | dglgq (subf, a, b, n); | 
| PL/I | SGLGQ | DGLGQ (subf, a, b, n); | 
Specified as: subf must be declared as an external subroutine in your application program. It can be whatever name you choose.
If b > 0, it is the lower limit of integration.
If b < 0, it is the upper limit of integration.
Specified as: a number of the data type indicated in Table 164.
The integral is approximated for a real valued function over a semi-infinite interval, using the Gauss-Laguerre Quadrature method of specified order. The region of integration is:
The method of order n is theoretically exact for integrals of the following form, where f is a polynomial of degree less than 2n:

The method of order n is a good approximation when your integrand is closely approximated by a function of the form f(x)e-bx, where f is a polynomial of degree less than 2n. See references [26] and [92]. The result is returned as the function value.
None
This example shows how to compute the integral of the function f given by:
over the interval (-2.0, infinity), using the Gauss-Laguerre method with 20 points:

The user-supplied subroutine FUN1, which evaluates the integrand function, is coded in Fortran as follows:
SUBROUTINE FUN1 (T,Y,N) INTEGER*4 N REAL*4 T(*),Y(*) DO 1 I=1,N 1 Y(I)=SIN(3.0*T(I))*EXP(-1.5*T(I)) RETURN END
EXTERNAL FUN1
        .
        .
        .
              SUBF     A     B    N
               |       |     |    |
XINT = SGLGQ( FUN1 , -2.0 , 1.5 , 20 )
        .
        .
        .
XINT = 5.891
This example shows how to compute the integral of the function f given by:
over the interval (-infinity, -2.0), using the Gauss-Laguerre method with 20 points:

The user-supplied subroutine FUN2, which evaluates the integrand function, is coded in Fortran as follows:
SUBROUTINE FUN2 (T,Y,N) INTEGER*4 N REAL*4 T(*),Y(*),TEMP DO 1 I=1,N 1 Y(I)=SIN(3.0*T(I))*EXP(1.5*T(I)) RETURN END
EXTERNAL FUN2
        .
        .
        .
              SUBF     A      B    N
               |       |      |    |
XINT = SGLGQ( FUN2 , -2.0 , -1.5 , 20 )
        .
        .
        .
FUN2     =  (see above)
XINT = -0.011