Re: issue with tgammaf
Keith Packard via Newlib <[email protected]>
| Newsgroups | gmane.comp.lib.newlib |
|---|---|
| Message-ID | <[email protected]> |
Paul Zimmermann <[email protected]> writes: > In summary, the old code (__OBSOLETE_MATH_DEFAULT=1) is always better in terms > of accuracy, with huge differences for some functions (cos, exp, exp10, exp2, > 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=2028164922 (47.41%) errors2=1833526367 maxerr=2.39e+02 ulp(s) > Total: errors=2026865970 (47.38%) errors2=1832940352 maxerr=2.39e+02 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... -- -keith
signature.asc
(application/pgp-signature, 832 B)
-----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-----