diff --git a/FastRng/Double/Distributions/CauchyLorentz.cs b/FastRng/Double/Distributions/CauchyLorentz.cs index 96d0c04..936d6f0 100644 --- a/FastRng/Double/Distributions/CauchyLorentz.cs +++ b/FastRng/Double/Distributions/CauchyLorentz.cs @@ -27,10 +27,10 @@ namespace FastRng.Double.Distributions public async ValueTask GetDistributedValue(CancellationToken token = default) { if (this.Random == null) - return System.Double.NaN; + return double.NaN; var value = await this.Random.GetUniform(token); - return this.Median + scale * Math.Tan(Math.PI * (value - 0.5)); + return 1.0 / (Math.PI * this.Scale * (1 + Math.Pow((value - this.Median) / this.Scale, 2))); } } } \ No newline at end of file