.


- 2


begin

x1 := f1(a, b); y1 := func(x1);

x2 := f2(a, b); y2 := func(x2);

while abs(b - a) > e do

if y1<y2 then

begin

b := x2; x2 := x1; y2 := y1;

x1 := f1(a, b); y1 := func(x1)

end

else

begin

a := x1; x1 := x2; y1 := y2;

x2 := f2(a, b); y2 := func(x2)

end;

x := (a + b)/2

end;

{----------------------------------------------------------------------------------------}

{ }

begin

write(' '); readln(a);

a1 := a;

write(' '); readln(b);

b1 := b;

write(' ');readln(e);

mingold(a, b, e, x);

write(' (');

write(a1:1:0, '; ', b1:2:0, ')');

writeln(' x = ', x:6:6);

writeln(' ',e:2:6)

end.

5

, .