function [value] = hw5afn(m,x,y,z)

   value = 0;
   for i = 1:m
      theprod = 1;
      for j = 1:m
         if j ~= i
            theprod = theprod*(z-x(j))/(x(i)-x(j));
         end
      end
      value = value+y(i)*theprod;
   end

end
