mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-19 05:40:38 +01:00
15 lines
260 B
C++
15 lines
260 B
C++
#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));
|
|
}
|
|
|
|
}
|