[Bug libquadmath/83800] [libquadmath] M_SQRT2q & sqrtq(2.0Q) off by one ULP ?

sisyphus1 at optusnet dot com.au gcc-bugzilla@gcc.gnu.org
Fri Jan 12 03:50:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83800

--- Comment #2 from sisyphus1 at optusnet dot com.au ---
The issue with sqrtq() is more widespread than I expected.
Checking the square roots of the integer values from 2 to 300, I found that
sqrtq differs from mpfr for 2, 6, 8, 13, 15, 19, 24, 30, 31, 32, 33, 37, 41,
43, 45, 52, 60, 66, 76, 83, 96, 97, 101, 102, 105, 114, 117, 120, 123, 124,
128, 130, 132, 133, 142, 148, 150, 153, 155, 163, 164, 172, 174, 177, 178, 179,
180, 182, 185, 187, 190, 191, 194, 203, 207, 208, 210, 213, 215, 223, 231, 235,
237, 240, 243, 246, 247, 249, 253, 258, 264, 265, 269, 274, 277, 294, and 297.

In all cases it's a 1 ULP discrepancy - though I only checked that visually.
I programmatically checked that the 2 values straddle the actual value, and
that  the value provided by mpfr is the closer approximation.

I got identical results with both gcc-5.4.0 (on Ubuntu) and gcc-7.2.0 (on
Windows).

Cheers,
Rob


More information about the Gcc-bugs mailing list