function [out,a,b] = taylor_error(N,x)
% TAYLOR_ERROR - sup norm error between exp(x) and its N-term Taylor series
%
% Input : x can be a vector of x values.
% Outputs: out = maximum (sup) of error over all x values
%          b = vector of absolute errors for each x value
%          a = vector of N-term Taylor series at each x value
% Authors: Zaven and Alex

a = 0;
for i=0:N  
   a = a + (x).^i/factorial(i);
 
end

b=abs(exp(x) - a);
out=max(b);