From owner-svn-src-all@FreeBSD.ORG Thu Feb 10 07:37:50 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C1E3106564A; Thu, 10 Feb 2011 07:37:50 +0000 (UTC) (envelope-from das@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 60B4C8FC0A; Thu, 10 Feb 2011 07:37:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p1A7boUb013630; Thu, 10 Feb 2011 07:37:50 GMT (envelope-from das@svn.freebsd.org) Received: (from das@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p1A7bo6j013624; Thu, 10 Feb 2011 07:37:50 GMT (envelope-from das@svn.freebsd.org) Message-Id: <201102100737.p1A7bo6j013624@svn.freebsd.org> From: David Schultz Date: Thu, 10 Feb 2011 07:37:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218509 - head/lib/msun/src X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2011 07:37:50 -0000 Author: das Date: Thu Feb 10 07:37:50 2011 New Revision: 218509 URL: http://svn.freebsd.org/changeset/base/218509 Log: For small arguments, these functions use simple approximations, e.g. cos(small) = 1, sin(small) = small. This commit tightens the thresholds at which the simple approximations are used. Reviewed by: bde Modified: head/lib/msun/src/e_asin.c head/lib/msun/src/s_atan.c head/lib/msun/src/s_cos.c head/lib/msun/src/s_sin.c head/lib/msun/src/s_tan.c Modified: head/lib/msun/src/e_asin.c ============================================================================== --- head/lib/msun/src/e_asin.c Thu Feb 10 07:37:29 2011 (r218508) +++ head/lib/msun/src/e_asin.c Thu Feb 10 07:37:50 2011 (r218509) @@ -82,7 +82,7 @@ __ieee754_asin(double x) return x*pio2_hi+x*pio2_lo; return (x-x)/(x-x); /* asin(|x|>1) is NaN */ } else if (ix<0x3fe00000) { /* |x|<0.5 */ - if(ix<0x3e400000) { /* if |x| < 2**-27 */ + if(ix<0x3e500000) { /* if |x| < 2**-26 */ if(huge+x>one) return x;/* return x with inexact if x!=0*/ } t = x*x; Modified: head/lib/msun/src/s_atan.c ============================================================================== --- head/lib/msun/src/s_atan.c Thu Feb 10 07:37:29 2011 (r218508) +++ head/lib/msun/src/s_atan.c Thu Feb 10 07:37:50 2011 (r218509) @@ -87,7 +87,7 @@ atan(double x) if(hx>0) return atanhi[3]+*(volatile double *)&atanlo[3]; else return -atanhi[3]-*(volatile double *)&atanlo[3]; } if (ix < 0x3fdc0000) { /* |x| < 0.4375 */ - if (ix < 0x3e200000) { /* |x| < 2^-29 */ + if (ix < 0x3e400000) { /* |x| < 2^-27 */ if(huge+x>one) return x; /* raise inexact */ } id = -1; Modified: head/lib/msun/src/s_cos.c ============================================================================== --- head/lib/msun/src/s_cos.c Thu Feb 10 07:37:29 2011 (r218508) +++ head/lib/msun/src/s_cos.c Thu Feb 10 07:37:50 2011 (r218509) @@ -63,7 +63,7 @@ cos(double x) /* |x| ~< pi/4 */ ix &= 0x7fffffff; if(ix <= 0x3fe921fb) { - if(ix<0x3e400000) /* if x < 2**-27 */ + if(ix<0x3e46a09e) /* if x < 2**-27 * sqrt(2) */ if(((int)x)==0) return 1.0; /* generate inexact */ return __kernel_cos(x,z); } Modified: head/lib/msun/src/s_sin.c ============================================================================== --- head/lib/msun/src/s_sin.c Thu Feb 10 07:37:29 2011 (r218508) +++ head/lib/msun/src/s_sin.c Thu Feb 10 07:37:50 2011 (r218509) @@ -63,7 +63,7 @@ sin(double x) /* |x| ~< pi/4 */ ix &= 0x7fffffff; if(ix <= 0x3fe921fb) { - if(ix<0x3e400000) /* |x| < 2**-27 */ + if(ix<0x3e500000) /* |x| < 2**-26 */ {if((int)x==0) return x;} /* generate inexact */ return __kernel_sin(x,z,0); } Modified: head/lib/msun/src/s_tan.c ============================================================================== --- head/lib/msun/src/s_tan.c Thu Feb 10 07:37:29 2011 (r218508) +++ head/lib/msun/src/s_tan.c Thu Feb 10 07:37:50 2011 (r218509) @@ -62,7 +62,7 @@ tan(double x) /* |x| ~< pi/4 */ ix &= 0x7fffffff; if(ix <= 0x3fe921fb) { - if(ix<0x3e300000) /* x < 2**-28 */ + if(ix<0x3e400000) /* x < 2**-27 */ if((int)x==0) return x; /* generate inexact */ return __kernel_tan(x,z,1); }