This is the mail archive of the newlib@sourceware.cygnus.com mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Patch for a few libm warnings


A few more libm warning cleanups - these removed redundant tests were
always true (the functions are only called with |x| >= 2.0), but the
compiler can't detect that, and if false, random uninitialized pointers
would be dereferenced, hence the "might be uninitialized" warnings
this patch removes.

The changes also bring a few double functions in sync with the float
ones (see the 2000-04-17 changes), and fix typos in comments.

I hereby place these changes in the public domain.  Please consider
installing them.  It might also be a good idea to restore -W -Wall
as there are still a few warnings left, which might or might not
indicate potential bugs.

Thanks,
Marek

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.

Index: newlib/libm/common/s_expm1.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/common/s_expm1.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 s_expm1.c
*** s_expm1.c	2000/02/17 19:39:51	1.1.1.1
--- s_expm1.c	2000/05/26 09:04:49
*************** Q5  =  -2.01099218183624371326e-07; /* B
*** 239,247 ****
  	    e  = (x*(e-c)-c);
  	    e -= hxs;
  	    if(k== -1) return 0.5*(x-e)-0.5;
! 	    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);
--- 239,248 ----
  	    e  = (x*(e-c)-c);
  	    e -= hxs;
  	    if(k== -1) return 0.5*(x-e)-0.5;
! 	    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);
Index: newlib/libm/common/s_log1p.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/common/s_log1p.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 s_log1p.c
*** s_log1p.c	2000/02/17 19:39:51	1.1.1.1
--- s_log1p.c	2000/05/26 09:04:50
*************** static double zero = 0.0;
*** 201,208 ****
  	}
  	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;}
  	    R = hfsq*(1.0-0.66666666666666666*f);
  	    if(k==0) return f-R; else
  	    	     return k*ln2_hi-((R-(k*ln2_lo+c))-f);
--- 201,208 ----
  	}
  	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;}}
  	    R = hfsq*(1.0-0.66666666666666666*f);
  	    if(k==0) return f-R; else
  	    	     return k*ln2_hi-((R-(k*ln2_lo+c))-f);
Index: newlib/libm/common/s_scalbn.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/common/s_scalbn.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 s_scalbn.c
*** s_scalbn.c	2000/02/17 19:39:51	1.1.1.1
--- s_scalbn.c	2000/05/26 09:04:50
*************** tiny   = 1.0e-300;
*** 91,100 ****
          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 (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;
--- 91,101 ----
          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 (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;
Index: newlib/libm/math/e_asin.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/math/e_asin.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 e_asin.c
*** e_asin.c	2000/02/17 19:39:51	1.1.1.1
--- e_asin.c	2000/05/26 09:04:50
*************** qS4 =  7.70381505559019352791e-02; /* 0x
*** 89,100 ****
  	} 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 
  		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);
--- 89,101 ----
  	} 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 {
  		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);
Index: newlib/libm/math/e_j0.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/math/e_j0.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 e_j0.c
*** e_j0.c	2000/02/17 19:39:51	1.1.1.1
--- e_j0.c	2000/05/26 09:04:50
*************** static double pS2[5] = {
*** 341,347 ****
  	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;}
  	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]))));
--- 341,347 ----
  	if(ix>=0x40200000)     {p = pR8; q= pS8;}
  	else if(ix>=0x40122E8B){p = pR5; q= pS5;}
  	else if(ix>=0x4006DB6D){p = pR3; q= pS3;}
! 	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]))));
*************** static double pS2[5] = {
*** 351,357 ****
  
  /* For x >= 8, the asymptotic expansions of qzero is
   *	-1/8 s + 75/1024 s^3 - ..., where s = 1/x.
!  * We approximate pzero 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
--- 351,357 ----
  
  /* For x >= 8, the asymptotic expansions of qzero is
   *	-1/8 s + 75/1024 s^3 - ..., where s = 1/x.
!  * 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
*************** static double qS2[6] = {
*** 477,483 ****
  	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;}
  	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])))));
--- 477,483 ----
  	if(ix>=0x40200000)     {p = qR8; q= qS8;}
  	else if(ix>=0x40122E8B){p = qR5; q= qS5;}
  	else if(ix>=0x4006DB6D){p = qR3; q= qS3;}
! 	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])))));
Index: newlib/libm/math/e_j1.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/math/e_j1.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 e_j1.c
*** e_j1.c	2000/02/17 19:39:51	1.1.1.1
--- e_j1.c	2000/05/26 09:04:50
*************** static double ps2[5] = {
*** 339,345 ****
          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;}
          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]))));
--- 339,345 ----
          if(ix>=0x40200000)     {p = pr8; q= ps8;}
          else if(ix>=0x40122E8B){p = pr5; q= ps5;}
          else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
!         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]))));
*************** static double ps2[5] = {
*** 349,355 ****
  
  /* For x >= 8, the asymptotic expansions of qone is
   *	3/8 s - 105/1024 s^3 - ..., where s = 1/x.
!  * We approximate pone 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
--- 349,355 ----
  
  /* For x >= 8, the asymptotic expansions of qone is
   *	3/8 s - 105/1024 s^3 - ..., where s = 1/x.
!  * 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
*************** static double qs2[6] = {
*** 476,482 ****
  	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;}
  	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])))));
--- 476,482 ----
  	if(ix>=0x40200000)     {p = qr8; q= qs8;}
  	else if(ix>=0x40122E8B){p = qr5; q= qs5;}
  	else if(ix>=0x4006DB6D){p = qr3; q= qs3;}
! 	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])))));
Index: newlib/libm/math/e_log.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/math/e_log.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 e_log.c
*** e_log.c	2000/02/17 19:39:51	1.1.1.1
--- e_log.c	2000/05/26 09:04:50
*************** static double zero   =  0.0;
*** 117,124 ****
  	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;}
  	    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);}
--- 117,124 ----
  	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;}}
  	    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);}
Index: newlib/libm/math/ef_asin.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/math/ef_asin.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 ef_asin.c
*** ef_asin.c	2000/02/17 19:39:51	1.1.1.1
--- ef_asin.c	2000/05/26 09:04:50
*************** qS4 =  7.7038154006e-02; /* 0x3d9dc62e *
*** 56,67 ****
  	} 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 
  		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);
--- 56,68 ----
  	} 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 {
  		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);
Index: newlib/libm/math/ef_j0.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/math/ef_j0.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 ef_j0.c
*** ef_j0.c	2000/02/17 19:39:51	1.1.1.1
--- ef_j0.c	2000/05/26 09:04:50
*************** static float pS2[5] = {
*** 295,301 ****
  	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;}
  	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]))));
--- 295,301 ----
  	if(ix>=0x41000000)     {p = pR8; q= pS8;}
  	else if(ix>=0x40f71c58){p = pR5; q= pS5;}
  	else if(ix>=0x4036db68){p = pR3; q= pS3;}
! 	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]))));
*************** static float pS2[5] = {
*** 305,311 ****
  
  /* For x >= 8, the asymptotic expansions of qzero is
   *	-1/8 s + 75/1024 s^3 - ..., where s = 1/x.
!  * We approximate pzero 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
--- 305,311 ----
  
  /* For x >= 8, the asymptotic expansions of qzero is
   *	-1/8 s + 75/1024 s^3 - ..., where s = 1/x.
!  * 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
*************** static float qS2[6] = {
*** 431,437 ****
  	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;}
  	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])))));
--- 431,437 ----
  	if(ix>=0x41000000)     {p = qR8; q= qS8;}
  	else if(ix>=0x40f71c58){p = qR5; q= qS5;}
  	else if(ix>=0x4036db68){p = qR3; q= qS3;}
! 	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])))));
Index: newlib/libm/math/ef_j1.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/math/ef_j1.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 ef_j1.c
*** ef_j1.c	2000/02/17 19:39:51	1.1.1.1
--- ef_j1.c	2000/05/26 09:04:50
*************** static float ps2[5] = {
*** 294,300 ****
          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;}
          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]))));
--- 294,300 ----
          if(ix>=0x41000000)     {p = pr8; q= ps8;}
          else if(ix>=0x40f71c58){p = pr5; q= ps5;}
          else if(ix>=0x4036db68){p = pr3; q= ps3;}
!         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]))));
*************** static float ps2[5] = {
*** 304,310 ****
  
  /* For x >= 8, the asymptotic expansions of qone is
   *	3/8 s - 105/1024 s^3 - ..., where s = 1/x.
!  * We approximate pone 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
--- 304,310 ----
  
  /* For x >= 8, the asymptotic expansions of qone is
   *	3/8 s - 105/1024 s^3 - ..., where s = 1/x.
!  * 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
*************** static float qs2[6] = {
*** 431,437 ****
  	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;}
  	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])))));
--- 431,437 ----
  	if(ix>=0x40200000)     {p = qr8; q= qs8;}
  	else if(ix>=0x40f71c58){p = qr5; q= qs5;}
  	else if(ix>=0x4036db68){p = qr3; q= qs3;}
! 	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])))));
Index: newlib/libm/mathfp/e_j0.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/mathfp/e_j0.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 e_j0.c
*** e_j0.c	2000/02/17 19:39:51	1.1.1.1
--- e_j0.c	2000/05/26 09:04:51
*************** static double pS2[5] = {
*** 341,347 ****
  	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;}
  	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]))));
--- 341,347 ----
  	if(ix>=0x40200000)     {p = pR8; q= pS8;}
  	else if(ix>=0x40122E8B){p = pR5; q= pS5;}
  	else if(ix>=0x4006DB6D){p = pR3; q= pS3;}
! 	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]))));
*************** static double pS2[5] = {
*** 351,357 ****
  
  /* For x >= 8, the asymptotic expansions of qzero is
   *	-1/8 s + 75/1024 s^3 - ..., where s = 1/x.
!  * We approximate pzero 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
--- 351,357 ----
  
  /* For x >= 8, the asymptotic expansions of qzero is
   *	-1/8 s + 75/1024 s^3 - ..., where s = 1/x.
!  * 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
*************** static double qS2[6] = {
*** 477,483 ****
  	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;}
  	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])))));
--- 477,483 ----
  	if(ix>=0x40200000)     {p = qR8; q= qS8;}
  	else if(ix>=0x40122E8B){p = qR5; q= qS5;}
  	else if(ix>=0x4006DB6D){p = qR3; q= qS3;}
! 	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])))));
Index: newlib/libm/mathfp/e_j1.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/mathfp/e_j1.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 e_j1.c
*** e_j1.c	2000/02/17 19:39:52	1.1.1.1
--- e_j1.c	2000/05/26 09:04:51
*************** static double ps2[5] = {
*** 339,345 ****
          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;}
          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]))));
--- 339,345 ----
          if(ix>=0x40200000)     {p = pr8; q= ps8;}
          else if(ix>=0x40122E8B){p = pr5; q= ps5;}
          else if(ix>=0x4006DB6D){p = pr3; q= ps3;}
!         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]))));
*************** static double ps2[5] = {
*** 349,355 ****
  
  /* For x >= 8, the asymptotic expansions of qone is
   *	3/8 s - 105/1024 s^3 - ..., where s = 1/x.
!  * We approximate pone 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
--- 349,355 ----
  
  /* For x >= 8, the asymptotic expansions of qone is
   *	3/8 s - 105/1024 s^3 - ..., where s = 1/x.
!  * 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
*************** static double qs2[6] = {
*** 476,482 ****
  	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;}
  	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])))));
--- 476,482 ----
  	if(ix>=0x40200000)     {p = qr8; q= qs8;}
  	else if(ix>=0x40122E8B){p = qr5; q= qs5;}
  	else if(ix>=0x4006DB6D){p = qr3; q= qs3;}
! 	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])))));
Index: newlib/libm/mathfp/ef_j0.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/mathfp/ef_j0.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 ef_j0.c
*** ef_j0.c	2000/02/17 19:39:52	1.1.1.1
--- ef_j0.c	2000/05/26 09:04:51
*************** static float pS2[5] = {
*** 295,301 ****
  	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;}
  	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]))));
--- 295,301 ----
  	if(ix>=0x41000000)     {p = pR8; q= pS8;}
  	else if(ix>=0x40f71c58){p = pR5; q= pS5;}
  	else if(ix>=0x4036db68){p = pR3; q= pS3;}
! 	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]))));
*************** static float pS2[5] = {
*** 305,311 ****
  
  /* For x >= 8, the asymptotic expansions of qzero is
   *	-1/8 s + 75/1024 s^3 - ..., where s = 1/x.
!  * We approximate pzero 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
--- 305,311 ----
  
  /* For x >= 8, the asymptotic expansions of qzero is
   *	-1/8 s + 75/1024 s^3 - ..., where s = 1/x.
!  * 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
*************** static float qS2[6] = {
*** 431,437 ****
  	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;}
  	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])))));
--- 431,437 ----
  	if(ix>=0x41000000)     {p = qR8; q= qS8;}
  	else if(ix>=0x40f71c58){p = qR5; q= qS5;}
  	else if(ix>=0x4036db68){p = qR3; q= qS3;}
! 	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])))));
Index: newlib/libm/mathfp/ef_j1.c
===================================================================
RCS file: /cvs/src/src/newlib/libm/mathfp/ef_j1.c,v
retrieving revision 1.1.1.1
diff -c -3 -p -r1.1.1.1 ef_j1.c
*** ef_j1.c	2000/02/17 19:39:52	1.1.1.1
--- ef_j1.c	2000/05/26 09:04:51
*************** static float ps2[5] = {
*** 294,300 ****
          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;}
          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]))));
--- 294,300 ----
          if(ix>=0x41000000)     {p = pr8; q= ps8;}
          else if(ix>=0x40f71c58){p = pr5; q= ps5;}
          else if(ix>=0x4036db68){p = pr3; q= ps3;}
!         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]))));
*************** static float ps2[5] = {
*** 304,310 ****
  
  /* For x >= 8, the asymptotic expansions of qone is
   *	3/8 s - 105/1024 s^3 - ..., where s = 1/x.
!  * We approximate pone 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
--- 304,310 ----
  
  /* For x >= 8, the asymptotic expansions of qone is
   *	3/8 s - 105/1024 s^3 - ..., where s = 1/x.
!  * 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
*************** static float qs2[6] = {
*** 431,437 ****
  	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;}
  	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])))));
--- 431,437 ----
  	if(ix>=0x40200000)     {p = qr8; q= qs8;}
  	else if(ix>=0x40f71c58){p = qr5; q= qs5;}
  	else if(ix>=0x4036db68){p = qr3; q= qs3;}
! 	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])))));



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]