本文整理汇总了C++中SymEngine::erf方法的典型用法代码示例。如果您正苦于以下问题:C++ SymEngine::erf方法的具体用法?C++ SymEngine::erf怎么用?C++ SymEngine::erf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymEngine
的用法示例。
在下文中一共展示了SymEngine::erf方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: a
#ifdef HAVE_SYMENGINE_MPFR
SymEngine::mpfr_class a(100);
SymEngine::eval_mpfr(a.get_mpfr_t(), *r1, MPFR_RNDN);
r5 = SymEngine::real_mpfr(std::move(a));
#else
r5 = SymEngine::real_double(SymEngine::eval_double(*r1));
#endif
std::vector<std::pair<RCP<const Basic>, double>> vec = {
{r1, 0.841470984808},
{r2, 0.479425538604},
{add(r1, r2), 1.320896523412},
{mul(r1, r2), 0.403422680111},
{pow(r1, r2), 0.920580670898},
{tan(pow(r1, r2)), 1.314847038576},
{erf(E), 0.9998790689599},
{erfc(E), 0.0001209310401},
{add(sin(r3), add(cos(r4), add(tan(r3), add(sec(integer(6)),
add(csc(r4), cot(r4)))))),
0.387875350057},
{add(asin(r3),
add(acos(r3), add(atan(r3), add(asec(integer(6)),
add(acsc(r4), acot(r4)))))),
3.570293614860},
{add(add(sinh(one), add(cosh(one), add(tanh(one), coth(one)))),
csch(r3)),
9.759732838729},
{add(add(add(asinh(r4), add(acosh(r4), add(atanh(r3), acoth(r4)))),
csch(r4)),
acsch(r3)),
7.336249966045},
示例2: min
r = min({sqrt(integer(3)), sqrt(integer(2))});
eval_mpfr(a, *r, MPFR_RNDN);
REQUIRE(mpfr_cmp_d(a, 1.41421356238) == -1);
REQUIRE(mpfr_cmp_d(a, 1.41421356236) == 1);
r = loggamma(E);
eval_mpfr(a, *r, MPFR_RNDN);
REQUIRE(mpfr_cmp_d(a, 0.44946174183) == -1);
REQUIRE(mpfr_cmp_d(a, 0.44946174181) == 1);
r = loggamma(integer(5));
eval_mpfr(a, *r, MPFR_RNDN);
REQUIRE(mpfr_cmp_d(a, 3.17805383035) == -1);
REQUIRE(mpfr_cmp_d(a, 3.17805383033) == 1);
r = erf(integer(2));
eval_mpfr(a, *r, MPFR_RNDN);
REQUIRE(mpfr_cmp_d(a, 0.995322265019) == -1);
REQUIRE(mpfr_cmp_d(a, 0.995322265017) == 1);
r = erf(div(E, pi));
eval_mpfr(a, *r, MPFR_RNDN);
REQUIRE(mpfr_cmp_d(a, 0.778918254988) == -1);
REQUIRE(mpfr_cmp_d(a, 0.778918254986) == 1);
mpfr_clear(a);
}