function x=minNR(funktion, x0, tolerans)
format short e
disp('     x       f(x)      fp(x)    h=f(x)/fp(x)')
format compact
h=1; x=x0;

while abs(h)>1e-10*abs(x)
    f=funktion(x);
    fp=(funktion(x+tolerans)-f)/tolerans;
    h=f/fp;
    disp([x f fp h])
    x=x-h;
end
format long
x