Presto the Mathematical Magician says, quite correctly, that ln(x), the natural logarithm (to the base e=2.718...) of x, is magically well-approximated by 2047(x
1/2048 - 1). Hence logarithms can be calculated with fair accuracy using a primitive calculator that only does square roots along with basic arithmetic.
What is behind Presto's magic?
By the same token, log(x), the common (base 10) logarithm of x, may be approximated by the similar formula K(x1/2048 - 1) for a suitable value of K. For values of x between 1 and 10, explore the accuracy of this approximation, and that of similar formulas of the type K(x1/N-1) where N=2n, under the assumption that a 10-digit calculator is being used to compute the repeated square roots. What values for K and n would you recommend when a 10-digit calculator is being used?
x^k can be approximated by the following power series:
x^k=1+k*ln(x)+(k*ln(x))^2/2!+)+(k*ln(x))^3/3!+....
Assuming k<<1, from the first two terms we get:
ln(x)~1/k*(x^k-1)
therefore, the smaller is k, the better is approximation. A quick numerical check showed that 2048*(x^1/2048-1) is a better approximation than 2047*(x^1/2048-1), and 12048*(x^1/12048-1) even better.
|
Posted by Art M
on 2006-09-06 17:30:49 |