Sourceware Bugzilla – Attachment 5993 Details for
Bug 13304
fma, fmaf, fmal produce wrong results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
test case #3 for fma()
fma-bug3.c (text/x-csrc), 753 bytes, created by
Bruno Haible
on 2011-10-17 02:05:34 UTC
(
hide
)
Description:
test case #3 for fma()
Filename:
MIME Type:
Creator:
Bruno Haible
Created:
2011-10-17 02:05:34 UTC
Size:
753 bytes
patch
obsolete
>/* Bug in fma() of glibc 2.11.3 on x86_64. */ > >#include <math.h> >#include <stdio.h> > >int >main () >{ > volatile double x = 1.0 + ldexp (1.0, -52); /* 2^0 + 2^-52 */ > volatile double y = x; > volatile double z = 4.0; /* 2^2 */ > /* x * y + z with infinite precision: 2^2 + 2^0 + 2^-51 + 2^-104. > Lies between (2^52 + 2^50) * 2^-50 and (2^52 + 2^50 + 1) * 2^-50 > and is closer to (2^52 + 2^50 + 1) * 2^-50, therefore the rounding > must round up and produce (2^52 + 2^50 + 1) * 2^-50. */ > volatile double expected = 4.0 + 1.0 + ldexp (1.0, -50); > volatile double result = fma (x, y, z); > > if (result != expected) > { > printf ("Expected: %A\n", expected); > printf ("Actual: %A\n", result); > return 1; > } > > return 0; >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 13304
:
5990
|
5991
|
5992
| 5993 |
5994
|
5995
|
5996
|
5997
|
5998
|
5999
|
6000
|
6001
|
6002
|
6003
|
6004
|
6005
|
6006
|
6008
|
6014
|
6015
|
6017
|
6657