This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: real.c fails floating point tests


On Wed, Oct 16, 2002 at 06:54:35PM -0400, Stephen L Moshier wrote:
> That does not test the 160-bit internal arithmetic, which is what the posted
> report was all about.  We seem to be talking about different things there.

Apparently.

Paranoia runs vs the 160 bit internal arithmetic *will* fail,
because the internal arithmetic (1) doesn't round and (2)
doesn't implement guard digits.  This is because it is expected
that the extra precision of the internal representation *is*
the guard digit.  The results will be correct after rounding
for some smaller external format.  As far as I can tell, the
old real.c implementation was the same in this respect.

> Also, beware that contrib/paranoia.cc is currently a watered-down test
> because the log, exp, pow functions use the host computer's math
> library instead of the arithmetic supposedly under test.

Yeah, well, I tried to write log/exp/pow routines that didn't
get too fresh with the representation, and yet produced result
that were sufficiently accurate, but failed.

Note that substituting native fpu arithmetic into these routines
didn't change this failure, so I don't believe this is a flaw
in the real.c routines, merely that it is quite difficult to
write accurate libm routines.

> I am mainly concerned about the decimal <-> binary conversion, which
> does exercise the internal arithmetic.  I'll continue to test and
> post decimal-binary cases as time permits.

Please do.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]