Skip to content

Commit

Permalink
Update pi(x) tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Mar 28, 2023
1 parent b562048 commit 9b2de66
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
14 changes: 7 additions & 7 deletions test/pi_deleglise_rivat.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///
/// @file pi_deleglise_rivat.cpp
/// @brief Test the pi_deleglise_rivat_64(x) function.
/// @brief Test the pi_deleglise_rivat(x) function.
///
/// Copyright (C) 2023 Kim Walisch, <[email protected]>
///
Expand Down Expand Up @@ -44,15 +44,15 @@ int main()

{
int64_t x = -1;
int64_t res = pi_deleglise_rivat_64(x, threads);
std::cout << "pi_deleglise_rivat_64(" << x << ") = " << res;
int64_t res = pi_deleglise_rivat(x, threads);
std::cout << "pi_deleglise_rivat(" << x << ") = " << res;
check(res == 0);
}

for (int64_t x = 0; x < (int64_t) pix.size(); x++)
{
int64_t res = pi_deleglise_rivat_64(x, threads);
std::cout << "pi_deleglise_rivat_64(" << x << ") = " << res;
int64_t res = pi_deleglise_rivat(x, threads);
std::cout << "pi_deleglise_rivat(" << x << ") = " << res;
check(res == pix[x]);
}

Expand All @@ -63,9 +63,9 @@ int main()
for (int i = 0; i < 1000; i++)
{
int64_t x = dist(gen);
int64_t res1 = pi_deleglise_rivat_64(x, threads);
int64_t res1 = pi_deleglise_rivat(x, threads);
int64_t res2 = pi_legendre(x, threads);
std::cout << "pi_deleglise_rivat_64(" << x << ") = " << res1;
std::cout << "pi_deleglise_rivat(" << x << ") = " << res1;
check(res1 == res2);
}

Expand Down
14 changes: 7 additions & 7 deletions test/pi_gourdon.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
///
/// @file pi_gourdon.cpp
/// @brief Test the pi_gourdon_64(x) function.
/// @brief Test the pi_gourdon(x) function.
///
/// Copyright (C) 2023 Kim Walisch, <[email protected]>
///
Expand Down Expand Up @@ -45,15 +45,15 @@ int main()

{
int64_t x = -1;
int64_t res = pi_gourdon_64(x, threads);
std::cout << "pi_gourdon_64(" << x << ") = " << res;
int64_t res = pi_gourdon(x, threads);
std::cout << "pi_gourdon(" << x << ") = " << res;
check(res == 0);
}

for (int64_t x = 0; x < (int64_t) pix.size(); x++)
{
int64_t res = pi_gourdon_64(x, threads);
std::cout << "pi_gourdon_64(" << x << ") = " << res;
int64_t res = pi_gourdon(x, threads);
std::cout << "pi_gourdon(" << x << ") = " << res;
check(res == pix[x]);
}

Expand All @@ -64,9 +64,9 @@ int main()
for (int i = 0; i < 1000; i++)
{
int64_t x = dist(gen);
int64_t res1 = pi_gourdon_64(x, threads);
int64_t res1 = pi_gourdon(x, threads);
int64_t res2 = pi_legendre(x, threads);
std::cout << "pi_gourdon_64(" << x << ") = " << res1;
std::cout << "pi_gourdon(" << x << ") = " << res1;
check(res1 == res2);
}

Expand Down

0 comments on commit 9b2de66

Please sign in to comment.