Sourceware Bugzilla – Attachment 5999 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 #9 for fmal()
fma-bug9.c (text/x-csrc), 848 bytes, created by
Bruno Haible
on 2011-10-17 02:08:21 UTC
(
hide
)
Description:
test case #9 for fmal()
Filename:
MIME Type:
Creator:
Bruno Haible
Created:
2011-10-17 02:08:21 UTC
Size:
848 bytes
patch
obsolete
>/* Bug in fmal() of glibc 2.11.3 on x86_64. */ > >#include <math.h> >#include <stdio.h> > >int >main () >{ > volatile long double x = 1.0L + ldexpl (1.0L, -32); /* 2^0 + 2^-32 */ > volatile long double y = x; > volatile long double z = ldexpl (1.0L, -63); /* 2^-63 */ > /* x * y + z with infinite precision: 2^0 + 2^-31 + 2^-63 + 2^-64. > Lies between (2^63 + 2^32 + 1) * 2^-63 and (2^63 + 2^32 + 2) * 2^-63 > and is at the same distance from each. According to the round-to-even > rule, the rounding must round up and produce (2^63 + 2^32 + 2) * 2^-63. */ > volatile long double expected = 1.0L + ldexpl (1.0L, -31) + ldexpl (1.0L, -62); > volatile long double result = fmal (x, y, z); > > if (result != expected) > { > printf ("Expected: %LA\n", expected); > printf ("Actual: %LA\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