Post Reply 
(28/48/50) Lambert W Function
03-22-2023, 08:55 PM (This post was last modified: 03-22-2023 08:56 PM by John Keith.)
Post: #7
RE: (28/48/50) Lambert W Function
(03-21-2023 06:15 AM)Gerald H Wrote:  This programme works for positive reals - I'm interested in the comparison of accuracy:

They are roughly comparable, unless x is very large. A few examples:
Code:

x = -.367
Exact:       -.932399184748
John Keith:  -.932399184762
Gerald H:    -.932399184749

x = -.36787944
Exact:       -.999920198484
John Keith:  -.99992018987
Gerald H:    -.999920176091

x = -.367879441171
Exact:       -.999998449288
John Keith:  -.99999787867
Gerald H:    -.999998020036

x = .000001
Exact:       9.99999000001E-7
John Keith:  .000000999999
Gerald H:    9.99999000001E-7

x = 999999999999
Exact:       24.4350044049
John Keith:     same
Gerald H:       same

x = 9.99999999999E499
Exact:       1144.25004187
John Keith:     same
Gerald H:    1144.25102833

Exact values were computed with Mathematica version 12.2.

As you can see, both programs lose accuracy for values very close to -1/e. Your program is very accurate over most of the real range but less accurate at MAXR. This is a known problem with Newton's method.
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 - 03-22-2023 08:55 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)