      FUNCTION GAMMLN1(XX)
C
C     * THIS FUNCTION IS TAKEN FROM NUMERICAL RECIPES.
C     * DOUBLE PRESISION IS REPLACED WITH SINGLE PRESISION.
C     * THE ORIGINAL NAME "GAMMLN" IS CHANGED TO "GAMMLN1".
C
C     JUN 28/96 - SLAVA KHARIN
C
C  (C) COPR. 1986-92 NUMERICAL RECIPES SOFTWARE #=!E=#,)]UBCJ.
C--------------------------------------------------------------------
C
      IMPLICIT REAL (A-H,O-Z),
     +INTEGER (I-N)
      REAL GAMMLN1,XX
      INTEGER J
      REAL SER,STP,TMP,X,Y,COF(6)
      SAVE COF,STP
      DATA COF,STP/ 76.18009172947146E0,-86.50532032941677E0,
     1              24.01409824083091E0,-1.231739572450155E0,
     2             0.1208650973866179E-2, -0.5395239384953E-5,
     3                                  2.5066282746310005E0/
C--------------------------------------------------------------------
      X=XX
      Y=X
      TMP=X+5.5E0
      TMP=(X+0.5E0)*LOG(TMP)-TMP
      SER=1.000000000190015E0
      DO 10 J=1,6
        Y=Y+1.E0
        SER=SER+COF(J)/Y
  10  CONTINUE
      GAMMLN1=TMP+LOG(STP*SER/X)
      RETURN
      END
