This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug math/14759] New: Most functions in math.h not correctly rounded
- From: "JoshuaHopp at web dot de" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Wed, 24 Oct 2012 08:07:40 +0000
- Subject: [Bug math/14759] New: Most functions in math.h not correctly rounded
- Auto-submitted: auto-generated
http://sourceware.org/bugzilla/show_bug.cgi?id=14759
Bug #: 14759
Summary: Most functions in math.h not correctly rounded
Product: glibc
Version: 2.15
Status: NEW
Severity: normal
Priority: P2
Component: math
AssignedTo: unassigned@sourceware.org
ReportedBy: JoshuaHopp@web.de
Classification: Unclassified
Host: x86_64
Target: x86_64
Build: linux-gnu
Most functions in math.h do not use correct rounding. Example:
//--- snip ---
#include <math.h>
#include <fenv.h>
#include <assert.h>
int main() {
double x = 1.0; // 1.0 is exact
fesetround(FE_DOWNWARD);
double a = asin(x);
fesetround(FE_UPWARD);
double b = asin(x);
// asin(1) == pi/2, which is not exactly representable
// so, assuming correct rounding, a should be less than b
assert(a < b);
}
//--- snap ---
Compile with "gcc -lm" (or even "gcc -lm -ffloat-store -frounding-math").
Run the example:
main: Assertion `a < b' failed.
Similar results can be obtained with exp, cos, acos, atan, sinh, cosh, atanh,
asinh and acosh.
------
Kernel version: 3.5.2-1.fc17
gcc version 4.7.2 20120921 (Red Hat 4.7.2-2) (GCC)
GNU ld version 2.22.52.0.1-10.fc17 20120131
--
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.