clear; clc; close all;
%MÉTODO DE NEWTON (MN)
f=@(x) exp(x)-2*x-1;
g=@(x) exp(x)-2;
phi=@(x) x-(f(x)/g(x));
x=1;
E=1e-5;
Dr=E+1;
k=0;
kmax=100;

while Dr>E && abs(f(x))>E && k<=kmax
    k=k+1;
    xx=phi(x);
    Dr=abs(xx-x);
    x=xx;
end

raiz=x
fraiz=f(x)
iteracoes=k
