Estimate logarithm quickly
11-20-2021, 02:02 PM
Post: #11
 Albert Chan Senior Member Posts: 2,516 Joined: Jul 2018
RE: Estimate logarithm quickly
(10-06-2021 10:58 PM)Albert Chan Wrote:  Thanks for the video. I finally "get" Doerfler's formula

ln(n) = (n-1) / ∫(n^t, t, 0, 1) ≈ (n-1) / ((1 + 4*√n + n)/6) // Simpson's Rule.

∫(n^t, t, 0, 1) = ∫(e^(t*ln(n)), t, 0, 1) = ∫(e^x, x, 0, ln(n)) / ln(n) = (n-1) / ln(n)

With exponential function, its derivative, (e^x)' = e^x, also grow exponentially.
Any integrand polynomial fit that included end-points will over-estimate integral result.
(Unless n=1, e^(t*ln(n)) = e^0 = 1, no longer exponential)

Because integral is in the denominator, |ln(n)| is under-estimated.
(we compare absolute value, to cover cases when 0 < n < 1)

|ln(n)| |n-1| / ((1 + 4*√n + n)/6) // Simpson's Rule

Error = 0 when n=1, and increases when n is further away from 1.
Example, ln(√3) will underestimate more than ln(√2)

ln(3)/ln(2)
= ln(√3)/ln(√2)
> (6*(√3-1)/(4*√(√3) + √3+1)) / (6*(√2-1)/(4*√(√2) + √2+1))
≈ 1.58492 ﻿ ﻿ ﻿ ﻿ ﻿ ﻿

ln(3)/ln(2) = 1.58496..., inequality holds, as expected
 « 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)