From owner-svn-src-all@freebsd.org Thu Jul 19 14:24:49 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 14264103C15F; Thu, 19 Jul 2018 14:24:49 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B21089396F; Thu, 19 Jul 2018 14:24:48 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 929712A688; Thu, 19 Jul 2018 14:24:48 +0000 (UTC) (envelope-from bde@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w6JEOm0K059428; Thu, 19 Jul 2018 14:24:48 GMT (envelope-from bde@FreeBSD.org) Received: (from bde@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w6JEOmGQ059427; Thu, 19 Jul 2018 14:24:48 GMT (envelope-from bde@FreeBSD.org) Message-Id: <201807191424.w6JEOmGQ059427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bde set sender to bde@FreeBSD.org using -f From: Bruce Evans Date: Thu, 19 Jul 2018 14:24:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r336484 - head/lib/msun/src X-SVN-Group: head X-SVN-Commit-Author: bde X-SVN-Commit-Paths: head/lib/msun/src X-SVN-Commit-Revision: 336484 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.27 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, 19 Jul 2018 14:24:49 -0000 Author: bde Date: Thu Jul 19 14:24:48 2018 New Revision: 336484 URL: https://svnweb.freebsd.org/changeset/base/336484 Log: Oops, r336412 undid the fix of the overflow threshold in r323003. Restore the previous overflow threshold and adjust comments. Modified: head/lib/msun/src/s_csqrtl.c Modified: head/lib/msun/src/s_csqrtl.c ============================================================================== --- head/lib/msun/src/s_csqrtl.c Thu Jul 19 13:09:29 2018 (r336483) +++ head/lib/msun/src/s_csqrtl.c Thu Jul 19 14:24:48 2018 (r336484) @@ -36,17 +36,22 @@ __FBSDID("$FreeBSD$"); #include "math_private.h" /* - * THRESH is now calculated portably (up to 113-bit precision). However, - * the denormal threshold is hard-coded for a 15-bit exponent with the usual - * bias. s_logl.c and e_hypotl have less hard-coding but end up requiring - * the same for the exponent and more for the mantissa. + * Several thresholds require a 15-bit exponent and also the usual bias. + * s_logl.c and e_hypotl have less hard-coding but end up requiring the + * same for the exponent and more for the mantissa. */ #if LDBL_MAX_EXP != 0x4000 #error "Unsupported long double format" #endif -/* For avoiding overflow for components >= LDBL_MAX / (1 + sqrt(2)). */ -#define THRESH (LDBL_MAX / 2.414213562373095048801688724209698L) +/* + * Overflow must be avoided for components >= LDBL_MAX / (1 + sqrt(2)). + * The precise threshold is nontrivial to determine and spell, so use a + * lower threshold of approximaely LDBL_MAX / 4, and don't use LDBL_MAX + * to spell this since LDBL_MAX is broken on i386 (it overflows in 53-bit + * precision). + */ +#define THRESH 0x1p16382L long double complex csqrtl(long double complex z)