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/13304] New: fma, fmaf, fmal produce wrong results


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

             Bug #: 13304
           Summary: fma, fmaf, fmal produce wrong results
           Product: glibc
           Version: 2.11
            Status: NEW
          Severity: normal
          Priority: P2
         Component: math
        AssignedTo: aj@suse.de
        ReportedBy: bruno@clisp.org
    Classification: Unclassified


Created attachment 5990
  --> http://sourceware.org/bugzilla/attachment.cgi?id=5990
test suite for fma()

The functions fma(), fmaf(), fmal() are defined in POSIX:2008
<http://pubs.opengroup.org/onlinepubs/9699919799/functions/fma.html>:

  "These functions shall compute (x * y) + z, rounded as one ternary operation:
   they shall compute the value (as if) to infinite precision and round once
   to the result format"

Find attached a test suite for fma(), easily adapted for fmaf() or fmal()
through a couple of #defines. I have checked this test suite by running it
against a slow but correct multi-precision implementation of fma().

This test suite gives
  - 7 failures for fma(),
  - 1 more failure for fmaf(),
  - 9 more failures for fmal(),
on a glibc 2.11.3 system where
  - fma() and fmaf() are implemented through a complex floating-point
    instruction rich code,
  - fmal() does just a x*y+z computation.

Find attached the bugs, each in a separate program, to be compiled and linked
with "-lm".

Feel free to add the test suite to glibc. I have a copyright assignment for
glibc on file, and am giving this file to the FSF.

-- 
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]