gammainc

constexpr double gammainc(const double a, const double x) noexcept

Evaluates the lower incomplete gamma function [1].

Parameters

const double a

A real number.

const double x

A real number.

Returns

double

A real number.

The lower incomplete gamma function evaluates the lower portion of the gamma integral from \(0\) to \(x\). It is defined as:

\[\gamma(a, x) = \int_{0}^{x} t^{x - 1}e^{-t}dt\]

Example

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

Output:

0.632121

References