32 #ifndef VSMC_RNG_LOGISTIC_DISTRIBUTION_HPP 33 #define VSMC_RNG_LOGISTIC_DISTRIBUTION_HPP 44 template <
typename RealType>
54 template <
typename RealType>
63 return std::numeric_limits<result_type>::lowest();
71 template <
typename RNGType>
77 return param.
a() + param.
b() *
std::log(u / (1 - u));
84 template <std::
size_t K,
typename RealType,
typename RNGType>
86 RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
90 sub(n, static_cast<RealType>(1), r, s.data());
91 div(n, r, s.data(), r);
105 #endif // VSMC_RNG_LOGISTIC_DISTRIBUTION_HPP
#define VSMC_DEFINE_RNG_DISTRIBUTION_2(Name, name, p1, v1, p2, v2)
#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_2(name, p1, p2)
bool logistic_distribution_check_param(RealType, RealType b)
void u01_oo_distribution(RNGType &rng, std::size_t n, RealType *r)
Generate standard uniform random variates on (0, 1)
Standard uniform distribution on (0, 1)
RealType u01(UIntType u) noexcept
Convert uniform unsigned integers to floating points within [0, 1].
#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_0
void div(std::size_t n, const float *a, const float *b, float *y)
void sub(std::size_t n, const float *a, const float *b, float *y)
void fma(std::size_t n, const T *a, const T *b, const T *c, T *y)
For , compute .
#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_2(Name, name, p1, p2)
std::array with proper alignment
void log(std::size_t n, const float *a, float *y)
void logistic_distribution_impl(RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)