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 rhettinger
Recipients mark.dickinson, rhettinger, serhiy.storchaka, tim.peters
Date 2020-08-15.04:54:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1597467280.26.0.0596473264628.issue41513@roundup.psfhosted.org>
In-reply-to
Content
Update:

    def hypot(*coords):
        # Corrected, unfused: https://arxiv.org/pdf/1904.09481.pdf
        # Simplified version omits scaling and handling of wide ranges
        # Has 1 ulp error 0.44% of the time (0.54% per the paper).
        # Can be reduced to 0% with a fused multiply-add.
        a, b = map(fabs, coords)
        if a < b:
            a, b = b, a
        h = sqrt(a*a + b*b)
        if h <= 2*b:
            delta = h - b
            x = a*(2*delta - a) + (delta - 2*(a - b))*delta
        else:
            delta = h - a
            x = 2*delta*(a - 2*b) + (4*delta - b)*b + delta*delta
        return h - x/(2*h)
History
Date User Action Args
2020-08-15 04:54:40rhettingersetrecipients: + rhettinger, tim.peters, mark.dickinson, serhiy.storchaka
2020-08-15 04:54:40rhettingersetmessageid: <1597467280.26.0.0596473264628.issue41513@roundup.psfhosted.org>
2020-08-15 04:54:40rhettingerlinkissue41513 messages
2020-08-15 04:54:39rhettingercreate