[HP41] Lambert function RPN; question
12-26-2022, 04:04 PM
Post: #3
 Albert Chan Senior Member Posts: 2,708 Joined: Jul 2018
RE: [HP41] Lambert function RPN; question
Two years ago, we had developed a more sophisticated lambertw function (actually e^W)

x*e^x = a      // x = W(a), by definition

Let y = ln(x) --> f = y*ln(y) - a = 0

Newton's method for y: y = y - f/f' = (y+a)/(ln(y)+1)

It extended W for complex numbers, and can get both branches for real argument.
(10-21-2020 03:05 PM)Albert Chan Wrote:  Example, to calculate eW(-log(2)/2), both branch 0 and -1:

2 LN 2 +/- / ﻿ ﻿ ﻿→ a = -0.3465735902799726547086160607290883
XEQ "eW" ﻿ ﻿ ﻿ ﻿ ﻿ ﻿ → e^W0(a) = 0.5
− 0.3 R/S ﻿ ﻿ ﻿ ﻿ ﻿ ﻿→ e^W-1(a) = 0.25

For e^W-1(a), -1/e < a < 0, any positive guess below -a work.

Update: a good guess for e^W-1(a), -1/e < a < 0, is 2a²
For above case, 2a² already gives 0.24022

Just replace "− new-guess R/S", with this: "− − + × R/S"

c = W(-ln(c)) / -ln(c) = 1 / e^W(-ln(c))

Above quoted example, (√2) = 2

We can reuse infinite tetration formula to solve for a^x = b*x
Let z = b*x, c = b√a

z = a^(z/b) = c^z = c^c^z = ... = c

https://github.com/isene/hp-41_wlambert example, 2^x = 3*x, for x

2 LN 3 / +/-      // -ln(c) = -0.2310490601866484364724107071527255
XEQ "eW"         // 1/z(0) = 0.7280844118213892196256653246326560
− − + × R/S    // 1/z(-1) = 0.1006083268252766116679239025157516

x = z/3

x(0) = 0.4578223732320550555738866680640553
x(-1) = 3.313178380475634845996561019588785
 « 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