
x = [0:0.01:10];
y = log(sqrt(x)+.5);
plot(x, y);

xold = 0.5;

format long

error = 10000

for i = 1:1000

    [f fp] = mylogfunction(xold);
    %f = log(sqrt(xold)+0.5);
    %fp = 1.0/(sqrt(xold)+0.5)*(0.5)*(xold)^(-0.5);
    xnew = xold - f/fp;
    xnew
    error = abs(xnew-xold)
    xold = xnew;
    
    if (error < 10^(-12))
        break;
    end
    
end



function [f, fp] = mylogfunction(x)
    f = log(sqrt(x)+.5);
    fp = 1.0/(sqrt(x)+0.5)*(0.5)*(x)^(-0.5);
end