diff --git a/ChangeLog b/ChangeLog index 1c630fe6d..9edcddd3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ Changes in version 12.2, 18/03/2024 * RiemannR.cpp: Fix infinite loop on Linux i386, see https://github.com/kimwalisch/primecount/issues/66. +* test/Riemann_R.cpp: Add more tests. Changes in version 12.1, 09/03/2024 =================================== diff --git a/test/Riemann_R.cpp b/test/Riemann_R.cpp index 6a4efc2ba..b61f789a9 100644 --- a/test/Riemann_R.cpp +++ b/test/Riemann_R.cpp @@ -20,6 +20,22 @@ using std::size_t; using namespace primesieve; +/// Generated using Mathematica: +/// Table[IntegerPart[RiemannR[k]], {k, 0, 99}] +Array RiemannR_tiny = +{ + 0, 1, 1, 2, 2, 2, 3, 3, 3, 4, + 4, 4, 5, 5, 5, 6, 6, 6, 6, 7, + 7, 7, 8, 8, 8, 8, 9, 9, 9, 9, + 10, 10, 10, 10, 11, 11, 11, 11, 12, 12, + 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, + 14, 15, 15, 15, 15, 16, 16, 16, 16, 17, + 17, 17, 17, 17, 18, 18, 18, 18, 18, 19, + 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, + 21, 21, 21, 22, 22, 22, 22, 23, 23, 23, + 23, 23, 24, 24, 24, 24, 24, 25, 25, 25 +}; + Array RiemannR_table = { 4, // RiemannR(10^1) @@ -47,6 +63,12 @@ void check(bool OK) int main() { + for (size_t x = 0; x < RiemannR_tiny.size(); x++) + { + std::cout << "RiemannR(" << x << ") = " << (uint64_t) RiemannR((long double) x); + check((uint64_t) RiemannR((long double) x) == RiemannR_tiny[x]); + } + uint64_t x = 1; for (size_t i = 0; i < RiemannR_table.size(); i++) {