      SUBROUTINE CBSSLJ (A, R, W)
C     ******************************************************************
C     FORTRAN SUBROUTINE FOR ORDINARY BESSEL FUNCTION OF FIRST KIND
C     ******************************************************************
C     A = ARGUMENT (COMPLEX NUMBER)
C     R = ORDER (COMPLEX NUMBER)
C     W = BESSEL FUNCTION VALUE (COMPLEX NUMBER)
C
      REAL NS
      COMPLEX A, R, W, Z
      DIMENSION AZ(2), CN(2), FJ(2)
      DIMENSION ZR(2), QZ(2), RZ(2), SZ(2), ZL(2), ZN(2), AN(2), GN(2)
      DIMENSION TS(2), TM(2), RM(4), SM(4), RE(4), RN(2), QT(2), QF(2)
      DIMENSION SK(2), QU(2), CU(16)
C
      AZ(1)=REAL(A)
      AZ(2)=AIMAG(A)
      CN(1)=REAL(R)
      CN(2)=AIMAG(R)
      ZS=AZ(1)*AZ(1)+AZ(2)*AZ(2)
      ZM=SQRT(ZS)
      NS=CN(1)*CN(1)+CN(2)*CN(2)
      PN=AINT(CN(1))
      FN=CN(1)-PN
      SN=+1.0
      IF(FN.NE.0.0.OR.CN(2).NE.0.0)GO TO 002
      N=PN
      PN=ABS(PN)
      IF(N.GE.0.OR.N.EQ.N/2*2)GO TO 002
      SN=-1.0
  002 IF(ZM.GT.17.5+0.5*NS)GO TO 006
      IF(ZM.LE.17.5)GO TO 003
      QN=PN
      GO TO 018
  003 IF(PN+FN)004,005,005
  004 PM=CN(2)
      QM=AZ(2)-0.5*CN(2)
      QN=-1.25*(ZM+0.5*ABS(PM)-ABS(QM))
      IF(PN+FN.GE.QN)GO TO 005
      QM=AZ(2)-CN(2)
      QN=+1.25*ZM-0.625*ABS(1.2*ZM-QM)-0.625*ABS(1.2*ZM+QM)
      IF(PN+FN.GE.QN)GO TO 005
      QN=-AINT(1.25*(ZM-ABS(PM)))
      IF(PN.GE.QN)GO TO 031
      QN=PN
      GO TO 031
  005 QM=0.0625*ZS*ZS-CN(2)*CN(2)
      QN=+AINT(SQRT(0.5*(QM+ABS(QM))))
      IF(PN.LT.QN)GO TO 031
      QN=PN
      GO TO 031
  006 IF(AZ(1))007,012,012
  007 QZ(1)=-AZ(1)
      QZ(2)=-AZ(2)
  008 IF(AZ(2))009,010,010
  009 AN(1)=+3.14159265358979*CN(2)
      AN(2)=-3.14159265358979*(PN+FN)
      GO TO 011
  010 AN(1)=-3.14159265358979*CN(2)
      AN(2)=+3.14159265358979*(PN+FN)
  011 QM=SN*0.797884560802865*EXP(AN(1))
      TM(1)=QM*COS(AN(2))
      TM(2)=QM*SIN(AN(2))
      GO TO 013
  012 QZ(1)=+AZ(1)
      QZ(2)=+AZ(2)
      TM(1)=SN*0.797884560802865
      TM(2)=0.0
  013 ZR(1)=SQRT(QZ(1)+ZM)
      ZR(2)=QZ(2)/ZR(1)
      ZR(1)=0.707106781186548*ZR(1)
      ZR(2)=0.707106781186548*ZR(2)
      QF(1)=+(TM(1)*ZR(1)+TM(2)*ZR(2))/ZM
      QF(2)=-(TM(1)*ZR(2)-TM(2)*ZR(1))/ZM
      RZ(1)=+0.5*QZ(1)/ZS
      RZ(2)=-0.5*QZ(2)/ZS
      TS(1)=PN+FN
      TS(2)=CN(2)
      AN(1)=TS(1)*TS(1)-TS(2)*TS(2)-0.25
      AN(2)=2.0*TS(1)*TS(2)
      SM(1)=0.0
      SM(2)=0.0
      SM(3)=0.0
      SM(4)=0.0
      TM(1)=1.0
      TM(2)=0.0
      PM=0.0
      GO TO 015
  014 AN(1)=AN(1)-2.0*PM
      PM=PM+1.0
      TS(1)=TM(1)*RZ(1)-TM(2)*RZ(2)
      TS(2)=TM(1)*RZ(2)+TM(2)*RZ(1)
      TM(1)=-(TS(1)*AN(1)-TS(2)*AN(2))/PM
      TM(2)=-(TS(1)*AN(2)+TS(2)*AN(1))/PM
  015 SM(1)=SM(1)+TM(1)
      SM(2)=SM(2)+TM(2)
      AN(1)=AN(1)-2.0*PM
      PM=PM+1.0
      TS(1)=TM(1)*RZ(1)-TM(2)*RZ(2)
      TS(2)=TM(1)*RZ(2)+TM(2)*RZ(1)
      TM(1)=+(TS(1)*AN(1)-TS(2)*AN(2))/PM
      TM(2)=+(TS(1)*AN(2)+TS(2)*AN(1))/PM
      IF(ABS(SM(3))+ABS(TM(1)).NE.ABS(SM(3)))GO TO 016
      IF(ABS(SM(4))+ABS(TM(2)).EQ.ABS(SM(4)))GO TO 017
  016 SM(3)=SM(3)+TM(1)
      SM(4)=SM(4)+TM(2)
      IF(PM.LT.35.0)GO TO 014
  017 AN(1)=QZ(1)-1.57079632679490*(PN+FN+0.5)
      AN(2)=QZ(2)-1.57079632679490*CN(2)
      TS(1)=+COS(AN(1))*0.5*(EXP(+AN(2))+EXP(-AN(2)))
      TS(2)=-SIN(AN(1))*0.5*(EXP(+AN(2))-EXP(-AN(2)))
      TM(1)=SM(1)*TS(1)-SM(2)*TS(2)
      TM(2)=SM(1)*TS(2)+SM(2)*TS(1)
      TS(1)=+SIN(AN(1))*0.5*(EXP(+AN(2))+EXP(-AN(2)))
      TS(2)=+COS(AN(1))*0.5*(EXP(+AN(2))-EXP(-AN(2)))
      RM(1)=TM(1)-SM(3)*TS(1)+SM(4)*TS(2)
      RM(2)=TM(2)-SM(3)*TS(2)-SM(4)*TS(1)
      FJ(1)=QF(1)*RM(1)-QF(2)*RM(2)
      FJ(2)=QF(1)*RM(2)+QF(2)*RM(1)
      W=CMPLX(FJ(1),FJ(2))
      RETURN
  018 N=1
      IF(ABS(CN(2)).GE.0.8*ABS(AZ(2)))N=0
      PM=CN(2)
      QM=AZ(2)-0.5*CN(2)
      QM=-1.25*(ZM+0.5*ABS(PM)-ABS(QM))
      IF(PN+FN.GE.QM)N=0
      QM=AZ(2)-CN(2)
      QM=+1.25*ZM-0.625*ABS(1.2*ZM-QM)-0.625*ABS(1.2*ZM+QM)
      IF(PN+FN.GE.QM)N=0
  019 IF(AZ(1))020,025,025
  020 QZ(1)=-AZ(1)
      QZ(2)=-AZ(2)
  021 IF(AZ(2))022,023,023
  022 AN(1)=+3.14159265358979*CN(2)
      AN(2)=-3.14159265358979*(PN+FN)
      GO TO 024
  023 AN(1)=-3.14159265358979*CN(2)
      AN(2)=+3.14159265358979*(PN+FN)
  024 QM=SN*0.398942280401433*EXP(AN(1))
      QF(1)=QM*COS(AN(2))
      QF(2)=QM*SIN(AN(2))
      GO TO 026
  025 QZ(1)=+AZ(1)
      QZ(2)=+AZ(2)
      QF(1)=SN*0.398942280401433
      QF(2)=0.0
  026 AN(1)=QN+FN
      AN(2)=CN(2)
      ZN(1)=+(AN(1)*QZ(1)+AN(2)*QZ(2))/ZS
      ZN(2)=-(AN(1)*QZ(2)-AN(2)*QZ(1))/ZS
      RM(1)=1.0-ZN(1)
      RM(2)=-ZN(2)
      RM(3)=1.0+ZN(1)
      RM(4)=+ZN(2)
      TM(1)=RM(1)*RM(1)+RM(2)*RM(2)
      TM(2)=RM(3)*RM(3)+RM(4)*RM(4)
      TS(1)=TM(1)*TM(1)
      TS(2)=TM(2)*TM(2)
      QR=TM(1)*TS(1)*TM(2)*TS(2)
      QS=(TS(1)+TS(2))*(TS(1)+TS(2))
      SS=16.0E-6*ZS*ZS*QR/QS
      IF(SS.GT.1.0)GO TO 027
      QN=QN+1.0
      IF(N.EQ.0)GO TO 026
      QN=-AINT(1.25*(ZM-ABS(PM)))
      IF(PN.GE.QN)GO TO 031
      QN=PN
      GO TO 031
  027 AN(1)=QN+FN
      AN(2)=CN(2)
      ASSIGN 028 TO LS
      GO TO 108
  028 SM(1)=SM(3)
      SM(2)=SM(4)
      IF(QN.EQ.PN)GO TO 030
      AN(1)=QN+FN+1.0
      AN(2)=CN(2)
      ASSIGN 029 TO LS
      GO TO 108
  029 AN(1)=QN+FN
      AN(2)=CN(2)
      TM(1)=+2.0*(AN(1)*QZ(1)+AN(2)*QZ(2))/ZS
      TM(2)=-2.0*(AN(1)*QZ(2)-AN(2)*QZ(1))/ZS
      TS(1)=TM(1)*SM(1)-TM(2)*SM(2)-SM(3)
      TS(2)=TM(1)*SM(2)+TM(2)*SM(1)-SM(4)
      SM(3)=SM(1)
      SM(4)=SM(2)
      SM(1)=TS(1)
      SM(2)=TS(2)
      QN=QN-1.0
      IF(QN.NE.PN)GO TO 029
  030 FJ(1)=QF(1)*SM(1)-QF(2)*SM(2)
      FJ(2)=QF(1)*SM(2)+QF(2)*SM(1)
      W=CMPLX(FJ(1),FJ(2))
      RETURN
  031 SZ(1)=+0.25*(AZ(1)*AZ(1)-AZ(2)*AZ(2))
      SZ(2)=+0.5*AZ(1)*AZ(2)
      QM=SZ(1)*SZ(1)+SZ(2)*SZ(2)
      AN(1)=QN+FN
      AN(2)=CN(2)
      SM(1)=0.0
      SM(2)=0.0
      SM(3)=0.0
      SM(4)=0.0
      TM(1)=1.0
      TM(2)=0.0
      PM=0.0
      IF(QN)032,037,037
  032 SS=AN(1)*AN(1)+AN(2)*AN(2)
      TS(1)=+(TM(1)*AN(1)+TM(2)*AN(2))/SS
      TS(2)=-(TM(1)*AN(2)-TM(2)*AN(1))/SS
      SM(1)=SM(1)+TS(1)
      SM(2)=SM(2)+TS(2)
      TM(1)=-TS(1)*SZ(1)+TS(2)*SZ(2)
      TM(2)=-TS(1)*SZ(2)-TS(2)*SZ(1)
      PM=PM+1.0
      TM(1)=TM(1)/PM
      TM(2)=TM(2)/PM
      IF(AN(1).LT.0.0.OR.QM.GT.PM*PM*SS)GO TO 033
      IF(ABS(SM(3))+ABS(TM(1)).NE.ABS(SM(3)))GO TO 033
      IF(ABS(SM(4))+ABS(TM(2)).EQ.ABS(SM(4)))GO TO 034
  033 SM(3)=SM(3)+TM(1)
      SM(4)=SM(4)+TM(2)
      AN(1)=AN(1)+1.0
      GO TO 032
  034 SM(3)=SM(3)+1.0
      AN(1)=QN+FN
      TS(1)=AN(1)*SM(1)-AN(2)*SM(2)
      TS(2)=AN(1)*SM(2)+AN(2)*SM(1)
      SM(1)=TS(1)
      SM(2)=TS(2)
      GO TO 036
  035 AN(1)=QN+FN
      TS(1)=AN(1)*AN(1)-AN(2)*AN(2)+AN(1)
      TS(2)=2.0*AN(1)*AN(2)+AN(2)
      SS=SZ(1)*SZ(1)+SZ(2)*SZ(2)
      TM(1)=+(SZ(1)*TS(1)+SZ(2)*TS(2))/SS
      TM(2)=+(SZ(1)*TS(2)-SZ(2)*TS(1))/SS
      TS(1)=TM(1)*(SM(1)-SM(3))-TM(2)*(SM(2)-SM(4))
      TS(2)=TM(1)*(SM(2)-SM(4))+TM(2)*(SM(1)-SM(3))
      SM(3)=SM(1)
      SM(4)=SM(2)
      SM(1)=TS(1)
      SM(2)=TS(2)
      QN=QN+1.0
  036 IF(QN.LT.PN)GO TO 035
      GO TO 042
  037 AN(1)=AN(1)+1.0
      SS=AN(1)*AN(1)+AN(2)*AN(2)
      TS(1)=+(TM(1)*AN(1)+TM(2)*AN(2))/SS
      TS(2)=-(TM(1)*AN(2)-TM(2)*AN(1))/SS
      SM(3)=SM(3)+TS(1)
      SM(4)=SM(4)+TS(2)
      TM(1)=-TS(1)*SZ(1)+TS(2)*SZ(2)
      TM(2)=-TS(1)*SZ(2)-TS(2)*SZ(1)
      PM=PM+1.0
      TM(1)=TM(1)/PM
      TM(2)=TM(2)/PM
      IF(ABS(SM(1))+ABS(TM(1)).NE.ABS(SM(1)))GO TO 038
      IF(ABS(SM(2))+ABS(TM(2)).EQ.ABS(SM(2)))GO TO 039
  038 SM(1)=SM(1)+TM(1)
      SM(2)=SM(2)+TM(2)
      GO TO 037
  039 SM(1)=SM(1)+1.0
      AN(1)=QN+FN+1.0
      TS(1)=AN(1)*SM(3)-AN(2)*SM(4)
      TS(2)=AN(1)*SM(4)+AN(2)*SM(3)
      SM(3)=TS(1)
      SM(4)=TS(2)
      GO TO 041
  040 AN(1)=QN+FN
      TS(1)=AN(1)*AN(1)-AN(2)*AN(2)+AN(1)
      TS(2)=2.0*AN(1)*AN(2)+AN(2)
      SS=TS(1)*TS(1)+TS(2)*TS(2)
      TM(1)=+(SZ(1)*TS(1)+SZ(2)*TS(2))/SS
      TM(2)=-(SZ(1)*TS(2)-SZ(2)*TS(1))/SS
      TS(1)=-TM(1)*SM(3)+TM(2)*SM(4)
      TS(2)=-TM(1)*SM(4)-TM(2)*SM(3)
      SM(3)=SM(1)
      SM(4)=SM(2)
      SM(1)=SM(1)+TS(1)
      SM(2)=SM(2)+TS(2)
      QN=QN-1.0
  041 IF(QN.GT.PN)GO TO 040
  042 AN(1)=PN+FN
      ZL(1)=0.5*ALOG(ZS)-0.693147180559945
      ZL(2)=ATAN2(AZ(2),AZ(1))
      TM(1)=AN(1)*ZL(1)-AN(2)*ZL(2)
      TM(2)=AN(1)*ZL(2)+AN(2)*ZL(1)
      AN(1)=AN(1)+1.0
      Z=CMPLX(AN(1),AN(2))
      CALL CGAMMA (1, Z, W)
      GN(1)=REAL(W)
      GN(2)=AIMAG(W)
      TM(1)=TM(1)-GN(1)
      TM(2)=TM(2)-GN(2)
      QM=SN*EXP(TM(1))
      QF(1)=QM*COS(TM(2))
      QF(2)=QM*SIN(TM(2))
      FJ(1)=QF(1)*SM(1)-QF(2)*SM(2)
      FJ(2)=QF(1)*SM(2)+QF(2)*SM(1)
      W=CMPLX(FJ(1),FJ(2))
      RETURN
  100 SS=SZ(1)*SZ(1)+SZ(2)*SZ(2)
      RS=SQRT(SS)
      RZ(1)=0.0
      RZ(2)=0.0
      IF(SZ(1))101,103,104
  101 RZ(2)=SQRT(-SZ(1)+RS)
      RZ(1)=SZ(2)/RZ(2)
      IF(SZ(2))102,105,105
  102 QM=-0.707106781186548
      GO TO 106
  103 IF(SZ(2).EQ.0.0)GO TO 107
  104 RZ(1)=SQRT(+SZ(1)+RS)
      RZ(2)=SZ(2)/RZ(1)
  105 QM=+0.707106781186548
  106 RZ(1)=QM*RZ(1)
      RZ(2)=QM*RZ(2)
  107 GO TO LR,(109,110)
  108 NS=AN(1)*AN(1)+AN(2)*AN(2)
      ZN(1)=(AN(1)*QZ(1)+AN(2)*QZ(2))/NS
      ZN(2)=(AN(1)*QZ(2)-AN(2)*QZ(1))/NS
      SZ(1)=(1.0-ZN(1))*(1.0+ZN(1))+ZN(2)*ZN(2)
      SZ(2)=-2.0*ZN(1)*ZN(2)
      ASSIGN 109 TO LR
      GO TO 100
  109 TS(1)=1.0+RZ(1)
      TS(2)=RZ(2)
      QS=TS(1)*TS(1)+TS(2)*TS(2)
      TM(1)=(TS(1)*ZN(1)+TS(2)*ZN(2))/QS
      TM(2)=(TS(1)*ZN(2)-TS(2)*ZN(1))/QS
      QS=TM(1)*TM(1)+TM(2)*TM(2)
      ZL(1)=RZ(1)+0.5*ALOG(QS)
      ZL(2)=RZ(2)+ATAN2(TM(2),TM(1))
      TS(1)=AN(1)*ZL(1)-AN(2)*ZL(2)
      TS(2)=AN(1)*ZL(2)+AN(2)*ZL(1)
      QT(1)=+SZ(1)/SS
      QT(2)=-SZ(2)/SS
      AR=1.0/SQRT(NS*RS)
      AQ=-1.0/RS
      AM=1.0
      TM(1)=AN(1)*RZ(1)-AN(2)*RZ(2)
      TM(2)=AN(1)*RZ(2)+AN(2)*RZ(1)
      QS=TM(1)*TM(1)+TM(2)*TM(2)
      SZ(1)=+TM(1)/QS
      SZ(2)=-TM(2)/QS
      ASSIGN 110 TO LR
      GO TO 100
  110 RN(1)=SZ(1)
      RN(2)=SZ(2)
      QM=(1.0/3.0)*ATAN2(QZ(2),QZ(1))
      TM(1)=COS(QM)
      TM(2)=SIN(QM)
      RM(1)=+0.866025403784439*TM(1)+0.5*TM(2)
      RM(2)=+0.866025403784439*TM(2)-0.5*TM(1)
      RM(3)=+0.866025403784439*TM(1)-0.5*TM(2)
      RM(4)=+0.866025403784439*TM(2)+0.5*TM(1)
      SK(1)=1.0
      SK(2)=0.0
  111 IF(AN(1)*RM(1)+AN(2)*RM(2)-QZ(1)*RM(1)-QZ(2)*RM(2)) 113,113,112
  112 SK(1)=0.0
  113 IF(AN(1)*RM(3)+AN(2)*RM(4)-QZ(1)*RM(3)-QZ(2)*RM(4)) 115,115,114
  114 SK(1)=0.0
  115 IF(AN(1)*RM(1)+AN(2)*RM(2)+QZ(1)*RM(1)+QZ(2)*RM(2)) 116,117,117
  116 SK(2)=1.0
  117 IF(AN(1)*RM(3)+AN(2)*RM(4)+QZ(1)*RM(3)+QZ(2)*RM(4)) 118,119,119
  118 SK(2)=1.0
  119 QS=AN(1)*TM(2)-AN(2)*TM(1)+QZ(1)*TM(2)-QZ(2)*TM(1)
      IF(QS.LE.0.0)GO TO 120
      SK(2)=-SK(2)
  120 RM(1)=0.0
      RM(2)=0.0
      RM(3)=0.0
      RM(4)=0.0
      QM=EXP(TS(1))
      TM(1)=QM*COS(TS(2))
      TM(2)=QM*SIN(TS(2))
      RE(1)=+TM(1)*RZ(1)-TM(2)*RZ(2)
      RE(2)=+TM(1)*RZ(2)+TM(2)*RZ(1)
  121 IF(SK(1).NE.0.0)GO TO 122
      RE(3)=0.0
      RE(4)=0.0
      GO TO 126
  122 QS=TM(1)*TM(1)+TM(2)*TM(2)
      TM(1)=+TM(1)/QS
      TM(2)=-TM(2)/QS
      RE(3)=+TM(1)*RZ(2)+TM(2)*RZ(1)
      RE(4)=-TM(1)*RZ(1)+TM(2)*RZ(2)
  123 IF(RN(2))125,124,126
  124 IF(RN(1))126,126,125
  125 RE(3)=-RE(3)
      RE(4)=-RE(4)
  126 DO 127 K=1,16
      CU(K)=0.0
  127 CONTINUE
      CU(1)=1.0
      M=1
      GO TO 130
  128 CK=0.0
      PM=M-1
      DO 129 K=1,M
      CM=CK
      CK=CU(K)
      CU(K)=(0.125/PM+0.5*(PM-1.0))*CK-(0.625/PM+0.5*(PM-3.0))*CM
      PM=PM+2.0
  129 CONTINUE
  130 QU(1)=0.0
      QU(2)=0.0
      AU=0.0
      L=M
      DO 131 K=1,M
      AU=CU(L)+AQ*AU
      TS(1)=QU(1)*QT(1)-QU(2)*QT(2)
      TS(2)=QU(1)*QT(2)+QU(2)*QT(1)
      QU(1)=TS(1)+CU(L)
      QU(2)=TS(2)
      L=L-1
  131 CONTINUE
      RM(1)=RM(1)+RE(1)*QU(1)-RE(2)*QU(2)
      RM(2)=RM(2)+RE(1)*QU(2)+RE(2)*QU(1)
      TS(1)=RE(1)*RN(1)-RE(2)*RN(2)
      TS(2)=RE(1)*RN(2)+RE(2)*RN(1)
      RE(1)=+TS(1)
      RE(2)=+TS(2)
  132 IF(SK(1).EQ.0.0)GO TO 133
      RM(3)=RM(3)+RE(3)*QU(1)-RE(4)*QU(2)
      RM(4)=RM(4)+RE(3)*QU(2)+RE(4)*QU(1)
      TS(1)=RE(3)*RN(1)-RE(4)*RN(2)
      TS(2)=RE(3)*RN(2)+RE(4)*RN(1)
      RE(3)=-TS(1)
      RE(4)=-TS(2)
  133 AU=AM*AU
      AM=AR*AM
      IF(1.0+AU.EQ.1.0)GO TO 134
      M=M+1
      IF(M.LE.16)GO TO 128
  134 IF(SK(1).NE.0.0)GO TO 135
      SM(3)=RM(1)
      SM(4)=RM(2)
      GO TO 147
  135 IF(SK(2).NE.0.0)GO TO 136
      SM(3)=RM(1)+RM(3)
      SM(4)=RM(2)+RM(4)
      GO TO 147
  136 IF(ZN(2))137,138,138
  137 TM(1)=-6.28318530717959*AN(2)
      TM(2)=+6.28318530717959*FN
      GO TO 139
  138 TM(1)=+6.28318530717959*AN(2)
      TM(2)=-6.28318530717959*FN
  139 QM=EXP(TM(1))
      TS(1)=QM*COS(TM(2))
      TS(2)=QM*SIN(TM(2))
  140 IF(QZ(2).LE.0.0.AND.SK(2).LE.0.0)GO TO 142
      IF(QZ(2).GE.0.0.AND.SK(2).GE.0.0)GO TO 142
      IF(QZ(2).LE.0.0.AND.ZN(2).LT.0.0)GO TO 142
      IF(QZ(2).GE.0.0.AND.ZN(2).GE.0.0)GO TO 142
  141 QS=TS(1)*TS(1)+TS(2)*TS(2)
      TM(1)=(TS(1)*RM(3)+TS(2)*RM(4))/QS
      TM(2)=(TS(1)*RM(4)-TS(2)*RM(3))/QS
      RM(3)=TM(1)
      RM(4)=TM(2)
  142 TM(1)=RM(1)-TS(1)*RM(1)+TS(2)*RM(2)
      TM(2)=RM(2)-TS(1)*RM(2)-TS(2)*RM(1)
  143 IF(QZ(1).NE.0.0) GO TO 144
      IF(QZ(2).LT.0.0.AND.AN(2).GT.0.0) GO TO 146
      IF(QZ(2).GT.0.0.AND.AN(2).LE.0.0) GO TO 146
      GO TO 145
  144 IF(QZ(2).LT.0.0.AND.ZN(2).LT.0.0) GO TO 145
      IF(QZ(2).GE.0.0.AND.ZN(2).GE.0.0) GO TO 145
      IF(QZ(2).LT.0.0.AND.AN(2).GE.0.0.AND.RN(2).LT.0.0) GO TO 146
      IF(QZ(2).GE.0.0.AND.AN(2).LT.0.0.AND.RN(2).GE.0.0) GO TO 146
  145 SM(3)=RM(3)+TM(1)
      SM(4)=RM(4)+TM(2)
      GO TO 147
  146 SM(3)=RM(3)-TM(1)
      SM(4)=RM(4)-TM(2)
  147 GO TO LS,(028,029)
      END
