Skip to content

Commit 1a417ae

Browse files
authored
Increase coverage (#41)
1 parent 3ae925b commit 1a417ae

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

test/test_Cl1.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,15 @@ TEST_CASE("test_real_fixed_values")
1717
const auto x64 = static_cast<double>(x128);
1818
const auto cl128_expected = v.second;
1919
const auto cl64_expected = static_cast<double>(cl128_expected);
20-
21-
const auto cl64_poly = polylogarithm::Cl1(x64);
20+
const auto cl64_poly = polylogarithm::Cl1(x64);
2221

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

2726
CHECK_CLOSE(cl64_poly, cl64_expected, 4*eps64);
27+
CHECK_CLOSE(polylogarithm::Cl1(-x64), cl64_expected, 4*eps64);
28+
CHECK_CLOSE(polylogarithm::Cl1(x64 + 2*M_PI), cl64_expected, 10*eps64);
29+
CHECK_CLOSE(polylogarithm::Cl1(x64 - 2*M_PI), cl64_expected, 10*eps64);
2830
}
2931
}

test/test_eta.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,25 @@
22

33
#include "doctest.h"
44
#include "eta.hpp"
5+
#include "test.hpp"
6+
#include <cmath>
57

68
TEST_CASE("test_fixed_values")
79
{
810
using polylogarithm::neg_eta;
911

12+
if (has_inf()) {
13+
CHECK(std::isinf(neg_eta(-221)));
14+
CHECK(std::isinf(neg_eta(-219)));
15+
}
16+
CHECK(neg_eta(-222) == 0.0);
17+
CHECK(neg_eta(-220) == 0.0);
18+
CHECK(neg_eta(-218) == 0.0);
19+
CHECK(neg_eta(-110) == 0.0);
20+
CHECK(neg_eta(-3) == 1.0/8);
21+
CHECK(neg_eta(-2) == 0.0);
22+
CHECK(neg_eta(-1) == -0.25);
23+
CHECK(neg_eta(0) == -0.5);
1024
CHECK(neg_eta(1) == -0.69314718055994531);
1125
CHECK(neg_eta(2) == -0.82246703342411322);
1226
CHECK(neg_eta(52) == -0.9999999999999998);

0 commit comments

Comments
 (0)