legendre - fabiankindermann/ce-fortran GitHub Wiki

subroutine legendre(x1, x2, x, w)

Description:

This subroutine calculates the nodes and weights for a Gauss-Legendre approximation of an integral

Input arguments:

  • real*8 :: x_1
    The left interval endpoint of the integration interval .
  • real*8 :: x_2
    The right interval endpoint of the integration interval .

Output arguments:

  • real*8 :: x(:)
    A one-dimensional array into which the subroutine stores the nodes for the Gauss-Legendre approximation.
  • real*8 :: w(:)
    A one-dimensional array into which the subroutine stores the weights for the Gauss-Legendre approximation. Note that w(:) needs to have exactly the same size as x(:).

References

  • Parts of this routine were copied and adapted from:
    • Press, W.H., Teukolsky, S.A., Vetterling, W.T. & Flannery, B.P. (1992). Numerical Recipes in Fortran 90: The Art of Parallel Scientific Computing, 2nd edition. Cambridge: Cambridge Univeristy Press.
  • For further reading refer to:
    • Stoer, J. & Bulirsch, R. (2002). Introduction to Numerical Analysis. New York: Springer Text in Applied Mathematics.
  • This routine is used in the following programs:
    • prog02_13.f90
⚠️ **GitHub.com Fallback** ⚠️