Created
February 11, 2016 09:53
-
-
Save CodeMaxx/7c7938ad7a736a4609b7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "catch.hpp" | |
#include <symengine/basic.h> | |
#include <symengine/integer.h> | |
#include <symengine/add.h> | |
#include <symengine/mul.h> | |
#include <symengine/eval_mpfr.h> | |
#include <symengine/constants.h> | |
#include <symengine/real_mpfr.h> | |
#include <symengine/functions.h> | |
using SymEngine::RCP; | |
using SymEngine::Basic; | |
using SymEngine::integer; | |
using SymEngine::pi; | |
using SymEngine::E; | |
using SymEngine::EulerGamma; | |
using SymEngine::mul; | |
using SymEngine::sub; | |
using SymEngine::eval_mpfr; | |
using SymEngine::print_stack_on_segfault; | |
TEST_CASE("trigonometry: eval_mpfr", "[eval_mpfr]") | |
{ | |
mpfr_t a; | |
mpfr_init2(a, 53); | |
RCP<const Basic> s = mul(pi, integer(5)); | |
RCP<const Basic> r = csch(s); | |
eval_mpfr(a, *r, MPFR_RNDN); | |
REQUIRE(mpfr_cmp_d(a, 0.0000003014034550780197673267)); | |
r = sech(s); | |
eval_mpfr(a, *r, MPFR_RNDN); | |
REQUIRE(mpfr_cmp_d(a, 0.000000301403455078006076)); | |
r = acsch(s); | |
eval_mpfr(a, *r, MPFR_RNDN); | |
REQUIRE(mpfr_cmp_d(a, 0.0636190534284985329)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment