37 #ifdef Vc_COMMON_MATH_H_INTERNAL
39 constexpr
float log2_e = 1.44269504088896341f;
40 constexpr
float MAXLOGF = 88.72283905206835f;
41 constexpr
float MINLOGF = -103.278929903431851103f;
42 constexpr
float MAXNUMF = 3.4028234663852885981170418348451692544e38f;
44 template <typename Abi, typename = enable_if<std::is_same<Abi, VectorAbi::Sse>::value ||
45 std::is_same<Abi, VectorAbi::Avx>::value>>
46 inline Vector<float, Abi>
exp(Vector<float, Abi> x)
48 using V = Vector<float, Abi>;
49 typedef typename V::Mask M;
50 typedef Detail::Const<float, Abi> C;
52 const M overflow = x > MAXLOGF;
53 const M underflow = x < MINLOGF;
61 V z =
floor(C::log2_e() * x + 0.5f);
63 x -= z * C::ln2_large();
64 x -= z * C::ln2_small();
67 z = ((((( 1.9875691500E-4f * x
68 + 1.3981999507E-3f) * x
69 + 8.3334519073E-3f) * x
70 + 4.1665795894E-2f) * x
71 + 1.6666665459E-1f) * x
72 + 5.0000001201E-1f) * (x * x)
78 x(overflow) = std::numeric_limits<typename V::EntryType>::infinity();
84 #endif // Vc_COMMON_MATH_H_INTERNAL
Vc::Vector< T > exp(const Vc::Vector< T > &v)
SimdArray< T, N, V, M > floor(const SimdArray< T, N, V, M > &x)
Applies the std:: floor function component-wise and concurrently.
Vc::Vector< T > ldexp(Vc::Vector< T > x, Vc::SimdArray< int, size()> e)
Multiply floating-point number by integral power of 2.
Data-parallel arithmetic type with user-defined number of elements.