uses crt;
function F(x: real): real;
begin
F := (x - 3) * cos(x) - 1; { функция }
end;
function F1(x: real): real;
begin
F1 := cos(x) - (x - 3) * sin(x); { первая производная }
end;
var
x, eps, b: real;
begin
clrscr;
{ простой метод Ньютона }
repeat
write('Vvedite nachalnoe priblizenie [-2;-1] x=');
readln(x);
until (x >= -2) and (x < -1);
eps := 0.001;
repeat
b := x;
x := b - F(b) / F1(b);
until abs(x - b) < eps;
write('X=', x:0:5);
readln
end.