Skip to content

Commit

Permalink
Add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kimwalisch committed Mar 22, 2024
1 parent 0889676 commit cf00ccc
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions test/Riemann_R.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,25 @@ int main()
check((uint64_t) RiemannR((long double) x) == RiemannR_table[i]);
}

std::cout << "RiemannR_inverse(1) = " << RiemannR_inverse((long double) 1);
check((uint64_t) RiemannR_inverse((long double) 1) == 1);

for (x = 2; x < RiemannR_tiny.size(); x++)
{
uint64_t y = RiemannR_tiny[x];
std::cout << "RiemannR_inverse(" << y << ") = " << (uint64_t) RiemannR_inverse((long double) y);
check((uint64_t) RiemannR_inverse((long double) y) < x &&
(uint64_t) RiemannR_inverse((long double) y + 1) >= x);
}

x = 1;
for (size_t i = 0; i < RiemannR_table.size(); i++)
{
x *= 10;
std::cout << "RiemannR_inverse(" << RiemannR_table[i] << ") = " << (uint64_t) RiemannR_inverse((long double) RiemannR_table[i]);
check((uint64_t) RiemannR_inverse((long double) RiemannR_table[i]) < x &&
(uint64_t) RiemannR_inverse((long double) RiemannR_table[i] + 1) >= x);
uint64_t y = RiemannR_table[i];
std::cout << "RiemannR_inverse(" << y << ") = " << (uint64_t) RiemannR_inverse((long double) y);
check((uint64_t) RiemannR_inverse((long double) y) < x &&
(uint64_t) RiemannR_inverse((long double) y + 1) >= x);
}

// Sanity checks for tiny values of RiemannR(x)
Expand Down

0 comments on commit cf00ccc

Please sign in to comment.