newton_pseudocode.txt function newton ( ) Input: f(), fp(), x, xtol, ftol, itmax it = 0 dx = 0 alpha = 0 Begin loop it = it + 1 Set xold to x, and set x to x - f(x) / fp(x) Set dx_old to dx, and set dx = | x - xold | Set alpha_old to alpha if dx_old is not 0, set alpha to dx / dx_old if alpha_old is not 0, set r = log ( alpha ) / log ( alpha_old ) if x - xold is less than xtol and |f(x)| is less than ftol, success if it > itmax, failure End loop Output: values of updated x and it