From owner-dev-commits-src-main@freebsd.org Mon Feb 8 22:34:22 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0E81A5441F5; Mon, 8 Feb 2021 22:34:22 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZLRd5KVvz3FrJ; Mon, 8 Feb 2021 22:34:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (tensor.andric.com [87.251.56.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "tensor.andric.com", Issuer "R3" (verified OK)) (Authenticated sender: dim) by smtp.freebsd.org (Postfix) with ESMTPSA id 965C429798; Mon, 8 Feb 2021 22:34:20 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from [IPv6:2001:470:7a58::8504:b25a:10b3:a2de] (unknown [IPv6:2001:470:7a58:0:8504:b25a:10b3:a2de]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id C3B305AB1F; Mon, 8 Feb 2021 23:34:18 +0100 (CET) From: Dimitry Andric Message-Id: Content-Type: multipart/signed; boundary="Apple-Mail=_4719ED40-36DF-4E36-B5AE-29B40C4F8DE8"; protocol="application/pgp-signature"; micalg=pgp-sha1 Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.17\)) Subject: Re: git: 93fc67896550 - main - Fix incorrect powf(3) result with x near 1 and |y| much larger than 1 Date: Mon, 8 Feb 2021 23:34:12 +0100 In-Reply-To: Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org To: Alexander Richardson References: <202102081949.118Jn10U008133@gitrepo.freebsd.org> X-Mailer: Apple Mail (2.3445.104.17) X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 22:34:22 -0000 --Apple-Mail=_4719ED40-36DF-4E36-B5AE-29B40C4F8DE8 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii On 8 Feb 2021, at 23:09, Alexander Richardson = wrote: >=20 > On Mon, 8 Feb 2021, 19:49 Dimitry Andric, wrote: > The branch main has been updated by dim: >=20 > URL: = https://cgit.FreeBSD.org/src/commit/?id=3D93fc67896550548f91b307dbe3053f11= db5d4a8a >=20 > commit 93fc67896550548f91b307dbe3053f11db5d4a8a > Author: Steve Kargl > AuthorDate: 2021-02-08 19:45:30 +0000 > Commit: Dimitry Andric > CommitDate: 2021-02-08 19:48:43 +0000 >=20 > Fix incorrect powf(3) result with x near 1 and |y| much larger = than 1 >=20 > This adjusts the check to trigger overflow/underflow to a slightly = lower > value. >=20 > Before: powf(9.999995e-01, -1.342177e+08) -> inf > After: powf(9.999995e-01, -1.342177e+08) -> 1.858724e+31 >=20 > MFC after: 1 week > --- > lib/msun/src/e_powf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/msun/src/e_powf.c b/lib/msun/src/e_powf.c > index 53f1d37d6bec..33eedad50b16 100644 > --- a/lib/msun/src/e_powf.c > +++ b/lib/msun/src/e_powf.c > @@ -136,7 +136,7 @@ __ieee754_powf(float x, float y) > /* |y| is huge */ > if(iy>0x4d000000) { /* if |y| > 2**27 */ > /* over/underflow if x is not close to one */ > - if(ix<0x3f7ffff8) return (hy<0)? = sn*huge*huge:sn*tiny*tiny; > + if(ix<0x3f7ffff7) return (hy<0)? = sn*huge*huge:sn*tiny*tiny; > if(ix>0x3f800007) return (hy>0)? = sn*huge*huge:sn*tiny*tiny; > /* now |1-x| is tiny <=3D 2**-20, suffice to compute > log(x) by x-x^2/2+x^3/3-x^4/4 */ >=20 >=20 > Do we have a test with previously buggy values? If not it would be = good to add one. Nope, I'll see if I can grok the awful kyua stuff enough to add it. -Dimitry --Apple-Mail=_4719ED40-36DF-4E36-B5AE-29B40C4F8DE8 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.2 iF0EARECAB0WIQR6tGLSzjX8bUI5T82wXqMKLiCWowUCYCG8ZAAKCRCwXqMKLiCW ox1xAKDif7gyRNSkSUrzQJUdg9YNE/j9bACguwOPczcPPbWMZeHpF8OsuobRZys= =wh56 -----END PGP SIGNATURE----- --Apple-Mail=_4719ED40-36DF-4E36-B5AE-29B40C4F8DE8--