Functions that implement math functions. Take care that some of the implementations will return results with less precision than what the FPU calculates.
Functions | |
| 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 > | 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. | |
| Vc::Vector< T > | ldexp (Vc::Vector< T > x, Vc::SimdArray< int, size()> e) |
| Multiply floating-point number by integral power of 2. | |
| 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. | |
| 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. | |
| Vc::Vector< T > log | ( | const Vc::Vector< T > & | v | ) |
| v | The values to apply the logarithm on. |
v.Referenced by log().
| Vc::Vector< T > log2 | ( | const Vc::Vector< T > & | v | ) |
| v | The values to apply the logarithm on. |
v.Referenced by log2().
| Vc::Vector< T > log10 | ( | const Vc::Vector< T > & | v | ) |
| v | The values to apply the logarithm on. |
v.Referenced by log10().
| Vc::Vector< T > exp | ( | const Vc::Vector< T > & | v | ) |
| v | The values to apply the exponential function on. |
v. Referenced by exp().
| Vc::Vector< T > min | ( | const Vc::Vector< T > & | x, |
| const Vc::Vector< T > & | y ) |
| x | \VSize{T} values to compare component-wise against y. |
| y | \VSize{T} values to compare component-wise against x. |
x and y. Referenced by min(), and SimdArray< T, N, V, VN >::min().
| Vc::Vector< T > max | ( | const Vc::Vector< T > & | x, |
| const Vc::Vector< T > & | y ) |
| x | \VSize{T} values to compare component-wise against y. |
| y | \VSize{T} values to compare component-wise against x. |
x and y. Referenced by max(), and SimdArray< T, N, V, VN >::max().
| Vc::Vector< T > frexp | ( | const Vc::Vector< T > & | x, |
| Vc::SimdArray< int, size()> * | e ) |
Convert floating-point number to fractional and integral components.
| x | value to be split into normalized fraction and exponent |
| e | the exponent to base 2 of x |
x is non-zero, the return value is x times a power of two, and its absolute value is always in the range [0.5,1).x is zero, then the normalized fraction is zero and zero is stored in e.x is a NaN, a NaN is returned, and the value of *e is unspecified.x is positive infinity (negative infinity), positive infinity (nega‐ tive infinity) is returned, and the value of *e is unspecified. | Vc::Vector< T > ldexp | ( | Vc::Vector< T > | x, |
| Vc::SimdArray< int, size()> | e ) |
Multiply floating-point number by integral power of 2.
| x | value to be multiplied by 2 ^ e |
| e | exponent |
x * 2 ^ e | Vc::Mask< T > isfinite | ( | const Vc::Vector< T > & | x | ) |
| x | The \VSize{T} values to check for finite values. |
Referenced by isfinite().
| Vc::Mask< T > isnan | ( | const Vc::Vector< T > & | x | ) |
| x | The \VSize{T} values to check for NaN values. |
Referenced by isnan().
| 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.
| a | First multiplication factor. |
| b | Second multiplication factor. |
| c | Summand that will be added after multiplication. |
|
inline |
Returns the sine of all input values in x.
| x | The values to apply the sine function on. |
x.Definition at line 134 of file trigonometric.h.
|
inline |
Returns the cosine of all input values in x.
| x | The values to apply the cosine function on. |
x.Definition at line 151 of file trigonometric.h.
|
inline |
Returns the arcsine of all input values in x.
| x | The values to apply the arcsine function on. |
x.Definition at line 168 of file trigonometric.h.
|
inline |
Returns the arctangent of all input values in x.
| x | The values to apply the arctangent function on. |
x. Definition at line 183 of file trigonometric.h.
|
inline |
Returns the arctangent of all input values in x and y.
Calculates the angle given the lengths of the opposite and adjacent legs in a right triangle.
| y | The opposite leg. |
| x | The adjacent leg. |
y / x. Definition at line 199 of file trigonometric.h.
|
inline |
| x | Input value to both sine and cosine. |
| sin | A non-null pointer to a potentially uninitialized object of type Vector. When sincos returns, *sin contains the result of sin(x). |
| cos | A non-null pointer to a potentially uninitialized object of type Vector. When sincos returns, *cos contains the result of cos(x). |
Definition at line 217 of file trigonometric.h.
|
inline |
Copies the sign(s) of sign to the value(s) in magnitude and returns the resulting vector.
| magnitude | This vector's magnitude will be used in the return vector. |
| sign | This vector's sign bit will be used in the return vector. |
sign. I.e. sign(copysign(v, r)) == sign(r).
|
inline |
Extracts the exponent of each floating-point vector component.
| x | The vector of values to check for the sign. |
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
You may use abs to apply this function to negative values: