mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-24 16:20:49 +01:00
[apps/proba] Implement Fisher formulae
This commit is contained in:
14
poincare/src/beta_function.cpp
Normal file
14
poincare/src/beta_function.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <poincare/beta_function.h>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
namespace Poincare {
|
||||
|
||||
double BetaFunction(double a, double b) {
|
||||
if (a < 0.0 || b < 0.0) {
|
||||
return NAN;
|
||||
}
|
||||
return std::exp(std::lgamma(a) + std::lgamma(b) - std::lgamma(a+b));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user