.


- 5


Procedure half(a, b, e : real; var x, d : real);

var

c : real;

begin

while abs(b - a) > e do

begin

c := (a + b)/2;

if fx(a)*fx(c) < 0 then b := c else

a := c

end;

x := (a + b)/2;

d := abs(b - a)/2

end;

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

begin

write(' '); readln(a);

write(' '); readln(b);

write(' '); readln(h);

write(' '); readln(e);

k := 0; x1 := a; x2 := x1 + h;

y1 := fx(x1);

while x2 <= b do

begin

y2 := fx(x2);

if y1*y2 < 0

then

begin

k := k + 1;

half(x1, x2, e, x, d);

write(k,'- ', x:6:6);

writeln(' ', d:2:10)

end;

x1 := x2; x2 := x1 + h; y1 := y2

end

end.