Functions that implement math functions. Take care that some of the implementations will return results with less precision than what the FPU calculates.
Functions | |
template<typename T , typename Abi > | |
Vector< T, detail::not_fixed_size_abi< Abi > > | sin (const Vector< T, Abi > &x) |
template<typename T , typename Abi > | |
Vector< T, detail::not_fixed_size_abi< Abi > > | cos (const Vector< T, Abi > &x) |
template<typename T , typename Abi > | |
Vector< T, detail::not_fixed_size_abi< Abi > > | asin (const Vector< T, Abi > &x) |
template<typename T , typename Abi > | |
Vector< T, detail::not_fixed_size_abi< Abi > > | atan (const Vector< T, Abi > &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) |
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) |
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) |
template<typename T , typename Abi > | |
Vector< T, detail::not_fixed_size_abi< Abi > >::MaskType | isnegative (Vector< T, Abi > x) |
Returns the sine of all input values in x
.
x | The values to apply the sine function on. |
x
.Abi
(e.g. Scalar uses the <cmath>
implementationVc_HAVE_LIBMVEC
is defined<cmath>
fallback, the implementations differ (e.g. MacOS vs. Linux vs. Windows; fpmath=sse vs. fpmath=387)Definition at line 134 of file trigonometric.h.
Referenced by Vc::sincos().
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.
Referenced by Vc::sincos().
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.
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.
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)
. 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: