(28/48/50) Lambert W Function
01-30-2024, 12:18 AM
Post: #35
 Albert Chan Senior Member Posts: 2,697 Joined: Jul 2018
RE: (28/48/50) Lambert W Function
(01-29-2024 09:50 PM)Gil Wrote:  for k=-1, and a=-.36787944118 (>-1/e, about -.367879441171), how do I know that formulae post 19, more accurate, will fail (at least with the code I put in my calculator) and that formulae post 18, a wee bit less accurate, will work?

They are equally accurate, if coded correctly.
They are really the same e^W formula, except we let Y = R+R*X
It is just scale and offset, convergence rate are exactly the same.

My preference is Y = (Y+A)/LOGP1((Y-R-R2)/R), because convergence is easily tested.
It is also easy to explain. Denominator is simply more accurate (LN(Y)+1)

The other version, X = (X-L+H)/L, where L = LOGP1(X), is harder to know when to stop.
Because of inaccurate X-L, X itself never really converged, only (1+X) = Y/R does.

OTTH, X formula is simpler than Y's (also, (R, R2) not used at all!)
With limited domain (A ≈ -1/e), fixed loops is simple to implement.

Quote:If yes, are there other pitfalls to look at for initial k≠{0, +-1} when "a" is near 0 or -1/e?

Yes! Only used this for k=0, or ±1 with small_imag part (k and im(a) of opposite sign)
This is because y = e^x lost branch information. Good guess is crucial to get right branch!

e^(2*k*pi*I) = cis(2*k*pi) = 1      // k is gone

What happen if k = ±1 and, k and im(a) have same sign?

x + ln(x) = lnk(a)

im(x) + arg(x) = (arg(a) + 2*k*pi) = [±2*pi .. ±3*pi]
im(x) = [±2*pi .. ±3*pi] - [0 .. ± pi] = [± pi .. ±3*pi]

Away from real line, no singularity around -1/e, easy to solve.
 « Next Oldest | Next Newest »

 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 - John Keith - 03-21-2023, 01:53 PM RE: (28/48/50) Lambert W Function - Albert Chan - 03-21-2023, 05:15 PM RE: (28/48/50) Lambert W Function - John Keith - 03-22-2023, 07:30 PM RE: (28/48/50) Lambert W Function - Albert Chan - 03-23-2023, 12:16 AM RE: (28/48/50) Lambert W Function - John Keith - 03-23-2023, 05:53 PM RE: (28/48/50) Lambert W Function - Albert Chan - 03-23-2023, 07:30 PM RE: (28/48/50) Lambert W Function - Gerald H - 03-21-2023, 06:15 AM RE: (28/48/50) Lambert W Function - John Keith - 03-22-2023, 08:55 PM RE: (28/48/50) Lambert W Function - Albert Chan - 03-23-2023, 02:56 AM RE: (28/48/50) Lambert W Function - Albert Chan - 03-26-2023, 06:43 PM RE: (28/48/50) Lambert W Function - Albert Chan - 04-02-2023, 11:12 PM RE: (28/48/50) Lambert W Function - John Keith - 04-03-2023, 07:24 PM RE: (28/48/50) Lambert W Function - Albert Chan - 04-03-2023, 08:47 PM RE: (28/48/50) Lambert W Function - John Keith - 03-27-2023, 04:45 PM RE: (28/48/50) Lambert W Function - Albert Chan - 03-27-2023, 08:57 PM RE: (28/48/50) Lambert W Function - Albert Chan - 03-31-2023, 04:06 PM RE: (28/48/50) Lambert W Function - John Keith - 03-31-2023, 06:15 PM RE: (28/48/50) Lambert W Function - Albert Chan - 03-31-2023, 07:10 PM RE: (28/48/50) Lambert W Function - Albert Chan - 03-27-2023, 11:30 PM RE: (28/48/50) Lambert W Function - Albert Chan - 03-31-2023, 10:07 PM RE: (28/48/50) Lambert W Function - Albert Chan - 04-01-2023, 12:44 PM RE: (28/48/50) Lambert W Function - John Keith - 04-01-2023, 05:36 PM RE: (28/48/50) Lambert W Function - John Keith - 04-01-2023, 05:59 PM RE: (28/48/50) Lambert W Function - Albert Chan - 04-03-2023, 10:47 PM RE: (28/48/50) Lambert W Function - Albert Chan - 04-04-2023, 01:03 AM RE: (28/48/50) Lambert W Function - John Keith - 04-04-2023, 07:09 PM RE: (28/48/50) Lambert W Function - Gil - 01-29-2024, 11:04 AM RE: (28/48/50) Lambert W Function - Albert Chan - 01-29-2024, 03:51 PM 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 - Albert Chan - 01-29-2024, 07:30 PM RE: (28/48/50) Lambert W Function - Gil - 01-29-2024, 09:50 PM RE: (28/48/50) Lambert W Function - Albert Chan - 01-30-2024 12:18 AM RE: (28/48/50) Lambert W Function - Gil - 01-30-2024, 12:33 AM RE: (28/48/50) Lambert W Function - Albert Chan - 01-30-2024, 01:09 AM RE: (28/48/50) Lambert W Function - Gil - 01-30-2024, 12:04 PM RE: (28/48/50) Lambert W Function - Albert Chan - 01-30-2024, 01:47 PM RE: (28/48/50) Lambert W Function - Gil - 01-30-2024, 02:52 PM RE: (28/48/50) Lambert W Function - Albert Chan - 01-30-2024, 04:04 PM RE: (28/48/50) Lambert W Function - Gil - 01-31-2024, 07:10 PM

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