function y2=Runge_met(f,x,y0,x0,eps)

h=(x-x0)/2;
podela=2;

while 1
    y1=y0;
    for i=1:podela
       y1=Runge_kutta(f,h,y1,x0+(i-1)*h);
    end
    
    H=2*h;
    y2=y0;
    for i=1:podela/2
        %sa korakom 2h u tacki x0+2h=x
        y2=Runge_kutta(f,H,y2,x0+(i-1)*H);
    end

    if abs(y2-y1)/15 > eps
        h=h/2;
        podela=podela*2;
    else
        break;
    end
end