Post Reply 
lambertw, all branches
04-08-2023, 03:21 PM (This post was last modified: 04-15-2023 01:56 PM by Albert Chan.)
Post: #6
RE: lambertw, all branches
(04-07-2023 07:54 PM)Albert Chan Wrote:  It is just here, "equivalent" may mean a difference of +0*I vs -0*I

Just to show how sensitive this ±0*I business is ...

lua> I.W(-1e-9,0,true)
(-1.0000000005000001e-009+0*I)
(-1.000000001e-009+0*I)
(-1.0000000010000002e-009+0*I)

lua> I.W(I.conj(-1e-9),0,true)
(-1.0000000005000001e-009+0*I)
(-1.000000001e-009+6.283185316604365e-009*I)
(3.1450880362038825e-008-4.729032266472273e-010*I)
(-7.848729544901978e-008-9.717506161329017e-008*I)
...

2nd should be complex conjugate of first. W(-1E-9 ± 0*I) ≈ -1.000000001E-9 ± 0*I
Imaginary part sign of (a, W0(a)) should match.

At first, I thought it is also a case of bad W guess.
To keep x imag part intact, x+1 should be written as x-(-1)
I added +0 to correction too, just to be sure. Technically, it is not needed.

Signed zero: (±0) - 0 = (±0)      ,       (±0) + 0 = 0

Code:
< function complex.log1p(x) local y = x+1; return I.log(y) - (y-1-x)/y end
> function complex.log1p(x) local y = x-(-1); return I.log(y) - ((y-1-x)/y+0) end

This get W0 guess phase correct, however iterations still diverges.
It is interesting Newton's 1st iteration essentially undo log1p patches.

lua> I.W(I.conj(-1e-9),0,true)
(-1.0000000005000001e-009-0*I)
(-1.000000001e-009+0*I)
(-1.0000000010000002e-009+6.283185319745956e-009*I)
(3.145088037733907e-008-4.729032324603788e-010*I)
...

The problem is Newton correction: 1/slope = x/(x+1). We fix it the same way:

Code:
< h = x/(x+1) * s(x)
> h = x/(x-(-1)) * s(x)

lua> I.W(I.conj(-1e-9),0,true)
(-1.0000000005000001e-009-0*I)
(-1.000000001e-009-0*I)
(-1.0000000010000002e-009-0*I)

I had applied above 2 patches to previous post.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
lambertw, all branches - Albert Chan - 04-07-2023, 01:24 PM
RE: lambertw, all branches - Albert Chan - 04-07-2023, 02:47 PM
RE: lambertw, all branches - Albert Chan - 04-19-2023, 01:30 AM
RE: lambertw, all branches - pier4r - 04-07-2023, 06:04 PM
RE: lambertw, all branches - Albert Chan - 04-07-2023, 07:54 PM
RE: lambertw, all branches - Albert Chan - 04-08-2023 03:21 PM
RE: lambertw, all branches - Albert Chan - 04-08-2023, 05:54 PM
RE: lambertw, all branches - Albert Chan - 04-07-2023, 08:40 PM
RE: lambertw, all branches - Albert Chan - 04-09-2023, 03:59 AM
RE: lambertw, all branches - Albert Chan - 04-09-2023, 04:36 PM
RE: lambertw, all branches - Albert Chan - 04-10-2023, 04:44 PM
RE: lambertw, all branches - Albert Chan - 04-10-2023, 06:47 PM
RE: lambertw, all branches - Albert Chan - 04-13-2023, 03:03 PM
RE: lambertw, all branches - floppy - 04-13-2023, 04:14 PM
RE: lambertw, all branches - Albert Chan - 04-23-2023, 02:49 PM
RE: lambertw, all branches - Albert Chan - 04-23-2023, 04:40 PM
RE: lambertw, all branches - Albert Chan - 01-19-2024, 04:14 PM
RE: lambertw, all branches - Albert Chan - 01-20-2024, 04:48 PM
RE: lambertw, all branches - Gil - 01-20-2024, 10:52 PM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 01:14 AM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 01:54 AM
RE: lambertw, all branches - Gil - 01-21-2024, 01:53 PM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 04:19 PM
RE: lambertw, all branches - Gil - 01-21-2024, 04:35 PM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 06:03 PM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 07:01 PM
RE: lambertw, all branches - Gil - 01-21-2024, 07:30 PM
RE: lambertw, all branches - Gil - 01-21-2024, 08:39 PM
RE: lambertw, all branches - Albert Chan - 01-21-2024, 10:06 PM
RE: lambertw, all branches - Gil - 01-21-2024, 09:51 PM
RE: lambertw, all branches - Gil - 01-21-2024, 10:56 PM
RE: lambertw, all branches - Albert Chan - 01-22-2024, 01:34 AM
RE: lambertw, all branches - Gil - 01-21-2024, 11:15 PM
RE: lambertw, all branches - Gil - 01-22-2024, 06:09 PM
RE: lambertw, all branches - Albert Chan - 01-22-2024, 07:29 PM
RE: lambertw, all branches - Gil - 01-22-2024, 11:33 PM
RE: lambertw, all branches - Albert Chan - 01-23-2024, 02:32 AM
RE: lambertw, all branches - Gil - 01-23-2024, 02:35 PM
RE: lambertw, all branches - Albert Chan - 01-23-2024, 03:54 PM
RE: lambertw, all branches - Gil - 01-23-2024, 04:57 PM
RE: lambertw, all branches - Albert Chan - 01-23-2024, 06:17 PM
RE: lambertw, all branches - Gil - 01-23-2024, 06:44 PM
RE: lambertw, all branches - Gil - 01-23-2024, 11:00 PM
RE: lambertw, all branches - Gil - 01-24-2024, 03:18 PM
RE: lambertw, all branches - Albert Chan - 01-24-2024, 08:53 PM
RE: lambertw, all branches - Gil - 01-25-2024, 12:37 AM
RE: lambertw, all branches - Gil - 01-25-2024, 01:10 AM
RE: lambertw, all branches - Gil - 01-25-2024, 03:04 AM
RE: lambertw, all branches - Albert Chan - 01-25-2024, 07:02 AM
RE: lambertw, all branches - Gil - 01-25-2024, 10:09 AM
RE: lambertw, all branches - Albert Chan - 01-25-2024, 04:13 PM
RE: lambertw, all branches - Gil - 01-25-2024, 05:14 PM
RE: lambertw, all branches - Albert Chan - 01-25-2024, 05:57 PM
RE: lambertw, all branches - Gil - 01-25-2024, 06:19 PM
RE: lambertw, all branches - Albert Chan - 01-28-2024, 11:18 PM
RE: lambertw, all branches - Albert Chan - 02-01-2024, 02:17 AM
RE: lambertw, all branches - Albert Chan - 02-01-2024, 04:16 PM
RE: lambertw, all branches - Albert Chan - 02-02-2024, 11:49 AM



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