procedure cheby(x :do
uble;
y: array ofdo
uble;
nC,n : integer;
var r : array ofdo
uble);
var i,j,k : integer;
s,v : array[0..20-1] ofdo
uble;
x0 :do
uble;
begin
x0 := 2;
if x0 <> x then
begin
x0 := x;
s[0]:= 1.0;
s[1]:= x;
for i := 2 to 20 -1do
s := 2*x*s[i-1] - s[i-2];
v[0] := 0.0;
// T0' = 0 v[1] := 1.0;
// T1' = 1 for i:=2 to 20 -1do
v := 2*x*v[i-1] + 2*s[i-1] - v[i-2];
end;
for i:=0 to nC -1do
begin
// k := i+nC, r=r[k] = 0;;?? k:= i +nC;
if r[k] = 0.0 then
r:= 1.0 else
r:= 0.0;
for j:= 0 to n -1 do
begin
r :=r+ s[j] * y[i*n+j];
r[k] :=r[k]+ v[j] * y[i*n+j];
end;
end;
end;