Floating point approximations to two trigonometric functions

Question Q10.1.4

The functions $f(x) = (1-\cos^2x)/x^2$ and $g(x) = \sin^2x / x^2$ are mathematically indistinguishable, but plotted in the region $-0.001 \le x \le 0.001$ show a significant difference. Explain the origin of this difference.


Solution Q10.1.4