This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.18-627-g8d56198
- From: siddhesh at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 16 Dec 2013 14:37:11 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.18-627-g8d56198
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via 8d561986c0b44c1f9b489b30b661354cf456eac5 (commit)
from 9e8ac24ba3cfeb782c5b24dde6224a3d2b4c4919 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=8d561986c0b44c1f9b489b30b661354cf456eac5
commit 8d561986c0b44c1f9b489b30b661354cf456eac5
Author: Siddhesh Poyarekar <siddhesh@redhat.com>
Date: Mon Dec 16 20:03:04 2013 +0530
Minor code cleanup in s_sin.c
- Remove redundant mynumber union definitions
- Clean up a clumsy ternary operator
- Rename TAYLOR_SINCOS to TAYLOR_SIN since we're only expanding the
sin Taylor series in it.
diff --git a/ChangeLog b/ChangeLog
index 7543682..78ee4fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2013-12-16 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/ieee754/dbl-64/s_sin.c (TAYLOR_SINCOS): Rename to
+ TAYLOR_SIN.
+ (__sin): Adjust.
+ (__cos): Likewise.
+ (sloww): Use mynumber union. Expand ternary operator into
+ if-else statements.
+ (cslow): use mynumber union.
+
2013-12-16 Allan McRae <allan@archlinux.org>
* configure.ac: Set AUTOCONF when maintainer-mode is not used.
diff --git a/sysdeps/ieee754/dbl-64/s_sin.c b/sysdeps/ieee754/dbl-64/s_sin.c
index b8c1303..9066667 100644
--- a/sysdeps/ieee754/dbl-64/s_sin.c
+++ b/sysdeps/ieee754/dbl-64/s_sin.c
@@ -67,7 +67,7 @@
The constants s1, s2, s3, etc. are pre-computed values of 1/3!, 1/5! and so
on. The result is returned to LHS and correction in COR. */
-#define TAYLOR_SINCOS(xx, a, da, cor) \
+#define TAYLOR_SIN(xx, a, da, cor) \
({ \
double t = ((POLYNOMIAL (xx) * (a) - 0.5 * (da)) * (xx) + (da)); \
double res = (a) + t; \
@@ -280,7 +280,7 @@ __sin (double x)
if (xx < 0.01588)
{
/* Taylor series. */
- res = TAYLOR_SINCOS (xx, a, da, cor);
+ res = TAYLOR_SIN (xx, a, da, cor);
cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
retval = (res == res + cor) ? res : sloww (a, da, x);
}
@@ -367,7 +367,7 @@ __sin (double x)
if (xx < 0.01588)
{
/* Taylor series. */
- res = TAYLOR_SINCOS (xx, a, da, cor);
+ res = TAYLOR_SIN (xx, a, da, cor);
cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
retval = (res == res + cor) ? res : bsloww (a, da, x, n);
}
@@ -488,7 +488,7 @@ __cos (double x)
xx = a * a;
if (xx < 0.01588)
{
- res = TAYLOR_SINCOS (xx, a, da, cor);
+ res = TAYLOR_SIN (xx, a, da, cor);
cor = (cor > 0) ? 1.02 * cor + 1.0e-31 : 1.02 * cor - 1.0e-31;
retval = (res == res + cor) ? res : csloww (a, da, x);
}
@@ -547,7 +547,7 @@ __cos (double x)
}
if (xx < 0.01588)
{
- res = TAYLOR_SINCOS (xx, a, da, cor);
+ res = TAYLOR_SIN (xx, a, da, cor);
cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
retval = (res == res + cor) ? res : csloww (a, da, x);
}
@@ -632,7 +632,7 @@ __cos (double x)
}
if (xx < 0.01588)
{
- res = TAYLOR_SINCOS (xx, a, da, cor);
+ res = TAYLOR_SIN (xx, a, da, cor);
cor = (cor > 0) ? 1.02 * cor + eps : 1.02 * cor - eps;
retval = (res == res + cor) ? res : bsloww (a, da, x, n);
}
@@ -830,17 +830,14 @@ SECTION
sloww (double x, double dx, double orig)
{
double y, t, res, cor, w[2], a, da, xn;
- union
- {
- int4 i[2];
- double x;
- } v;
+ mynumber v;
int4 n;
res = TAYLOR_SLOW (x, dx, cor);
- cor =
- (cor >
- 0) ? 1.0005 * cor + ABS (orig) * 3.1e-30 : 1.0005 * cor -
- ABS (orig) * 3.1e-30;
+ if (cor > 0)
+ cor = 1.0005 * cor + ABS (orig) * 3.1e-30;
+ else
+ cor = 1.0005 * cor - ABS (orig) * 3.1e-30;
+
if (res == res + cor)
return res;
else
@@ -1183,11 +1180,7 @@ SECTION
csloww (double x, double dx, double orig)
{
double y, t, res, cor, w[2], a, da, xn;
- union
- {
- int4 i[2];
- double x;
- } v;
+ mynumber v;
int4 n;
/* Taylor series */
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 10 ++++++++++
sysdeps/ieee754/dbl-64/s_sin.c | 33 +++++++++++++--------------------
2 files changed, 23 insertions(+), 20 deletions(-)
hooks/post-receive
--
GNU C Library master sources