1) Plot the function f(x) = log(1+x)/x close to zero.
Here's the code I used.
------------------------------------------------
end = 1
x = linspace(-end, end)
y = where(x==0, 1.0, log(1+x)/x)
plot(x, y)
-------------------------------------------------
How to describe the main features of this graph and how those features relate to the loss of precision when numbers of very different magnitudes are added or subtracted?
2) How to plot the Taylor series approximation along with the graph from #1?
Taylor's Theorem : f(x) = f(0) + f'(0)*x + (f"(0)/2!)*x^2 + (f"'(0)/3!)*x^3 + ... + (f^n(0)/n!)*x^n + (f^(n+1)(z) / (n+1)!)*x^(n+1)
3) How to find how big abs(x) can be using this approximation while maintaining a relative error of less than 1 part in 10^16?