Estimate logarithm quickly
08-21-2021, 03:39 PM
Post: #1
 Albert Chan Senior Member Posts: 2,516 Joined: Jul 2018
Estimate logarithm quickly
Estimate logorithm quickly, with tiny errors.
source: Dead Reckoning: Calculating without Instruments, p. 123

n*n = (n+x) * (n-x) * (n*n/(n*n-x*x))

2*ln(n) = ln(n+x) + ln(n-x) + ln(n*n/(n*n-x*x))

ln(n*n/(n*n-x*x)) = ln(1-x*x/(n*n-x*x)) = 2*atanh(x*x/(2*n*n-x*x))

Let a = ln(n+x), b = ln(n-x), c = n/x, and halved both side.

ln(n) = (a+b)/2 + atanh(1/(2*c*c-1))

atanh(1/(2*c*c-1)) > atanh(1/c) / (2c) = (a-b)/2 / (2c)

ln(n) > (a+b)/2 + (a-b)/2 / (2c)

If we divide both side by ln(base), inequality still holds
We can thus generalize for log of any base.

Example, n=3, x=1

a = log(3+1) = 2*log(2)
b = log(3-1) = log(2)
c = 3/1 = 3

log(3) > 3*log(2)/2 + (log(2)/2) / (2*3) = 19/12 * log(2)
log(3)/log(2) > 19/12

Example, n=3, x=1.5

a = log(3+1.5) = 2*log(3)-log(2)
b = log(3-1.5) = log(3)-log(2)
c = 3/1.5 = 2

log(3) > (3*log(3)-2*log(2))/2 + (log(3))/2 / (2*2) = -log(2) + 13/8*log(3)
log(2) > 5/8*log(3)
log(3)/log(2) < 8/5

19/12 < log2(3) < 8/5

Both extreme happened to be convergents of log2(3)

C:\> spigot -C log(3)/log(2) | head
1/1
2/1
3/2
8/5
19/12
65/41
84/53
485/306
1054/665
24727/15601
 « Next Oldest | Next Newest »

 Messages In This Thread Estimate logarithm quickly - Albert Chan - 08-21-2021 03:39 PM RE: Estimate logarithm quickly - Albert Chan - 08-21-2021, 03:58 PM RE: Estimate logarithm quickly - Albert Chan - 08-21-2021, 05:41 PM RE: Estimate logarithm quickly - trojdor - 08-21-2021, 06:31 PM RE: Estimate logarithm quickly - Albert Chan - 08-21-2021, 11:42 PM RE: Estimate logarithm quickly - EdS2 - 08-23-2021, 06:44 AM RE: Estimate logarithm quickly - Albert Chan - 10-06-2021, 10:58 PM RE: Estimate logarithm quickly - Albert Chan - 10-18-2021, 01:02 PM RE: Estimate logarithm quickly - Albert Chan - 11-20-2021, 02:02 PM RE: Estimate logarithm quickly - Albert Chan - 11-22-2021, 01:49 AM RE: Estimate logarithm quickly - Albert Chan - 11-23-2021, 09:01 PM RE: Estimate logarithm quickly - Albert Chan - 04-26-2022, 05:01 PM RE: Estimate logarithm quickly - Albert Chan - 11-26-2021, 06:24 PM RE: Estimate logarithm quickly - Csaba Tizedes - 10-07-2021, 06:25 PM RE: Estimate logarithm quickly - Albert Chan - 10-22-2021, 02:15 PM RE: Estimate logarithm quickly - Albert Chan - 04-27-2022, 10:02 PM RE: Estimate logarithm quickly - klesl - 04-26-2022, 05:52 PM RE: Estimate logarithm quickly - vaklaff - 04-28-2022, 04:33 PM RE: Estimate logarithm quickly - klesl - 04-28-2022, 05:02 PM

User(s) browsing this thread: 1 Guest(s)