SICP Exercise 3.65 natural logarithm of 2

Exercise 3.65.  Use the series

to compute three sequences of approximations to the natural logarithm of 2, in the same way we did above for . How rapidly do these sequences converge?

SOLUTION

As we can see from the results below, the rate of convergence increases dramatically with Euler transforms and tableau.

I ran multiple tests on the un-accelerated series. Even with 10000 terms, the value of ln(2) computed was 0.6930971830599583 whereas the desired value is 0.69314718056. The difference is 0.0000499975.

Euler acceleration is much faster and gets very close to the desired value in 5000
steps. The value after combining 5000 terms is 0.6931471805589525.

But by using tableau acceleration, we reach 0.6931471805599454 just 10 steps!

The code and tests are here.

Comments

Popular posts from this blog

SICP Exercise 2.56 differentiation rule

SICP Exercise 1.28 (Miller-Rabin Test)

SICP Exercise 4.18 a alternative strategy for interpreting internal definitions