function f=difftable(x,y)
%
% construct a divided difference table using the data
% stored in x and y
%
n=size(x,1);
for i=1:n
   f(i,1)=y(i);
end
for j=2:n
   for i=1:n-j+1
     f(i,j)=(f(i+1,j-1)-f(i,j-1))/(x(i+j-1)-x(i));
   end
end
