Lagrange interpolation accuracy

295 Views Asked by At

I computed cot(0.0015) as accurately as possible using the following table by a) interpolating for cot(x), b) by interpolating for cos(x) and sin(x) and using them to calculate cot(x).

So why using cos(x) and sin (x) is more accurate that using cot (x)??enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

Close to $x=0$, the Taylor series is $$\cot(x)=\frac{1}{x}-\frac{x}{3}-\frac{x^3}{45}+O\left(x^4\right)$$ which is not very well conditioned so close to zero.

May be you could try to interpolate $x \cot(x)$ and, I hope, get the same accuracy as with $\sin(x)$ and $\cos(x)$ which are very well conditioned even very close to zero.