FastRng by Thorsten Sommer

<PackageReference Include="FastRng" Version="1.0.0" />

 GammaA5B15

public sealed class GammaA5B15 : Distribution
using System; namespace FastRng.Float.Distributions { public sealed class GammaA5B15 : Distribution { private const float ALPHA = 5; private const float BETA = 15; private const float CONSTANT = 0.3413442; private static readonly float GAMMA_ALPHA; private static readonly float BETA_TO_THE_ALPHA; static GammaA5B15() { GAMMA_ALPHA = MathTools.Gamma(5); BETA_TO_THE_ALPHA = MathF.Pow(15, 5); } public GammaA5B15(IRandom rng) : base(rng) { } protected override float ShapeFunction(float x) { return 0.3413442 * (BETA_TO_THE_ALPHA * MathF.Pow(x, 4) * MathF.Exp(-15 * x) / GAMMA_ALPHA); } } }