summaryrefslogtreecommitdiff
path: root/libc/sysdeps/ieee754/dbl-64/e_log.c
diff options
context:
space:
mode:
authorjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-10-25 00:37:10 +0000
committerjoseph <joseph@7b3dc134-2b1b-0410-93df-9e9f96275f8d>2011-10-25 00:37:10 +0000
commit4bbe4e2185c5484328182720ff7b3bb4f9593bff (patch)
treecd67e40a74928c0f58d4f5b79d2e260e4099fee7 /libc/sysdeps/ieee754/dbl-64/e_log.c
parent91b4be71461f78cabe1fb5f164cea71b60e9e98a (diff)
downloadeglibc2-4bbe4e2185c5484328182720ff7b3bb4f9593bff.tar.gz
Merge changes between r15223 and r15532 from /fsf/trunk.
git-svn-id: svn://svn.eglibc.org/trunk@15545 7b3dc134-2b1b-0410-93df-9e9f96275f8d
Diffstat (limited to 'libc/sysdeps/ieee754/dbl-64/e_log.c')
-rw-r--r--libc/sysdeps/ieee754/dbl-64/e_log.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/libc/sysdeps/ieee754/dbl-64/e_log.c b/libc/sysdeps/ieee754/dbl-64/e_log.c
index 1a9967b54..14851638a 100644
--- a/libc/sysdeps/ieee754/dbl-64/e_log.c
+++ b/libc/sysdeps/ieee754/dbl-64/e_log.c
@@ -1,7 +1,7 @@
/*
* IBM Accurate Mathematical Library
* written by International Business Machines Corp.
- * Copyright (C) 2001 Free Software Foundation
+ * Copyright (C) 2001, 2011 Free Software Foundation
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -36,7 +36,7 @@
#include "endian.h"
-#include "dla.h"
+#include <dla.h>
#include "mpa.h"
#include "MathLib.h"
#include "math_private.h"
@@ -55,9 +55,12 @@ double __ieee754_log(double x) {
int k;
#endif
double dbl_n,u,p0,q,r0,w,nln2a,luai,lubi,lvaj,lvbj,
- sij,ssij,ttij,A,B,B0,y,y1,y2,polI,polII,sa,sb,
- t1,t2,t3,t4,t5,t6,t7,t8,t,ra,rb,ww,
- a0,aa0,s1,s2,ss2,s3,ss3,a1,aa1,a,aa,b,bb,c;
+ sij,ssij,ttij,A,B,B0,y,y1,y2,polI,polII,sa,sb,
+ t1,t2,t7,t8,t,ra,rb,ww,
+ a0,aa0,s1,s2,ss2,s3,ss3,a1,aa1,a,aa,b,bb,c;
+#ifndef DLA_FMA
+ double t3,t4,t5,t6;
+#endif
number num;
mp_no mpx,mpy,mpy1,mpy2,mperr;
@@ -68,18 +71,21 @@ double __ieee754_log(double x) {
num.d = x; ux = num.i[HIGH_HALF]; dx = num.i[LOW_HALF];
n=0;
- if (ux < 0x00100000) {
- if (((ux & 0x7fffffff) | dx) == 0) return MHALF/ZERO; /* return -INF */
- if (ux < 0) return (x-x)/ZERO; /* return NaN */
+ if (__builtin_expect(ux < 0x00100000, 0)) {
+ if (__builtin_expect(((ux & 0x7fffffff) | dx) == 0, 0))
+ return MHALF/ZERO; /* return -INF */
+ if (__builtin_expect(ux < 0, 0))
+ return (x-x)/ZERO; /* return NaN */
n -= 54; x *= two54.d; /* scale x */
num.d = x;
}
- if (ux >= 0x7ff00000) return x+x; /* INF or NaN */
+ if (__builtin_expect(ux >= 0x7ff00000, 0))
+ return x+x; /* INF or NaN */
/* Regular values of x */
w = x-ONE;
- if (ABS(w) > U03) { goto case_03; }
+ if (__builtin_expect(ABS(w) > U03, 1)) { goto case_03; }
/*--- Stage I, the case abs(x-1) < 0.03 */
@@ -90,7 +96,7 @@ double __ieee754_log(double x) {
/* Evaluate polynomial II */
polII = (b0.d+w*(b1.d+w*(b2.d+w*(b3.d+w*(b4.d+
- w*(b5.d+w*(b6.d+w*(b7.d+w*b8.d))))))))*w*w*w;
+ w*(b5.d+w*(b6.d+w*(b7.d+w*b8.d))))))))*w*w*w;
c = (aa+bb)+polII;
/* End stage I, case abs(x-1) < 0.03 */
@@ -99,7 +105,7 @@ double __ieee754_log(double x) {
/*--- Stage II, the case abs(x-1) < 0.03 */
a = d11.d+w*(d12.d+w*(d13.d+w*(d14.d+w*(d15.d+w*(d16.d+
- w*(d17.d+w*(d18.d+w*(d19.d+w*d20.d))))))));
+ w*(d17.d+w*(d18.d+w*(d19.d+w*d20.d))))))));
EMULV(w,a,s2,ss2,t1,t2,t3,t4,t5)
ADD2(d10.d,dd10.d,s2,ss2,s3,ss3,t1,t2)
MUL2(w,ZERO,s3,ss3,s2,ss2,t1,t2,t3,t4,t5,t6,t7,t8)
@@ -201,3 +207,4 @@ double __ieee754_log(double x) {
}
return y1;
}
+strong_alias (__ieee754_log, __log_finite)