Functions that implement math functions. Take care that some of the implementations will return results with less precision than what the FPU calculates.
|
Vc::Vector< T > | sqrt (const Vc::Vector< T > &v) |
| Returns the square root of v .
|
|
Vc::Vector< T > | rsqrt (const Vc::Vector< T > &v) |
| Returns the reciprocal square root of v .
|
|
Vc::Vector< T > | reciprocal (const Vc::Vector< T > &v) |
| Returns the reciprocal of v .
|
|
Vc::Vector< T > | abs (const Vc::Vector< T > &v) |
| Returns the absolute value of v .
|
|
Vc::Vector< T > | round (const Vc::Vector< T > &v) |
| Returns the closest integer to v ; 0.5 is rounded to even.
|
|
Vc::Vector< T > | log (const Vc::Vector< T > &v) |
|
Vc::Vector< T > | log2 (const Vc::Vector< T > &v) |
|
Vc::Vector< T > | log10 (const Vc::Vector< T > &v) |
|
Vc::Vector< T > | exp (const Vc::Vector< T > &v) |
|
Vc::Vector< T > | sin (const Vc::Vector< T > &v) |
|
Vc::Vector< T > | cos (const Vc::Vector< T > &v) |
|
Vc::Vector< T > | asin (const Vc::Vector< T > &v) |
|
Vc::Vector< T > | atan (const Vc::Vector< T > &v) |
|
Vc::Vector< T > | atan2 (const Vc::Vector< T > &y, const Vc::Vector< T > &x) |
| Calculates the angle given the lengths of the opposite and adjacent legs in a right triangle. More...
|
|
Vc::Vector< T > | min (const Vc::Vector< T > &x, const Vc::Vector< T > &y) |
|
Vc::Vector< T > | max (const Vc::Vector< T > &x, const Vc::Vector< T > &y) |
|
Vc::Vector< T > | frexp (const Vc::Vector< T > &x, Vc::SimdArray< int, size()> *e) |
| Convert floating-point number to fractional and integral components. More...
|
|
Vc::Vector< T > | ldexp (Vc::Vector< T > x, Vc::SimdArray< int, size()> e) |
| Multiply floating-point number by integral power of 2. More...
|
|
Vc::Mask< T > | isfinite (const Vc::Vector< T > &x) |
|
Vc::Mask< T > | isnan (const Vc::Vector< T > &x) |
|
Vc::Vector< T > | fma (Vc::Vector< T > a, Vc::Vector< T > b, Vc::Vector< T > c) |
| Multiplies a with b and then adds c , without rounding between the multiplication and the addition. More...
|
|
template<typename T , typename Abi , typename = enable_if<std::is_floating_point<T>::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. More...
|
|
template<typename T , typename Abi , typename = enable_if<std::is_floating_point<T>::value>> |
Vector< T, Abi > | exponent (Vector< T, Abi > x) |
| Extracts the exponent of each floating-point vector component. More...
|
|
template<typename T , typename Abi > |
Vector< T, Abi >::MaskType | isnegative (Vector< T, Abi > x) |
| Returns for each vector component whether it stores a negative value. More...
|
|
Vector<T, Abi> Vc::exponent |
( |
Vector< T, Abi > |
x | ) |
|
|
inline |
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:
Referenced by Vector< T, Abi >::Vector().