Mark Dickinson <dicki...@gmail.com> added the comment:

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.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45917>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to