Question: What is problem with procedure

Hello everbody.

Newton:=proc(p[0],TOL,N)  

 local i,p,f;   i:=1;

 while i<= N do      

     p:=p[0]-(f(p[0]))/(diff(f(p[0]),x));    

     if abs(p-p[0])<TOL then             return p;     else i:=i+1;            p[0]:=p; end if;  

end do;

printf("The method failed after N iterations,N=%d",N);  end proc:

Please Wait...