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 Gideon, mark.dickinson, rhettinger, serhiy.storchaka, tim.peters
Date 2021-11-28.20:56:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1638132971.48.0.804109724322.issue45917@roundup.psfhosted.org>
In-reply-to
Content
Sounds good to me, provided that all the common platforms that we care about have a reasonable quality implementation. This should be a straightforward wrapping of the C99 function, and with sufficient tests the buildbots should tell us if there are any issues on common platforms.

@Gideon: are you're interested in working on a pull request? I'd be happy to review.

(Ideally I'd like to have exp10 too, but that's not in C99 so platform support is likely to be spotty. If anyone's interested in pursuing that, we should make it a separate issue.)

> a libm exp2 is supposedly more accurate than pow(2.0, x), though I don’t really see how this would be the case

pow is a difficult function to implement at high accuracy, and there are a good number of low quality pow implementations around in system math libraries. It's much easier to come up with a high accuracy implementation of a single-argument function - there are well known techniques for generating approximating polynomials that simply don't extend well to functions of two arguments.

sqrt is similar: pow(x, 0.5) is very often not correctly rounded even on systems where sqrt(x) _is_. (Though that one's a bit of a cheat, since common processors have dedicated instructions for a correctly-rounded sqrt.)
History
Date User Action Args
2021-11-28 20:56:11mark.dickinsonsetrecipients: + mark.dickinson, tim.peters, rhettinger, serhiy.storchaka, Gideon
2021-11-28 20:56:11mark.dickinsonsetmessageid: <1638132971.48.0.804109724322.issue45917@roundup.psfhosted.org>
2021-11-28 20:56:11mark.dickinsonlinkissue45917 messages
2021-11-28 20:56:11mark.dickinsoncreate