Message375448
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? ;-) |
|
| Date |
User |
Action |
Args |
| 2020-08-15 05:03:13 | tim.peters | set | recipients:
+ tim.peters, rhettinger, mark.dickinson, serhiy.storchaka |
| 2020-08-15 05:03:13 | tim.peters | set | messageid: <[email protected]> |
| 2020-08-15 05:03:13 | tim.peters | link | issue41513 messages |
| 2020-08-15 05:03:13 | tim.peters | create | |
|