The following finds a solution to g(x) = 0 given 3 initial approximation p0, using the Muller's method. This WILL find complex roots! 'G' - this variable must contain the funtion to be evaluated e.g. 'X^2-2*X+4' stack levels: 5: initial approximation 1 4: initial approximation 2 3: initial approximation 3 2: tolerance 1: maximum number of iterations 'MULL' [ 970B ] << 2 -> x0 x1 x2 tol n0 i << x1 x0 - h1 STO x2 x1 - h2 STO x1 'X' STO G EVAL x0 'X' STO G EVAL - h1 / s1 STO x2 'X' STO G EVAL x1 'X' STO G EVAL - h2 / s2 STO s2 s1 - h2 h1 + / d STO WHILE i n0 <= REPEAT s2 h2 d * + 'b' STO b SQ x2 'X' STO G EVAL 4 * d * - .5  'dd' STO IF b dd - ABS b dd + ABS tol < THEN b dd + 'ee' STO ELSE b dd - 'ee' STO END G EVAL -2 * ee / 'h' STO x2 h + 'p' STO IF h + ABS tol < THEN p { p X h ee dd b d s2 s1 h2 h1 } PURGE ABORT END x1 'x0' STO x2 'x1' STO p 'x2' STO x1 x0 - 'h1' STO x2 x1 - 'h2' STO x1 'X' STO G EVAL x0 'X' STO G EVAL - h1 / 's1' STO x2 'X' STO G EVAL x1 'X' STO G EVAL - h2 / 's2' STO s2 s1 - h2 h1 + / 'd' STO i 1 + 'i' STO i h ABS p p 'X' STO G EVAL 4 ->LIST SHON HALT DROP END 'F' >> >> SHON simply turns shift key on. SHON << # 1F8A7h SYSEVAL >> At each halt of the program a list containing - iteration step - error limit for this guess - current solution - current value of g(x) at current solution Simply press CONT to go on to next iteration step. ******************************************************************** * J.J. * JJL101@psuvm.bitnet * * * Penn State Center for Academic Computing * * John Lehett * Computational Mathematics * ********************************************************************