3 ms·
Quality comparison of floating-point maths libraries
- mturmon 16y agoFrom TFA: "The results for R/Linux C were almost identical and a quick check of the R source tree showed that R calls the C library function to evaluate log" thus making the whole article an exercise in redundancy.
- andrewf 16y agoNot entirely; it means the comparison was effectively between single-precision and double-precision logs from the C library.
- mturmon 16y agoWere they not both calling the normal double-precision log function in libm? Sure, the linked article scans all the single-precision floats in a certain range to do the test, but the function eventually called (using that list of floats) is log in libm. In any event, no discrepancy is noted, so what was the point? Additionally, TFA does not make clear that there should be no errors in the computed function affecting more than the least sig bit. It uses absolute errors (up to 50 e-17) rather than looking at the relative error (or ULP, in the jargon). It seems like a mess. Here's a link with much more useful information: http://www.gnu.org/s/libc/manual/html_node/Errors-in-Math-Functions.html http://www.gnu.org/s/libc/manual/html_node/Errors-in-Math-Fu...
- ars 16y agoWith a little research they would have seen that the source of the math library is actually: http://www.moshier.net/#Cephes http://www.moshier.net/#Cephes Another common library is: http://www.ibm.com/software/awdtools/mass/ http://www.ibm.com/software/awdtools/mass/ and http://www.ibm.com/systems/software/essl/ http://www.ibm.com/systems/software/essl/ both from IBM. Writing good math libraries is a huge undertaking, and there aren't that many versions out there.
- kakali 16y agoIsn't the printf also introducing a rounding error? This all seems like a futile test.