function [T,k,x,fa,d] = mynew(f,fl,x0,eps1,eps2)
%
% implementation of newton method
%

k=0;
x=x0;
fa = abs(f(x));
d=inf;
T(1,1:4)=[k,x,fa,d];
if fa < eps1
else
	k=1;
	x=x0-f(x0)/fl(x0);
	fa=abs(f(x));
	d=abs(x-x0);
	T(2,1:4)=[k,x,fa,d];
	while fa >= eps1 & d >= eps2 & k < 1000
		k = k+1;
		x0=x;
	    x=x0-f(x0)/fl(x0);
	    fa=abs(f(x));
		d=abs(x-x0);
		T(k+1,1:4) =[k,x,fa,d];
	end  
end
