function y=parabolikus(t0,t1,t2,k)
f0=f(t0);f1=f(t1);f2=f(t2);
for i=1:k f12=f1-f2;f10=f1-f0;t10=t1-t0;t12=t1-t2;
     t=t1-(f12*t10^2-f10*t12^2)/(f12*t10-f10*t12)/2;
     ft=f(t);
     if t<t1&ft<f1 t2=t1;f2=f1;t1=t;f1=ft;
     elseif t<t1&ft>=f1 t0=t;f0=ft;
     elseif t>t1&ft<f1 t0=t1;f0=f1;t1=t;f1=ft;
     elseif t>t1&ft>=f1 t2=t;f2=ft;
     else t1=t1+eps;f1=f(t1);
     end;
y=t1;
end;