37#ifdef Vc_COMMON_MATH_H_INTERNAL
39constexpr float log2_e = 1.44269504088896341f;
40constexpr float MAXLOGF = 88.72283905206835f;
41constexpr float MINLOGF = -103.278929903431851103f;
42constexpr float MAXNUMF = 3.4028234663852885981170418348451692544e38f;
44template <typename Abi, typename = enable_if<std::is_same<Abi, VectorAbi::Sse>::value ||
45 std::is_same<Abi, VectorAbi::Avx>::value>>
46inline Vector<float, detail::not_fixed_size_abi<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();
Data-parallel arithmetic type with user-defined number of elements.
fixed_size_simd< T, N > exp(const SimdArray< T, N, V, M > &x)
Applies the std:: exp function component-wise and concurrently.
fixed_size_simd< T, N > floor(const SimdArray< T, N, V, M > &x)
Applies the std:: floor function component-wise and concurrently.
SimdArray< T, N > ldexp(const SimdArray< T, N > &x, const SimdArray< int, N > &e)
Applies the std::ldexp function component-wise and concurrently.