From owner-dev-commits-src-all@freebsd.org Mon Feb 8 22:09:42 2021 Return-Path: Delivered-To: dev-commits-src-all@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 E48F1543C08; Mon, 8 Feb 2021 22:09:42 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f52.google.com (mail-ej1-f52.google.com [209.85.218.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DZKvB5mRrz3DF8; Mon, 8 Feb 2021 22:09:42 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f52.google.com with SMTP id i8so27971259ejc.7; Mon, 08 Feb 2021 14:09:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zwH2QtajO0M2cFe5AJJeiki/37ehDIALF2/C9XcHNdI=; b=mrFk66U9icIYdj45gD4t5jUCO8J7MSUfw6luSLCtVn1GGMrijJGpdlA/A9H0vi56iC NCEVtk6srY4QXLJLm612AnjQRYuQxGPNyQMWpPG5r73whda3JepEE23b0s1RqA4Aygfs jccBh5XvGZM3tzuxR8chi39YWRTWLWQsgV/YhExt+B+o3hSL+sOI1i2RvE1cKYA34gpH lhgpiAM/Vlh40AyceCJeaus3YQTXYITv+EfPaFrFyu9XIO0UuARCG7FtkaTZ7gBoC03+ c0BwhqWvmDdk0Kwg6uncJ5mnQsQWsws3RVIUU9LA0Zpp/PiOl+T9CmNZMwfv7DlZYL0u GgvA== X-Gm-Message-State: AOAM531CXV50Cand9HUFJ1cGFTMmRJ3KTzHiu4uCFZ6rK6ebuTAp4JG9 /30CmVwqxKeu9MfAiGCFo3kE7ctpokKx5w== X-Google-Smtp-Source: ABdhPJwS26NYmwt8mFSULiCUV1VX60WPJz8hmEKtWLe+oGmiW2aJakOqKkakFBwgAF6nIGnS0UTAVA== X-Received: by 2002:a17:906:2993:: with SMTP id x19mr18232996eje.409.1612822181133; Mon, 08 Feb 2021 14:09:41 -0800 (PST) Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com. [209.85.128.42]) by smtp.gmail.com with ESMTPSA id w3sm9525382eja.52.2021.02.08.14.09.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Feb 2021 14:09:41 -0800 (PST) Received: by mail-wm1-f42.google.com with SMTP id t142so461165wmt.1; Mon, 08 Feb 2021 14:09:40 -0800 (PST) X-Received: by 2002:a1c:2e83:: with SMTP id u125mr673458wmu.13.1612822174874; Mon, 08 Feb 2021 14:09:34 -0800 (PST) MIME-Version: 1.0 References: <202102081949.118Jn10U008133@gitrepo.freebsd.org> In-Reply-To: <202102081949.118Jn10U008133@gitrepo.freebsd.org> From: Alexander Richardson Date: Mon, 8 Feb 2021 22:09:24 +0000 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: 93fc67896550 - main - Fix incorrect powf(3) result with x near 1 and |y| much larger than 1 To: Dimitry Andric Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4DZKvB5mRrz3DF8 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; TAGGED_FROM(0.00)[]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Feb 2021 22:09:43 -0000 On Mon, 8 Feb 2021, 19:49 Dimitry Andric, wrote: > The branch main has been updated by dim: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=93fc67896550548f91b307dbe3053f11db5d4a8a > > commit 93fc67896550548f91b307dbe3053f11db5d4a8a > Author: Steve Kargl > AuthorDate: 2021-02-08 19:45:30 +0000 > Commit: Dimitry Andric > CommitDate: 2021-02-08 19:48:43 +0000 > > Fix incorrect powf(3) result with x near 1 and |y| much larger than 1 > > This adjusts the check to trigger overflow/underflow to a slightly > lower > value. > > Before: powf(9.999995e-01, -1.342177e+08) -> inf > After: powf(9.999995e-01, -1.342177e+08) -> 1.858724e+31 > > MFC after: 1 week > --- > lib/msun/src/e_powf.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > 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 <= 2**-20, suffice to compute > log(x) by x-x^2/2+x^3/3-x^4/4 */ > Do we have a test with previously buggy values? If not it would be good to add one. Alex >