[HP41] Lambert function RPN; question
12-30-2022, 11:27 PM
Post: #15
 Albert Chan Senior Member Posts: 2,708 Joined: Jul 2018
RE: [HP41] Lambert function RPN; question
When I try to understand lyuka's eW formula (previous post), I found a better one.

e^W(a) = y = (y+a) / (ln(y)+1)

Let r = 1/e
If a = -r + h (tiny h), we have y = r + z (tiny z)

e^W(a) = (r+z) = (h+z) / ln(1+e*z)

Let H = e*h (known), Z = e*z (unknown), we have:

(1+Z) = (H+Z) / ln(1+Z)

H = (1+Z) * ln(1+Z) - Z = Z^2/2 - Z^3/6 + Z^4/12 - Z^5/20 + ...

2H ≈ Z^2 / (1+Z/3)
Z^2 - 2*(H/3)*Z - 2H ≈ 0
Z ≈ H/3 ± √((H/3)^2 + 2H) ≈ H/3 ± √(2H)

Divide both side by e, we have: y = r + z ≈ r + h/3 ± √(2*r*h)

We could estimate Z another way, by first ignoring O(Z^3) terms
Note: +sign for branch 0, -sign for branch -1

2H ≈ Z^2                      → Z = ±√(2H)

Then, we solve again, using above rough estimated Z

2H ≈ Z^2 / (1+Z/3)      → Z = ±√(2H*(1+Z/3))

Redo previous examples, with this 2 step Z estimate, then convert back to y = r + r*Z

e^W0 (-0.367879) ≈ 0.368449 321311
e^W-1(-0.367879) ≈ 0.367309 855146
e^W0 (-0.3678) ≈ 0.375551 106237
e^W-1(-0.3678) ≈ 0.360260 737204
 « Next Oldest | Next Newest »

 Messages In This Thread [HP41] Lambert function RPN; question - floppy - 12-26-2022, 12:13 PM RE: [HP41] Lambert function RPN; question - Didier Lachieze - 12-26-2022, 02:07 PM RE: [HP41] Lambert function RPN; question - floppy - 12-26-2022, 05:46 PM RE: [HP41] Lambert function RPN; question - Albert Chan - 12-26-2022, 04:04 PM RE: [HP41] Lambert function RPN; question - Sylvain Cote - 12-26-2022, 04:32 PM RE: [HP41] Lambert function RPN; question - floppy - 12-26-2022, 06:45 PM RE: [HP41] Lambert function RPN; question - Thomas Klemm - 12-27-2022, 02:31 AM RE: [HP41] Lambert function RPN; question - Albert Chan - 12-27-2022, 04:26 AM RE: [HP41] Lambert function RPN; question - Thomas Klemm - 12-27-2022, 04:36 PM RE: [HP41] Lambert function RPN; question - Thomas Klemm - 12-27-2022, 04:48 PM RE: [HP41] Lambert function RPN; question - floppy - 12-27-2022, 06:42 PM RE: [HP41] Lambert function RPN; question - Thomas Klemm - 12-27-2022, 05:06 PM RE: [HP41] Lambert function RPN; question - Pekis - 12-28-2022, 11:14 AM RE: [HP41] Lambert function RPN; question - Albert Chan - 12-28-2022, 10:26 PM RE: [HP41] Lambert function RPN; question - Albert Chan - 12-30-2022 11:27 PM RE: [HP41] Lambert function RPN; question - Albert Chan - 12-30-2022, 11:48 PM

User(s) browsing this thread: 1 Guest(s)