Post Reply 
Estimate logarithm quickly
10-06-2021, 10:58 PM
Post: #7
RE: Estimate logarithm quickly
(10-06-2021 05:12 PM)Eric Rechlin Wrote:  Computing Logarithms by Integration - Richard Schwartz (17:02)

Thanks for the video. I finally "get" Doerfler's formula Smile

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

I also learned about Boole's Rule.
It is really just Richardson extrapolation, from Simpson's Rule.

CAS> S1 := [1,0,4,0,1] ./ 6
CAS> S2 := [1,4,2,4,1] ./ 12
CAS> B1 := S2 + (S2-S1)/(4^2-1)     → [7/90, 16/45, 2/15, 16/45, 7/90]
CAS> horner(B1, e^0.25) / (e-1)       → 1.00000050019 // estimated 1/ln(e), Boole's Rule

This should match extrapolation of 2 Simpson's.
Note: we work with reciprocal log, to simplify Richardson's extrapolation.

CAS> D(x) := horner([1,4,1], x^0.5)/(6*(x-1)) // Doerfler's formula, for 1/ln(x)
CAS> s1 := D(e)             → 1.00033715273
CAS> s2 := D(e^0.5)/2   → 1.00002154097
CAS> horner([1,4,2,4,1], e^0.25)/(12*(e-1))   → 1.00002154097

Note: s2 is equivalent to more messy [1,4,2,4,1] Simpson's. version.
Thus, it is a good idea to reduce log arguments, close to 1

Extrapolate for Boole's Rule result:

CAS> s2 + (s2-s1)/(4^2-1)              → 1.00000050019
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Estimate logarithm quickly - Albert Chan - 08-21-2021, 03:39 PM
RE: Estimate logarithm quickly - trojdor - 08-21-2021, 06:31 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 - 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)