f(x) = (exp(x)-1)/x; g(x) = (exp(x)-1)/log(exp(x))
Analytically, f(x) = g(x).
When x is approaching to 0, both f(x) and g(x) are approaching to 1. However, g(x) works better than f(x).
% Compute y against x
for k = 1:15 x(k) = 10^(-k); f(k) =(exp(x(k))-1)/x(k); De(k) = log(exp(x(k))); g(k)= (exp(x(k))-1)/De(k);end% Plot y
plot(1:15,f,'r',1:15,g,'b');
f(x) actually diverges when x approaches to 0.But shouldn't them be the same??
Best Answer