From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from elaine.keithp.com (home.keithp.com [63.227.221.253]) by sourceware.org (Postfix) with ESMTPS id 1A261385DC2E for ; Tue, 15 Sep 2020 17:28:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 1A261385DC2E Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 80F0D3F2D212; Tue, 15 Sep 2020 10:28:21 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at keithp.com Received: from elaine.keithp.com ([127.0.0.1]) by localhost (elaine.keithp.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id flJ3QaN77XwG; Tue, 15 Sep 2020 10:28:20 -0700 (PDT) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id 3B6E13F2D82D; Tue, 15 Sep 2020 10:28:20 -0700 (PDT) Received: by keithp.com (Postfix, from userid 1000) id 1017015821A6; Tue, 15 Sep 2020 10:28:20 -0700 (PDT) From: "Keith Packard" To: Paul Zimmermann , newlib@sourceware.org Subject: Re: issue with tgammaf In-Reply-To: References: Date: Tue, 15 Sep 2020 10:28:19 -0700 Message-ID: <87een3eyq4.fsf@keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Tue, 15 Sep 2020 17:28:25 -0000 --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain Paul Zimmermann writes: > Hi, > > in https://sourceware.org/pipermail/newlib/2020/017920.html I reported an > issue with tgammaf(-0). > > With Newlib 3.3.0, there seems to be the same issue for negative subnormal > values of the input, where tgammaf gives +inf instead of -inf. We've been fixing a bunch of gamma problems; this is one that got missed when the library is configured to report errno. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-libm-Make-tgamma-small-INFINITY.patch Content-Transfer-Encoding: quoted-printable From=208cefdba40a4382de6b3f44a5d35880026727f1dd Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Tue, 15 Sep 2020 10:10:07 -0700 Subject: [PATCH] libm: Make tgamma(-small) =3D -INFINITY Need to copy the argument sign to the output for tgamma(finite) overflow case. Signed-off-by: Keith Packard =2D-- newlib/libm/math/k_standard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/newlib/libm/math/k_standard.c b/newlib/libm/math/k_standard.c index 906412ba7..beab51e16 100644 =2D-- a/newlib/libm/math/k_standard.c +++ b/newlib/libm/math/k_standard.c @@ -331,7 +331,7 @@ static double zero =3D 0.0; /* used as const */ case 40: case 140: /* gamma(finite) overflow */ =2D retval =3D HUGE_VAL; + retval =3D copysign(HUGE_VAL, x); errno =3D ERANGE; break; case 41: =2D-=20 2.28.0 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable =2D-=20 =2Dkeith --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAl9g+bMACgkQ2yIaaQAA ABFL4A//cLpVE0AE7zfKIaCjXqT0MtVgKbmuh+WMyFwF42ZIX55Iq7TZMtcGZAbH /zj5BLncxT/s2/5uVR2i+m/CTZuWUiJYkpjVzI0gN2patI/Vpj3HM2SdjjRQrZaR nioadoldDz8d9BWrK+2Gl8V5+TgJy0YobBHUnG7Tg2zK+pssZokjhu3Dgzt3K08F 144EaR3W2gGwWZCTZVvD8wcFN2AzIZ0QHOMc3BvEsMYkAiR2S/59w1kocc3o1Kc+ Kx932/wcO3VNCFN/Q+ig6B9cREBrqUKd/EyMlot/oV7+WJv8FuJMdavdERLPTOAD CGsoxbOTrCyJKKtL+dS/wV7Pq9x1PcKPby980LpCx8EZOqFdnTreCNDMFxamuTvG lyX5KlKMivmZWUy47vr4B6ZweKJd6KL+7QIDlcnpFZmr6BVC0HHOV8CT2MVFSrBC LYDVAFBcdSqDIwL7M4D994Wus9geaQTl1yiyfRkxc/RYPzqlpNxfQwBuxIMB1oHn pD1qLrus2TzlH5qdP/q3Bm3O2uhVlOkiIce1ZUzwwRwjZR6tf4E5aqMskm37w36H MVjWvyCbzEUoeyS9vF/rTyoRRGSYlKbsfKKkNUgpB0k2DjU+4QDILuCxryJlGCKW yYumHi7GVBijgHpwaBD7IYsgiWfOZknUL9DhWT46L3/BXzRuzwE= =Ba8Q -----END PGP SIGNATURE----- --==-=-=--