26 #define CMS_VECTORIZE_VERBOSE
30 #define VDT_FORCE_INLINE __attribute__((always_inline)) inline
198 unsigned long long n =
d2ll(x);
202 unsigned long long le = ((n >> 52) & 0x7ffLL);
210 n &=0xfffffffffffffLL;
214 const unsigned long long p05 =
d2ll(0.5);
228 double initial_x =
x;
231 double px = std::floor(
LOG2E * x + 0.5);
235 x -= px * 6.93145751953125E-1;
236 x -= px * 1.42860682030941723212E-6;
265 u.
ll = (
long long) (n) << 52;
267 double res = x * u.
d;
326 y -= fe * 2.121944400546905827679e-4;
330 z += fe * 0.693359375;
362 double y = int( x/
PIO4 );
389 y = 1.0 - zz * .5 + zz * zz * px;
514 double y = int( x/
PIO4 );
555 y = 1. - zz * .5 + zz * zz * px;
607 int factor = ( 1 - 2* nPIO2);
608 x = nPIO2* PI + factor *
x;
614 double y = 2 * nPIO4;
648 y = z + z * zz * px / qx;
655 y -= nPIO4 * ( y + 1.0 /
y);
693 x = (x-1.0) / (x+1.0);
695 if( originalx >
T3PO8 ) {
699 x = -1.0 / originalx ;
701 if ( originalx <= 0.66 ) {
735 y = y +x * px / qx + x +factor;
750 unsigned long long i =
d2ll(y);
752 i = 0x5fe6eb50c7aa19f9 - ( i >> 1 );
754 for (
unsigned int j=0;
j<ISQRT_ITERATIONS;++
j)
755 y *= 1.5 - ( x2 * y * y ) ;
802 #define FAST_VECT_FUNC(NAME) __attribute__((always_inline)) inline void NAME##_vect(double const * VDT_RESTRICT input , double * VDT_RESTRICT outupt, const unsigned int arr_size) { \
803 for (unsigned int i=0;i<arr_size;++i) \
804 outupt[i] = NAME ( input[i] ) CMS_VECTORIZE_VERBOSE; \
851 #define VECT_FUNC(NAME) __attribute__((always_inline)) inline void std_##NAME##_vect(double const * VDT_RESTRICT input , double* VDT_RESTRICT outupt, const unsigned int arr_size) { \
852 for (unsigned int i=0;i<arr_size;++i) \
853 outupt[i] = std::NAME ( input[i] ) CMS_VECTORIZE_VERBOSE; \
876 for (
unsigned int i=0;
i<arr_size;++
i)
884 for (
unsigned int i=0;
i<arr_size;++
i)
VDT_FORCE_INLINE double fast_approx_isqrt(double x)
constexpr double SQRT_LIMIT
Sin< T >::type sin(const T &t)
void fast_exp_vect_46(double const *input, double *output, const unsigned int arr_size)
Some tweaks to make it vectorise with gcc46.
VDT_FORCE_INLINE double std_isqrt(double x)
VDT_FORCE_INLINE double fast_isqrt(double x)
constexpr double EXP_LIMIT
VDT_FORCE_INLINE unsigned long long d2ll(double x)
Converts a double to an unsigned long long.
constexpr double TAN_LIMIT
#define FAST_VECT_FUNC(NAME)
void print_instructions_info()
Print the instructions used on screen.
constexpr double LOG_UPPER_LIMIT
VDT_FORCE_INLINE double getMantExponent(double x, double &fe)
Like frexp but vectorising and the exponent is a double.
VDT_FORCE_INLINE double fast_asin(double x)
constexpr double MOREBITSO2
VDT_FORCE_INLINE double fast_exp(double x)
Exponential Function.
VDT_FORCE_INLINE void std_inv_vect(double const *VDT_RESTRICT input, double *VDT_RESTRICT output, const unsigned int arr_size) CMS_VECTORIZE_VERBOSE
VDT_FORCE_INLINE double std_inv(double x)
constexpr double LOG_LOWER_LIMIT
Cos< T >::type cos(const T &t)
VDT_FORCE_INLINE void std_isqrt_vect(double const *VDT_RESTRICT input, double *VDT_RESTRICT output, const unsigned int arr_size) CMS_VECTORIZE_VERBOSE
Tan< T >::type tan(const T &t)
void fast_log_vect_46(double const *input, double *output, const unsigned int arr_size)
Some tweaks to make it vectorise with gcc46.
VDT_FORCE_INLINE double fast_tan(double x)
Sin defined between -2pi and 2pi.
constexpr double SIN_UPPER_LIMIT
constexpr double ATAN_LIMIT
VDT_FORCE_INLINE double fast_isqrt_general(double x, const unsigned short ISQRT_ITERATIONS)
constexpr double SIN_LOWER_LIMIT
VDT_FORCE_INLINE double fast_cos(double x)
Cos defined between -2pi and 2pi.
VDT_FORCE_INLINE double fast_sin(double x)
Sin defined between -2pi and 2pi.
std::vector< std::vector< double > > tmp
VDT_FORCE_INLINE double fast_acos(double x)
#define CMS_VECTORIZE_VERBOSE
VDT_FORCE_INLINE double fast_atan(double x)
constexpr double MOREBITS
VDT_FORCE_INLINE double fast_log(double x)
VDT_FORCE_INLINE double fast_inv(double x)
VDT_FORCE_INLINE double fast_approx_inv(double x)
VDT_FORCE_INLINE double ll2d(unsigned long long x)
Converts an unsigned long long to a double.
Used to switch between different type of interpretations of the data (64 bits)