x(1) = input(' Initial guess for Newton Method for y = x^5-x^4+x^3-x^2+x-1 = 0 ');
D = input(' How close you want to be to root of y = x^5-x^4+x^3-x^2+x-1 ');
k = 1;
while (abs(g(x(k)))>D || abs(nm(x(k))-x(k))>D)
    x(k+1)=nm(x(k));
    k = k+1;
end
format long
disp(x(k))
disp(nm(x(k)))
disp(g(x(k)))
plot(x)