betainc

constexpr double betainc(const double x, const double a, const double b) noexcept

Evaluates the incomplete beta function [1].

Parameters

const double x

A real number.

const double a

A real number.

const double b

A real number.

Returns

double

A real number.

The incomplete gamma function is a generalization of the beta function defined as:

\[B(x; a, b) = \int_{0}^{x} t^{a - 1}(1 - t)^{b - 1}dt\]

Example

double a = 1;
double b = 1;
double x = 1;
std::cout << betainc(x, a, b) << "\n";

Output:

1

References