2023-07-07 14:41:01 +02:00
|
|
|
using System.Numerics;
|
2020-11-01 00:08:30 +01:00
|
|
|
|
2023-07-06 10:26:12 +02:00
|
|
|
namespace FastRng.Distributions;
|
2020-11-01 00:08:30 +01:00
|
|
|
|
2023-07-07 14:41:01 +02:00
|
|
|
public sealed class InverseExponentialLa10<TNum> : Distribution<TNum> where TNum : IFloatingPointIeee754<TNum>
|
2023-07-06 10:26:12 +02:00
|
|
|
{
|
2023-07-07 14:41:01 +02:00
|
|
|
private static readonly TNum LAMBDA = TNum.CreateChecked(10.0f);
|
|
|
|
|
private static readonly TNum CONSTANT = TNum.CreateChecked(4.539992976248453e-06f);
|
2020-11-08 16:23:05 +01:00
|
|
|
|
2023-07-07 14:41:01 +02:00
|
|
|
public InverseExponentialLa10(IRandom<TNum> rng) : base(rng)
|
2023-07-06 10:26:12 +02:00
|
|
|
{
|
2020-11-01 00:08:30 +01:00
|
|
|
}
|
2023-07-06 10:26:12 +02:00
|
|
|
|
2023-10-25 15:21:16 +02:00
|
|
|
/// <inheritdoc />
|
|
|
|
|
public override TNum ShapeFunction(TNum x) => CONSTANT * LAMBDA * TNum.Exp(LAMBDA * x);
|
2020-11-01 00:08:30 +01:00
|
|
|
}
|