.


           


write(' '); readln(x0);

write(' ');

readln(eps);

dy := derivat2(x0, eps);

write(' ', x0:6:t(eps));

writeln(' ', dy:6:t(eps));

writeln(' ', eps:1:t(eps))

end.

3

{ : , . }

{ }

Program Case_method;

uses WinCrt;

var

a, b, x, eps : real;

k : integer;

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

{ }

Function fx(x : real) : real;

begin

fx := x*sin(x) - 0.5

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;

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

{ 1- }

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*dy2*fx(x0))/(2*dx)) < eps;

derivat1 := dy/dx

end;

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

{ 2- }

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

var

dx, dy, dy3 : real;

begin

dx := 1;

repeat

dx := dx/2;

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

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