Lambert W Function (hp-42s)
|
10-02-2020, 07:29 PM
Post: #40
|
|||
|
|||
RE: Lambert W Function (hp-42s)
Here is a demo of previous post results, r + err_r = 1/e (108-bits accurate)
Code: r, err_r = 0.36787944117144233, -1.2428753672788363E-17 >>> from mpmath import * >>> ulp = 2**-54 >>> x = -r + ulp # -0.36787944117144228 >>> eW(x, g=g0) # simple version, half precision, as expected. 0 0.367879447562281 1 0.367879447022175 2 0.367879445804813 3 0.367879448020601 4 0.367879446543632 mpf('0.36787944701838976') >>> eW(x, g=g1) # log1p version 0 0.367879447562281 1 0.367879447562281 2 0.367879447562281 3 0.367879447562281 4 0.367879447562281 mpf('0.36787944756228136') >>> eW(x, g=g2) # log1p + more precise 1/e 0 0.367879447562281 1 0.367879446846838 2 0.367879446801743 3 0.367879446801563 4 0.367879446801563 mpf('0.36787944680156281') >>> exp(lambertw(x)) # accurate eW mpf('0.36787944680156281') |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)