.


           

,


end;

Monte_Karlo, , .

.

7



,

(P) R .







43. .

{ }

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;

44. .

{ 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;

45. .

{ }

{ }

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;

46. , .

{ - - }

Function t(eps : real) : integer;