Author rhettinger
Recipients PedanticHacker, Stefan Pochmann, mark.dickinson, mcognetta, pablogsal, rhettinger, serhiy.storchaka, tim.peters
Date 2021-12-21.19:52:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1640116338.03.0.771638328749.issue37295@roundup.psfhosted.org>
In-reply-to
Content
>  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 :-)
History
Date User Action Args
2021-12-21 19:52:18rhettingersetrecipients: + rhettinger, tim.peters, mark.dickinson, serhiy.storchaka, PedanticHacker, mcognetta, Stefan Pochmann, pablogsal
2021-12-21 19:52:18rhettingersetmessageid: <1640116338.03.0.771638328749.issue37295@roundup.psfhosted.org>
2021-12-21 19:52:18rhettingerlinkissue37295 messages
2021-12-21 19:52:17rhettingercreate