Find a good strategy to compute$f(x) = e^x −\cos x − \sin x$ for $x$ near $0$ Find a good strategy to compute $f(x) = e^x − \cos x − \sin x$ for $x$ near 0.
In five-decimal-digit arithmetic, compute $f(0.1)$ using the straightforward method
and your better strategy, and compare the difference. (Hint: The computer can only
store numbers with five decimal digits at any step.)
so I know using the straightforward strategy that:
$f(0.1) = e^{(0.1)} - \cos(0.1) - \sin(0.1)$ (since the computer can only store 5 decimal digits at any step ->
$= 1.10517 - 0.99500 - 0.09998$
$= 0.01019 $
so I think my teacher mentioned something in class saying we should use either taylor or macclaurin series? Can someone walk me through how exactly I would do that for my "better" strategy?

With Taylor series you have
$$\begin{align} f(x) &= \left(1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \frac{x^4}{24} + \frac{x^5}{120} + \cdots \right)\\
&-\left(1 - \frac{x^2}{2} + \frac{x^4}{24} + \cdots\right)\\
&- \left(x - \frac{x^3}{6} + \frac{x^5}{120} + \cdots\right)\end{align}$$
Now, notice that the terms after $x^5$ were deliberately left out because they won't be significant if your computer can store only $5$ decimal places, as all these terms would be at least in the $6$th decimal place ($0.1^6, 0.1^7, \cdots$).
So you may as well leave those terms out and approximate $f$ as
$$$$\begin{align} f(x) &\approx \left(1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \frac{x^4}{24} + \frac{x^5}{120} \right)\\
&-\left(1 - \frac{x^2}{2} + \frac{x^4}{24} \right)\\
&- \left(x - \frac{x^3}{6} + \frac{x^5}{120} \right)\end{align}$$$$
