program NEWTR data neq,itm/6,100/ f1(x)=4.*x*x -12.*cos(2.*x) f2(x)=4.*x*x - 12.*sin(2.*x) + 5. f3(x) = alog(x) + x*x - 3.*x f4(x) = 7.*(x**4)-13.*(x**3)+21.*x-38 f5(x) = 8.*(x**7)-24./sin(x) f6(x) = 37.*(x**3)-29./cos(2.*x) fd1(x)=8.*x + 24.*sin(2*x) fd2(x)=8.*x - 24.*cos(2*x) fd3(x)= (1./x) + 2.*x -3 fd4(x)=28.*(x**3)-39.*x*x+21. fd5(x)=56.*(x**6)+24.*cot(x)/sin(x) fd6(x)=111.*x*x-58.*tan(2.*x)/cos(2.*x) 10 write(*,*) ' eqn no? and initial guess? how many iterations?' read(*,*)ne,x,its if (ne.gt.neq)goto 13 it=0 goto(5,6,7,15,16,17)ne 5 x=x-f1(x)/fd1(x) it=it+1 if(it.eq.its)goto 11 if(it.lt.itm)goto 5 11 write(*,*)it,x goto 10 6 x=x-f2(x)/fd2(x) it=it+1 if(it.eq.its)goto 12 if(it.lt.itm)goto 6 12 write(*,*)it,x goto 10 7 x=x-f3(x)/fd3(x) it=it+1 if(it.eq.its)goto 21 if(it.lt.itm)goto 7 21 write(*,*)it,x goto 10 15 x=x-f4(x)/fd4(x) it=it+1 if(it.eq.its)goto 14 if(it.lt.itm)goto 15 14 write(*,*)it,x goto 10 16 x=x-f5(x)/fd5(x) it=it+1 if(it.eq.its)goto 19 if(it.lt.itm)goto 16 19 write(*,*)it,x goto 10 17 x=x-f6(x)/fd6(x) it=it+1 if(it.eq.its)goto 22 if(it.lt.itm)goto 17 22 write(*,*)it,x goto 10 13 stop end