function nf=newton(xo,Niter,tol)
disp("")
disp ("Output for the Newton method")
disp("")
disp ("           n          x          err        f(x)")  
for i=1:Niter
  x=xo-f(xo)/df(xo);
  if (f(xo)==0 |abs(x-xo)<tol)
    disp("")
    disp ("The method completed successfully!")
    disp("")
    return;
  else 
    epsilon=abs(x-xo);
    xo=x;
    disp ([i, xo, epsilon, f(xo)]);
  endif
endfor
disp("")
disp ("The method failed after (Niter)")
disp (Niter)
disp ("iterations")
disp("")
endfunction