Skip to content

Commit

Permalink
Tests to increase coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
ShikharJ committed Jan 21, 2017
1 parent c4d2322 commit 95108bb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions symengine/tests/basic/test_arit.cpp
Expand Up @@ -767,6 +767,9 @@ TEST_CASE("Pow: arit", "[arit]")
r2 = pow(pow(r2, integer(3)), real_double(0.2));
REQUIRE(std::abs(down_cast<const RealDouble &>(*r2).i - 0.501187233627)
< 1e-12);
r2 = pow(E, real_double(0.2));
REQUIRE(is_a<RealDouble>(*r2));
REQUIRE(std::abs(down_cast<const RealDouble &>(*r2).i - 1.22140275816017) < 1e-12);

r1 = real_double(-0.01);
r2 = pow(r1, Rational::from_mpq(rational_class(1, 2)));
Expand Down
4 changes: 3 additions & 1 deletion symengine/tests/eval/test_eval_double.cpp
Expand Up @@ -107,6 +107,8 @@ TEST_CASE("eval_double: eval_double", "[eval_double]")
{SymEngine::atan2(r1, neg(r2)), 2.08867384922582},
{mul(pi, mul(E, EulerGamma)), 4.92926836742289},
{pow(mul(EulerGamma, r4), integer(8)), 4813.54354505117582},
{pow(E, real_double(0.2)), 1.22140275816017},
{pow(real_double(0.2), E), 0.01258932770594},
{mul(EulerGamma, integer(10)), 5.7721566490153286},
{max({r2, r1}), 0.841470984808},
{min({add(r1, r4), r2}), 0.479425538604},
Expand All @@ -115,7 +117,7 @@ TEST_CASE("eval_double: eval_double", "[eval_double]")
{loggamma(pi), 0.82769459232343710152},
{add(asech(div(one, integer(2))), real_double(0.1)), 1.41695789692482},
{r5, 0.841470984807897},
};
{pow(E, r5), 2.31977682471585}};

for (unsigned i = 0; i < vec.size(); i++) {
double val = eval_double(*vec[i].first);
Expand Down

0 comments on commit 95108bb

Please sign in to comment.