26 return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];
36 for (
idx_t nn = (n > 0) ? n : -n; nn != 0; nn >>= 1)
45 return (n > 0) ? yy : 1.0 / yy;
62 constexpr auto p = 0.3275911_r;
63 constexpr auto a1 = 0.254829592_r;
64 constexpr auto a2 = -0.284496736_r;
65 constexpr auto a3 = 1.421413741_r;
66 constexpr auto a4 = -1.453152027_r;
67 constexpr auto a5 = 1.061405429_r;
68 auto t = 1_r / (1_r + p * x);
69 expX2 = std::exp(-x * x);
70 return t * (a1 + t * (a2 + t * (a3 + t * (a4 + t * a5)))) * expX2;
75 [[maybe_unused]]
real_t tmp;
KOKKOS_INLINE_FUNCTION real_t sqr(const real_t &sqr)
Definition math.hpp:29
KOKKOS_INLINE_FUNCTION real_t approxErfc(const real_t &x, real_t &expX2)
"Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Table" Milton Abramowitz ...
Definition math.hpp:58
KOKKOS_INLINE_FUNCTION real_t powInt(const real_t &x, const idx_t n)
Definition math.hpp:31
KOKKOS_INLINE_FUNCTION real_t dot3(real_t const *const a, real_t const *const b)
Definition math.hpp:24
Definition BerendsenBarostat.cpp:18
int64_t idx_t
Definition datatypes.hpp:91
double real_t
Definition datatypes.hpp:99