Post Reply 
(Free42) accuracy of LN1+X
06-13-2020, 12:45 AM (This post was last modified: 06-13-2020 10:46 AM by Albert Chan.)
Post: #6
RE: (Free42) accuracy of LN1+X
With such a tiny x, log1p(x) is just going to return x

Error is due to decimal128 unable to round-trip thru binary128
You need ceil(34 * log2(10)) + 1 = 114 bits, see Number of Digits required for round-trip conversions

Trivia: LN1+X(ε) will not return (1.000 ... 1) ε

Assuming you do get a result of (1.000 ... 1) ε
This implied decimal128 to binary128 returns ≥ (10^33 + ½) / (ε/10^33)
(if ε = 1/10^n, replace "≥" with ">", due to round-to-even rule)

That meant it required relative error ≥ ½ / 10^33 = 500e-36

binary128 (113 bits precision), relative error ≤ (½ ulp) / (2^112 ulp) ≈ 96e-36

Assumption were wrong, you will not see this. QED

However, returning (0.999 ...) ε is possible.
Required relative error dropped by a factor of 10, to 50e-36 < 96e-36

Update:
(0.999 ... 8) ε required relative error ≥ 3 * 50e-36 = 150e-36, thus not possible.
Based on relative errors, only 2 patterns possible, (1.000 ...) ε, or (0.999 ...) ε
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
(Free42) accuracy of LN1+X - Werner - 06-12-2020, 03:23 PM
RE: (Free42) accuracy of LN1+X - grsbanks - 06-12-2020, 08:21 PM
RE: (Free42) accuracy of LN1+X - ijabbott - 06-13-2020, 11:07 AM
RE: (Free42) accuracy of LN1+X - johanw - 06-12-2020, 10:07 PM
RE: (Free42) accuracy of LN1+X - rprosperi - 06-12-2020, 10:45 PM
RE: (Free42) accuracy of LN1+X - Albert Chan - 06-13-2020 12:45 AM
RE: (Free42) accuracy of LN1+X - Paul Dale - 06-14-2020, 01:09 AM
RE: (Free42) accuracy of LN1+X - Paul Dale - 06-14-2020, 10:39 PM



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