Skip to content

Commit

Permalink
Increase coverage (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
Expander authored Mar 5, 2024
1 parent 3ae925b commit 1a417ae
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_Cl1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,15 @@ TEST_CASE("test_real_fixed_values")
const auto x64 = static_cast<double>(x128);
const auto cl128_expected = v.second;
const auto cl64_expected = static_cast<double>(cl128_expected);

const auto cl64_poly = polylogarithm::Cl1(x64);
const auto cl64_poly = polylogarithm::Cl1(x64);

INFO("x(64) = " << x64);
INFO("Cl1(64) real = " << cl64_expected << " (expected)");
INFO("Cl1(64) real = " << cl64_poly << " (polylogarithm C++)");

CHECK_CLOSE(cl64_poly, cl64_expected, 4*eps64);
CHECK_CLOSE(polylogarithm::Cl1(-x64), cl64_expected, 4*eps64);
CHECK_CLOSE(polylogarithm::Cl1(x64 + 2*M_PI), cl64_expected, 10*eps64);
CHECK_CLOSE(polylogarithm::Cl1(x64 - 2*M_PI), cl64_expected, 10*eps64);
}
}
14 changes: 14 additions & 0 deletions test/test_eta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,25 @@

#include "doctest.h"
#include "eta.hpp"
#include "test.hpp"
#include <cmath>

TEST_CASE("test_fixed_values")
{
using polylogarithm::neg_eta;

if (has_inf()) {
CHECK(std::isinf(neg_eta(-221)));
CHECK(std::isinf(neg_eta(-219)));
}
CHECK(neg_eta(-222) == 0.0);
CHECK(neg_eta(-220) == 0.0);
CHECK(neg_eta(-218) == 0.0);
CHECK(neg_eta(-110) == 0.0);
CHECK(neg_eta(-3) == 1.0/8);
CHECK(neg_eta(-2) == 0.0);
CHECK(neg_eta(-1) == -0.25);
CHECK(neg_eta(0) == -0.5);
CHECK(neg_eta(1) == -0.69314718055994531);
CHECK(neg_eta(2) == -0.82246703342411322);
CHECK(neg_eta(52) == -0.9999999999999998);
Expand Down

0 comments on commit 1a417ae

Please sign in to comment.