      SUBROUTINE QTCRT (AC, RZ)
C     ******************************************************************
C     FORTRAN SUBROUTINE FOR ROOTS OF QUARTIC POLYNOMIAL (EULER)
C     ******************************************************************
C     AC = POLYNOMIAL COEFFICIENTS (5-ARRAY)
C     RZ = POLYNOMIAL ROOTS        (8-ARRAY)
C
      DIMENSION AC(5), CK(4), RK(6), RL(2), RM(2), RN(2), RZ(8)
  001 P=AC(4)/AC(5)
      Q=AC(3)/AC(5)
      R=AC(2)/AC(5)
      S=AC(1)/AC(5)
      A=-0.375*P*P+Q
      B=+0.125*P*P*P-0.5*P*Q+R
      C=-0.01171875*P*P*P*P+0.0625*P*P*Q-0.25*P*R+S
      CK(1)=-0.015625*B*B
      CK(2)=+0.0625*(A*A-4.0*C)
      CK(3)=+0.5*A
      CK(4)=+1.0
      CALL CBCRT (CK, RK)
      CK(1)=RK(1)
      CK(2)=RK(2)
      ASSIGN 002 TO LR
      GO TO 010
  002 RL(1)=CK(3)
      RL(2)=CK(4)
      CK(1)=RK(3)
      CK(2)=RK(4)
      ASSIGN 003 TO LR
      GO TO 010
  003 RM(1)=CK(3)
      RM(2)=CK(4)
      CK(1)=RK(5)
      CK(2)=RK(6)
      ASSIGN 004 TO LR
      GO TO 010
  004 RN(1)=CK(3)
      RN(2)=CK(4)
      QM=RL(1)*(RM(1)*RN(1)-RM(2)*RN(2))-RL(2)*(RM(1)*RN(2)+RM(2)*RN(1))
      IF(B*QM)005,006,006
  005 RL(1)=-RL(1)
      RL(2)=-RL(2)
      RM(1)=-RM(1)
      RM(2)=-RM(2)
      RN(1)=-RN(1)
      RN(2)=-RN(2)
  006 RZ(1)=-RL(1)-RM(1)-RN(1)-P/4.0
      RZ(2)=-RL(2)-RM(2)-RN(2)
      RZ(3)=-RL(1)+RM(1)+RN(1)-P/4.0
      RZ(4)=-RL(2)+RM(2)+RN(2)
      RZ(5)=+RL(1)-RM(1)+RN(1)-P/4.0
      RZ(6)=+RL(2)-RM(2)+RN(2)
      RZ(7)=+RL(1)+RM(1)-RN(1)-P/4.0
      RZ(8)=+RL(2)+RM(2)-RN(2)
      RETURN
  010 SS=CK(1)*CK(1)+CK(2)*CK(2)
      RS=SQRT(SS)
      CK(3)=0.0
      CK(4)=0.0
      IF(CK(1))011,013,014
  011 CK(4)=SQRT(-CK(1)+RS)
      CK(3)=CK(2)/CK(4)
  012 QM=+0.707106781186548
      GO TO 016
  013 IF(CK(2).EQ.0.0)GO TO 017
  014 CK(3)=SQRT(+CK(1)+RS)
      CK(4)=CK(2)/CK(3)
      IF(CK(2))015,015,012
  015 QM=-0.707106781186548
  016 CK(3)=QM*CK(3)
      CK(4)=QM*CK(4)
  017 GO TO LR,(002,003,004)
      END
