.


- 5


}

{ approach - }

Procedure approach(a, b : real; n : integer;

var x2, y2 : real);

begin

x2 := a + (b - a)*fib(n-1)/fib(n);

y2 := func(x2)

end;

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

{ }

begin

write(' '); readln(a);

aa := a;

write(' '); readln(b);

bb := b;

write(' '); readln(e); n := 3;

approach(a, b, n, x2, y2);

while abs(b - a) > e do

begin

x1 := a + b - x2; y1 := func(x1);

if (x2 > x1) and (y2 > y1)

then

begin

n := n + 1;

approach(a, b, n, x2, y2);

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

end;

if (x2 <= x1) and (y2 > y1)

then

begin

n := n + 1;

approach(a, b, n, x2, y2);

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

end;

if (x2 > x1) and (y2 < y1)

then

begin

n := n + 1;

approach(a, b, n, x2, y2);

a := x1; goto 1

end;

if (x2 <= x1) and (y2 <= y1)

then

begin

n := n + 1;

approach(a, b, n, x2, y2);

b := x1; goto 1

end;

n := n + 1;

approach(a, b, n, x2, y2);

1: end;

x := (a + b)/2;

write('. (');