How to find the value of a function correct to $n$ decimal places as efficiently as possible?
For example, how to find $\sin(1)$ correct to six decimal places as efficiently as possible?
I computed $\sin(1)$ correct to six decimal places as follows:
$$|\sin(1) - (1 - \frac{1}{3!} + \frac{1}{5!} - \frac{1}{7!} + \frac{1}{9!} - \frac{1}{11!})| < \frac{1}{(2 \times 6 + 1)!} \fallingdotseq 1.6059 \times10^{-10}.$$
$$1 = 1.000000000.$$
$$-\frac{1}{3!} \fallingdotseq -0.166666667.$$
$$\frac{1}{5!} \fallingdotseq 0.008333333.$$
$$-\frac{1}{7!} \fallingdotseq -0.000198413.$$
$$\frac{1}{9!} \fallingdotseq 0.000002756.$$
$$-\frac{1}{11!} \fallingdotseq -0.000000025.$$
$$1 - \frac{1}{3!} + \frac{1}{5!} - \frac{1}{7!} + \frac{1}{9!} - \frac{1}{11!} \fallingdotseq 0.841470984.$$
$$|0.841470984 - (1 - \frac{1}{3!} + \frac{1}{5!} - \frac{1}{7!} + \frac{1}{9!} - \frac{1}{11!})| \leq 6 \times (5 \times 10^{-10}) = 30 \times 10^{-10}.$$
So,
$$|\sin(1) - 0.841470984| < 1.6059 \times10^{-10} + 30 \times 10^{-10} < 100 \times 10^{-10} = 10^{-8}.$$
So,
$$0.841470974 < \sin(1) < 0.841470994.$$
So, the answer is $\sin(1) \fallingdotseq 0.841470$.
By the way, how to find the value of $1 + \frac{1}{2} + \frac{1}{4} + \frac{1}{8} + \frac{1}{16} + \cdots$ correct to six decimal places in a similar way?
I guess we cannot compute the value of $1 + \frac{1}{2} + \frac{1}{4} + \frac{1}{8} + \frac{1}{16} + \cdots$ correct to six decimal places in a similar way.