17 lines
		
	
	
		
			438 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			438 B
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| 
 | |
| namespace FastRng.Distributions
 | |
| {
 | |
|     public sealed class BetaA2B2 : Distribution
 | |
|     {
 | |
|         private const float ALPHA = 2f;
 | |
|         private const float BETA = 2f;
 | |
|         private const float CONSTANT = 4f;
 | |
| 
 | |
|         public BetaA2B2(IRandom rng) : base(rng)
 | |
|         {
 | |
|         }
 | |
| 
 | |
|         private protected override float ShapeFunction(float x) => CONSTANT * MathF.Pow(x, ALPHA - 1f) * MathF.Pow(1f - x, BETA - 1f);
 | |
|     }
 | |
| } |