The Cauchy distribution is a continuous probability distribution with
parameters x₀ (median) and γ (scale).
It describes the distribution of the ratio of two independent
normally distributed random variables with means x₀ and scales γ.
In other words, if X and Y are independent normally distributed
random variables with means x₀ and scales γ, respectively, then
X / Y is Cauchy(x₀, γ) distributed.
The plot illustrates the Cauchy distribution with various values of x₀ and γ.
Note how the median parameter x₀ shifts the distribution along the x-axis,
and how the scale γ changes the density around the median.
The standard Cauchy distribution is the special case with x₀ = 0 and γ = 1,
which corresponds to the ratio of two StandardNormal distributions.
use rand_distr::{Cauchy, Distribution};
let cau = Cauchy::new(2.0, 5.0).unwrap();
let v = cau.sample(&mut rand::rng());
println!("{} is from a Cauchy(2, 5) distribution", v);