1 #ifndef COMMON_EXPONENTIAL_H
2 #define COMMON_EXPONENTIAL_H
31 #ifndef VC_COMMON_EXPONENTIAL_H
32 #define VC_COMMON_EXPONENTIAL_H
40 using Vc::VC__USE_NAMESPACE::c_log;
41 using Vc::VC__USE_NAMESPACE::Vector;
45 static const float log2_e = 1.44269504088896341f;
46 static const float MAXLOGF = 88.72283905206835f;
47 static const float MINLOGF = -103.278929903431851103f;
48 static const float MAXNUMF = 3.4028234663852885981170418348451692544e38f;
55 typedef typename V::Mask M;
62 const M underflow = x <
MINLOGF;
71 I
n =
static_cast<I
>(z);
72 x -= z * C::ln2_large();
73 x -= z * C::ln2_small();
76 z = ((((( 1.9875691500E-4
f * x
77 + 1.3981999507E-3
f) * x
78 + 8.3334519073
E-3
f) * x
79 + 4.1665795894E-2
f) * x
80 + 1.6666665459
E-1
f) * x
81 + 5.0000001201E-1
f) * (x * x)
92 static inline Vector<double>
exp(Vector<double>::AsArg _x) {
93 Vector<double>
x = _x;
94 typedef Vector<double> V;
96 typedef Const<double>
C;
98 const M overflow = x >
Vc_buildDouble( 1, 0x0006232bdd7abcd2ull, 9);
99 const M underflow = x <
Vc_buildDouble(-1, 0x0006232bdd7abcd2ull, 9);
104 n.data() = Mem::permute<X0, X2, X1, X3>(n.data());
105 #elif defined(VC_IMPL_AVX)
106 __m128i tmp = _mm256_cvttpd_epi32(px.data());
107 Vector<int> n =
AVX::concat(_mm_unpacklo_epi32(tmp, tmp), _mm_unpackhi_epi32(tmp, tmp));
109 x -= px * C::ln2_large();
110 x -= px * C::ln2_small();
124 px = x * ((P[0] * x2 + P[1]) * x2 + P[2]);
125 x = px / ((((Q[0] * x2 + Q[1]) * x2 + Q[2]) * x2 + Q[3]) - px);
131 x.setZero(underflow);
144 #endif // VC_COMMON_EXPONENTIAL_H
145 #endif // COMMON_EXPONENTIAL_H
static const float MAXLOGF
Namespace for new ROOT classes and functions.
static const float log2_e
static const float MAXNUMF
static const double x2[5]
Vc_INTRINSIC Vc_CONST m256 concat(param128 a, param128 b)
#define VC_ALIGNED_PARAMETER(_Type)
#define Vc_buildDouble(sign, mantissa, exponent)
static const float MINLOGF
MyComplex< T > P(MyComplex< T > z, T c_real, T c_imag)
[MyComplex]
static Vector< T > exp(VC_ALIGNED_PARAMETER(Vector< T >) _x)
#define VC__USE_NAMESPACE
double ldexp(double, int)