➜

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.

作者 tim.peters
收信人 mark.dickinson, rhettinger, serhiy.storchaka, terry.reedy, tim.peters
日期 2020-08-25.20:03:54
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1598385834.48.0.176809534586.issue41513@roundup.psfhosted.org>
In-reply-to
内容
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".
历史
日期 用户 动作 参数
2020-08-25 20:03:54tim.peters修改recipients: + tim.peters, rhettinger, terry.reedy, mark.dickinson, serhiy.storchaka
2020-08-25 20:03:54tim.peters修改messageid: <1598385834.48.0.176809534586.issue41513@roundup.psfhosted.org>
2020-08-25 20:03:54tim.peters链接issue41513 messages
2020-08-25 20:03:54tim.peters创建