This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc 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]

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


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.


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