Bug 2500 - Incorrect return from float cos (0X1.32D0875AC4074P+16)
Summary: Incorrect return from float cos (0X1.32D0875AC4074P+16)
Status: RESOLVED INVALID
Alias: None
Product: glibc
Classification: Unclassified
Component: math (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Andreas Jaeger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-31 23:49 UTC by H.J. Lu
Modified: 2019-04-10 09:31 UTC (History)
2 users (show)

See Also:
Host: x86_64-unknown-linux-gnu
Target: x86_64-unknown-linux-gnu
Build: x86_64-unknown-linux-gnu
Last reconfirmed:
fweimer: security-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2006-03-31 23:49:21 UTC
[hjl@gnu-13 tmp]$ cat y.c
#include <stdio.h>
#include <math.h>

int
main ()
{
  printf ("%.20e\n", cos  (7.8544528e+04));
  printf ("%.20e\n", cosf (7.8544528e+04));
}
[hjl@gnu-13 tmp]$ gcc -O2 y.c -lm
[hjl@gnu-13 tmp]$ ./a.out
-7.28725145449983058125e-04
2.52127205021679401398e-03
[hjl@gnu-13 tmp]$
Comment 1 H.J. Lu 2006-04-14 18:33:15 UTC
Failure: Test: cos (0X1.32D0875AC4074P+16) == -0X1.CA51FDD2C46CCP-40
Result:
 is:          2.52127205021679401398e-03   0x1.4a77da00000000000000p-9
 should be:  -1.62828073507065296255e-12  -0x1.ca51fe00000000000000p-40
 difference:  2.52127205021679401398e-03   0x1.4a77da00000000000000p-9
 ulp       :  23254630125273088.0000
 max.ulp   :  0.0000
Comment 2 Ulrich Drepper 2006-04-23 17:48:29 UTC
Suspended until somebody comes up with the patch.
Comment 3 Joseph Myers 2012-02-23 01:51:52 UTC
When the given 0X1.32D0875AC4074P+16 is rounded to float you get 0X1.32D088P+16 and cos of that value, correctly rounded to float, is exactly the value cosf gives.