Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
arnoudbuzing committed Sep 17, 2018
1 parent 11cd65b commit ef99861
Show file tree
Hide file tree
Showing 13 changed files with 285 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Prototypes/Prototypes.wl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Module[ {files},
"Image.wl", "Language.wl", "Paclet.wl", "Formats.wl",
"Resources.wl", "Search.wl", "String.wl", "System.wl", "Color.wl",
"Entities.wl", "WolframAlpha.wl", "Translation.wl","GeoGraphics.wl", "Words.wl", "Packages.wl", "Random.wl",
"Cryptography.wl", "Service/What3Words.wl"};
"Cryptography.wl", "Service/What3Words.wl", "Primes/Primes.wl"};
Map[
Function[ {file},
AppendTo[ timings, file<>"-Before" -> N@SessionTime[] ];
Expand Down
24 changes: 24 additions & 0 deletions Prototypes/Source/Primes/Binaries/Linux-x86-64/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
BSD 2-Clause License

Copyright (c) 2013 - 2018, Kim Walisch.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
69 changes: 69 additions & 0 deletions Prototypes/Source/Primes/Binaries/Linux-x86-64/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
primecount 4.4
May 9, 2018
Kim Walisch, <[email protected]>

About primecount
================

primecount is a command-line program that counts the number of
primes below an integer x <= 10^31 using fast implementations of the
prime counting function pi(x).

Homepage: https://github.com/kimwalisch/primecount

Usage examples
==============

Open a terminal and run:

# Count the primes below 10^14
./primecount 1e14

# Print progress and status information during computation
./primecount 1e20 --status

# Count primes using Meissel's algorithm
./primecount 2**32 --meissel

# Find the 10^14th prime using 4 threads
./primecount 1e14 --nthprime --threads=4 --time

Command-line options
====================

Usage: primecount x [OPTION]...
Count the primes below x <= 10^31 using fast implementations of the
combinatorial prime counting function.

Options:

-d, --deleglise_rivat Count primes using Deleglise-Rivat algorithm
--legendre Count primes using Legendre's formula
--lehmer Count primes using Lehmer's formula
-l, --lmo Count primes using Lagarias-Miller-Odlyzko
-m, --meissel Count primes using Meissel's formula
--Li Approximate pi(x) using the logarithmic integral
--Li_inverse Approximate the nth prime using Li^-1(x)
-n, --nthprime Calculate the nth prime
-p, --primesieve Count primes using the sieve of Eratosthenes
--phi=<a> phi(x, a) counts the numbers <= x that are
not divisible by any of the first a primes
--Ri Approximate pi(x) using Riemann R
--Ri_inverse Approximate the nth prime using Ri^-1(x)
-s[N], --status[=N] Show computation progress 1%, 2%, 3%, ...
[N] digits after decimal point e.g. N=1, 99.9%
--test Run various correctness tests and exit
--time Print the time elapsed in seconds
-t<N>, --threads=<N> Set the number of threads, 1 <= N <= CPU cores
-v, --version Print version and license information
-h, --help Print this help menu

Advanced Deleglise-Rivat options:

-a<N>, --alpha=<N> Tuning factor, 1 <= alpha <= x^(1/6)
--P2 Only compute the 2nd partial sieve function
--S1 Only compute the ordinary leaves
--S2_trivial Only compute the trivial special leaves
--S2_easy Only compute the easy special leaves
--S2_hard Only compute the hard special leaves

Binary file not shown.
24 changes: 24 additions & 0 deletions Prototypes/Source/Primes/Binaries/MacOSX-x86-64/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
BSD 2-Clause License

Copyright (c) 2013 - 2018, Kim Walisch.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
69 changes: 69 additions & 0 deletions Prototypes/Source/Primes/Binaries/MacOSX-x86-64/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
primecount 4.4
May 9, 2018
Kim Walisch, <[email protected]>

About primecount
================

primecount is a command-line program that counts the number of
primes below an integer x <= 10^31 using fast implementations of the
prime counting function pi(x).

Homepage: https://github.com/kimwalisch/primecount

Usage examples
==============

Open a terminal and run:

# Count the primes below 10^14
./primecount 1e14

# Print progress and status information during computation
./primecount 1e20 --status

# Count primes using Meissel's algorithm
./primecount 2**32 --meissel

# Find the 10^14th prime using 4 threads
./primecount 1e14 --nthprime --threads=4 --time

Command-line options
====================

Usage: primecount x [OPTION]...
Count the primes below x <= 10^31 using fast implementations of the
combinatorial prime counting function.

Options:

-d, --deleglise_rivat Count primes using Deleglise-Rivat algorithm
--legendre Count primes using Legendre's formula
--lehmer Count primes using Lehmer's formula
-l, --lmo Count primes using Lagarias-Miller-Odlyzko
-m, --meissel Count primes using Meissel's formula
--Li Approximate pi(x) using the logarithmic integral
--Li_inverse Approximate the nth prime using Li^-1(x)
-n, --nthprime Calculate the nth prime
-p, --primesieve Count primes using the sieve of Eratosthenes
--phi=<a> phi(x, a) counts the numbers <= x that are
not divisible by any of the first a primes
--Ri Approximate pi(x) using Riemann R
--Ri_inverse Approximate the nth prime using Ri^-1(x)
-s[N], --status[=N] Show computation progress 1%, 2%, 3%, ...
[N] digits after decimal point e.g. N=1, 99.9%
--test Run various correctness tests and exit
--time Print the time elapsed in seconds
-t<N>, --threads=<N> Set the number of threads, 1 <= N <= CPU cores
-v, --version Print version and license information
-h, --help Print this help menu

Advanced Deleglise-Rivat options:

-a<N>, --alpha=<N> Tuning factor, 1 <= alpha <= x^(1/6)
--P2 Only compute the 2nd partial sieve function
--S1 Only compute the ordinary leaves
--S2_trivial Only compute the trivial special leaves
--S2_easy Only compute the easy special leaves
--S2_hard Only compute the hard special leaves

Binary file not shown.
Binary file not shown.
24 changes: 24 additions & 0 deletions Prototypes/Source/Primes/Binaries/Windows-x86-64/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
BSD 2-Clause License

Copyright (c) 2013 - 2018, Kim Walisch.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
68 changes: 68 additions & 0 deletions Prototypes/Source/Primes/Binaries/Windows-x86-64/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
primecount 4.4
May 9, 2018
Kim Walisch, <[email protected]>

About primecount
================

primecount is a command-line program that counts the number of
primes below an integer x <= 10^31 using fast implementations of the
prime counting function pi(x).

Homepage: https://github.com/kimwalisch/primecount

Usage examples
==============

Open a Command Prompt and run:

# Count the primes below 10^14
> primecount 1e14

# Print progress and status information during computation
> primecount 1e20 --status

# Count primes using Meissel's algorithm
> primecount 2**32 --meissel

# Find the 10^14th prime using 4 threads
> primecount 1e14 --nthprime --threads=4 --time

Command-line options
====================

Usage: primecount x [OPTION]...
Count the primes below x <= 10^31 using fast implementations of the
combinatorial prime counting function.

Options:

-d, --deleglise_rivat Count primes using Deleglise-Rivat algorithm
--legendre Count primes using Legendre's formula
--lehmer Count primes using Lehmer's formula
-l, --lmo Count primes using Lagarias-Miller-Odlyzko
-m, --meissel Count primes using Meissel's formula
--Li Approximate pi(x) using the logarithmic integral
--Li_inverse Approximate the nth prime using Li^-1(x)
-n, --nthprime Calculate the nth prime
-p, --primesieve Count primes using the sieve of Eratosthenes
--phi=<a> phi(x, a) counts the numbers <= x that are
not divisible by any of the first a primes
--Ri Approximate pi(x) using Riemann R
--Ri_inverse Approximate the nth prime using Ri^-1(x)
-s[N], --status[=N] Show computation progress 1%, 2%, 3%, ...
[N] digits after decimal point e.g. N=1, 99.9%
--test Run various correctness tests and exit
--time Print the time elapsed in seconds
-t<N>, --threads=<N> Set the number of threads, 1 <= N <= CPU cores
-v, --version Print version and license information
-h, --help Print this help menu

Advanced Deleglise-Rivat options:

-a<N>, --alpha=<N> Tuning factor, 1 <= alpha <= x^(1/6)
--P2 Only compute the 2nd partial sieve function
--S1 Only compute the ordinary leaves
--S2_trivial Only compute the trivial special leaves
--S2_easy Only compute the easy special leaves
--S2_hard Only compute the hard special leaves
Binary file not shown.
3 changes: 3 additions & 0 deletions Prototypes/Source/Primes/Primes.wl
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
primeCountBinary = FileNameJoin[{DirectoryName[$InputFileName], "Binaries", $SystemID, "primecount"}] ];

PrimeCount[n_Integer] := ToExpression[ StringTrim[ RunProcess[ {primeCountBinary, ToString[n]}, "StandardOutput"]]];
3 changes: 3 additions & 0 deletions Prototypes/Source/Usage.wl
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,6 @@ What3Words::usage = "What3Words[location] and What3Words[words] use the What3Wor

(* Crypto *)
$HashTypes::usage = "$HashTypes gives the list of supported hash types";

(* Primes *)
PrimeCount::usage = "PrimeCount[n] gives the number of primes less than or equal to 'n'. Uses binaries from: https://github.com/kimwalisch/primecount";

0 comments on commit ef99861

Please sign in to comment.