[Bug math/14638] New: fma produced wrong results for (0 * -1.0) + -0.0

law at redhat dot com sourceware-bugzilla@sourceware.org
Thu Sep 27 20:45:00 GMT 2012


http://sourceware.org/bugzilla/show_bug.cgi?id=14638

             Bug #: 14638
           Summary: fma produced wrong results for (0 * -1.0) + -0.0
           Product: glibc
           Version: 2.17
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: unassigned@sourceware.org
        ReportedBy: law@redhat.com
    Classification: Unclassified


The FMA implementation in sysdeps/ieee754/dbl-64/s_fma.c produces the wrong
result for this program when run on a x86_64 box that doesn't have fma3/fma4
support.

#include <assert.h>
#include <math.h>
#include <stdlib.h>


int main (void) {
  double f1 = 0.0f;
  double f2 = -1.0f;
  double f3 = -0.0f;

  double dresult = fma (f1, f2, f3);

  if (! signbit (dresult))
    abort ();
  exit (0);
}

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the Glibc-bugs mailing list