lambertw, all branches
|
01-21-2024, 10:06 PM
Post: #30
|
|||
|
|||
RE: lambertw, all branches
(01-21-2024 08:39 PM)Gil Wrote: Suppose that k=0, s=(+1.E-100-i.0000000001). You misread W0 guess formula: < if k==0 then x = I.abs(a+1)<.6 and T/2 or I.log1p(a) end BTW, why did you pick this? The other version so much simpler! > if k==0 then x = I.log1p(2*a)/2 end" Quote:Then initial xo = T/2. For k=0, I.W code assumed a imag part positive (conj to positive if not true) Python code does not do flips, perhaps you should use that as guide. Python version (no flip arguments, no signed zero): T = mpc(0,2*k*pi+arg(a)) = mpc(0, arg(a)) ≈ -pi/2*I T/2 ≈ -pi/4*I Of course, this is not applicable for x guess. Quote:for the other case k=0, a=(-.1,+i×1.E-100), Same issue, abs(a+1), not abs(a) T = mpc(0,2*k*pi+arg(a)) = mpc(0, arg(a)) ≈ pi*I T/2 ≈ pi/2*I Again, this is not applicable for x guess. To experiment, I patched I.W to allow user supplied guess. I don't see problem with log1p(a) lua> a = I(-.1, 1e-100) lua> I.W(a, 0, I.log1p(a)) (-0.1053605156578263+1.1111111111111111e-100*I) (-0.11161906744205385+1.1848854610650873e-100*I) (-0.11183232962808998+1.187433773120638e-100*I) (-0.11183255915869776+1.1874365171431567e-100*I) (-0.11183255915896298+1.1874365171463274e-100*I) (-0.11183255915896298+1.2591382437197292e-100*I) As expected, I.log1p(2a)/2 ≈ a-a*a is better, matching W0(a) taylor series. lua> I.W(a, 0, I.log1p(2*a)/2) (-0.11157177565710488+1.25e-100*I) (-0.1118322166456466+1.2532842987580516e-100*I) (-0.11183255915837244+1.2532886205550325e-100*I) (-0.11183255915896304+1.2532886205624847e-100*I) (-0.11183255915896297+1.259138243719729e-100*I) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)