FastRng/FastRng/Distributions/CauchyLorentzX1.cs
2023-07-06 10:26:12 +02:00

16 lines
459 B
C#

using System;
namespace FastRng.Distributions;
public sealed class CauchyLorentzX1 : Distribution
{
private const float CONSTANT = 0.31f;
private const float SCALE = 0.1f;
private const float MEDIAN = 1.0f;
public CauchyLorentzX1(IRandom rng) : base(rng)
{
}
private protected override float ShapeFunction(float x) => CONSTANT * (1.0f / (MathF.PI * SCALE)) * ((SCALE * SCALE) / (MathF.Pow(x - MEDIAN, 2f) + (SCALE * SCALE)));
}