Message409001
> Finv = [pow(fodd, -1, 2**64) for fodd in Fodd]
This is a good trick. I had already experimented with separating factorials into an odd component and a shift count, but failed to get a speed-up because the divisions were slow. Having a table of multiplicative inverses and working mod 2**64 bypasses that problem nicely. Division-free is the way to go :-) |
|
Date |
User |
Action |
Args |
2021-12-21 19:52:18 | rhettinger | set | recipients:
+ rhettinger, tim.peters, mark.dickinson, serhiy.storchaka, PedanticHacker, mcognetta, Stefan Pochmann, pablogsal |
2021-12-21 19:52:18 | rhettinger | set | messageid: <1640116338.03.0.771638328749.issue37295@roundup.psfhosted.org> |
2021-12-21 19:52:18 | rhettinger | link | issue37295 messages |
2021-12-21 19:52:17 | rhettinger | create | |
|