[issue27761] Private _nth_root function loses accuracy

Mark Dickinson report at bugs.python.org
Sun Aug 14 06:52:42 EDT 2016


Mark Dickinson added the comment:

> - finally, compare the epsilons abs(y**n - x) for the initial guess
>   and improved version, returning whichever gives the smaller epsilon.
> 
> So I'm confident that nth_root() should never be worse than pow().

Same deal here: those aren't the actual errors; they're approximations to the errors, since the computations of the epsilons depends on (a) the usual floating-point rounding, and more significantly (b) the accuracy of the `y**n` computation. It's entirely possible that the value giving the smaller epsilon is actually the worse of the two approximations.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27761>
_______________________________________


More information about the Python-bugs-list mailing list