本文整理汇总了C++中SymEngine::cot方法的典型用法代码示例。如果您正苦于以下问题:C++ SymEngine::cot方法的具体用法?C++ SymEngine::cot怎么用?C++ SymEngine::cot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SymEngine
的用法示例。
在下文中一共展示了SymEngine::cot方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: add
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},
{add(add(sinh(one), add(cosh(one), add(tanh(one), coth(one)))),
sech(r3)),
5.773239267559},
示例2: sin
TEST_CASE("eval_double: eval_double", "[eval_double]")
{
RCP<const Basic> r1, r2, r3, r4;
r1 = sin(integer(1));
r2 = sin(div(integer(1), integer(2)));
r3 = div(one, integer(5));
r4 = integer(5);
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 },
{ 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(sinh(one), add(cosh(one), add(tanh(one), coth(one)))), 4.792911269914 },
{ add(asinh(r4), add(acosh(r4), add(atanh(r3), acoth(r4)))), 5.010335118942 },
{ SymEngine::abs(log(div(pi, mul(E, integer(2))))), 0.548417294710 },
{ SymEngine::atan2(r1, neg(r2)), 2.08867384922582 }
};
for (unsigned i = 0; i < vec.size(); i++) {
double val = eval_double(*vec[i].first);
std::cout.precision(12);
std::cout << vec[i].first->__str__() << " ~ " << val << std::endl;
REQUIRE(::fabs(val - vec[i].second) < 1e-12);
}
for (unsigned i = 0; i < vec.size(); i++) {