      SUBROUTINE CEIG(E1,E2,A,B,C,D)
      REAL P,Q,R,S,T,MAG
      COMPLEX A,B,C,D,E1,E2,U,V,X,Y
      Q = MAG(B)
      R = MAG(C)
      T = SQRT(Q)*SQRT(R)
      U = .5*(A-D)
      S = MAG(U)
      IF ( S .LT. T ) GOTO 20
      IF ( T .NE. 0. ) GOTO  10
      E1 = A
      E2 = D
      RETURN
10    P = 1./T
      S = 1./S
      V = CSQRT((S*U)**2+((B*P)*(C*P))*(S*T)**2)
      GOTO 30
20    S = 1./T
      V = CSQRT((S*U)**2+(B*S)*(C*S))
30    U = S*U
      X = U + V
      Y = U - V
      IF ( MAG(X) .GT. MAG(Y) ) GOTO 50
      IF ( Q .GT. R ) GOTO 40
      E1 = A + B*(C*S)/Y
      E2 = D - B*(C*S)/Y
      RETURN
40    E1 = A + (B*S)*C/Y
      E2 = D - (B*S)*C/Y
      RETURN
50    IF ( Q .GT. R ) GOTO 60
      E1 = A + B*(C*S)/X
      E2 = D - B*(C*S)/X
      RETURN
60    E1 = A + (B*S)*C/X
      E2 = D - (B*S)*C/X
      RETURN
      END
