ニュートン法
program newton2(input,output);
const delta=1E-10;
var k,i:integer;{$B#k$O2?2s7W;;$r$7$?$+%+%&%s%?!<(B}
x,d:real;{$B#x$O=PH/CM$H$9$k(B}
function f(x:real):real;
begin
f:=((((x-7)*x+16)*x-8)*x-16)*x+16
end; { f }
function f1(x:real):real;
begin
f1:=(((5*x-28)*x+48)*x-16)*x-16;
end; { f1 }
begin
k:=0;
for i:=-10 to 20 do
begin
x:=i;
if x<>2 then begin
repeat
d:= -f(x)/f1(x);
x:=x+d;
k:=k+1
until abs(f(x)) < delta;
end;
writeln('$B=PH/CM(B:',i:3,' ','$B7W;;2s?t(B:':10,k:3,' ',x:15);
k:=0;
end
end.
Last modified: 2000$BG/(B1$B7n(B20$BF|(B 13:51