32 #ifndef VSMC_RNG_ARCSINE_DISTRIBUTION_HPP 33 #define VSMC_RNG_ARCSINE_DISTRIBUTION_HPP 44 template <
typename RealType>
54 template <
typename RealType>
68 template <
typename RNGType>
75 return param.
a() + (param.
b() - param.
a()) * (r * r);
82 template <std::
size_t,
typename RealType,
typename RNGType>
84 RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
87 mul(n, const_pi_by2<RealType>(), r, r);
90 fma(n, r, b - a, a, r);
102 #endif // VSMC_RNG_ARCSINE_DISTRIBUTION_HPP
void mul(std::size_t n, const float *a, const float *b, float *y)
#define VSMC_DEFINE_RNG_DISTRIBUTION_2(Name, name, p1, v1, p2, v2)
#define VSMC_DEFINE_RNG_DISTRIBUTION_IMPL_2(name, p1, p2)
void arcsine_distribution_impl(RNGType &rng, std::size_t n, RealType *r, RealType a, RealType b)
RealType u01(UIntType u) noexcept
Convert uniform unsigned integers to floating points within [0, 1].
#define VSMC_DEFINE_RNG_DISTRIBUTION_MEMBER_0
void fma(std::size_t n, const T *a, const T *b, const T *c, T *y)
For , compute .
void sin(std::size_t n, const float *a, float *y)
bool arcsine_distribution_check_param(RealType a, RealType b)
#define VSMC_DEFINE_RNG_DISTRIBUTION_RAND_2(Name, name, p1, p2)
Standard uniform distribution on [0, 1)
void sqr(std::size_t n, const float *a, float *y)
void u01_co_distribution(MKLEngine< BRNG, Bits > &rng, std::size_t n, float *r)