From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 657643858C60 for ; Thu, 10 Feb 2022 15:02:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 657643858C60 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1644505324; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=82ey3EB95I1aYae9CnHbbgf4X1Ev28uIg9M4FK1WBdA=; b=g/OuGQZXrSbk+YpVkqQW/IeRSegr6e1EhqmEM7v3uTvQ6GzfDhXIIJDcR+rYb21HC9hJeO P/xXqRrIBBmNJcvLeuORM5fAIiSinGX+yMe2PPyhgV1Z56ITheZ3NuCtg7yPRYTW5fZHlH nVTmAnFJvTIRcE1XVnGXV9/fPsGrS4A= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-464-D8865ZUjNsmf99gGggfb5A-1; Thu, 10 Feb 2022 10:01:54 -0500 X-MC-Unique: D8865ZUjNsmf99gGggfb5A-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B77AC1091DB4; Thu, 10 Feb 2022 15:01:53 +0000 (UTC) Received: from calimero.vinschen.de (unknown [10.36.112.15]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 893FF74E8C; Thu, 10 Feb 2022 15:01:53 +0000 (UTC) Received: by calimero.vinschen.de (Postfix, from userid 500) id E6049A8088A; Thu, 10 Feb 2022 16:01:51 +0100 (CET) Date: Thu, 10 Feb 2022 16:01:51 +0100 From: Corinna Vinschen To: Andoni Arregi Cc: newlib@sourceware.org Subject: Re: [PATCH] Fix expf overflow limit Message-ID: Reply-To: newlib@sourceware.org Mail-Followup-To: Andoni Arregi , newlib@sourceware.org References: <6505c1b332ef8ecb9d9ea5900d7cb5a3a9cc767e.camel@gtd-gmbh.de> MIME-Version: 1.0 In-Reply-To: <6505c1b332ef8ecb9d9ea5900d7cb5a3a9cc767e.camel@gtd-gmbh.de> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=vinschen@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: newlib@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Newlib mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 10 Feb 2022 15:02:06 -0000 On Feb 9 14:52, Andoni Arregi wrote: > 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. > > 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). > > 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). > --- > 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= 8.8721679688e+01, /* 0x42b17180 */ > -u_threshold= -1.0397208405e+02; /* 0xc2cff1b5 */ > +o_threshold= 0x1.62e42ep+06, /* 0x42b17217 */ > +u_threshold= -0x1.9fe36ap+06; /* 0xc2cff1b5 */ > > #ifdef __STDC__ > float expf(float x) /* wrapper expf */ > -- > 2.35.1 Pushed. Thanks, Corinna