function r = Newton_Raphson(f, df, x1)
k=1;
while 1
    x2 = x1 - f(x1)/df(x1);
    disp([x2, x1 , f(x1), df(x1)]);
    %fprintf('%02d %12.6f %12.6f %12.6f, %12.6f\n', k, x1, f(x1), x2, f(x2));
    if abs(f(x2)) < 1e-6 break;
    else x1 = x2;
    end;
    k = k+1;
end;
r = x2;
end