/************************************************************** This program computes z such that f(z) = 0 , where f(z) is an N-th order polynominal equation with coefficients C[i] = A[i] + j*B[i] for (i = 0 to N) and g(z) = df(z)/dz ; Guess z[k] = x[k] + j*y[k] for k = 0 and then the program computes recursively z[k+1] = z[k] - f(z[k]) /g(z) until you stop the program by typing-in "s" or you type "g" for the next guess for z[0] ; ************************************************************** Type "s" to stop program. Type "g" to start the next guess. **************************************************************/ N=2 A[0]=-2.000000 A[1]=0.000000 A[2]=1.000000 x[0]=1.500000 k x[k] fx[k] ffx[k] gx[k] 0 1.500000 0.250000 3.000000 1.416667 1 1.416667 0.006944 2.833333 1.414216 2 1.414216 0.000006 2.828431 1.414214 3 1.414214 0.000000 2.828427 1.414214 4 1.414214 0.000000 2.828427 1.414214 ******************** Next Guess ****************** h = 1.000000 x[0] = 5.000000 k x[k] fx[k] ffx[k] gx[k] 0 5.000000 23.000000 10.000000 2.700000 1 2.700000 5.290000 5.400000 1.720370 2 1.720370 0.959674 3.440741 1.441455 3 1.441455 0.077794 2.882911 1.414471 4 1.414471 0.000728 2.828942 1.414214 5 1.414214 0.000000 2.828427 1.414214 6 1.414214 0.000000 2.828427 1.414214 7 1.414214 -0.000000 2.828427 1.414214 ******************** Next Guess ****************** h = 1.000000 x[0] = 1.000000 k x[k] fx[k] ffx[k] gx[k] 0 1.000000 -1.000000 2.000000 1.500000 1 1.500000 0.250000 3.000000 1.416667 2 1.416667 0.006944 2.833333 1.414216 3 1.414216 0.000006 2.828431 1.414214 4 1.414214 0.000000 2.828427 1.414214 5 1.414214 0.000000 2.828427 1.414214 6 1.414214 -0.000000 2.828427 1.414214 ******************** Next Guess ****************** h = 1.000000 x[0] = -3.000000 k x[k] fx[k] ffx[k] gx[k] 0 -3.000000 7.000000 -6.000000 -1.833333 1 -1.833333 1.361111 -3.666667 -1.462121 2 -1.462121 0.137798 -2.924242 -1.414998 3 -1.414998 0.002221 -2.829997 -1.414214 4 -1.414214 0.000001 -2.828428 -1.414214 5 -1.414214 0.000000 -2.828427 -1.414214 6 -1.414214 -0.000000 -2.828427 -1.414214 7 -1.414214 0.000000 -2.828427 -1.414214 8 -1.414214 -0.000000 -2.828427 -1.414214 9 -1.414214 0.000000 -2.828427 -1.414214 10 -1.414214 -0.000000 -2.828427 -1.414214 11 -1.414214 0.000000 -2.828427 -1.414214