38 #ifdef Vc_COMMON_MATH_H_INTERNAL
40 constexpr
float log2_e = 1.44269504088896341f;
41 constexpr
float MAXLOGF = 88.72283905206835f;
42 constexpr
float MINLOGF = -103.278929903431851103f;
43 constexpr
float MAXNUMF = 3.4028234663852885981170418348451692544e38f;
45 template <
typename Abi>
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);
62 const auto n =
static_cast<Vc::SimdArray<int, V::Size>
>(z);
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)
Vc::Vector< T > ldexp(Vc::Vector< T > x, Vc::SimdArray< int, size()> e)
Multiply floating-point number by integral power of 2.