16 lines
523 B
C#
16 lines
523 B
C#
using System.Numerics;
|
|
|
|
namespace FastRng.Distributions;
|
|
|
|
public sealed class InverseExponentialLa10<TNum> : Distribution<TNum> where TNum : IFloatingPointIeee754<TNum>
|
|
{
|
|
private static readonly TNum LAMBDA = TNum.CreateChecked(10.0f);
|
|
private static readonly TNum CONSTANT = TNum.CreateChecked(4.539992976248453e-06f);
|
|
|
|
public InverseExponentialLa10(IRandom<TNum> rng) : base(rng)
|
|
{
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
public override TNum ShapeFunction(TNum x) => CONSTANT * LAMBDA * TNum.Exp(LAMBDA * x);
|
|
} |