      REAL FUNCTION RCOMP(A,X)
C     -------------------
C     EVALUATION OF EXP(-X)*X**A/GAMMA(A)
C     -------------------
C     RT2PIN = 1/SQRT(2*PI)
C     -------------------
      DATA RT2PIN/.398942280401433/
C     -------------------
      RCOMP = 0.0
      IF (A .GE. 30.0) GO TO 10
      T = A*ALOG(X) - X
      RCOMP = EXP(T)/GAMMA(A)
      RETURN
C
   10 U = X/A
      IF (U .EQ. 0.0) RETURN
      T = 1.0/(A*A)
      T1 = (((0.75*T - 1.0)*T + 3.5)*T - 105.0)/(A*1260.0)
      T1 = T1 - A*RLOG(U)
      RCOMP = RT2PIN*SQRT(A)*EXP(T1)
      RETURN
      END
