aboutsummaryrefslogtreecommitdiff
path: root/newlib/libm/math
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2000-05-26 22:42:39 +0000
committerJeff Johnston <jjohnstn@redhat.com>2000-05-26 22:42:39 +0000
commit8887021868a19a9feb8d4cdb22148823ee42579b (patch)
treec3ac1cbf18fa5bd246106ad5d916cb7c03c048b9 /newlib/libm/math
parente8844e5d9f6a07f7846ad0766cc3ef6e08dce8f5 (diff)
downloadnewlib-8887021868a19a9feb8d4cdb22148823ee42579b.zip
newlib-8887021868a19a9feb8d4cdb22148823ee42579b.tar.gz
newlib-8887021868a19a9feb8d4cdb22148823ee42579b.tar.bz2
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/math')
-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
7 files changed, 18 insertions, 16 deletions
diff --git a/newlib/libm/math/e_asin.c b/newlib/libm/math/e_asin.c
index 559f288..4b6f45e 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 43ea389..13773cb 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 feaa732..098eb56 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 774ca38..72cddb2 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 bbe210b..64f3608 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 5ae6f30..e7ee6e7 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 a3e75f6..e11cf1f 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])))));