PROGRAM COMPLEX_COMPUTATION
C=======================================================================
C                  SOLUTION OF X**3-Z=0
C                           EIJI FUKUMORI
C                          29 DECEMBER 2012
C=======================================================================
      IMPLICIT REAL*8 ( A-H , O-Z )
      COMPLEX*16 Z, ZQR, T1, T2, ZPRIME1, ZPRIME2, ZPRIME3
      COMPLEX*16 ZQR1, ZQR2, ZQR3
      WRITE (*,*) 'COMPLEX COMPUTATION OF X**3-Z'
C
      Z = DCMPLX(15.D0, 3.D0)
C
      WRITE (*,*) 'GIVEN COMPLEX, Z=', Z
      ZQR = Z**(1.D0/3.D0)
      T1 = DCMPLX(-0.5D0, +0.5D0*DSQRT(3.D0))
      T2 = DCMPLX(-0.5D0, -0.5D0*DSQRT(3.D0))
      ZQR1 = ZQR
      ZQR2 = ZQR*T1
      ZQR3 = ZQR*T2
      WRITE (*,*) 'X1, X2, X3 ARE', ZQR1, ZQR2, ZQR3
      ZPRIME1 = ZQR1**3
      ZPRIME2 = ZQR2**3
      ZPRIME3 = ZQR3**3
      WRITE (*,*) 'CUBICS OF X1, X2, X3 ARE ',ZPRIME1, ZPRIME2, ZPRIME3
      WRITE (1,*) '0. 0.'
      WRITE (1,*) DREAL(ZQR1), DIMAG(ZQR1)
      WRITE (1,*)
      WRITE (1,*) '0. 0.'
      WRITE (1,*) DREAL(ZQR2), DIMAG(ZQR2)
      WRITE (1,*)
      WRITE (1,*) '0. 0.'
      WRITE (1,*) DREAL(ZQR3), DIMAG(ZQR3)
      R = DSQRT ( DREAL(ZQR3)**2 + DIMAG(ZQR3)**2 )
      PI = 4.D0*DATAN (1.D0)
      N = 100
      DANG = 2.D0*PI / N
      WRITE (1,*)
      WRITE (1,*) R, ' 0.'
      DO I = 1 , N
      ANG = I*DANG
      X = R*DCOS(ANG)
      Y = R*DSIN(ANG)
      WRITE (1,*) X , Y
      END DO
      STOP
      END