Post Reply 
(28/48/50) Lambert W Function
04-04-2023, 07:09 PM
Post: #28
RE: (28/48/50) Lambert W Function
Your HP-71 program from post #19 is very good. It outperforms my program in both branches for -1/e < x <= -.2

I frankly don't feel that FNL from post #20 is worth the extra memory requirement since the post 19 program is always within 3 ULP's.

Here is my RPL translation. It is optimized for size rather than readability (lots of "stackrobatics") so I have added comments corresponding to the BASIC statements. As with the other programs, the level 2 argument is k, and the level 1 argument is x. This program is not intended for x > -.1, nor for k other than 0 or -1.

I'm not sure whether I will integrate it into the main program, which already takes over 600 bytes. For now I'll just leave it as-is for anyone who needs higher accuracy near the branch point.

Code:

\<< -1. EXP DUP ROT +
    4.42321595524E-13 + SWAP /    @ H=(A+R+R2)/R
    DUP 2. * \v/ ROT DUP NOT + *  @ X=SQRT(2*H)*K
     DUP 3. / 1. + \v/ *          @ X=X*SQRT(1+X/3)
    DO DUP LNP1                   @ Z=LOGP1(X)
      DUP2 - 4. PICK + SWAP /
      OVER SWAP -                 @ Z=X-(X-Z+H)/Z
      SWAP OVER -                 @ X=X-Z
      SWAP .000001 * OVER +       @ X=X+Z*.000001
    UNTIL OVER SAME
    END SWAP DROP LNP1 1. -       @ LOGP1(X)-1
\>>
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 - John Keith - 04-04-2023 07:09 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)