Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2000-05-27 02:42:39 +0400
committerJeff Johnston <jjohnstn@redhat.com>2000-05-27 02:42:39 +0400
commit8887021868a19a9feb8d4cdb22148823ee42579b (patch)
treec3ac1cbf18fa5bd246106ad5d916cb7c03c048b9 /newlib/libm
parente8844e5d9f6a07f7846ad0766cc3ef6e08dce8f5 (diff)
2000-05-26 Marek Michalkiewicz <marekm@linux.org.pl>
* libm/common/s_expm1.c (expm1): Add curly braces, avoid warnings. * libm/common/s_log1p.c (log1p): Likewise. * libm/common/s_scalbn.c (scalbn): Likewise. * libm/math/e_log.c: Likewise. * libm/math/e_asin.c: Likewise. * libm/math/ef_asin.c: Likewise. * libm/math/e_j0.c (pzero, qzero): Remove redundant test. * libm/math/e_j1.c (pone, qone): Likewise. * libm/math/ef_j0.c (pzerof, qzerof): Likewise. * libm/math/ef_j1.c (ponef, qonef): Likewise. * libm/mathfp/e_j0.c (pzero, qzero): Likewise. * libm/mathfp/e_j1.c (pone, qone): Likewise. * libm/mathfp/ef_j0.c (pzerof, qzerof): Likewise. * libm/mathfp/ef_j1.c (ponef, qonef): Likewise.
Diffstat (limited to 'newlib/libm')
-rw-r--r--newlib/libm/common/s_expm1.c3
-rw-r--r--newlib/libm/common/s_log1p.c4
-rw-r--r--newlib/libm/common/s_scalbn.c3
-rw-r--r--newlib/libm/math/e_asin.c3
-rw-r--r--newlib/libm/math/e_j0.c6
-rw-r--r--newlib/libm/math/e_j1.c6
-rw-r--r--newlib/libm/math/e_log.c4
-rw-r--r--newlib/libm/math/ef_asin.c3
-rw-r--r--newlib/libm/math/ef_j0.c6
-rw-r--r--newlib/libm/math/ef_j1.c6
-rw-r--r--newlib/libm/mathfp/e_j0.c6
-rw-r--r--newlib/libm/mathfp/e_j1.c6
-rw-r--r--newlib/libm/mathfp/ef_j0.c6
-rw-r--r--newlib/libm/mathfp/ef_j1.c6
14 files changed, 36 insertions, 32 deletions
diff --git a/newlib/libm/common/s_expm1.c b/newlib/libm/common/s_expm1.c
index bc0e2f23e..c857c32f2 100644
--- a/newlib/libm/common/s_expm1.c
+++ b/newlib/libm/common/s_expm1.c
@@ -239,9 +239,10 @@ Q5 = -2.01099218183624371326e-07; /* BE8AFDB7 6E09C32D */
e = (x*(e-c)-c);
e -= hxs;
if(k== -1) return 0.5*(x-e)-0.5;
- if(k==1)
+ if(k==1) {
if(x < -0.25) return -2.0*(e-(x+0.5));
else return one+2.0*(x-e);
+ }
if (k <= -2 || k>56) { /* suffice to return exp(x)-1 */
__uint32_t high;
y = one-(e-x);
diff --git a/newlib/libm/common/s_log1p.c b/newlib/libm/common/s_log1p.c
index 3c3d49733..351c887e7 100644
--- a/newlib/libm/common/s_log1p.c
+++ b/newlib/libm/common/s_log1p.c
@@ -201,8 +201,8 @@ static double zero = 0.0;
}
hfsq=0.5*f*f;
if(hu==0) { /* |f| < 2**-20 */
- if(f==zero) if(k==0) return zero;
- else {c += k*ln2_lo; return k*ln2_hi+c;}
+ if(f==zero) { if(k==0) return zero;
+ else {c += k*ln2_lo; return k*ln2_hi+c;}}
R = hfsq*(1.0-0.66666666666666666*f);
if(k==0) return f-R; else
return k*ln2_hi-((R-(k*ln2_lo+c))-f);
diff --git a/newlib/libm/common/s_scalbn.c b/newlib/libm/common/s_scalbn.c
index 245888fc8..e06767042 100644
--- a/newlib/libm/common/s_scalbn.c
+++ b/newlib/libm/common/s_scalbn.c
@@ -91,10 +91,11 @@ tiny = 1.0e-300;
if (k > 0x7fe) return huge*copysign(huge,x); /* overflow */
if (k > 0) /* normal result */
{SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20)); return x;}
- if (k <= -54)
+ if (k <= -54) {
if (n > 50000) /* in case integer overflow in n+k */
return huge*copysign(huge,x); /*overflow*/
else return tiny*copysign(tiny,x); /*underflow*/
+ }
k += 54; /* subnormal result */
SET_HIGH_WORD(x,(hx&0x800fffff)|(k<<20));
return x*twom54;
diff --git a/newlib/libm/math/e_asin.c b/newlib/libm/math/e_asin.c
index 559f2884a..4b6f45e15 100644
--- a/newlib/libm/math/e_asin.c
+++ b/newlib/libm/math/e_asin.c
@@ -89,12 +89,13 @@ qS4 = 7.70381505559019352791e-02; /* 0x3FB3B8C5, 0xB12E9282 */
} else if (ix<0x3fe00000) { /* |x|<0.5 */
if(ix<0x3e400000) { /* if |x| < 2**-27 */
if(huge+x>one) return x;/* return x with inexact if x!=0*/
- } else
+ } else {
t = x*x;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
w = p/q;
return x+x*w;
+ }
}
/* 1> |x|>= 0.5 */
w = one-fabs(x);
diff --git a/newlib/libm/math/e_j0.c b/newlib/libm/math/e_j0.c
index 43ea38982..13773cbf9 100644
--- a/newlib/libm/math/e_j0.c
+++ b/newlib/libm/math/e_j0.c
@@ -341,7 +341,7 @@ static double pS2[5] = {
if(ix>=0x40200000) {p = pR8; q= pS8;}
else if(ix>=0x40122E8B){p = pR5; q= pS5;}
else if(ix>=0x4006DB6D){p = pR3; q= pS3;}
- else if(ix>=0x40000000){p = pR2; q= pS2;}
+ else {p = pR2; q= pS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -351,7 +351,7 @@ static double pS2[5] = {
/* For x >= 8, the asymptotic expansions of qzero is
* -1/8 s + 75/1024 s^3 - ..., where s = 1/x.
- * We approximate pzero by
+ * We approximate qzero by
* qzero(x) = s*(-1.25 + (R/S))
* where R = qR0 + qR1*s^2 + qR2*s^4 + ... + qR5*s^10
* S = 1 + qS0*s^2 + ... + qS5*s^12
@@ -477,7 +477,7 @@ static double qS2[6] = {
if(ix>=0x40200000) {p = qR8; q= qS8;}
else if(ix>=0x40122E8B){p = qR5; q= qS5;}
else if(ix>=0x4006DB6D){p = qR3; q= qS3;}
- else if(ix>=0x40000000){p = qR2; q= qS2;}
+ else {p = qR2; q= qS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
diff --git a/newlib/libm/math/e_j1.c b/newlib/libm/math/e_j1.c
index feaa732de..098eb569e 100644
--- a/newlib/libm/math/e_j1.c
+++ b/newlib/libm/math/e_j1.c
@@ -339,7 +339,7 @@ static double ps2[5] = {
if(ix>=0x40200000) {p = pr8; q= ps8;}
else if(ix>=0x40122E8B){p = pr5; q= ps5;}
else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
- else if(ix>=0x40000000){p = pr2; q= ps2;}
+ else {p = pr2; q= ps2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -349,7 +349,7 @@ static double ps2[5] = {
/* For x >= 8, the asymptotic expansions of qone is
* 3/8 s - 105/1024 s^3 - ..., where s = 1/x.
- * We approximate pone by
+ * We approximate qone by
* qone(x) = s*(0.375 + (R/S))
* where R = qr1*s^2 + qr2*s^4 + ... + qr5*s^10
* S = 1 + qs1*s^2 + ... + qs6*s^12
@@ -476,7 +476,7 @@ static double qs2[6] = {
if(ix>=0x40200000) {p = qr8; q= qs8;}
else if(ix>=0x40122E8B){p = qr5; q= qs5;}
else if(ix>=0x4006DB6D){p = qr3; q= qs3;}
- else if(ix>=0x40000000){p = qr2; q= qs2;}
+ else {p = qr2; q= qs2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
diff --git a/newlib/libm/math/e_log.c b/newlib/libm/math/e_log.c
index 774ca389f..72cddb2f8 100644
--- a/newlib/libm/math/e_log.c
+++ b/newlib/libm/math/e_log.c
@@ -117,8 +117,8 @@ static double zero = 0.0;
k += (i>>20);
f = x-1.0;
if((0x000fffff&(2+hx))<3) { /* |f| < 2**-20 */
- if(f==zero) if(k==0) return zero; else {dk=(double)k;
- return dk*ln2_hi+dk*ln2_lo;}
+ if(f==zero) { if(k==0) return zero; else {dk=(double)k;
+ return dk*ln2_hi+dk*ln2_lo;}}
R = f*f*(0.5-0.33333333333333333*f);
if(k==0) return f-R; else {dk=(double)k;
return dk*ln2_hi-((R-dk*ln2_lo)-f);}
diff --git a/newlib/libm/math/ef_asin.c b/newlib/libm/math/ef_asin.c
index bbe210b7c..64f3608d3 100644
--- a/newlib/libm/math/ef_asin.c
+++ b/newlib/libm/math/ef_asin.c
@@ -56,12 +56,13 @@ qS4 = 7.7038154006e-02; /* 0x3d9dc62e */
} else if (ix<0x3f000000) { /* |x|<0.5 */
if(ix<0x32000000) { /* if |x| < 2**-27 */
if(huge+x>one) return x;/* return x with inexact if x!=0*/
- } else
+ } else {
t = x*x;
p = t*(pS0+t*(pS1+t*(pS2+t*(pS3+t*(pS4+t*pS5)))));
q = one+t*(qS1+t*(qS2+t*(qS3+t*qS4)));
w = p/q;
return x+x*w;
+ }
}
/* 1> |x|>= 0.5 */
w = one-fabsf(x);
diff --git a/newlib/libm/math/ef_j0.c b/newlib/libm/math/ef_j0.c
index 5ae6f308f..e7ee6e748 100644
--- a/newlib/libm/math/ef_j0.c
+++ b/newlib/libm/math/ef_j0.c
@@ -295,7 +295,7 @@ static float pS2[5] = {
if(ix>=0x41000000) {p = pR8; q= pS8;}
else if(ix>=0x40f71c58){p = pR5; q= pS5;}
else if(ix>=0x4036db68){p = pR3; q= pS3;}
- else if(ix>=0x40000000){p = pR2; q= pS2;}
+ else {p = pR2; q= pS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -305,7 +305,7 @@ static float pS2[5] = {
/* For x >= 8, the asymptotic expansions of qzero is
* -1/8 s + 75/1024 s^3 - ..., where s = 1/x.
- * We approximate pzero by
+ * We approximate qzero by
* qzero(x) = s*(-1.25 + (R/S))
* where R = qR0 + qR1*s^2 + qR2*s^4 + ... + qR5*s^10
* S = 1 + qS0*s^2 + ... + qS5*s^12
@@ -431,7 +431,7 @@ static float qS2[6] = {
if(ix>=0x41000000) {p = qR8; q= qS8;}
else if(ix>=0x40f71c58){p = qR5; q= qS5;}
else if(ix>=0x4036db68){p = qR3; q= qS3;}
- else if(ix>=0x40000000){p = qR2; q= qS2;}
+ else {p = qR2; q= qS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
diff --git a/newlib/libm/math/ef_j1.c b/newlib/libm/math/ef_j1.c
index a3e75f651..e11cf1fba 100644
--- a/newlib/libm/math/ef_j1.c
+++ b/newlib/libm/math/ef_j1.c
@@ -294,7 +294,7 @@ static float ps2[5] = {
if(ix>=0x41000000) {p = pr8; q= ps8;}
else if(ix>=0x40f71c58){p = pr5; q= ps5;}
else if(ix>=0x4036db68){p = pr3; q= ps3;}
- else if(ix>=0x40000000){p = pr2; q= ps2;}
+ else {p = pr2; q= ps2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -304,7 +304,7 @@ static float ps2[5] = {
/* For x >= 8, the asymptotic expansions of qone is
* 3/8 s - 105/1024 s^3 - ..., where s = 1/x.
- * We approximate pone by
+ * We approximate qone by
* qone(x) = s*(0.375 + (R/S))
* where R = qr1*s^2 + qr2*s^4 + ... + qr5*s^10
* S = 1 + qs1*s^2 + ... + qs6*s^12
@@ -431,7 +431,7 @@ static float qs2[6] = {
if(ix>=0x40200000) {p = qr8; q= qs8;}
else if(ix>=0x40f71c58){p = qr5; q= qs5;}
else if(ix>=0x4036db68){p = qr3; q= qs3;}
- else if(ix>=0x40000000){p = qr2; q= qs2;}
+ else {p = qr2; q= qs2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
diff --git a/newlib/libm/mathfp/e_j0.c b/newlib/libm/mathfp/e_j0.c
index c53cc68f4..c58c08e70 100644
--- a/newlib/libm/mathfp/e_j0.c
+++ b/newlib/libm/mathfp/e_j0.c
@@ -341,7 +341,7 @@ static double pS2[5] = {
if(ix>=0x40200000) {p = pR8; q= pS8;}
else if(ix>=0x40122E8B){p = pR5; q= pS5;}
else if(ix>=0x4006DB6D){p = pR3; q= pS3;}
- else if(ix>=0x40000000){p = pR2; q= pS2;}
+ else {p = pR2; q= pS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -351,7 +351,7 @@ static double pS2[5] = {
/* For x >= 8, the asymptotic expansions of qzero is
* -1/8 s + 75/1024 s^3 - ..., where s = 1/x.
- * We approximate pzero by
+ * We approximate qzero by
* qzero(x) = s*(-1.25 + (R/S))
* where R = qR0 + qR1*s^2 + qR2*s^4 + ... + qR5*s^10
* S = 1 + qS0*s^2 + ... + qS5*s^12
@@ -477,7 +477,7 @@ static double qS2[6] = {
if(ix>=0x40200000) {p = qR8; q= qS8;}
else if(ix>=0x40122E8B){p = qR5; q= qS5;}
else if(ix>=0x4006DB6D){p = qR3; q= qS3;}
- else if(ix>=0x40000000){p = qR2; q= qS2;}
+ else {p = qR2; q= qS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
diff --git a/newlib/libm/mathfp/e_j1.c b/newlib/libm/mathfp/e_j1.c
index f93c77e00..274adfdc8 100644
--- a/newlib/libm/mathfp/e_j1.c
+++ b/newlib/libm/mathfp/e_j1.c
@@ -339,7 +339,7 @@ static double ps2[5] = {
if(ix>=0x40200000) {p = pr8; q= ps8;}
else if(ix>=0x40122E8B){p = pr5; q= ps5;}
else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
- else if(ix>=0x40000000){p = pr2; q= ps2;}
+ else {p = pr2; q= ps2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -349,7 +349,7 @@ static double ps2[5] = {
/* For x >= 8, the asymptotic expansions of qone is
* 3/8 s - 105/1024 s^3 - ..., where s = 1/x.
- * We approximate pone by
+ * We approximate qone by
* qone(x) = s*(0.375 + (R/S))
* where R = qr1*s^2 + qr2*s^4 + ... + qr5*s^10
* S = 1 + qs1*s^2 + ... + qs6*s^12
@@ -476,7 +476,7 @@ static double qs2[6] = {
if(ix>=0x40200000) {p = qr8; q= qs8;}
else if(ix>=0x40122E8B){p = qr5; q= qs5;}
else if(ix>=0x4006DB6D){p = qr3; q= qs3;}
- else if(ix>=0x40000000){p = qr2; q= qs2;}
+ else {p = qr2; q= qs2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
diff --git a/newlib/libm/mathfp/ef_j0.c b/newlib/libm/mathfp/ef_j0.c
index 65975f4a5..e4cc1081f 100644
--- a/newlib/libm/mathfp/ef_j0.c
+++ b/newlib/libm/mathfp/ef_j0.c
@@ -295,7 +295,7 @@ static float pS2[5] = {
if(ix>=0x41000000) {p = pR8; q= pS8;}
else if(ix>=0x40f71c58){p = pR5; q= pS5;}
else if(ix>=0x4036db68){p = pR3; q= pS3;}
- else if(ix>=0x40000000){p = pR2; q= pS2;}
+ else {p = pR2; q= pS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -305,7 +305,7 @@ static float pS2[5] = {
/* For x >= 8, the asymptotic expansions of qzero is
* -1/8 s + 75/1024 s^3 - ..., where s = 1/x.
- * We approximate pzero by
+ * We approximate qzero by
* qzero(x) = s*(-1.25 + (R/S))
* where R = qR0 + qR1*s^2 + qR2*s^4 + ... + qR5*s^10
* S = 1 + qS0*s^2 + ... + qS5*s^12
@@ -431,7 +431,7 @@ static float qS2[6] = {
if(ix>=0x41000000) {p = qR8; q= qS8;}
else if(ix>=0x40f71c58){p = qR5; q= qS5;}
else if(ix>=0x4036db68){p = qR3; q= qS3;}
- else if(ix>=0x40000000){p = qR2; q= qS2;}
+ else {p = qR2; q= qS2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));
diff --git a/newlib/libm/mathfp/ef_j1.c b/newlib/libm/mathfp/ef_j1.c
index 04c12cff2..636a4c961 100644
--- a/newlib/libm/mathfp/ef_j1.c
+++ b/newlib/libm/mathfp/ef_j1.c
@@ -294,7 +294,7 @@ static float ps2[5] = {
if(ix>=0x41000000) {p = pr8; q= ps8;}
else if(ix>=0x40f71c58){p = pr5; q= ps5;}
else if(ix>=0x4036db68){p = pr3; q= ps3;}
- else if(ix>=0x40000000){p = pr2; q= ps2;}
+ else {p = pr2; q= ps2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*q[4]))));
@@ -304,7 +304,7 @@ static float ps2[5] = {
/* For x >= 8, the asymptotic expansions of qone is
* 3/8 s - 105/1024 s^3 - ..., where s = 1/x.
- * We approximate pone by
+ * We approximate qone by
* qone(x) = s*(0.375 + (R/S))
* where R = qr1*s^2 + qr2*s^4 + ... + qr5*s^10
* S = 1 + qs1*s^2 + ... + qs6*s^12
@@ -431,7 +431,7 @@ static float qs2[6] = {
if(ix>=0x40200000) {p = qr8; q= qs8;}
else if(ix>=0x40f71c58){p = qr5; q= qs5;}
else if(ix>=0x4036db68){p = qr3; q= qs3;}
- else if(ix>=0x40000000){p = qr2; q= qs2;}
+ else {p = qr2; q= qs2;}
z = one/(x*x);
r = p[0]+z*(p[1]+z*(p[2]+z*(p[3]+z*(p[4]+z*p[5]))));
s = one+z*(q[0]+z*(q[1]+z*(q[2]+z*(q[3]+z*(q[4]+z*q[5])))));