(28/48/50) Lambert W Function
|
01-29-2024, 03:51 PM
(This post was last modified: 01-29-2024 05:20 PM by Albert Chan.)
Post: #31
|
|||
|
|||
RE: (28/48/50) Lambert W Function
Hi, Gil
Post 18 HP71B code is short, I'll just copy/pasted in full Code: 10 INPUT "a, k? ";A,K @ K=K+K+1 Line 10: K=K+K+1 map W branch (0,-1) into sign ±1 Line 40: this simplified lyuka's formula 2 branches ±√ term But lyuka's formula is not suitable if A is too far from -1/e Example, if -√ term keep growing, eventually we would get e^W guess = 0. But, this does not match exactly at A = 0, which make W-1 guess very bad. For that, I just use simple guess (note: K = ±1) Line 70: Y=(K=1)+K*A/4 K=-1 --> Y = -A/4 // --> X = ln(-A/4), roughly ln(-A) if A → -0 K=+1 --> Y = 1 + A/4 // --> X = log1p(A/4), roughly ln(A) if A → INF There was another way to get W, based from how lyuka's formula work? Then, solve the same thing using accurate log(1+x)-x Turns out, this super accuracy is not needed. I made a version with FNL(x) = accurate log(1+x)-x, and it make little difference. (post #20) (03-31-2023 10:07 PM)Albert Chan Wrote: When we are close to branch point, x is tiny. Even rough x estimate suffice. Gil Wrote:No solution is found: X is never equal to 'X+Z*.000001'. Math assumed real numbers to begin with. It may work with complex numbers, but you still need adjustments. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)