% Newton method for finding roots of functions of a single variable.
% Use as starting point, add comments and elaborations of basic code as needed.
% Bare bone version, would be good to add more safeguards in case method diverges, and some measures of performance.
function root=newton(F, Fprime,guess)
iter=1;
maxiter=100;
x=guess;
accuracy=1;
tolerance=1e-12;
while accuracy>tolerance && iter<maxiter
    x=x-F(x)/Fprime(x);
    accuracy=abs(F(x));
    iter=iter+1;
end
root=x;
end