      SUBROUTINE ZSECCX( X2, TOL, IT, MAXIT, ERRMSG )
      IMPLICIT REAL*8 (A-H, O-Z)
      COMPLEX*16 X0, X1, X2, SHIFT, F0, F1
      CHARACTER*80 ERRMSG

C     Secant method

      ERRMSG = ' '
      IF ( TOL .LE. 0.0 ) THEN
         ERRMSG = 'Non-positive tolerance specified'
         STOP
      ENDIF

      TEN    = 10.0
      X1     = X2 + 100.0 * TOL
c       X1 = X2 - 10.0*TOL
c       X2 = X2 +10.0*TOL
      CALL FUNCT( X1, F1, IPOW1)

      DO 1000 IT = 1, MAXIT
         X0 = X1
         F0 = F1
         IPOW0 = IPOW1

         X1 = X2
         CALL FUNCT( X1, F1, IPOW1)
         SHIFT = F1 * ( X1 - X0 ) / ( F1 - F0 * TEN ** (IPOW0-IPOW1) )
c         SHIFT = SHIFT / 10.0
         X2 = X1 - SHIFT

         IF ( ABS( X2 - X1 ) .LT. TOL ) GOTO 3000
         IF ( ABS( X2 - X0 ) .LT. TOL ) GOTO 3000
 1000 CONTINUE

      ERRMSG = ' *** FAILURE TO CONVERGE IN SECANT'

 3000 RETURN
      END
