Post Reply 
Free42 possible accuracy flaw
03-22-2022, 04:31 PM
Post: #2
RE: Free42 possible accuracy flaw
https://github.com/thomasokken/free42/bl...at.cc#L649
Code:
        // Integral power. bid128_pow doesn't handle these very well,
        // so I'm using repeated squaring instead. This way at least
        // we get exact results for integral powers of ten!
        if (x < -2147483647.0 || x > 2147483647.0)
            // For really huge exponents, the repeated-squaring
            // algorithm for integer exponents loses its accuracy
            // and speed advantage, and we switch to the
            // library's bid128_pow() instead.
            goto noninteger_exponent;

I would have reduce integer exponent range a bit, possibly remove it.
For exponent 1e8, that is already 27 squaring's, plus many multiplies !
No wonder the result is off.

Let's bypass the integer squaring part, and see what happen.

1 1e-8 + 32e8 Y^X       → 78962947548608.16088504664995794553
√ √ √ √ √                   → 2.718281814867636217652977243009177
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Free42 possible accuracy flaw - Albert Chan - 03-22-2022 04:31 PM
RE: Free42 possible accuracy flaw - Werner - 03-23-2022, 07:30 AM
RE: Free42 possible accuracy flaw - Werner - 03-23-2022, 08:49 AM
RE: Free42 possible accuracy flaw - Werner - 03-25-2022, 07:03 AM
RE: Free42 possible accuracy flaw - Werner - 03-30-2022, 08:04 AM
RE: Free42 possible accuracy flaw - Werner - 03-25-2022, 08:53 AM



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