function Sep9()


function w = BaryWeights(x)
% x is a column n-vector with x(1) < ... < x(n)
% w is a column n-vector with 
%    w(j) =  (x(j)-x(1))*..*(x(j)-x(j-1))(x(j)-x(j+1))*...*(x(j)-x(n)
n = length(x);
for j=1:n
    w(j) = prod(x(j)-x([1:j-1 j+1:n]))
end

  function zVals = LagrangeEval(u,w,x,y)
% u is a column m-vector
% w,x, and y are column n-vectors and w = BaryWeights(x).
% zVals is a column m-vector with zVals(i) = p(u(i)) where
%   p(z) = y(1)*w(1)/(z-x(1)) + ... + y(n)*w(n)/(z-x(n))
% Assume that no u and x have no common values

m = length(u);
zVals = zeros(m,1);




