clear all;close all;
f = @(x) x.^2-2;
fp = @(x) 2.*x;
x = 1;
k = 1;
d=1;
fprintf('%20s %20s %20s\n','k','zero','deviation') ;
while abs(d)>10^-10
    d = f(x)/fp(x);
    fprintf('%20d %20.15f %20.15f\n',k,x,d);
    x = x-d;
    k = k+1;
end
