Post Reply 
(28/48/50) Lambert W Function
03-31-2023, 07:10 PM
Post: #18
RE: (28/48/50) Lambert W Function
(03-31-2023 06:15 PM)John Keith Wrote:  Unfortunately, I am still not able to achieve that level of accuracy with the 12-digit precision of HP calculators.

For an input of -.3678, your program for e^W(x) returns .375551106194 and -.979360715069

My Lua expW code translated to HP71B. It seems to work fine.

Code:
10 INPUT "a, k? ";A,K @ K=K+K+1
20 IF A<=-.1 THEN
30 R=.367879441171 @ R2=4.42321595524E-13
40 Y=SQRT(2*R*(A+R+R2))*K @ Y=R+Y*SQRT(1+Y/(3*R))
50 REPEAT @ H=Y-(Y+A)/LOGP1((Y-R-R2)/R) @ Y=Y-H @ UNTIL Y=Y+H*.0001
60 ELSE
70 Y=(K=1)+K*A/4
80 REPEAT @ H=Y-(Y+A)/(LOG(Y)+1) @ Y=Y-H @ UNTIL Y=Y+H*.0001
90 END IF
100 PRINT "e^W, W =";Y;A/Y

>run
a, k? -.3678, 0
e^W, W = .37555110633 -.979360714962
>run
a, k? -.3678, -1
e^W, W = .360260737301 -1.02092723941

>run
a, k? -1e-6, 0
e^W, W = .999998999999 -.000001000001
>run
a, k? -1e-6, -1
e^W, W = 6.01449171278E-8 -16.6265089014
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(28/48/50) Lambert W Function - John Keith - 03-20-2023, 08:43 PM
RE: (28/48/50) Lambert W Function - Albert Chan - 03-31-2023 07:10 PM
RE: (28/48/50) Lambert W Function - Gil - 01-29-2024, 11:04 AM
RE: (28/48/50) Lambert W Function - Gil - 01-29-2024, 02:47 PM
RE: (28/48/50) Lambert W Function - Gil - 01-29-2024, 06:46 PM
RE: (28/48/50) Lambert W Function - Gil - 01-29-2024, 09:50 PM
RE: (28/48/50) Lambert W Function - Gil - 01-30-2024, 12:33 AM
RE: (28/48/50) Lambert W Function - Gil - 01-30-2024, 12:04 PM
RE: (28/48/50) Lambert W Function - Gil - 01-30-2024, 02:52 PM
RE: (28/48/50) Lambert W Function - Gil - 01-31-2024, 07:10 PM



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