Commit Graph

9 Commits (2c67a5cd78e5dcffd7146e6fd0eb95f810a497e1)

Author SHA1 Message Date
John Benediktsson d487d8068d math.primes.erato: minor performance improvements. 2012-10-23 10:49:45 -07:00
John Benediktsson ac2e60e997 math.primes.erato: bit faster by inlining. 2012-08-23 09:35:09 -07:00
Jon Harper 093951556e math.primes.erato doc fixes. 2010-11-02 17:34:28 +01:00
Rupert Swarbrick 5af9f3cdd7 math.primes.erato: Fix off-by-one error
The sieve bit vector deals with numbers in chunks of 30. Therefore,
the number 90 (say) is the 91st 'element' of the vector. Each byte
deals with some range {0,1,...,29}+30n so to have the number 90, you
need four bytes.

Rather pleasingly, I bumped into this bug and it reduced to the
incantation:
  2010 2010 sieve marked-prime?
2010-11-02 17:34:24 +01:00
Slava Pestov 302867c9a7 math.primes.erato: fix typo in docs 2010-10-22 18:26:08 -07:00
Doug Coleman 1ee8c8f5eb sigma -> map-sum 2009-10-29 14:34:04 -05:00
Doug Coleman e1bdd33156 use if-zero in a few more places 2009-08-11 18:15:53 -05:00
Samuel Tardieu 0fef7b94c4 Pack primes numbers by slices of 30
In any given 30 successive integers greater than 5, there are at most
8 prime numbers. Use this to tightly pack the result of the Eratostene
sieve. This lets us store more prime numbers than before in less space.
2009-06-24 13:15:12 +02:00
Samuel Tardieu 594bd3aee8 Move math.primes from extra to basis 2009-01-07 21:12:48 +01:00