c c Numerical Analysis: c The Mathematics of Scientific Computing c D.R. Kincaid & E.W. Cheney c Brooks/Cole Publ., 1990 c c Section 3.2 c c Example of simple Newton's method c c c file: ex2s32.f c double precision x,f,fp data x/4.0d0/, M/4/ f(x) = x*x - 17.0d0 fp(x) = 2.0d0*x c print * print *,' Simple Newton method example' print *,' Section 3.2, Kincaid-Cheney' print * c fx = f(x) print 3 print 4,0,x,fx do 2 k = 1,M x = x - fx/fp(x) fx = f(x) print 4,k,x,fx 2 continue c 3 format (3x,' k',12x,'x',21x,'f(x)') 4 format(2x,i3,2x,d22.15,2x,d22.15) stop end