! Program Example from "Essential Fortran 90 & 95" by Loren P. Meissner
! Copyright 1996. Copying for sale requires permission from the author.
! Otherwise, distribution is permitted if these three lines are included.

  module I07M2
    implicit none
    public :: Poly_4, Distribution
  contains
  !  Fourth-degree polynomial test for Quadrature.
    function Poly_4( Z ) result ( A )
      real, intent (in) :: Z
      real :: A
  !  start function Poly_4
      A = 17.3 + Z * (23.4 + Z * (137.0 + Z * (64.2 - Z)))
      return
    end function Poly_4
  !  Gaussian distribution test for Quadrature.
    function Distribution( Z ) result ( B )
      real, intent (in) :: Z
      real :: B
  !  start function Distribution
     B = exp( -Z ** 2 )
     return
    end function Distribution
  end module I07M2

