Post Reply 
(28/48/50) Lambert W Function
03-20-2023, 10:51 PM
Post: #2
RE: (28/48/50) Lambert W Function
The issue is how to accurately calculate Newton's iteration, around branch point, -1/e
I prefer solving for y = e^W(a). Its Newton's method is very simple.

x*e^x = ln(y)*y = a
f = y*ln(y) - a

y = y - f/f' = y - (y*ln(y) - a) / (ln(y)+1)
y = (y+a) / (ln(y)+1)

Around a ≈ -1/e, (y, a) are considered input, thus "exact".
They are about the same size, with opposite sign.
By Sterbenz lemma, (y+a) is exact.

e^W(-1/e) = 1/e      // a ≈ -1/e --> y ≈ +1/e

(12-30-2022 11:48 PM)Albert Chan Wrote:  ln(y)+1 = ln(e*y) = log1p(e*(y-1/e))

For accurate denominator, we need "doubled" precision for 1/e
For 12 digits, 1/e ≈ 0.367879441171 + 0.442321595524E-12

To reduce iterations, we also need good starting estimate.
Lua e^W code (0, -1 branch): https://www.hpmuseum.org/forum/thread-19...#pid167919
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(28/48/50) Lambert W Function - John Keith - 03-20-2023, 08:43 PM
RE: (28/48/50) Lambert W Function - Albert Chan - 03-20-2023 10:51 PM
RE: (28/48/50) Lambert W Function - Gil - 01-29-2024, 11:04 AM
RE: (28/48/50) Lambert W Function - Gil - 01-29-2024, 02:47 PM
RE: (28/48/50) Lambert W Function - Gil - 01-29-2024, 06:46 PM
RE: (28/48/50) Lambert W Function - Gil - 01-29-2024, 09:50 PM
RE: (28/48/50) Lambert W Function - Gil - 01-30-2024, 12:33 AM
RE: (28/48/50) Lambert W Function - Gil - 01-30-2024, 12:04 PM
RE: (28/48/50) Lambert W Function - Gil - 01-30-2024, 02:52 PM
RE: (28/48/50) Lambert W Function - Gil - 01-31-2024, 07:10 PM



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