29 Numerics library [numerics]

29.10 Data-parallel types [simd]

29.10.7 basic_simd non-member operations [simd.nonmembers]

29.10.7.9 Mathematical functions [simd.math]

template<math-floating-point V> constexpr rebind_simd_t<int, deduced-simd-t<V>> ilogb(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> ldexp(const V& x, const rebind_simd_t<int, deduced-simd-t<V>>& exp); template<math-floating-point V> constexpr deduced-simd-t<V> scalbn(const V& x, const rebind_simd_t<int, deduced-simd-t<V>>& n); template<math-floating-point V> constexpr deduced-simd-t<V> scalbln(const V& x, const rebind_simd_t<long int, deduced-simd-t<V>>& n); template<signed_integral T, class Abi> constexpr basic_simd<T, Abi> abs(const basic_simd<T, Abi>& j); template<math-floating-point V> constexpr deduced-simd-t<V> abs(const V& j); template<math-floating-point V> constexpr deduced-simd-t<V> fabs(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> ceil(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> floor(const V& x); template<math-floating-point V> deduced-simd-t<V> nearbyint(const V& x); template<math-floating-point V> deduced-simd-t<V> rint(const V& x); template<math-floating-point V> rebind_simd_t<long int, deduced-simd-t<V>> lrint(const V& x); template<math-floating-point V> rebind_simd_t<long long int, deduced-simd-t<V>> llrint(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> round(const V& x); template<math-floating-point V> constexpr rebind_simd_t<long int, deduced-simd-t<V>> lround(const V& x); template<math-floating-point V> constexpr rebind_simd_t<long long int, deduced-simd-t<V>> llround(const V& x); template<class V0, class V1> constexpr math-common-simd-t<V0, V1> fmod(const V0& x, const V1& y); template<math-floating-point V> constexpr deduced-simd-t<V> trunc(const V& x); template<class V0, class V1> constexpr math-common-simd-t<V0, V1> remainder(const V0& x, const V1& y); template<class V0, class V1> constexpr math-common-simd-t<V0, V1> copysign(const V0& x, const V1& y); template<class V0, class V1> constexpr math-common-simd-t<V0, V1> nextafter(const V0& x, const V1& y); template<class V0, class V1> constexpr math-common-simd-t<V0, V1> fdim(const V0& x, const V1& y); template<class V0, class V1> constexpr math-common-simd-t<V0, V1> fmax(const V0& x, const V1& y); template<class V0, class V1> constexpr math-common-simd-t<V0, V1> fmin(const V0& x, const V1& y); template<class V0, class V1, class V2> constexpr math-common-simd-t<V0, V1, V2> fma(const V0& x, const V1& y, const V2& z); template<math-floating-point V> constexpr rebind_simd_t<int, deduced-simd-t<V>> fpclassify(const V& x); template<math-floating-point V> constexpr typename deduced-simd-t<V>::mask_type isfinite(const V& x); template<math-floating-point V> constexpr typename deduced-simd-t<V>::mask_type isinf(const V& x); template<math-floating-point V> constexpr typename deduced-simd-t<V>::mask_type isnan(const V& x); template<math-floating-point V> constexpr typename deduced-simd-t<V>::mask_type isnormal(const V& x); template<math-floating-point V> constexpr typename deduced-simd-t<V>::mask_type signbit(const V& x); template<class V0, class V1> constexpr typename math-common-simd-t<V0, V1>::mask_type isgreater(const V0& x, const V1& y); template<class V0, class V1> constexpr typename math-common-simd-t<V0, V1>::mask_type isgreaterequal(const V0& x, const V1& y); template<class V0, class V1> constexpr typename math-common-simd-t<V0, V1>::mask_type isless(const V0& x, const V1& y); template<class V0, class V1> constexpr typename math-common-simd-t<V0, V1>::mask_type islessequal(const V0& x, const V1& y); template<class V0, class V1> constexpr typename math-common-simd-t<V0, V1>::mask_type islessgreater(const V0& x, const V1& y); template<class V0, class V1> constexpr typename math-common-simd-t<V0, V1>::mask_type isunordered(const V0& x, const V1& y);
Let Ret denote the return type of the specialization of a function template with the name math-func.
Let math-func-simd denote: template<class... Args> Ret math-func-simd(Args... args) { return Ret([&](simd-size-type i) { math-func(make-compatible-simd-t<Ret, Args>(args)[i]...); }); }
Returns: A value ret of type Ret, that is element-wise equal to the result of calling math-func-simd with the arguments of the above functions.
If in an invocation of a scalar overload of math-func for index i in math-func-simd a domain, pole, or range error would occur, the value of ret[i] is unspecified.
Remarks: It is unspecified whether errno ([errno]) is accessed.
template<math-floating-point V> constexpr deduced-simd-t<V> acos(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> asin(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> atan(const V& x); template<class V0, class V1> constexpr math-common-simd-t<V0, V1> atan2(const V0& y, const V1& x); template<math-floating-point V> constexpr deduced-simd-t<V> cos(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> sin(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> tan(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> acosh(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> asinh(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> atanh(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> cosh(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> sinh(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> tanh(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> exp(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> exp2(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> expm1(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> log(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> log10(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> log1p(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> log2(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> logb(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> cbrt(const V& x); template<class V0, class V1> constexpr math-common-simd-t<V0, V1> hypot(const V0& x, const V1& y); template<class V0, class V1, class V2> constexpr math-common-simd-t<V0, V1, V2> hypot(const V0& x, const V1& y, const V2& z); template<class V0, class V1> constexpr math-common-simd-t<V0, V1> pow(const V0& x, const V1& y); template<math-floating-point V> constexpr deduced-simd-t<V> sqrt(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> erf(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> erfc(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> lgamma(const V& x); template<math-floating-point V> constexpr deduced-simd-t<V> tgamma(const V& x); template<class V0, class V1, class V2> constexpr math-common-simd-t<V0, V1, V2> lerp(const V0& a, const V1& b, const V2& t) noexcept; template<math-floating-point V> deduced-simd-t<V> assoc_laguerre(const rebind_simd_t<unsigned, deduced-simd-t<V>>& n, const rebind_simd_t<unsigned, deduced-simd-t<V>>& m, const V& x); template<math-floating-point V> deduced-simd-t<V> assoc_legendre(const rebind_simd_t<unsigned, deduced-simd-t<V>>& l, const rebind_simd_t<unsigned, deduced-simd-t<V>>& m, const V& x); template<class V0, class V1> math-common-simd-t<V0, V1> beta(const V0& x, const V1& y); template<math-floating-point V> deduced-simd-t<V> comp_ellint_1(const V& k); template<math-floating-point V> deduced-simd-t<V> comp_ellint_2(const V& k); template<class V0, class V1> math-common-simd-t<V0, V1> comp_ellint_3(const V0& k, const V1& nu); template<class V0, class V1> math-common-simd-t<V0, V1> cyl_bessel_i(const V0& nu, const V1& x); template<class V0, class V1> math-common-simd-t<V0, V1> cyl_bessel_j(const V0& nu, const V1& x); template<class V0, class V1> math-common-simd-t<V0, V1> cyl_bessel_k(const V0& nu, const V1& x); template<class V0, class V1> math-common-simd-t<V0, V1> cyl_neumann(const V0& nu, const V1& x); template<class V0, class V1> math-common-simd-t<V0, V1> ellint_1(const V0& k, const V1& phi); template<class V0, class V1> math-common-simd-t<V0, V1> ellint_2(const V0& k, const V1& phi); template<class V0, class V1, class V2> math-common-simd-t<V0, V1, V2> ellint_3(const V0& k, const V1& nu, const V2& phi); template<math-floating-point V> deduced-simd-t<V> expint(const V& x); template<math-floating-point V> deduced-simd-t<V> hermite(const rebind_simd_t<unsigned, deduced-simd-t<V>>& n, const V& x); template<math-floating-point V> deduced-simd-t<V> laguerre(const rebind_simd_t<unsigned, deduced-simd-t<V>>& n, const V& x); template<math-floating-point V> deduced-simd-t<V> legendre(const rebind_simd_t<unsigned, deduced-simd-t<V>>& l, const V& x); template<math-floating-point V> deduced-simd-t<V> riemann_zeta(const V& x); template<math-floating-point V> deduced-simd-t<V> sph_bessel(const rebind_simd_t<unsigned, deduced-simd-t<V>>& n, const V& x); template<math-floating-point V> deduced-simd-t<V> sph_legendre(const rebind_simd_t<unsigned, deduced-simd-t<V>>& l, const rebind_simd_t<unsigned, deduced-simd-t<V>>& m, const V& theta); template<math-floating-point V> deduced-simd-t<V> sph_neumann(const rebind_simd_t<unsigned, deduced-simd-t<V>>& n, const V& x);
Let Ret denote the return type of the specialization of a function template with the name math-func.
Let math-func-simd denote: template<class... Args> Ret math-func-simd(Args... args) { return Ret([&](simd-size-type i) { math-func(make-compatible-simd-t<Ret, Args>(args)[i]...); }); }
Returns: A value ret of type Ret, that is element-wise approximately equal to the result of calling math-func-simd with the arguments of the above functions.
If in an invocation of a scalar overload of math-func for index i in math-func-simd a domain, pole, or range error would occur, the value of ret[i] is unspecified.
Remarks: It is unspecified whether errno ([errno]) is accessed.
template<math-floating-point V> constexpr deduced-simd-t<V> frexp(const V& value, rebind_simd_t<int, deduced-simd-t<V>>* exp);
Let Ret be deduced-simd-t<V>.
Let frexp-simd denote: template<class V> pair<Ret, rebind_simd_t<int, Ret>> frexp-simd(const V& x) { int r1[Ret::size()]; Ret r0([&](simd-size-type i) { frexp(make-compatible-simd-t<Ret, V>(x)[i], &r1[i]); }); return {r0, rebind_simd_t<int, Ret>(r1)}; }
Let ret be a value of type pair<Ret, rebind_simd_t<int, Ret>> that is the same value as the result of calling frexp-simd(x).
Effects: Sets *exp to ret.second.
Returns: ret.first.
template<class V0, class V1> constexpr math-common-simd-t<V0, V1> remquo(const V0& x, const V1& y, rebind_simd_t<int, math-common-simd-t<V0, V1>>* quo);
Let Ret be math-common-simd-t<V0, V1>.
Let remquo-simd denote: template<class V0, class V1> pair<Ret, rebind_simd_t<int, Ret>> remquo-simd(const V0& x, const V1& y) { int r1[Ret::size()]; Ret r0([&](simd-size-type i) { remquo(make-compatible-simd-t<Ret, V0>(x)[i], make-compatible-simd-t<Ret, V1>(y)[i], &r1[i]); }); return {r0, rebind_simd_t<int, Ret>(r1)}; }
Let ret be a value of type pair<Ret, rebind_simd_t<int, Ret>> that is the same value as the result of calling remquo-simd(x, y).
If in an invocation of a scalar overload of remquo for index i in remquo-simd a domain, pole, or range error would occur, the value of ret[i] is unspecified.
Effects: Sets *quo to ret.second.
Returns: ret.first.
Remarks: It is unspecified whether errno ([errno]) is accessed.
template<class T, class Abi> constexpr basic_simd<T, Abi> modf(const type_identity_t<basic_simd<T, Abi>>& value, basic_simd<T, Abi>* iptr);
Let V be basic_simd<T, Abi>.
Let modf-simd denote: pair<V, V> modf-simd(const V& x) { T r1[Ret::size()]; V r0([&](simd-size-type i) { modf(V(x)[i], &r1[i]); }); return {r0, V(r1)}; }
Let ret be a value of type pair<V, V> that is the same value as the result of calling modf-simd(value).
Effects: Sets *iptr to ret.second.
Returns: ret.first.