This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
int main() { | |
std::cout << "Hello World!" << std::endl; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
primality test using primality_naive(int64_t) | |
L = 100000 : R = 200000 | |
test 1 duration : 19.897 s | |
test 2 duration : 20.491 s | |
average of 2 test(s) : 20.198 s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <ctime> | |
#include <vector> | |
#include <functional> | |
using namespace std; | |
int L = 100000000; | |
int R = 100100000; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
primality test using primality_sqrt_bound(int64_t) | |
L = 100000000 : R = 100100000 | |
test 1 duration : 0.761 s | |
test 2 duration : 0.762 s | |
test 3 duration : 0.764 s | |
test 4 duration : 0.771 s | |
test 5 duration : 0.741 s | |
test 6 duration : 0.741 s | |
test 7 duration : 0.769 s | |
test 8 duration : 0.744 s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
primality test using primality_sqrt_bound_coprime_2(int64_t) | |
L = 100000000 : R = 100100000 | |
test 1 duration : 0.418 s | |
test 2 duration : 0.393 s | |
test 3 duration : 0.397 s | |
test 4 duration : 0.406 s | |
test 5 duration : 0.379 s | |
test 6 duration : 0.381 s | |
test 7 duration : 0.383 s | |
test 8 duration : 0.383 s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
primality test using primality_sqrt_bound_coprime_6(int64_t) | |
L = 100000000 : R = 100100000 | |
test 1 duration : 0.278 s | |
test 2 duration : 0.269 s | |
test 3 duration : 0.283 s | |
test 4 duration : 0.258 s | |
test 5 duration : 0.263 s | |
test 6 duration : 0.272 s | |
test 7 duration : 0.262 s | |
test 8 duration : 0.265 s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
primality test using primality_sqrt_bound_coprime_30(int64_t) | |
L = 100000000 : R = 100100000 | |
test 1 duration : 0.281 s | |
test 2 duration : 0.225 s | |
test 3 duration : 0.222 s | |
test 4 duration : 0.227 s | |
test 5 duration : 0.226 s | |
test 6 duration : 0.223 s | |
test 7 duration : 0.223 s | |
test 8 duration : 0.225 s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
primality test using primality_miller_rabin(int64_t) | |
L = 100000000 : R = 100100000 | |
test 1 duration : 0.861 s | |
test 2 duration : 0.853 s | |
test 3 duration : 0.856 s | |
test 4 duration : 0.844 s | |
test 5 duration : 0.84 s | |
test 6 duration : 0.835 s | |
test 7 duration : 0.839 s | |
test 8 duration : 0.839 s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int tt = 10, it = 1; | |
double total = 0.; | |
cout << "primality test using primality_miller_rabin_probabilistic(int64_t)" << endl; | |
cout << "Miller Rabin iteration count = " << it << endl; | |
cout << "L : " << L << " R : " << R << endl; | |
for(int k = 0, c = 0, t = clock(); k < tt; k++, c = 0, t = clock()) { | |
for(int i = L; i <= R; i++) | |
c += primality_miller_rabin_probabilistic(i, it); | |
double time = (clock() - t) / (CLOCKS_PER_SEC + 0.); | |
total += time; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var maxIterations; | |
var maxVal; | |
var height; | |
var width; | |
function preload() { | |
maxIterations = 200; | |
maxVal = 50; |
OlderNewer