procedure newton complexe(A,B,N,EPS1,EPS2,EPS3,MAXITER,X,Y); value N,A,B,EPS1,EPS2,EPS3; integer N,MAXITER; array A,B,X,Y; real EPS1,EPS2,EPS3;
Finds the roots of (A[0] + iB[0]) × ZN+.. .+A[N] + iB[N] = 0 by Newton's method. The iteration is terminated when
max(| x(k+1) - x(k) | , |y(k+1) - y(k) |) < EPS1.
If no convergence is achieved after MAXITER iterations, EPS1 is multiplied by 10 and the process restarted (as long as EPS1≤EPS2). A root is considered real if |y(k)/x(k)| <EPS3. Declare A,B,X,Y [0:N]. The initial guess is X[0], Y[0] (which should be quite close to the origin) and the roots are stored in X[1], Y[1], ... , X[N], Y[N].
procedure muller(N,A,B,EPS,MAXITER,X,Y); value N,A,B; real EPS; integer N,MAXITER; array A,B,X,Y;
Finds the roots of (A[0] + iB[0]) × ZN + ....A[N] + ib[N] = 0 by Muller's method. The iteration terminates when
| Z(k+1) - z(k) | < EPS × Z(k+1) |, or after MAXITER steps. The initial guess is set internally. The roots are stored in X,Y [1:N].
procedure laguerre(N,A,MAXITER,EPS,EPS2,X,IMPOSS); value N,A,EPS,EPS2; integer N,MAXITER; real EPS,EPS2; array A,X; label IMPOSS;
Finds the roots of A[0] × xN + ..... + A[N] = 0 by Laguerre's method, assuming they are all real. The iteration is terminated when | x(k+1) - x(k) | < EPS.
If convergence is not achieved after MAXITER iterations, EPS is multiplied by 10 and the process restarted, as long as EPS≤EPS2. We suggest MAXITER = 30 and EPS2 = 0.01. The initial guess is placed in X[0] and the roots are stored in X[1], ..... , X[N].
procedure bissection(F,Y1,Y2,EPS,ETA,X,FAIL); value Y1,Y2; real procedure F; real Y1,Y2,EPS,ETA,X; label FAIL;
Finds a zero X of F(y) in [Y1,Y2] by the method of bisection. An exit to FAIL is made if an even number of zeros is found. If there are an odd number then only one is found. Calculation terminates when F (X) < EPS or the interval is less than ETA in width.
procedure bisdou(F,G,A1,B1,A2,B2,EPS,X,Y,IMPOSS); value A1,B1,A2,B2,EPS; real procedure F,G; real A1,B1,A2,B2,EPS,X,Y; label IMPOSS;
Finds a solution of F(X,Y) = G(X,Y) = 0 in the rectangle [A1,B1] × [A2,B2] by the method of bissection. The solution will lie in the square [X,X + EPS] × [Y,Y + EPS]. Exit to IMPOSS if no solution is found.
These two procedures are rather slow and are most useful when used to supply a starting value for an iterative process such as Newton's method.