lambertw, all branches
|
04-10-2023, 04:44 PM
Post: #10
|
|||
|
|||
RE: lambertw, all branches
(04-09-2023 03:59 AM)Albert Chan Wrote: [*] if |Im(x)| < pi, we are on W branch 0, or branch ±1 with small imag part. Another way to look at this, if above is true, we can simplify f: < f = x - (ln(a) - ln(x)) - 2*k*pi*i > f = x - ln(a/x) f general form has issues with catastrophic cancellation, simplifed f is much better. The problem is we don't know |Im(x)| < pi, until we solve it. Also, f simplifed form have multiple roots. A good guess is needed to get correct branch. For f general form, with 1 root, guess good enough for convergence is all that is needed. We use f general form for *good* guess, correct with using simplified f (if applicable) lua> a = 1e-100-1e-10*I lua> I.W(a, 0, true) (1e-100-1e-010*I) (1.000000082740371e-020-1e-010*I) (1.000000082740371e-020-1e-010*I) -- general f=0 solution (1.0000000000000002e-020-1e-010*I) true Here, initial guess log1p(a) ≈ a is not good (I.log code need work ...) But, it doesn't matter. Guess is good enough for general f to converge. f simplified form, with 1 Newton step, we get W(a) ≈ a - a*a |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: