From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2134) id 481593858D37; Thu, 13 Apr 2023 17:37:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 481593858D37 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1681407421; bh=RhViShtsIXQSTWU4/qV8xV0KSLqODhRz4f82SfTt3Mc=; h=From:To:Subject:Date:From; b=MxeRPlXE0w0utX0O5qyxyP9TDeHUZTsKoLI9rcSkBdsMuKssC9S8xyagmO7tcoJx1 CFSPC2fTtNTp1EV/p2GUDedd51wMMHuprh2HRatqH/RcgXM1zhNqLmD2TesF+n2Ptl av4o4yg3gBRuJsFUfTy//cGngfB+G7/wk+yiHmhg= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Jeff Johnston To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Fix x close to 1, y between 2^31 and 2^64 X-Act-Checkin: newlib-cygwin X-Git-Author: Andoni Arregi X-Git-Refname: refs/heads/master X-Git-Oldrev: 5a961061de7d70bd3568270185c3189e20958e68 X-Git-Newrev: e5a36e6af7c52b70fbc8c11a888220d8579e0275 Message-Id: <20230413173701.481593858D37@sourceware.org> Date: Thu, 13 Apr 2023 17:37:01 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3De5a36e6af7c= 52b70fbc8c11a888220d8579e0275 commit e5a36e6af7c52b70fbc8c11a888220d8579e0275 Author: Andoni Arregi Date: Wed Apr 12 17:34:43 2023 +0200 Fix x close to 1, y between 2^31 and 2^64 =20 E.g. known errors: x =3D 0x1.000002c5e2e99p+0, y =3D 0x1.c9eee35374af6p+31 had an error of= 639 ULP and is now correctly rounded. x =3D 0x1.fffffd2e3e669p-1, y =3D 0x1.344c9823eb66cp+32 had an error of= 428 ULP and is now correctly rounded. Diff: --- newlib/libm/math/e_pow.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newlib/libm/math/e_pow.c b/newlib/libm/math/e_pow.c index f02f76dc0..f24a98f6e 100644 --- a/newlib/libm/math/e_pow.c +++ b/newlib/libm/math/e_pow.c @@ -196,8 +196,8 @@ ivln2_l =3D 1.92596299112661746887e-08; /* 0x3E54AE0B= , 0xF85DDF44 =3D1/ln2 tail*/ } =20 /* |y| is huge */ - if(iy>0x41e00000) { /* if |y| > 2**31 */ - if(iy>0x43f00000){ /* if |y| > 2**64, must o/uflow and y is an even i= nteger */ + if(iy>0x42000000) { /* if |y| > ~2**33 (does not regard mantissa) */ + if(iy>0x43f00000){ /* if |y| > ~2**64, must o/uflow and y is an even = integer */ if(ix<=3D0x3fefffff) return (hy<0)? __math_oflow(0):__math_uflow(0); if(ix>=3D0x3ff00000) return (hy>0)? __math_oflow(0):__math_uflow(0); }