      SUBROUTINE FRNL(T,C,S)
C     ******************************************************************
C     EVALUATION OF THE REAL FRESNEL INTEGRALS
C     ******************************************************************
      REAL N
      REAL A(6),B(6),CP(13),SP(13)
      REAL PN(6),PD(6),QN(6),QD(6)
      REAL AN(6),AD(6),BN(6),BD(6)
      REAL CN(5),CD(5),DN(5),DD(5)
      REAL FP(7),GP(7),P(6),Q(6)
C     ---------------------
      DATA PI/3.1415926535898/
C     ---------------------
      DATA A(1)/-.119278241233760E-05/,  A(2)/.540730666359417E-04/,
     1     A(3)/-.160488306381990E-02/,  A(4)/.281855008757077E-01/,
     2     A(5)/-.246740110027210E+00/,  A(6)/.100000000000000E+01/
      DATA B(1)/-.155653074871090E-06/,  B(2)/.844415353045065E-05/,
     1     B(3)/-.312116934326082E-03/,  B(4)/.724478420395276E-02/,
     2     B(5)/-.922805853580325E-01/,  B(6)/.523598775598300E+00/
C     ---------------------
      DATA CP(1) /.114739945188034E-20/,  CP(2) /-.384444827287950E-18/,
     1     CP(3) /.832125729394275E-16/,  CP(4) /-.142979507360076E-13/,
     2     CP(5) /.198954961821465E-11/,  CP(6) /-.220226545457144E-09/,
     3     CP(7) /.188434924092257E-07/,  CP(8) /-.120009722914157E-05/,
     4     CP(9) /.540741337442140E-04/,  CP(10)/-.160488313553028E-02/,
     5     CP(11)/.281855008777956E-01/,  CP(12)/-.246740110027196E+00/,
     6     CP(13)/.999999999999996E+00/
      DATA SP(1) /.705700784853927E-22/,  SP(2) /-.252757991492418E-19/,
     1     SP(3) /.594117488940008E-17/,  SP(4) /-.112161631555448E-14/,
     2     SP(5) /.173332189994074E-12/,  SP(6) /-.215742302078015E-10/,
     3     SP(7) /.210821173208116E-08/,  SP(8) /-.156471443116560E-06/,
     4     SP(9) /.844427287845253E-05/,  SP(10)/-.312116942346186E-03/,
     5     SP(11)/.724478420418951E-02/,  SP(12)/-.922805853580323E-01/,
     6     SP(13)/.523598775598300E+00/
C     ---------------------
      DATA PN(1)/.318309816100920D+00/,  PN(2)/.134919391391516E+02/,
     1     PN(3)/.158258097490377E+03/,  PN(4)/.598796451682535E+03/,
     2     PN(5)/.632369782194966E+03/,  PN(6)/.967985390141920E+02/
      DATA PD(1)/.100000000000000E+01/,  PD(2)/.426900960480796E+02/,
     1     PD(3)/.509085485682426E+03/,  PD(4)/.200034664144742E+04/,
     2     PD(5)/.231910140792937E+04/,  PD(6)/.486678558201084E+03/
      DATA QN(1)/.101320876178478E+00/,  QN(2)/.490534697099052E+01/,
     1     QN(3)/.652095157811808E+02/,  QN(4)/.274183825747887E+03/,
     2     QN(5)/.305040725009211E+03/,  QN(6)/.364566615872326E+02/
      DATA QD(1)/.100000000000000E+01/,  QD(2)/.499330024470621E+02/,
     1     QD(3)/.709854097670206E+03/,  QD(4)/.343470762861172E+04/,
     2     QD(5)/.522213879312684E+04/,  QD(6)/.168801831831851E+04/
C     ---------------------
      DATA AN(1)/.318309885869756E+00/,  AN(2)/.254179177393500E+02/,
     1     AN(3)/.575003792540838E+03/,  AN(4)/.426673405867140E+04/,
     2     AN(5)/.891831887923938E+04/,  AN(6)/.267955736537967E+04/
      DATA AD(1)/.100000000000000E+01/,  AD(2)/.801567066285184E+02/,
     1     AD(3)/.182971463354850E+04/,  AD(4)/.138848884373420E+05/,
     2     AD(5)/.309228411873207E+05/,  AD(6)/.120421274105856E+05/
      DATA BN(1)/.101321181932417E+00/,  BN(2)/.925021984290547E+01/,
     1     BN(3)/.240932023056602E+03/,  BN(4)/.206079616836437E+04/,
     2     BN(5)/.484901973010149E+04/,  BN(6)/.130680669688315E+04/
      DATA BD(1)/.100000000000000E+01/,  BD(2)/.928158182389149E+02/,
     1     BD(3)/.250926840439955E+04/,  BD(4)/.233924458152954E+05/,
     2     BD(5)/.685638896406835E+05/,  BD(6)/.418593101455019E+05/
C     ---------------------
      DATA CN(1)/.318309886182000E+00/,  CN(2)/.299191968327887E+02/,
     1     CN(3)/.691428839605668E+03/,  CN(4)/.394539800974744E+04/,
     2     CN(5)/.290314254767015E+04/
      DATA CD(1)/.100000000000000E+01/,  CD(2)/.942978925136851E+02/,
     1     CD(3)/.219977296283666E+04/,  CD(4)/.129726479671006E+05/,
     2     CD(5)/.114991427758165E+05/
      DATA DN(1)/.101321183630876E+00/,  DN(2)/.110988033615242E+02/,
     1     DN(3)/.306282306497228E+03/,  DN(4)/.213130259794164E+04/,
     2     DN(5)/.171270676541694E+04/
      DATA DD(1)/.100000000000000E+01/,  DD(2)/.111060616085627E+03/,
     1     DD(3)/.318197586347414E+04/,  DD(4)/.249342095714049E+05/,
     2     DD(5)/.359241903823488E+05/
C     ---------------------
      DATA FP(1)/.449763389301234E+05/,  FP(2)/-.188763642051836E+04/,
     1     FP(3)/.669261097103246E+02/,  FP(4)/-.343966606879114E+01/,
     2     FP(5)/.343112896133346E+00/,  FP(6)/-.967546019461500E-01/,
     3     FP(7)/.318309886183465E+00/
      DATA GP(1)/.316642183365360E+06/,  GP(2)/-.120618995106638E+05/,
     1     GP(3)/.359164749179351E+03/,  GP(4)/-.142252603258172E+02/,
     2     GP(5)/.982934118445454E+00/,  GP(6)/-.153989722912325E+00/,
     3     GP(7)/.101321183639714E+00/
C     ---------------------
      DATA P(1)/-654729075.0/,  P(2)/2027025.0/,  P(3)/-10395.0/,
     1     P(4)/105.0/,  P(5)/-3.0/,  P(6)/1.0/
      DATA Q(1)/-13749310575.0/,  Q(2)/34459425.0/,  Q(3)/-135135.0/,
     1     Q(4)/945.0/,  Q(5)/-15.0/,  Q(6)/1.0/
C     ---------------------
C     ****** AMAX IS A MACHINE DEPENDENT CONSTANT USED IN STATEMENT 60.
C            IT IS ASSUMED THAT THE LARGEST INTEGER LESS THAN AMAX CAN
C            BE REPRESENTED EXACTLY AS AN INTEGER (STATEMENT 70), AND
C            THAT 1 + 2/(PI*X) = 1 FOR X .GE. AMAX (STATEMENTS 100-102).
C
      AMAX=1.0/SPMPAR(1)
C     ------------------------------------------------------------------
C             EVALUATION OF C(X) AND S(X) FOR X .LT. 1.65
C                          WHERE X = ABS(T)
C     ------------------------------------------------------------------
      X=ABS(T)
      IF (X.GT.0.6) GO TO 10
      XX=X*X
      Y=XX*XX
      C=A(1)
      S=B(1)
      DO 5 I=2,6
      C=A(I)+C*Y
    5 S=B(I)+S*Y
      C=T*C
      S=T*XX*S
      RETURN
C
   10 IF (X.GE.1.65) GO TO 20
      XX=X*X
      Y=XX*XX
      C=CP(1)
      S=SP(1)
      DO 11 I=2,13
      C=CP(I)+C*Y
   11 S=SP(I)+S*Y
      C=T*C
      S=T*XX*S
      RETURN
C     ------------------------------------------------------------------
C          EVALUATION OF THE AUXILIARY FUNCTIONS F(X) AND G(X)
C                        FOR X .GE. 1.65
C     ------------------------------------------------------------------
   20 IF (X.GE.2.0) GO TO 30
      XX=X*X
      Y=XX*XX
      FN=PN(1)
      FD=PD(1)
      GN=QN(1)
      GD=QD(1)
      DO 21 I=2,6
      FN=PN(I)+FN*Y
      FD=PD(I)+FD*Y
      GN=QN(I)+GN*Y
   21 GD=QD(I)+GD*Y
      F=FN/(X*FD)
      G=GN/(X*XX*GD)
      Y=0.5*XX
      GO TO 75
C
   30 IF (X.GE.3.0) GO TO 40
      XX=X*X
      Y=XX*XX
      FN=AN(1)
      FD=AD(1)
      GN=BN(1)
      GD=BD(1)
      DO 31 I=2,6
      FN=AN(I)+FN*Y
      FD=AD(I)+FD*Y
      GN=BN(I)+GN*Y
   31 GD=BD(I)+GD*Y
      F=FN/(X*FD)
      G=GN/(X*XX*GD)
      GO TO 70
C
   40 IF (X.GT.4.0) GO TO 50
      XX=X*X
      Y=XX*XX
      FN=CN(1)
      FD=CD(1)
      GN=DN(1)
      GD=DD(1)
      DO 41 I=2,5
      FN=CN(I)+FN*Y
      FD=CD(I)+FD*Y
      GN=DN(I)+GN*Y
   41 GD=DD(I)+GD*Y
      F=FN/(X*FD)
      G=GN/(X*XX*GD)
      GO TO 70
C
   50 IF (X.GE.6.0) GO TO 60
      XX=X*X
      Y=1.0/(XX*XX)
      F=FP(1)
      G=GP(1)
      DO 51 I=2,7
      F=FP(I)+F*Y
   51 G=GP(I)+G*Y
      F=F/X
      G=G/(X*XX)
      GO TO 70
C
   60 IF (X.GE.AMAX) GO TO 100
      PIX=PI*X
      PIXX=PIX*X
      Y=1.0/PIXX
      Y=Y*Y
      F=P(1)
      G=Q(1)
      DO 61 I=2,6
      F=P(I)+F*Y
   61 G=Q(I)+G*Y
      F=F/PIX
      G=G/(PIX*PIXX)
C     ------------------------------------------------------------------
C           EVALUATION OF SIN(0.5*PI*X*X) AND COS(0.5*PI*X*X)
C                 THE RESULTS ARE STORED IN SY AND CY
C     ------------------------------------------------------------------
   70 M=X
      L=MOD(M,2)
      N=M-L
      R=X-N
      Y=R
      IF (R.GE.1.0) Y=R-1.0
      Y=Y*N
      M=Y
      L=MOD(M,2)
      N=M-L
      Y=Y-N
      Y=Y+0.5*R*R
      IF (Y.GE.2.0) Y=Y-2.0
C
   75 THETA=Y
      IF (Y.GE.1.0) THETA=Y-1.0
      IF (THETA.GT.0.9) THETA=1.0-THETA
      SY=SIN(PI*THETA)
      IF (Y.GT.1.0) SY=-SY
C
      IF (Y.GT.0.25) GO TO 80
      CY=COS(PI*Y)
      GO TO 90
   80 IF (Y.GT.0.5) GO TO 81
      CY=SIN(PI*(0.5-Y))
      GO TO 90
   81 IF (Y.LT.1.5) GO TO 82
      CY=SIN(PI*(Y-1.5))
      GO TO 90
   82 THETA=Y-0.5
      IF (THETA.GT.0.9) THETA=1.0-THETA
      CY=-SIN(PI*THETA)
C     ------------------------------------------------------------------
   90 C= F*SY-G*CY
      S=-F*CY-G*SY
      C=0.5+C
      S=0.5+S
      IF (T.GE.0.0) RETURN
      C=-C
      S=-S
      RETURN
C
  100 IF (T.LT.0.0) GO TO 101
      C=0.5
      S=0.5
      RETURN
  101 C=-0.5
      S=-0.5
  102 RETURN
      END
