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, scoder, serhiy.storchaka, tim.peters
Date 2018-08-12.16:00:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1534089636.37.0.56676864532.issue34376@psf.upfronthosting.co.za>
In-reply-to
Content
Sure, if we make more assumptions.  For 754 doubles, e.g., scaling isn't needed if `1e-100 < absmax < 1e100` unless there are a truly ludicrous number of points.  Because, if that holds, the true sum is between 1e-200 and number_of_points*1e200, both far from being near trouble.

Then the summation loop gets mostly duplicated (with and without scaling), a platform-dependent assumption is introduced, and we need two test-and-branches to determine which to run.  In the common two-argument cases, it saves one division in return.

Note that without the current form of scaling, we lose the guarantee that the sum is exact when all the arguments are the same (because they're all scaled to exactly 1.0 then, but in general each x*x loses half the product bits without scaling).  I don't care about that myself, but Serhiy seems to.
History
Date User Action Args
2018-08-12 16:00:36tim.peterssetrecipients: + tim.peters, rhettinger, mark.dickinson, scoder, serhiy.storchaka
2018-08-12 16:00:36tim.peterssetmessageid: <1534089636.37.0.56676864532.issue34376@psf.upfronthosting.co.za>
2018-08-12 16:00:36tim.peterslinkissue34376 messages
2018-08-12 16:00:36tim.peterscreate