Tuesday, May 30, 2017

algebra precalculus - How to find logx close to exact value in two digits with these methods?


I'm trying to find the result of logx (base 10) close to exact value in two digits with these methods:


The methods below are doing by hand. I appreciate you all who already give answers for computer method.


As suggested by Praktik Deoghare's answer



If number N (base 10) is n-digit then n1log10(N)<n

Then logarithm can be approximated using log10(N)n1+N10n10n1
Logarithm maps numbers from 10 to 100 in the range 1 to 2 so log of numbers near 50 is about 1.5. But this is only a linear approximation, good for mental calculation and toy projects but not that good for serious research.




This method is cool for me, but it's nearly close to exact value. log10(53) is 1.7 and with that method results 1.58.


As suggested by Pedro Tamaroff's answer



One can get very good approximations by using 12log|1+x1x|=x+x33+x55+

Say you want to get log3. Then take x=1/2. Then you get log32(12+124+1140)=1.0976190
The real value is log31.098065476



This one is also cool for me, but it's to find natural logarithm, not base-10 logarithm.


As suggested by Kaleb's answer



This can be done by recourse to Taylor series. For ln(x) centered at 1, i.e. where 0<x2: ln(x)=n=1(x1)nn=(x1)12(x1)2+13(x1)3+14(x1)4+




The method is for calculating ln(x), not logx. I don't know the Taylor series for calculate logx, especially when to find log result close to exact value in two digits (with similar method).


As suggested by Glenn's answer



The Wikipedia article "Generalized continued fraction" has a Khovanskiĭ-based algorithm that differs only in substituting x/y for z, and showing an intermediate step: log(1+xy)=xy+1x2+1x3y+2x2+2x5y+3x2+



This method is very slow for me. When I stop at 3y, the result (log calculation) is still far from the exact value.


Anyone who can improve all of the above methods so I can precisely get log result close to exact value in two digits?


Answer



Listing a few tricks that work for mental arithmetic. Mostly to get the OP to comment, whether this is at all what they expect. I write log for log10 to save a few keystrokes.



You need to memorize a few logarithms and play with those. We all have seen log20.30103 enough many times to have memorized it. Consequently by mental arithmetic we get for example the following log4=2log20.602,log5=log(10/2)0.699,log1.6=log(24/10)0.204,log1.024=log(210)30.0103.

Using these is based on spotting numerical near matches.


You should also be aware of the first order Taylor series approximation log(1+x)xln10x2.30.434x,

which implies (plug in x=0.01) that if you change the value of x by 1 per cent, then its logarithm changes by approximately 0.0043.


As an example let's do log53 and log7. Here x=53 is 6% larger than 50, so a first order approximation would be log53log50+60.0043=log(102/2)+60.0043420.30103+0.02581.725.

With 7 we can spot that 72=49 is 2% less than 50, so log7=12log4912(20.30120.0043)1.6902=0.845.
Here the third decimal of log53 is off by one, but log7 has three correct digits - both well within your desired accuracy.


No comments:

Post a Comment

analysis - Injection, making bijection

I have injection f:AB and I want to get bijection. Can I just resting codomain to f(A)? I know that every function i...