25 template<std::
floating_po
int T_Fp>
28 using result_type = T_Fp;
30 template<concepts::UniformStdEngine T_Rng>
31 constexpr T_Fp operator()(T_Rng& rng)
34 if(m_hasSecondRngNumber)
36 m_hasSecondRngNumber =
false;
37 return m_secondRngNumber;
42 T_Fp u1 = uniformDist(rng);
43 T_Fp u2 = uniformDist(rng);
47 T_Fp theta = T_Fp{2} *
static_cast<T_Fp
>(M_PI) * u2;
51 m_secondRngNumber = z1;
52 m_hasSecondRngNumber =
true;
57 T_Fp m_secondRngNumber;
58 bool m_hasSecondRngNumber =
false;
72 template<std::
floating_po
int T_Result>
92 constexpr explicit NormalReal(T_Result mean = T_Result{0}, T_Result stdDev = T_Result{1})
104 template<concepts::UniformStdEngine T_Engine>
107 return m_impl(
engine) * m_stdDev + m_mean;
112 using T_Impl = internal::BoxMuller<T_Result>;
constexpr auto sin(auto const &arg)
constexpr auto sqrt(auto const &arg)
constexpr auto cos(auto const &arg)
constexpr auto log(auto const &arg)
Computes the natural (base e) logarithm of arg.
constexpr OO oo
Interval-tag (a, b) object instance.
constexpr result_type operator()(T_Engine &engine)
Selects a value from a normal (-/gaussian) distribution for the configured (mean,stdDev) settings.
constexpr NormalReal(T_Result mean=T_Result{0}, T_Result stdDev=T_Result{1})
Constructs normal(-/gaussian) distribution with given parameters.