Functions that implement math functions. Take care that some of the implementations will return results with less precision than what the FPU calculates.
|
template<typename T , typename Abi > |
Vector< T, detail::not_fixed_size_abi< Abi > > | sin (const Vector< T, Abi > &x) |
| Returns the sine of all input values in x .
|
|
template<typename T , typename Abi > |
Vector< T, detail::not_fixed_size_abi< Abi > > | cos (const Vector< T, Abi > &x) |
| Returns the cosine of all input values in x .
|
|
template<typename T , typename Abi > |
Vector< T, detail::not_fixed_size_abi< Abi > > | asin (const Vector< T, Abi > &x) |
| Returns the arcsine of all input values in x .
|
|
template<typename T , typename Abi > |
Vector< T, detail::not_fixed_size_abi< Abi > > | atan (const Vector< T, Abi > &x) |
| Returns the arctangent of all input values in x .
|
|
template<typename T , typename Abi > |
Vector< T, detail::not_fixed_size_abi< Abi > > | atan2 (const Vector< T, Abi > &y, const Vector< T, Abi > &x) |
| Returns the arctangent of all input values in x and y .
|
|
template<typename T , typename Abi > |
void | sincos (const Vector< T, Abi > &x, Vector< T, detail::not_fixed_size_abi< Abi > > *sin, Vector< T, Abi > *cos) |
|
template<typename T , typename Abi , typename = enable_if<std::is_floating_point<T>::value && !detail::is_fixed_size_abi<Abi>::value>> |
Vector< T, Abi > | copysign (Vector< T, Abi > magnitude, Vector< T, Abi > sign) |
| Copies the sign(s) of sign to the value(s) in magnitude and returns the resulting vector.
|
|
template<typename T , typename Abi , typename = enable_if<std::is_floating_point<T>::value && !detail::is_fixed_size_abi<Abi>::value>> |
Vector< T, Abi > | exponent (Vector< T, Abi > x) |
| Extracts the exponent of each floating-point vector component.
|
|
template<typename T , typename Abi > |
Vector< T, detail::not_fixed_size_abi< Abi > >::MaskType | isnegative (Vector< T, Abi > x) |
| Returns for each vector component whether it stores a negative value.
|
|
template<typename T , typename Abi , typename = enable_if<std::is_floating_point<T>::value && !detail::is_fixed_size_abi<Abi>::value>>
Extracts the exponent of each floating-point vector component.
- Parameters
-
x | The vector of values to check for the sign. |
- Returns
- the exponent to base 2.
This function provides efficient access to the exponent of the floating point number. The returned value is a fast approximation to the logarithm of base 2. The absolute error of that approximation is between [0, 1[.
Examples:
value | exponent | log2
=======|==========|=======
1.0 | 0 | 0
2.0 | 1 | 1
3.0 | 1 | 1.585
3.9 | 1 | 1.963
4.0 | 2 | 2
4.1 | 2 | 2.036
- Warning
- This function assumes a positive value (non-zero). If the value is negative the sign bit will modify the returned value. An input value of zero will return the bias of the floating-point representation. If you compile with Vc runtime checks, the function will assert values greater than or equal to zero.
You may use abs to apply this function to negative values:
fixed_size_simd< T, N > abs(const SimdArray< T, N, V, M > &x)
Applies the std::abs function component-wise and concurrently.
fixed_size_simd< T, N > exponent(const SimdArray< T, N, V, M > &x)
Applies the std::exponent function component-wise and concurrently.