public static double Value(int n) { Assertion.NonNegative(nameof(n), n); if (n <= 20) { long value = 1; for (long i = 1; i <= n; i++) { value *= i; } return(value); } return(GammaFunction.Value(n + 1)); }
/// <summary> /// Complete beta function B(a,b) /// </summary> public static double CompleteValue(double a, double b) { return(GammaFunction.Value(a) * GammaFunction.Value(b) / GammaFunction.Value(a + b)); }