29#include "../option_structure.hpp"
40static inline uint64_t splitmix64(uint64_t x) {
41 x += 0x9e3779b97f4a7c15ULL;
42 x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9ULL;
43 x = (x ^ (x >> 27)) * 0x94d049bb133111ebULL;
54inline uint64_t
GetHash(
unsigned long nodeIndex,
unsigned short iDim,
unsigned long timeIter) {
55 uint64_t x = nodeIndex;
56 x ^= splitmix64(iDim);
57 x ^= splitmix64(timeIter);
69 constexpr double inv53 = 1.0 / 9007199254740992.0;
70 uint64_t uInt = x >> 11;
71 return (uInt + 1) * inv53;
84 double r =
sqrt(-2.0 * log(u));
86 return r * cos(theta);
99inline double GetNormal(
unsigned long nodeIndex,
unsigned long dim,
unsigned long timeIter) {
100 uint64_t hash =
GetHash(nodeIndex, dim, timeIter);
119 t * t * (3.0899424 + t * t * (1.2067492 + t * t * (0.2659732 + t * t * (0.0360768 + t * t * 0.0045813)))));
129 t * (0.00916281 + t * (-0.02057706 + t * (0.02635537 + t * (-0.01647633 + t * 0.00392377)))))));
131 T arg =
sqrt(abx) * poly;
132 return abx - log(arg);
146 const T
A = 1 + 2 * (beta_x + beta_y + beta_z);
147 const T Bx = 2 * beta_x;
148 const T By = 2 * beta_y;
149 const T Bz = 2 * beta_z;
152 const T t_max = 20.0;
153 const T dt = t_max / N;
157 for (
int i = 1; i <= N; i++) {
162 T integrand =
exp(lin);
164 T weight = (i == N) ? 0.5 : 1.0;
165 sum += integrand * weight;
FORCEINLINE ARRAY_T exp(const ARRAY_T &x)
Definition special_vectorization.hpp:156
FORCEINLINE ARRAY_T sqrt(const ARRAY_T &x)
Definition special_vectorization.hpp:116
constexpr passivedouble PI_NUMBER
Pi number (not using M_PI to avoid Windows issues).
Definition option_structure.hpp:108