unit Unit2;
interface
procedure POLCOE(X, Y:array of real; N:integer; var COF:array of real);
implementation
procedure POLCOE(X, Y:array of real; N:integer; var COF:array of real);
var
S:array[0..15] of real;
I,J,K:integer; PHI,FF,B:real;
begin
For I:=1 To N do
begin
S[I]:=0;
COF[I]:=0;
end;
S[N]:=-X[1];
For I:=2 To N do
begin
For J:=N + 1 - I To N - 1 do
S[J]:=S[J] - X[I] * S[J + 1];
S[N]:=S[N] - X[I];
end;
For J:=1 To N do
begin
PHI:=N;
For K:=N - 1 DownTo 1 do
PHI:=K * S[K + 1] + X[J] * PHI;
FF:=Y[J] / PHI;
B:=1;
For K:=N DownTo 1 do
begin
COF[K]:=COF[K] + B * FF;
B:=S[K] + X[J] * B;
end;
end;
end;
end.