program pr7;
uses
crt;
var
y:array[1..3] of real; {çíà÷åíèÿ ôóíêöèé â òî÷êàõ x1, x2, x3}
eps1: real; {òî÷íîñòè}
a, b, c, x, fx, t: real;
fmin: real; {ìèíèìóì ôóíêöèè}
Xmin, Xmiddle: real; {Çíà÷åíèå àðãóìåíòà ïðè ìèíèìóìå è ñðåäíåå çíà÷åíèå àðãóìåíòà}
stop: boolean;
function f(x:real):real;
begin
f:=exp((1/3)*ln(x-2*x*x+x*x*x));
end;
function midX(var a:real; var c:real; var b:real):real;
var p1, p2:real;
begin
p1:=(b-c)*(b-c)*(f(a)-f(c))-(c-a)*(c-a)*(f(b)-f(c));
p2:=(b-c)*(f(a)-f(c))+(c-a)*(f(b)-f(c));
midX:=c+0.5*(p1/p2)
end;
BEGIN
//ClrScr;
stop:=false;
Writeln('Input accuracy eps1');
Readln(eps1);
Writeln('Input limits a, c and b (a < c < b)');
Readln(a, c, b);
y[1]:=f(a);
y[2]:=f(c);
y[3]:=f(b);
Repeat
t:=midX(a, c, b);
if t <> c then x:=t;
if t = c then x:=(a+c)/2;
fx:=f(x);
if x<c then
begin
if fx<f(c) then begin b:=c; c:=x; y[3]:=y[2]; y[2]:=fx; end;
if fx>f(c) then begin a:=x; y[1]:=fx; end;
if fx=f(c) then begin a:=x; b:=c; c:=(x+c)/2; y[1]:=fx; y[3]:=y[2]; y[2]:=f(c); end;
end;
if x>c then
begin
if fx<f(c) then begin a:=c; c:=x; y[1]:=y[2]; y[2]:=fx; end;
if fx>f(c) then begin b:=x; y[3]:=fx; end;
if fx=f(c) then begin a:=c; b:=x; c:=(x+c)/2; y[1]:=y[2]; y[3]:=fx; y[2]:=f(c); end;
end;
if abs(b-a)<eps1 then begin Xmin:=x; fmin:=fx; stop:=true; end
Until stop=true;
Writeln('Min: (',Xmin:0:16,' , ',fmin:0:16,')');
END.