function F = divdiff(x,f)

%
% Compute Newton's Divided Difference Table
%

n=length(x);

F      = zeros(n,n);
F(:,1) = reshape(f,n,1);


for i=1:(n-1)
  for j=1:i
    F(i+1,j+1) = (F(i+1,j)-F(i,j)) / (x(i+1)-x(i-j+1));
  end
end