Function (a, b)=WTF (h0, x1)
% extrapolation
% details is shown here
Syms x
F=3 * x * x - 8 * x + 9;
Y1=subs (f, x, the x1);
H=h0;
X2=h + x1;
Y2=subs (f, x, x2);
If y2 & gt; Y1
H=- h;
The x3=x1;
Y3=y1;
The x1 x2=;
X2=x3;
Y2=y3;
The x3=x2 + h;
Y3=subs (f, x, x3);
The else
The x3=x2 + h;
Y3=subs (f, x, x3);
End
While (y3 & lt; Y2)
H=2 * h;
The x1 x2=;
X2=x3;
Y2=y3;
The x3=x2 + h;
Y3=subs (f, x, x3);
End
A=min (x1, x3);
B=Max (x1, x3);
end