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 4EAB9385800F for ; Wed, 13 Jan 2021 06:38:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4EAB9385800F Received: from localhost (localhost [127.0.0.1]) by elaine.keithp.com (Postfix) with ESMTP id 08C6D3F2E77C; Tue, 12 Jan 2021 22:38:40 -0800 (PST) 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 BfcsVwLw49wN; Tue, 12 Jan 2021 22:38:39 -0800 (PST) Received: from keithp.com (koto.keithp.com [10.0.0.2]) by elaine.keithp.com (Postfix) with ESMTPSA id 868213F2E77B; Tue, 12 Jan 2021 22:38:39 -0800 (PST) Received: by keithp.com (Postfix, from userid 1000) id 507EF1582498; Tue, 12 Jan 2021 22:38:39 -0800 (PST) From: Keith Packard To: Paul Zimmermann Cc: newlib@sourceware.org Subject: Re: issue with tgammaf In-Reply-To: References: <87een3eyq4.fsf@keithp.com> <87sgbheouh.fsf@keithp.com> <878sd8e62g.fsf@keithp.com> Date: Tue, 12 Jan 2021 22:38:38 -0800 Message-ID: <87mtxdmjdd.fsf@keithp.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, 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: Wed, 13 Jan 2021 06:38:42 -0000 --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Paul Zimmermann writes: > In summary, the old code (__OBSOLETE_MATH_DEFAULT=3D1) is always better i= n terms > of accuracy, with huge differences for some functions (cos, exp, exp10, e= xp2, > log, log2, sin, pow). Thanks so much for your evaluation. It's very good to know that by selecting the original SunPro math functions we're not losing anything in precision while we target machines with less capable hardware. Are you able to share the code which performs these tests? I'd love to be able to run these on a regular basis to ensure that no regressions occur as we maintain the code. This also provides a potential starting point for someone interested in improving the accuracy of this library -- we could clearly use better bessel and gamma functions. > For bivariate functions (atan2, hypot, pow), the tests are not > exhaustive. Yeah, the search space is a bit large :-) > tgamma: > Total: errors=3D2028164922 (47.41%) errors2=3D1833526367 maxerr=3D2.39e+0= 2 ulp(s) > Total: errors=3D2026865970 (47.38%) errors2=3D1832940352 maxerr=3D2.39e+0= 2 ulp(s) Given that around half of the possible input values (> 35, or near negative integers) generate an overflow, it seems like tgamma essentially *never* gives us an accurate finite result... =2D-=20 =2Dkeith --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEw4O3eCVWE9/bQJ2R2yIaaQAAABEFAl/+lW8ACgkQ2yIaaQAA ABGtTA//cEEsUgrgLxTHO4PXD56eN6nKClkWx9ed0++l3VbxayshD83YNy/0Y19+ fLi99kUNRXmkH5Um0zpiR0dmKv2Kzeuh08OHj3dzia2CmxO0lY6bBuZYUt9gJgq9 P7Nj5ACIEFxzy90vItw3iERwNSSZvwDvdt2yW9ssam/Y5p4bm2rfoMccNpFmHCU7 gKNSmtIEBlSAMGcqGt2I7klBolvCcSDXSwbaBGh2uhSgb4tGLpg5QV+eEmKK4Gdg bYz2fueDO7rLQgIlg/3SxRuTC2HL9RRUjzgLMViRDuWfTvFusNSMsNXWkaVPszHE RWt3hEabkrhrERYESbMS5IMWyP90fBDeAKGBlfgZ1gcGFAA94hfkv/dj/+9Iy00t JJso+CPtvuTxEKSKdCjFjexY2f1lAW/5JK0BxJcKfbvvNTUdqtQt73nIVCprfjgQ e0faWpiLu7we0Dbfr/apDVoG718ZdGPOeNqnCWgzO5H9evsWW0u7yiPA6er7rdRb WqALiOOW8nCZa+fKeQ/UAcXu+fN8+AIHlNk0JRXTDE/ecbJB7QRYUk+WVffUGwxV rzR4Rr+9VIik2m9L8Uhl+2MIcqFTe7ZkVkZ5pgv93qqwKqt/Ld4pZyyRADE9VNH3 xkY3nSLXDYpBsxAoAIwqX0eUEtbCCm2bE4MPqhl9KWVIbp7Mqbg= =qOO9 -----END PGP SIGNATURE----- --=-=-=--