This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH][libm] Remove unnecessary variable mptwoim1
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Thu, 27 Dec 2012 21:26:04 +0530
- Subject: [PATCH][libm] Remove unnecessary variable mptwoim1
Hi,
mptwoim1 stores double format of 2^i at offset i, which is
unnecessary. One could simply calculate it as 1<<i and cast it to
double safely since the maximum offset used is 7. OK to commit?
Siddhesh
ChangeLog:
* sysdeps/ieee754/dbl-64/mpatan.c (__mpatan): Remove
__ATAN_TWOM.
* sysdeps/ieee754/dbl-64/mpatan.h: Likewise.
diff --git a/sysdeps/ieee754/dbl-64/mpatan.c b/sysdeps/ieee754/dbl-64/mpatan.c
index 3c21a58..db3c55b 100644
--- a/sysdeps/ieee754/dbl-64/mpatan.c
+++ b/sysdeps/ieee754/dbl-64/mpatan.c
@@ -94,7 +94,7 @@ __mpatan(mp_no *x, mp_no *y, int p) {
__sub(&mps,&mpt1,&mpt,p);
/* Compute Atan(x) */
- mptwoim1.d[1] = __atan_twom[m].d;
+ mptwoim1.d[1] = 1 << m;
__mul(&mptwoim1,&mpt,y,p);
return;
diff --git a/sysdeps/ieee754/dbl-64/mpatan.h b/sysdeps/ieee754/dbl-64/mpatan.h
index f920cc2..b07f8e2 100644
--- a/sysdeps/ieee754/dbl-64/mpatan.h
+++ b/sysdeps/ieee754/dbl-64/mpatan.h
@@ -83,18 +83,6 @@ extern const int __atan_np[33] attribute_hidden;
/**/ {{0x405d4000, 0x00000000} }, /* 117 */
};
- const number
- __atan_twom[8] = { /* 2**m */
-/**/ {{0x3ff00000, 0x00000000} }, /* 1.0 */
-/**/ {{0x40000000, 0x00000000} }, /* 2.0 */
-/**/ {{0x40100000, 0x00000000} }, /* 4.0 */
-/**/ {{0x40200000, 0x00000000} }, /* 8.0 */
-/**/ {{0x40300000, 0x00000000} }, /* 16.0 */
-/**/ {{0x40400000, 0x00000000} }, /* 32.0 */
-/**/ {{0x40500000, 0x00000000} }, /* 64.0 */
-/**/ {{0x40600000, 0x00000000} }, /* 128.0 */
- };
-
#else
#ifdef LITTLE_ENDI
@@ -146,18 +134,6 @@ __atan_twonm1[33] = { /* 2n-1 */
/**/ {{0x00000000, 0x405d4000} }, /* 117 */
};
- const number
- __atan_twom[8] = { /* 2**m */
-/**/ {{0x00000000, 0x3ff00000} }, /* 1.0 */
-/**/ {{0x00000000, 0x40000000} }, /* 2.0 */
-/**/ {{0x00000000, 0x40100000} }, /* 4.0 */
-/**/ {{0x00000000, 0x40200000} }, /* 8.0 */
-/**/ {{0x00000000, 0x40300000} }, /* 16.0 */
-/**/ {{0x00000000, 0x40400000} }, /* 32.0 */
-/**/ {{0x00000000, 0x40500000} }, /* 64.0 */
-/**/ {{0x00000000, 0x40600000} }, /* 128.0 */
- };
-
#endif
#endif