n=12;x=rand(n,1);y=x.*x.*x;z=zeros(n,n);t=0.2;
for i=1:n;z(i,1)=y(i);end
for j=2:n
  for i=1:n+1-j
     z(i,j)=(z(i+1,j-1)-z(i,j-1))/(x(i+j-1)-x(i));
  end
end
p=z(1,n);
for i=1:(n-1);p=p*(t-x(n-i))+z(1,n-i);end
