37#ifdef Vc_COMMON_MATH_H_INTERNAL
39constexpr float log2_e = 1.44269504088896341f;
47constexpr float MAXLOGF = 88.722831726074219f;
48constexpr float MINLOGF = -88.029685974121094f;
49constexpr float MAXNUMF = 3.4028234663852885981170418348451692544e38f;
51template <typename Abi, typename = enable_if<std::is_same<Abi, VectorAbi::Sse>::value ||
52 std::is_same<Abi, VectorAbi::Avx>::value>>
53inline Vector<float, detail::not_fixed_size_abi<Abi>> exp(Vector<float, Abi> x)
55 using V = Vector<float, Abi>;
56 typedef typename V::Mask M;
57 typedef Detail::Const<float, Abi> C;
59 const M overflow = x > MAXLOGF;
60 const M underflow = x < MINLOGF;
68 V z = floor(C::log2_e() * x + 0.5f);
70 x -= z * C::ln2_large();
71 x -= z * C::ln2_small();
74 z = ((((( 1.9875691500E-4f * x
75 + 1.3981999507E-3f) * x
76 + 8.3334519073E-3f) * x
77 + 4.1665795894E-2f) * x
78 + 1.6666665459E-1f) * x
79 + 5.0000001201E-1f) * (x * x)
85 x(overflow) = std::numeric_limits<typename V::EntryType>::infinity();
Data-parallel arithmetic type with user-defined number of elements.