(28/48/50) Lambert W Function
|
01-30-2024, 01:47 PM
Post: #39
|
|||
|
|||
RE: (28/48/50) Lambert W Function
Hi, Gil
FNL(x) = accurate ln(1+x)-x, was designed for real number. It may need work to extend for complex numbers. Also, it is defined recursively, until x is small, not a IF THEN ELSE structure. see thread: Accurate x - log(1+x) (for consisteny, I switched order, and do log1p_sub(x)) Anyway, accurate FNL(x) is not needed here. Here is a direct replacement snippet for my Python W code I am using formula to get log1p, instead of calling built-in log1p Quote:y=1+x --> log1p(x) ≈ ln(y) - (y-1-x)/y Because of inaccurate x-log1p(x), x does not converge, but (1+x) does. (again, you may forget about checking convergence, and just loop a few times) Code: if abs(h)<.25 and (k==0 or small_imag): With identical termination condition, results compared well to W original version. Code: if abs(h)<.25 and (k==0 or small_imag): |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 16 Guest(s)