Program Lab8_B2;
var x, eps, korin, a, b, d: real;
function f(x: real): real;
begin
f := x - 0.785 * sqrt(1 - x * x);
end;
function fp(x: real): real;
begin
fp:= (f(x) + eps) - f(x) / eps;
end;
function fpp(x: real): real;
begin
fpp := (fp(x) / (x + eps)) - f(x) / eps;
end;
procedure nuton(x, eps: real; var korin: real);
begin
var n, i: integer;
n := 1000;
i := 1;
while abs(f(x)) > eps do
begin
x:= x - F(x) / fp(x);
if i >= n then begin
writeln('koreniv ne znaydeno');
korin:= 0; halt;
i:= i + 1;
end;
korin:= x;
end;
end;
begin
//writeln('vvedit promijok'); read(a, b);
writeln('vvedit tochnist'); readln(eps);
a := 0.5;
b := 0.7;
if f(a) * fpp(b) > 0 then begin
x := a;
end
else x := b;
nuton(x, eps, korin);
writeln('korin = ', korin);
d := f(korin);2
end.