summaryrefslogtreecommitdiff
path: root/sysdeps/ieee754/dbl-64/mpsqrt.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2012-12-21 09:15:10 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2013-01-02 10:07:50 +0530
commitda08f647d58d674db08cdb3e61c8826c89470e2e (patch)
tree688b963715a16be8198bb735c114ab058b3b3bac /sysdeps/ieee754/dbl-64/mpsqrt.c
parent38686a0363dcd2ce65bebf2055864e403aab1dff (diff)
downloadglibc-da08f647d58d674db08cdb3e61c8826c89470e2e.tar.gz
Move more constants into static variables
Code cleanup.
Diffstat (limited to 'sysdeps/ieee754/dbl-64/mpsqrt.c')
-rw-r--r--sysdeps/ieee754/dbl-64/mpsqrt.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/sysdeps/ieee754/dbl-64/mpsqrt.c b/sysdeps/ieee754/dbl-64/mpsqrt.c
index 87bc22ec12..de0eb701d1 100644
--- a/sysdeps/ieee754/dbl-64/mpsqrt.c
+++ b/sysdeps/ieee754/dbl-64/mpsqrt.c
@@ -52,19 +52,11 @@ SECTION
__mpsqrt(mp_no *x, mp_no *y, int p) {
int i,m,ey;
double dx,dy;
- mp_no
- mphalf = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}},
- mp3halfs = {0,{0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,
- 0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0,0.0}};
+ static const mp_no
+ mphalf = {0,{1.0,8388608.0 /* 2^23 */}},
+ mp3halfs = {1,{1.0,1.0,8388608.0 /* 2^23 */}};
mp_no mpxn,mpz,mpu,mpt1,mpt2;
- /* Prepare multi-precision 1/2 and 3/2 */
- mphalf.e =0; mphalf.d[0] =ONE; mphalf.d[1] =HALFRAD;
- mp3halfs.e=1; mp3halfs.d[0]=ONE; mp3halfs.d[1]=ONE; mp3halfs.d[2]=HALFRAD;
-
ey=EX/2; __cpy(x,&mpxn,p); mpxn.e -= (ey+ey);
__mp_dbl(&mpxn,&dx,p); dy=fastiroot(dx); __dbl_mp(dy,&mpu,p);
__mul(&mpxn,&mphalf,&mpz,p);