]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix accuracy problem in generic sin
authorUlrich Drepper <drepper@gmail.com>
Sat, 29 Oct 2011 18:08:56 +0000 (14:08 -0400)
committerUlrich Drepper <drepper@gmail.com>
Sat, 29 Oct 2011 18:08:56 +0000 (14:08 -0400)
ChangeLog
NEWS
math/libm-test.inc
sysdeps/ieee754/dbl-64/s_sin.c

index 6cb54e65d498afef23d846a9a3155de6f7a2ab84..4c5ff75bcf5629dc8ab34482440ca792a0434f30 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-03  Andreas Jaeger  <aj@suse.de>
+
+       [BZ #10709]
+       * sysdeps/ieee754/dbl-64/s_sin.c (__sin): Fix incorrect rounding
+       of sin. Patch suggested by Paul Zimmermann <zimmerma+gcc@loria.fr>.
+       * math/libm-test.inc (sin_test): Add test case.
+
 2011-10-29  Ulrich Drepper  <drepper@gmail.com>
 
        [BZ #13337]
diff --git a/NEWS b/NEWS
index e4b9f449d33ad5db8f930cee50cc59d266a3a414..73ab2b9e875daa127e5f3ddbca6613e6b4efc97f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -9,10 +9,10 @@ Version 2.15
 
 * The following bugs are resolved with this release:
 
-  6779, 6783, 9696, 11589, 12403, 12847, 12868, 12852, 12874, 12885, 12892,
-  12907, 12922, 12935, 13007, 13021, 13067, 13068, 13090, 13092, 13114,
-  13118, 13123, 13134, 13138, 13150, 13179, 13192, 13268, 13291, 13335,
-  13337, 13344
+  6779, 6783, 9696, 10709, 11589, 12403, 12847, 12868, 12852, 12874, 12885,
+  12892, 12907, 12922, 12935, 13007, 13021, 13067, 13068, 13090, 13092,
+  13114, 13118, 13123, 13134, 13138, 13150, 13179, 13192, 13268, 13291,
+  13335, 13337, 13344
 
 * New program pldd to list loaded object of a process
   Implemented by Ulrich Drepper.
index 96da7cde6b716ca53df800d1ad454be93dbcc2f5..a451174f0e3392d24cdad4e3eab59b3a884bd059 100644 (file)
@@ -5642,6 +5642,7 @@ sin_test (void)
 
 #ifdef TEST_DOUBLE
   TEST_f_f (sin, 0.80190127184058835, 0.71867942238767868);
+  TEST_f_f (sin, 2.522464e-1, 2.4957989804940911e-1);
 #endif
 
   END (sin);
index 6f19f158f19731c7b08c5c6815ada7ef7f80abd0..5183e55e8b6415eb67c3f5756a2e159387cda0c9 100644 (file)
@@ -138,7 +138,7 @@ __sin(double x){
          cor=(ssn+s*ccs-sn*c)+cs*s;
          res=sn+cor;
          cor=(sn-res)+cor;
-         return (res==res+1.025*cor)? res : slow1(x);
+         return (res==res+1.096*cor)? res : slow1(x);
        }    /*   else  if (k < 0x3feb6000)    */
 
 /*----------------------- 0.855469  <|x|<2.426265  ----------------------*/