+--------------------------------------------------------------------+
 |                                                                    |
 |                               GAMLN                                |
 |                                                                    |
 +--------------------------------------------------------------------+

 MEANING: GAMLN function
 CONTEXT: NONMEM utility routine

 USAGE:
      USE SIZES, ONLY: DPSIZE
      REAL(KIND=DPSIZE) :: GAMLN,X
      REAL(KIND=DPSIZE) :: LN_OF_GAMMA
       .  . .
      LN_OF_GAMMA= GAMLN(X)

 DISCUSSION:
 Gives  the  natural logarithm of the gamma function.  It is more accu-
 rate than the Stirling's approximation.

 May be used in abbreviated code.  May be used in  the  computation  of
 the objective function because it is continuous.  The first derivative
 (GAMLND1) and second derivative (GAMLND2) are also evaluated, and  are
 continuous for X>0.0.

 Input argument:

  X

 EXAMPLE OF USAGE:

      FAC=EXP(GAMLN(X+1.))

      If X takes only integer values, then

      FAC=X!=X*(X-1)*(X-2)... *1

      The  GAMMA function in effect "fills in" the values of the facto-
      rial (but with a shift of 1 in the argument) for non-integer val-
      ues of x.

 If  the  argument  is a random variable, it should always be positive. |
 Eta partial derivatives are computed.

 REFERENCES: None.


  
Go to main index.
  
Created by nmhelp2html v. 1.0 written by Niclas Jonsson (Modified by AJB 5/2006,11/2007,10/2012)