Find the number of points necessary to interpolate $\cos(x)$ linearly with an absolute error that is $< 5*10^{-7}$

145 Views Asked by At

It is necessary to build a table of values for the function $f(x) = \cos(x)$ such that the linear interpolation for every value $x \in [0,\pi]$ has an absolute error that is inferior to $5\cdot 10^{-7}$. Knowing that the values on the table are equally spaced and rounded to 3 decimal places, what should be the least number of entries on the table?

If it wasn't for the bolded part I'd just do

$$\frac{(x_1-x_0)^2}{8}\max_{[x_0,x_1]}{|f''(x)|} < 5\cdot 10^{-7}$$

And solve for h, where $h = x_1-x_0$, and then do $\pi/h$. The problem is that rounding error. How do I add it to this?