Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Dec 2014 19:00:56 +0000 (UTC)
From:      Steve Kargl <kargl@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r275518 - head/lib/msun/src
Message-ID:  <201412051900.sB5J0u0U080870@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kargl
Date: Fri Dec  5 19:00:55 2014
New Revision: 275518
URL: https://svnweb.freebsd.org/changeset/base/275518

Log:
  Update the constants associated with the evaluation of j0f(x)
  for |x| small.
  
  While here, remove the explicit cast of 0.25 to float.  Replace
  a multiplication involving 0.25 by a division using an integer
  constant 4.  Make a similar change in j0() to minimize the diff.
  
  Suggested by:	bde

Modified:
  head/lib/msun/src/e_j0.c
  head/lib/msun/src/e_j0f.c

Modified: head/lib/msun/src/e_j0.c
==============================================================================
--- head/lib/msun/src/e_j0.c	Fri Dec  5 18:55:32 2014	(r275517)
+++ head/lib/msun/src/e_j0.c	Fri Dec  5 19:00:55 2014	(r275518)
@@ -115,7 +115,7 @@ __ieee754_j0(double x)
 	if(ix<0x3f200000) {	/* |x| < 2**-13 */
 	    if(huge+x>one) {	/* raise inexact if x != 0 */
 	        if(ix<0x3e400000) return one;	/* |x|<2**-27 */
-	        else 	      return one - 0.25*x*x;
+	        else 	      return one - x*x/4;
 	    }
 	}
 	z = x*x;

Modified: head/lib/msun/src/e_j0f.c
==============================================================================
--- head/lib/msun/src/e_j0f.c	Fri Dec  5 18:55:32 2014	(r275517)
+++ head/lib/msun/src/e_j0f.c	Fri Dec  5 19:00:55 2014	(r275518)
@@ -69,10 +69,10 @@ __ieee754_j0f(float x)
 		}
 		return z;
 	}
-	if(ix<0x39000000) {	/* |x| < 2**-13 */
+	if(ix<0x3c000000) {	/* |x| < 2**-7 */
 	    if(huge+x>one) {	/* raise inexact if x != 0 */
-	        if(ix<0x32000000) return one;	/* |x|<2**-27 */
-	        else 	      return one - (float)0.25*x*x;
+	        if(ix<0x39800000) return one;	/* |x|<2**-12 */
+	        else 	      return one - x*x/4;
 	    }
 	}
 	z = x*x;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412051900.sB5J0u0U080870>