function y = MyExp4(x)
%
% Pre:
%    x: a vector.
%
% Post:
%    y: a vector the same shape as x with the property that
%       y(i) is a Taylor approximation to exp(x(i)).
% 
   y = zeros(size(x));
   term = ones(size(x));
   k = 0;
   while any(abs(term) > eps*abs(y))
      y = y + term;
      k = k+1;
      term = x.*term/k;
   end
