.


           


begin

fx := x*x*x - 2*x*x - 4*x - 7

end;

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

{ 1- }

{ derivative - }

Function derivat1(x0, eps : real) : real;

var

dx, dy, dy2 : real;

begin

dx := 1;

repeat

dx := dx/2;

dy := fx(x0 + dx/2) - fx(x0 - dx/2);

dy2 := fx(5*x0/4 + dx) - 2*fx(5*x0/4);

dy2 := dy2 + fx(5*x0/4 - dx)

until abs(dy2/(2*dx)) < eps;

derivat1 := dy/dx

end;

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

{ - - }

Function t(eps : real) : integer;

var

k : integer;

begin

k := -1;

repeat

eps := eps*10;

k := k + 1

until eps > 1;

t := k

end;

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

{ }

{ }

Procedure minimum(a, b, eps : real; var min : real);

var

d : real;

begin

a := a - eps;

b := b + eps;

repeat

a := a + eps;

b := b - eps;

min := abs(derivat1(a, eps));

d := abs(derivat1(b, eps));

if min > d then min := d

until min <> 0

end;

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

{ }

Procedure chord(a, b, eps, min : real; var

x : real);

var

x1 : real;

begin

x1 := a;

repeat

x := x1 - ((b - x1)*fx(x1))/(fx(b) - fx(x1));

x1 := x

until abs(fx(x))/min < eps

end;

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