program rtnewt_main real rtnewt, x1, x2, xacc external rtnewt, funcd write (*,*) 'Please type in interval x1 and x2 :' read (*,*) x1, x2 write(*,*) 'Please typle in theaccuracy for root finding :' read (*,*) xacc write(*,*) 'The root is ', rtnewt(funcd,x1,x2,xacc) write(*,*) 'within the accuracy of +/- ', xacc end c subroutine funcd(x,f,df) c real x, f, df c f = x**2 - 1.0 c df = 2*x c end subroutine funcd(x,f,df) real x, f, df f = x**3 df = 3*(x**2) end c subroutine funcd(x,f,df) c real x, f, df c f = 7*sin(x) + x c df = 7*cos(x) + 1 c end