g = @(x) (2+log(x))^(1/3);
p0=1.5;
k=0.1875; % |g'(x)| < k

N=4; % number of iterations
e=0.00; % accuracy
d=5; % number of digits (sig fig) rounding
format long g

digits(d)
p(1)=p0;
for i=2:N+1
    p(i)=g(p(i-1));
    %p(i)=vpa(p(i));
    disp("p"+(i-1)+"="+p(i));
    
    E(i-1)=(k^(i-1))/(1-k)*abs(p(2)-p(1));
    if E(i-1)<e
        break;
    end
end
disp(" ");
for i=1:length(E)
    disp("E"+i+"="+E(i));
    if E(i)<e
        break;
    end
end