WOLFRAM NOTEBOOK

WOLFRAM|DEMONSTRATIONS PROJECT

Approximating the Logarithm of Any Base with Continued Fractions

number of terms n
20
base of logarithm b
87
5
number x
21
5
n = 20
absolute error = 4.102144927×
-17
10
log
10
(relative error) = -16.08803678
convergent for
log
87
5
(
21
5
) =
1
1+
1
1+
1
103+
1
1+
1
3+
1
6+
1
3+
1
3+
1
1+
1
5+
1
1+
1
3+
1
1+
1
39+
1
5+
1
3+
1
1+
1
1+
1
1+
1
1+0
=
4456315661
8870092800
Continued fractions provide a very effective toolset for approximating functions. Usually the continued fraction expansion of a function approximates the function better than its Taylor or Fourier series. This Demonstration shows the high quality of a continued fraction expansion to approximate the logarithm to an arbitrary real base greater than 1. It uses the Shanks method and is very efficient due to its adaptability for high-speed numerical computer code.
The logarithm base
b
must be larger than 1, and the number
x
for which the log is computed must be larger than the logarithm base, so
1<b<x
must hold.
To make this Demonstration easier to use, the sliders only increment in multiples of 1/10, but Shanks' method is not limited to rationals.
Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.