      PROGRAM MAIN
      IMPLICIT NONE

      DOUBLE PRECISION PI,E,Y,X
      DOUBLE PRECISION FACT,XFACT
      DOUBLE PRECISION EXPO,EXPN
      INTEGER N,I

      E=EXP(1.D0)

      PI=2.D0*ACOS(0.D0)
      WRITE(6,*) '           PI = ',PI

      DO N=1,5000,100
       Y=E/DBLE(N)

       DO I=1,N-1
        Y=Y*DBLE(I)/DBLE(N)*E
       END DO

       Y=DBLE(N)*.5D0*Y*Y

       WRITE(6,*) ' Stirling: PI = ',Y/PI,' pour N = ',N
       WRITE(6,*) 

      END DO

      END

