This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients mark.dickinson, martin.panter, rhettinger, steven.daprano, tim.peters
Date 2016-08-14.13:34:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1471181697.33.0.502474103053.issue27761@psf.upfronthosting.co.za>
In-reply-to
Content
> I thought IEEE 754 was supposed to put an end to these sorts of cross-platform differences.

Maybe one day. (Though I'm not holding my breath.)

IEEE 754-2008 does indeed *recommend* (but not actually *require*) correctly rounded implementations of all the usual transcendental and power functions (including nth root). And if everyone followed those recommendations, then yes, the correct rounding would imply that those cross-platform differences would be a thing of the past.

I don't see that happening any time soon, though: writing an implementation of log (for example) that's provably correctly rounded for all possible inputs is much harder than writing an implementation that's simply "almost always" correctly rounded (e.g., provably accurate to 0.53 ulps instead of 0.5 ulps), and the latter is going to be good enough in the vast majority of contexts. Going from "almost always correctly rounded" to "correctly rounded" isn't going to have much effect on the overall accuracy of a multistep numerical algorithm, so all you're buying (apart from a likely degraded running time) is the cross-platform reproducibility, and it's not really clear how useful cross-platform reproducibility is as a goal in its own right. Overall, it doesn't seem like a good tradeoff.

The pow function is especially hard to make correctly rounded, not least because of its two inputs. At least for single-input transcendental functions there's some (perhaps remote) hope of doing exhaustive testing on the 18 million million million possible double-precision inputs; for a function taking two inputs that's completely infeasible.

You can take a look at CRlibm [1] for efforts in the direction of a correctly-rounded libm; AFAIK it hasn't had wide adoption, and its pow function is still work in progress.

[1] http://lipforge.ens-lyon.fr/www/crlibm/
History
Date User Action Args
2016-08-14 13:34:57mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, steven.daprano, martin.panter
2016-08-14 13:34:57mark.dickinsonsetmessageid: <1471181697.33.0.502474103053.issue27761@psf.upfronthosting.co.za>
2016-08-14 13:34:57mark.dickinsonlinkissue27761 messages
2016-08-14 13:34:56mark.dickinsoncreate