Trigonometric functions¶
-
template<class B>
inline batch_type_t<B> xsimd::sin(const simd_base<B> &x)¶ Computes the sine of the batch
x
.- Parameters
x – batch of floating point values.
- Returns
the sine of
x
.
-
template<class B>
inline batch_type_t<B> xsimd::cos(const simd_base<B> &x)¶ Computes the cosine of the batch
x
.- Parameters
x – batch of floating point values.
- Returns
the cosine of
x
.
-
template<class B>
inline void xsimd::sincos(const simd_base<B> &x, batch_type_t<B> &si, batch_type_t<B> &co)¶ Computes the sine and the cosine of the batch
x
.This method is faster than calling sine and cosine independently.
- Parameters
x – batch of floating point values.
si – the sine of x.
co – the cosine of x.
-
template<class B>
inline batch_type_t<B> xsimd::tan(const simd_base<B> &x)¶ Computes the tangent of the batch
x
.- Parameters
x – batch of floating point values.
- Returns
the tangent of
x
.
-
template<class B>
inline batch_type_t<B> xsimd::asin(const simd_base<B> &x)¶ Computes the arc sine of the batch
x
.- Parameters
x – batch of floating point values.
- Returns
the arc sine of
x
.
-
template<class B>
inline batch_type_t<B> xsimd::acos(const simd_base<B> &x)¶ Computes the arc cosine of the batch
x
.- Parameters
x – batch of floating point values.
- Returns
the arc cosine of
x
.
-
template<class B>
inline batch_type_t<B> xsimd::atan(const simd_base<B> &x)¶ Computes the arc tangent of the batch
x
.- Parameters
x – batch of floating point values.
- Returns
the arc tangent of
x
.
-
template<class B>
inline batch_type_t<B> xsimd::atan2(const simd_base<B> &y, const simd_base<B> &x)¶ Computes the arc tangent of the batch
x/y
, using the signs of the arguments to determine the correct quadrant.- Parameters
x – batch of floating point values.
y – batch of floating point values.
- Returns
the arc tangent of
x/y
.