[Bug middle-end/30789] complex folding inexact
joseph at codesourcery dot com
gcc-bugzilla@gcc.gnu.org
Thu Aug 13 01:25:00 GMT 2009
------- Comment #4 from joseph at codesourcery dot com 2009-08-13 01:25 -------
Subject: Re: complex folding inexact
On Wed, 12 Aug 2009, ghazi at gcc dot gnu dot org wrote:
>
>
> ------- Comment #3 from ghazi at gcc dot gnu dot org 2009-08-12 22:28 -------
> (In reply to comment #2)
>
> Joseph - Thanks for your reply and testvalues.
>
> > There are also cases for exact rounding where you'd expect MPC to produce
> > the right results but would *not* expect operations executed at runtime to
> > produce exactly those results. For example, (1.0 + DBL_EPSILON + 1.0i) *
> > (1.0 - DBL_EPSILON + 1.0i), which would only work at runtime if the code
> > happens to use exactly the right fused multiply-add operation.
>
> What is the "right result" for this case? GCC with MPC produces:
> -4.93038065763132378382330353301741393545754021943139377981e-32 + 2.0i)
>
> Unpatched GCC as well as the runtime on my x86_64 box says:
> 0.0 + 2.0i
>
> So the runtime here is not using the fused instruction?
>
> Is the MPC value correct?
It looks correct. You expect real part -DBL_EPSILON*DBL_EPSILON,
imaginary part 2.0.
I believe existing x86_64 hardware does not have fused multiply-add
instructions.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30789
More information about the Gcc-bugs
mailing list