24template <
typename RealType>
30 CauchyRand(
double location = 0,
double scale = 1);
31 [[nodiscard]] std::string
Name()
const override;
33 [[nodiscard]] RealType
MinValue()
const override {
return -INFINITY; }
34 [[nodiscard]] RealType
MaxValue()
const override {
return INFINITY; }
36 [[nodiscard]]
double f(
const RealType &x)
const override;
37 [[nodiscard]]
double F(
const RealType &x)
const override;
38 [[nodiscard]]
double S(
const RealType &x)
const override;
39 template <std::uniform_random_bit_generator G>
42 template <std::uniform_random_bit_generator G>
46 RealType quantileImpl(
double p)
const override;
47 RealType quantileImpl1m(
double p)
const override;
49 std::complex<double> CFImpl(
double t)
const override;
52 [[nodiscard]]
long double Entropy()
const;
62template <
typename RealType>
67template <
typename RealType>
70 return "Cauchy(" + this->toStringWithPrecision(this->GetLocation()) +
", " +
71 this->toStringWithPrecision(this->GetScale()) +
")";
74template <
typename RealType>
77 return this->pdfCauchy(x);
80template <
typename RealType>
83 return this->cdfCauchy(x);
86template <
typename RealType>
89 return this->cdfCauchyCompl(x);
92template <
typename RealType>
93template <std::uniform_random_bit_generator G>
96 return this->mu + this->gamma * StandardVariate(g);
99template <
typename RealType>
100template <std::uniform_random_bit_generator G>
107 }
while (y == 0.0 || x * x + y * y > 1.0);
111template <
typename RealType>
114 return this->cfCauchy(t);
117template <
typename RealType>
118RealType CauchyRand<RealType>::quantileImpl(
double p)
const
120 return this->quantileCauchy(p);
123template <
typename RealType>
124RealType CauchyRand<RealType>::quantileImpl1m(
double p)
const
126 return this->quantileCauchy1m(p);
129template <
typename RealType>
The CauchyRand class Cauchy distribution.
Definition cauchy.hpp:26
double S(const RealType &x) const override
Definition cauchy.hpp:87
Support SupportType() const override
Definition cauchy.hpp:32
static RealType StandardVariate(G &g)
Definition cauchy.hpp:101
CauchyRand(double location=0, double scale=1)
Definition cauchy.hpp:63
RealType MaxValue() const override
Definition cauchy.hpp:34
RealType MinValue() const override
Definition cauchy.hpp:33
long double Entropy() const
Definition cauchy.hpp:130
std::string Name() const override
Definition cauchy.hpp:68
double f(const RealType &x) const override
Definition cauchy.hpp:75
RealType operator()(G &g) const
Definition cauchy.hpp:94
double F(const RealType &x) const override
Definition cauchy.hpp:81
The StableDistribution class Abstract class for Stable distribution.
Definition stable.hpp:74
The EngineRef class Non-owning, type-erased reference to any uniform random bit generator.
Definition engine/uniform.hpp:116
constexpr long double ln2
Definition constants.hpp:18
constexpr long double lnpi
Definition constants.hpp:21
Real standardNormal(G &g)
Ziggurat algorithm of Marsaglia and Tsang with 256 layers and an explicit sign bit.
Definition variates.hpp:45
Definition bivariate_normal.hpp:10
Support
Shape of the support of a univariate distribution.
Definition univariate.hpp:15