Basic functions¶
Warning
doxygenfunction: Unable to resolve multiple matches for function “abs” with arguments (const simd_batch<X>&) in doxygen xml output for project “xsimd” from directory: ../xml. Potential matches:
- static batch_type xsimd::detail::batch_kernel::abs(const batch_type&)
- static batch_type xsimd::detail::int16_batch_kernel::abs(const batch_type&)
- static real_batch xsimd::detail::complex_batch_kernel::abs(const batch_type&)
- template <class X>
real_batch_type_t<X> xsimd::abs(const simd_base<X>&)
Warning
doxygenfunction: Unable to resolve multiple matches for function “fabs” with arguments (const simd_batch<X>&) in doxygen xml output for project “xsimd” from directory: ../xml. Potential matches:
- static batch_type xsimd::detail::batch_kernel::fabs(const batch_type&)
- template <class X>
batch_type_t<X> xsimd::fabs(const simd_base<X>&)
- template <class B>
-
batch_type_t<B>
xsimd::fmod(const simd_base<B> &x, const simd_base<B> &y)¶ Computes the floating-point remainder of the division operation
x/y.The floating-point remainder of the division operation
x/ycalculated by this function is exactly the valuex - n*y, wherenisx/ywith its fractional part truncated. The returned value has the same sign asxand is less thanyin magnitude.- Return
the floating-point remainder of the division.
- Parameters
x: batch of floating point values.y: batch of floating point values.
- template <class B>
-
batch_type_t<B>
xsimd::remainder(const simd_base<B> &x, const simd_base<B> &y)¶ Computes the IEEE remainder of the floating point division operation
x/y.The IEEE floating-point remainder of the division operation
x/ycalculated by this function is exactly the valuex - n*y, where the value n is the integral value nearest the exact valuex/y. When|n-x/y| = 0.5, the value n is chosen to be even. In contrast to fmod, the returned value is not guaranteed to have the same sign asx. If the returned value is 0, it will have the same sign asx.- Return
the IEEE remainder remainder of the floating point division.
- Parameters
x: batch of floating point values.y: batch of floating point values.
Warning
doxygenfunction: Unable to resolve multiple matches for function “fma” with arguments (const simd_batch<X>&, const simd_batch<X>&, const simd_batch<X>&) in doxygen xml output for project “xsimd” from directory: ../xml. Potential matches:
- static batch_type xsimd::detail::avx512_int16_batch_kernel::fma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int32_batch_kernel::fma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int64_batch_kernel::fma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int8_batch_kernel::fma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx_int_kernel_base::fma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::batch_kernel::fma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::sse_int_kernel_base::fma(const batch_type&, const batch_type&, const batch_type&)
- template <class T>
std::enable_if<std::is_scalar<T>::value, T>::type xsimd::fma(const T&, const T&, const T&)
- template <class X>
batch_type_t<X> xsimd::fma(const simd_base<X>&, const simd_base<X>&, const simd_base<X>&)
Warning
doxygenfunction: Unable to resolve multiple matches for function “fms” with arguments (const simd_batch<X>&, const simd_batch<X>&, const simd_batch<X>&) in doxygen xml output for project “xsimd” from directory: ../xml. Potential matches:
- static batch_type xsimd::detail::avx512_int16_batch_kernel::fms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int32_batch_kernel::fms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int64_batch_kernel::fms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int8_batch_kernel::fms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx_int_kernel_base::fms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::batch_kernel::fms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::sse_int_kernel_base::fms(const batch_type&, const batch_type&, const batch_type&)
- template <class X>
batch_type_t<X> xsimd::fms(const simd_base<X>&, const simd_base<X>&, const simd_base<X>&)
Warning
doxygenfunction: Unable to resolve multiple matches for function “fnma” with arguments (const simd_batch<X>&, const simd_batch<X>&, const simd_batch<X>&) in doxygen xml output for project “xsimd” from directory: ../xml. Potential matches:
- static batch_type xsimd::detail::avx512_int16_batch_kernel::fnma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int32_batch_kernel::fnma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int64_batch_kernel::fnma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int8_batch_kernel::fnma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx_int_kernel_base::fnma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::batch_kernel::fnma(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::sse_int_kernel_base::fnma(const batch_type&, const batch_type&, const batch_type&)
- template <class X>
batch_type_t<X> xsimd::fnma(const simd_base<X>&, const simd_base<X>&, const simd_base<X>&)
Warning
doxygenfunction: Unable to resolve multiple matches for function “fnms” with arguments (const simd_batch<X>&, const simd_batch<X>&, const simd_batch<X>&) in doxygen xml output for project “xsimd” from directory: ../xml. Potential matches:
- static batch_type xsimd::detail::avx512_int16_batch_kernel::fnms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int32_batch_kernel::fnms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int64_batch_kernel::fnms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx512_int8_batch_kernel::fnms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::avx_int_kernel_base::fnms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::batch_kernel::fnms(const batch_type&, const batch_type&, const batch_type&)
- static batch_type xsimd::detail::sse_int_kernel_base::fnms(const batch_type&, const batch_type&, const batch_type&)
- template <class X>
batch_type_t<X> xsimd::fnms(const simd_base<X>&, const simd_base<X>&, const simd_base<X>&)
Warning
doxygenfunction: Unable to resolve multiple matches for function “min” with arguments (const simd_batch<X>&, const simd_batch<X>&) in doxygen xml output for project “xsimd” from directory: ../xml. Potential matches:
- static batch_type xsimd::detail::batch_kernel::min(const batch_type&, const batch_type&)
- static batch_type xsimd::detail::int16_batch_kernel::min(const batch_type&, const batch_type&)
- static batch_type xsimd::detail::sse_int64_batch_kernel::min(const batch_type&, const batch_type&)
- template <class T0, class T1>
auto xsimd::min(T0 const&, T1 const&)
- template <class T0, class T1>
std::complex<typename std::common_type<T0, T1>::type> xsimd::min(std::complex<T0> const&, std::complex<T1> const&)
- template <class X>
batch_type_t<X> xsimd::min(const simd_base<X>&, const simd_base<X>&)
Warning
doxygenfunction: Unable to resolve multiple matches for function “max” with arguments (const simd_batch<X>&, const simd_batch<X>&) in doxygen xml output for project “xsimd” from directory: ../xml. Potential matches:
- static batch_type xsimd::detail::batch_kernel::max(const batch_type&, const batch_type&)
- static batch_type xsimd::detail::int16_batch_kernel::max(const batch_type&, const batch_type&)
- static batch_type xsimd::detail::sse_int64_batch_kernel::max(const batch_type&, const batch_type&)
- template <class T0, class T1>
auto xsimd::max(T0 const&, T1 const&)
- template <class T0, class T1>
std::complex<typename std::common_type<T0, T1>::type> xsimd::max(std::complex<T0> const&, std::complex<T1> const&)
- template <class X>
batch_type_t<X> xsimd::max(const simd_base<X>&, const simd_base<X>&)
- template <class X>
-
batch_type_t<X>
xsimd::fmin(const simd_batch<X> &lhs, const simd_batch<X> &rhs) Returns the smaller values of the batches
lhsandrhs.- Return
a batch of the smaller values.
- Parameters
lhs: a batch of floating point values.rhs: a batch of floating point values.
- template <class X>
-
batch_type_t<X>
xsimd::fmax(const simd_batch<X> &lhs, const simd_batch<X> &rhs) Returns the larger values of the batches
lhsandrhs.- Return
a batch of the larger values.
- Parameters
lhs: a batch of floating point values.rhs: a batch of floating point values.
- template <class B>
-
batch_type_t<B>
xsimd::fdim(const simd_base<B> &x, const simd_base<B> &y)¶ Computes the positive difference between
xandy, that is,max(0, x-y).- Return
the positive difference.
- Parameters
x: batch of floating point values.y: batch of floating point values.
Warning
doxygenfunction: Unable to resolve multiple matches for function “clip” with arguments (const batch<T, N>&, const batch<T, N>&, const batch<T, N>&) in doxygen xml output for project “xsimd” from directory: ../xml. Potential matches:
- template <class B>
batch_type_t<B> xsimd::clip(const simd_base<B>&, const simd_base<B>&, const simd_base<B>&)
- template <class T, class = typename std::enable_if<std::is_scalar<T>::value>::type>
T xsimd::clip(const T&, const T&, const T&)