# # Numerical Mathematics and Computing, Fifth Edition # Ward Cheney & David Kincaid # Brooks/Cole Publ. Co. # (c) 2004 # # file: newt # # Newton's method # Digits := 100: f := x -> ((x - 2.0)*x + 1.0)*x - 3.0: fp := x -> (3.0*x - 4.0)*x + 1.0: x := 3.0; f(x); for n from 1 by 1 to 10 do x := x - f(x)/fp(x); e :=f(x); end do;