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?
Charlie has already given the solution for log(x) but without derivation and Art M has derived it for ln(x), so I thought I could derive the formula for log(x). Nothing original here, just for the sake of completeness.
Use abbreviations a:=10 and log(x) := logarithm of x to base 10 = ln(x)/ln(10) = ln(x)/ln(a). Following Art M's method of power series expansion, you'll see that
x^(m/ln(a)) ~ 1+m*ln(x)/ln(a) for "small" m>0.
No need to use limit symbols, we are doing proper numerical math here, where it is custom to use "~" when we mean "almost equal" ;-) Follows
log(x)=ln(x)/ln(a) ~ 1/m * ( x^(m/ln(a)) -1)
Substitute n:=ln(a)/m you get
log(x) ~ n/ln(a) * ( x^(1/n) - 1 ).
For n=2048, k:=890 is a good approximation for n/ln(a)=2048/ln(10). Therefore I'd suggest the appoximation
log(x) ~ 890*(x^(1/2048)-1)
Maybe 889 is even better, don't know. After all we have cut the power series expansion after the linear term and 1/2048 is not equal to 0. Don't know about the 10-digit thing though, that is getting too numerical for me.
|
Posted by JLo
on 2006-09-10 13:51:06 |