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;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to