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 tim.peters
Recipients mark.dickinson, rhettinger, serhiy.storchaka, terry.reedy, tim.peters
Date 2020-08-25.20:03:54
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1598385834.48.0.176809534586.issue41513@roundup.psfhosted.org>
In-reply-to
Content
One more implication: since the quality of the initial square root doesn't really much matter, instead of

    result = sqrt(to_float(parts))
    a, b = split(result)
    parts = add_on(-a*a, parts)
    parts = add_on(-2.0*a*b, parts)
    parts = add_on(-b*b, parts)
    x = to_float(parts)
    result += x / (2.0 * result)

at the end, it should work just as well (in fact, probably a little better, due to getting more beneficial cancellation) to do:

    a = parts[0] - 1.0
    result = sqrt(a)
    x, y = split(result)
    result += (a - x*x - 2.0*x*y - y*y + parts[1]) / (2.0 * result)

at the end. Although this crucially relies on the doing the last-line chain of subtracts and adds "left to right".
History
Date User Action Args
2020-08-25 20:03:54tim.peterssetrecipients: + tim.peters, rhettinger, terry.reedy, mark.dickinson, serhiy.storchaka
2020-08-25 20:03:54tim.peterssetmessageid: <1598385834.48.0.176809534586.issue41513@roundup.psfhosted.org>
2020-08-25 20:03:54tim.peterslinkissue41513 messages
2020-08-25 20:03:54tim.peterscreate