From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 2A39D3858C20; Thu, 10 Feb 2022 15:00:48 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2A39D3858C20 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] Fix expf overflow limit X-Act-Checkin: newlib-cygwin X-Git-Author: Andoni Arregi X-Git-Refname: refs/heads/master X-Git-Oldrev: 1aec525a44f8aaa47030024a70c04a4dece23d3b X-Git-Newrev: 8f2bd6f046cf2c7a6d7332bf056ebdb294077747 Message-Id: <20220210150048.2A39D3858C20@sourceware.org> Date: Thu, 10 Feb 2022 15:00:48 +0000 (GMT) X-BeenThere: newlib-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib GIT logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2022 15:00:48 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D8f2bd6f046c= f2c7a6d7332bf056ebdb294077747 commit 8f2bd6f046cf2c7a6d7332bf056ebdb294077747 Author: Andoni Arregi Date: Wed Feb 9 14:52:07 2022 +0100 Fix expf overflow limit =20 Correct the overflow limit in the variable o_threshold to be consistent with the FLT_UWORD_LOG_MAX variable used by the internal implementation of the expf algorithm itself. The u_threshold variable has also been modified to be written in the same format. =20 Note that this fix improves the situation but does not completely correct the inconsistencies regarding the overflow and underflow limits between the expf wrapper (wf_exp.c) and the expf algorithm itself (ef_exp.c). =20 Currently these limits are different for the _FLT_LARGEST_EXPONENT_IS_NORMAL and _FLT_NO_DENORMALS cases as well as for the case where __OBSOLETE_MATH is not defined (only for the underflow limit in this case). Diff: --- newlib/libm/math/wf_exp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newlib/libm/math/wf_exp.c b/newlib/libm/math/wf_exp.c index 38cacd95a..075b5bb0a 100644 --- a/newlib/libm/math/wf_exp.c +++ b/newlib/libm/math/wf_exp.c @@ -26,8 +26,8 @@ static const float #else static float #endif -o_threshold=3D 8.8721679688e+01, /* 0x42b17180 */ -u_threshold=3D -1.0397208405e+02; /* 0xc2cff1b5 */ +o_threshold=3D 0x1.62e42ep+06, /* 0x42b17217 */ +u_threshold=3D -0x1.9fe36ap+06; /* 0xc2cff1b5 */ =20 #ifdef __STDC__ float expf(float x) /* wrapper expf */