fast prime sieve algorithm
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
FastGn.cpp
FastTn.cpp
Goldbach.cpp
Ktprime.cpp
PrimeNumber.cpp
README
SophieGermain.cpp
TwinPrime.cpp
topK.cpp

README

Mingw: g++ 5.1.0 flag -DSIEVE_SIZE=2048 -DW30 -march=native -funroll-loops -O3 -s -pipe
Windows 10 x64               i3-350M,i5-3470,i7-7500u,i7-6700,r7-1700
pi(0,    1e10) = 455052511     3.10    1.84    1.55    1.40    1.65
pi(1e11, 1e10) = 394050419     4.35    2.50    2.02    1.83    2.00
pi(1e12, 1e10) = 361840208     5.40    3.00    2.40    2.14    2.30
pi(1e13, 1e10) = 334067230     6.60    3.50    2.85    2.50    2.70
pi(1e14, 1e10) = 310208140     7.90    4.20    3.50    3.00    3.20
pi(1e15, 1e10) = 289531946     10.2    5.10    4.32    3.67    3.91
pi(1e16, 1e10) = 271425366     12.3    6.10    5.11    4.34    4.75
pi(1e17, 1e10) = 255481287     14.4    7.09    5.95    5.17    5.75
pi(1e18, 1e10) = 241272176     17.8    8.58    7.17    6.25    7.16
pi(1e19, 1e10) = 228568014     24.8    11.6    9.86    8.64    9.82
pi(0-1e9,1e9)  = 22537866      8.35    4.28    3.92    3.42    3.82
pi(1e18, 1e6)  = 24280         0.75    0.46    0.34    0.52    0.60
pi(1e18, 1e8)  = 2414886       1.30    0.81    0.70    0.64    0.80
pi(1e18, 1e9)  = 24217085      3.60    1.80    1.58    1.40    1.55
pi(0,    1e12) = 37607912018   500     270     224     200     220
pi(1e14, 1e12) = 31016203073   790     420     354     295     320
pi(1e16, 1e12) = 27143405794   1200    600     512     430     485
pi(1e18, 1e12) = 24127637783   1535    760     622     560     640
pi(1e19, 1e12) = 22857444126   1700    830     702     610     665