Free42 possible accuracy flaw
03-25-2022, 02:58 PM
Post: #31
 Albert Chan Senior Member Posts: 2,710 Joined: Jul 2018
RE: Free42 possible accuracy flaw
(03-22-2022 10:08 PM)Thomas Okken Wrote:  10^2 = 99.99999999999999999999999999999999

That's just the first one of many where bid128_pow() returns an inexact result for an easy case...

Going thru the source, bid128_pow.c, I may have spotted the issue.

Code:
// Compute dominant exponential term // We really want exp(l + l_lo)   BIDECIMAL_CALL1(bid128_exp,res,l); ...   BIDECIMAL_CALL3(bid128_fma,res,res,l_lo,res);

log of result, is done in excess precision, say, accurate to 128+ bits.
However, it use bid128_exp to recover result, *then* adjust.

exp(l + l_lo) = exp(l) * exp(l_lo) ≈ exp(l) * (1 + l_lo)

But, RHS exp(l) already rounded to 34 decimal digits.
Essentially I think bid128_pow does this with the l_lo correction.

10 LN 2 *       → 4.605170185988091368035982909368728
E^X             → 99.99999999999999999999999999999995
4.152E-34       // Note: no need to use fma for correction
X<>Y * LASTX +  → 99.99999999999999999999999999999999

It should have call a custom exp, to handle exp(l + l_lo), *then* round.

round34(exp(4.6051701859880913680359829093687284152)) = 100.
 « Next Oldest | Next Newest »

 Messages In This Thread Free42 possible accuracy flaw - J-F Garnier - 03-22-2022, 12:33 PM RE: Free42 possible accuracy flaw - Albert Chan - 03-22-2022, 04:31 PM RE: Free42 possible accuracy flaw - Thomas Okken - 03-22-2022, 05:18 PM RE: Free42 possible accuracy flaw - Albert Chan - 03-22-2022, 07:11 PM RE: Free42 possible accuracy flaw - J-F Garnier - 03-24-2022, 10:20 AM RE: Free42 possible accuracy flaw - J-F Garnier - 03-24-2022, 07:18 PM RE: Free42 possible accuracy flaw - Thomas Okken - 03-22-2022, 05:39 PM RE: Free42 possible accuracy flaw - Thomas Okken - 03-22-2022, 07:38 PM RE: Free42 possible accuracy flaw - Werner - 03-23-2022, 07:30 AM RE: Free42 possible accuracy flaw - Thomas Okken - 03-22-2022, 10:08 PM RE: Free42 possible accuracy flaw - J-F Garnier - 03-23-2022, 07:57 AM RE: Free42 possible accuracy flaw - Albert Chan - 03-25-2022 02:58 PM RE: Free42 possible accuracy flaw - Thomas Okken - 03-23-2022, 08:05 AM RE: Free42 possible accuracy flaw - Werner - 03-23-2022, 08:49 AM RE: Free42 possible accuracy flaw - Thomas Okken - 03-23-2022, 12:07 PM RE: Free42 possible accuracy flaw - Albert Chan - 03-24-2022, 04:53 PM RE: Free42 possible accuracy flaw - Thomas Okken - 03-23-2022, 06:02 PM RE: Free42 possible accuracy flaw - Thomas Okken - 03-23-2022, 07:43 PM RE: Free42 possible accuracy flaw - Albert Chan - 03-23-2022, 07:50 PM RE: Free42 possible accuracy flaw - Albert Chan - 03-23-2022, 09:11 PM RE: Free42 possible accuracy flaw - Thomas Okken - 03-24-2022, 11:02 AM RE: Free42 possible accuracy flaw - J-F Garnier - 03-24-2022, 01:02 PM RE: Free42 possible accuracy flaw - Thomas Okken - 03-24-2022, 05:01 PM RE: Free42 possible accuracy flaw - Thomas Okken - 03-24-2022, 07:45 PM RE: Free42 possible accuracy flaw - Werner - 03-25-2022, 07:03 AM RE: Free42 possible accuracy flaw - J-F Garnier - 03-25-2022, 08:03 AM RE: Free42 possible accuracy flaw - Werner - 03-30-2022, 08:04 AM RE: Free42 possible accuracy flaw - Albert Chan - 03-30-2022, 11:51 PM RE: Free42 possible accuracy flaw - Thomas Okken - 03-25-2022, 08:35 AM RE: Free42 possible accuracy flaw - Albert Chan - 03-27-2022, 10:58 PM RE: Free42 possible accuracy flaw - Werner - 03-25-2022, 08:53 AM RE: Free42 possible accuracy flaw - J-F Garnier - 03-25-2022, 11:12 AM RE: Free42 possible accuracy flaw - Thomas Okken - 03-25-2022, 09:06 AM RE: Free42 possible accuracy flaw - Thomas Okken - 03-25-2022, 09:18 AM

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