Tim Peters <[email protected]> added the comment:
Cute: for any number of arguments, try computing h**2, then one at a time
subtract a**2 (an argument squared) in descending order of magnitude. Call
that (h**2 - a1**2 - a2**2 - ...) x.
Then
h -= x/(2*h)
That should reduce errors too, although not nearly so effectively, since it's a
cheap way of estimating (& correcting for) the discrepancy between sum(a**2)
and h**2.
Note that "descending order" is important: it's trying to cancel as many
leading bits as possible as early as possible, so that lower-order bits come
into play.
Then again ... why bother? ;-)
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue41513>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com