lambertw, all branches
|
04-08-2023, 05:54 PM
(This post was last modified: 04-09-2023 08:31 PM by Albert Chan.)
Post: #7
|
|||
|
|||
RE: lambertw, all branches
(04-08-2023 03:21 PM)Albert Chan Wrote: The problem is Newton correction: 1/slope = x/(x+1). We fix it the same way: Patch is wrong. It get the correct result by accident. The problem is (±0) + 0 = 0, losing sign information. If h imag part = -0, x = x - h may lose x sign information. We could do x = x - (h + 0), but that is ugly. I am sick of this ±0*I, and simply flip k to avoid it. I.W(I.conj(-1e-9), 0) --> I.conj(I.W(-1e-9, -0)) We flip k to ensure x imag part always non-negative. Losing sign information now becomes an advantage. x = x - h will not generate x with imag part of -0. Only update is complex.W code, the rest remains unaffected. I am leaving 1/slope = x/(x-(-1)), but x/(x+1) will work as well. Code: function complex.W(a, k, verbal, x) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)