Message105777
Okay, here's what I'm planning to commit (tomorrow), in case anyone wants to give it one last check. I've added some comments half-explaining the algorithm used (just in case the referenced URL goes out of existence). I made a couple of other minor changes to the algorithm:
(1) in factorial_partial_product, use 'k = (n + num_operands) | 1;' rather than 'k = (n + num_operands - 1) | 1;'. This saves an operation, and means that when a range including an odd number of terms is split then the bottom half gets the extra term, which makes the partial products a teensy bit more balanced, since the bottom half consists of smaller numbers.
(2) in factorial_loop, I set the initial value of 'upper' to 3 rather than 1. This avoids factorial_partial_product ever being called with a start of 1.
Apart from that, no significant changes. |
|
Date |
User |
Action |
Args |
2010-05-14 23:42:16 | mark.dickinson | set | recipients:
+ mark.dickinson, rhettinger, belopolsky, draghuram, stutzbach |
2010-05-14 23:42:16 | mark.dickinson | set | messageid: <1273880536.1.0.648487000916.issue8692@psf.upfronthosting.co.za> |
2010-05-14 23:42:14 | mark.dickinson | link | issue8692 messages |
2010-05-14 23:42:12 | mark.dickinson | create | |
|