本文整理汇总了C++中nt2::acot方法的典型用法代码示例。如果您正苦于以下问题:C++ nt2::acot方法的具体用法?C++ nt2::acot怎么用?C++ nt2::acot使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nt2
的用法示例。
在下文中一共展示了nt2::acot方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NT2_TEST_CASE_TPL
NT2_TEST_CASE_TPL ( acot_real_1, NT2_SIMD_REAL_TYPES)
{
using nt2::acot;
using nt2::tag::acot_;
using boost::simd::native;
typedef BOOST_SIMD_DEFAULT_EXTENSION ext_t;
typedef native<T,ext_t> vT;
typedef typename nt2::meta::call<acot_(vT)>::type r_t;
typedef vT wished_r_t;
// return type conformity test
NT2_TEST_TYPE_IS(r_t, wished_r_t);
// specific values tests
#ifndef BOOST_SIMD_NO_INVALIDS
NT2_TEST_ULP_EQUAL(acot(nt2::Inf<vT>()), nt2::Zero<r_t>(), 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Minf<vT>()), nt2::Zero<r_t>(), 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Nan<vT>()), nt2::Nan<r_t>(), 1.5);
#endif
NT2_TEST_ULP_EQUAL(acot(nt2::Half<vT>()), nt2::splat<vT>(1.107148717794090e+00), 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Mhalf<vT>()), nt2::splat<vT>(-1.107148717794090e+00), 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Mone<vT>()), nt2::splat<vT>(-7.853981633974483e-01), 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::One<vT>()), nt2::splat<vT>(7.853981633974483e-01), 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Zero<vT>()), nt2::splat<vT>(1.570796326794897e+00), 1.5);
NT2_TEST_ULP_EQUAL(acot(rec(nt2::Eps<vT>())), nt2::Eps<vT>(), 1.5);
}
示例2: NT2_TEST_CASE_TPL
NT2_TEST_CASE_TPL ( acot_real__1_0, NT2_REAL_TYPES)
{
using nt2::acot;
using nt2::tag::acot_;
typedef typename nt2::meta::as_integer<T>::type iT;
typedef typename nt2::meta::call<acot_(T)>::type r_t;
typedef typename nt2::meta::upgrade<T>::type u_t;
typedef typename boost::result_of<nt2::meta::floating(T)>::type wished_r_t;
// return type conformity test
NT2_TEST( (boost::is_same < r_t, wished_r_t >::value) );
std::cout << std::endl;
double ulpd;
ulpd=0.0;
// specific values tests
NT2_TEST_ULP_EQUAL(acot(nt2::Half<T>()), 1.107148717794090e+00, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Inf<T>()), 0, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Mhalf<T>()), -1.107148717794090e+00, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Minf<T>()), 0, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Mone<T>()), -7.853981633974483e-01, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Nan<T>()), nt2::Nan<r_t>(), 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::One<T>()), 7.853981633974483e-01, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Zero<T>()), 1.570796326794897e+00, 1.5);
} // end of test for real_
示例3: NT2_TEST_CASE_TPL
NT2_TEST_CASE_TPL ( acot_real__1_0, NT2_SIMD_REAL_TYPES)
{
using nt2::acot;
using nt2::tag::acot_;
using nt2::load;
using boost::simd::native;
using nt2::meta::cardinal_of;
typedef NT2_SIMD_DEFAULT_EXTENSION ext_t;
typedef typename nt2::meta::upgrade<T>::type u_t;
typedef native<T,ext_t> n_t;
typedef n_t vT;
typedef typename nt2::meta::as_integer<T>::type iT;
typedef native<iT,ext_t> ivT;
typedef typename nt2::meta::call<acot_(vT)>::type r_t;
typedef typename nt2::meta::call<acot_(T)>::type sr_t;
typedef typename nt2::meta::scalar_of<r_t>::type ssr_t;
double ulpd;
ulpd=0.0;
// specific values tests
NT2_TEST_ULP_EQUAL(acot(nt2::Half<vT>())[0], 1.107148717794090e+00, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Inf<vT>())[0], 0, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Mhalf<vT>())[0], -1.107148717794090e+00, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Minf<vT>())[0], 0, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Mone<vT>())[0], -7.853981633974483e-01, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Nan<vT>())[0], nt2::Nan<sr_t>(), 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::One<vT>())[0], 7.853981633974483e-01, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Zero<vT>())[0], 1.570796326794897e+00, 1.5);
} // end of test for real_
示例4: NT2_TEST_CASE_TPL
NT2_TEST_CASE_TPL ( acot_unsigned_int__1_0, NT2_UNSIGNED_TYPES)
{
using nt2::acot;
using nt2::tag::acot_;
typedef typename nt2::meta::as_integer<T>::type iT;
typedef typename nt2::meta::call<acot_(T)>::type r_t;
typedef typename nt2::meta::scalar_of<r_t>::type ssr_t;
typedef typename nt2::meta::upgrade<T>::type u_t;
typedef typename boost::dispatch::meta::as_floating<T>::type wished_r_t;
// return type conformity test
NT2_TEST( (boost::is_same < r_t, wished_r_t >::value) );
std::cout << std::endl;
// specific values tests
NT2_TEST_ULP_EQUAL(acot(nt2::One<T>()), 7.853981633974483e-01, 1.5);
NT2_TEST_ULP_EQUAL(acot(nt2::Zero<T>()), 1.570796326794897e+00, 1.5);
} // end of test for unsigned_int_