beta

fnreal beta(real x, real y)

Beta function, B(x,y)

Mathematically, if x ≥ 0 and y ≥ 0 then B(x,y) = ∫01tx-1(l-t)y-1dt. Through analytic continuation, it is extended to 2 where it can be expressed in terms of Γ(z).

B(x,y) = Γ(x)Γ(y) / Γ(x+y).

This implementation restricts x and y to the set of real numbers.

Parameters

xthe first argument of B
ythe second argument of B

Returns

It returns B(x,y) if it can be computed, otherwise NaN.
x y beta(x, y)
NaN y NaN
-∞ y NaN
integer < 0 y NaN
noninteger and x+y even ≤ 0 noninteger -0
noninteger and x+y odd ≤ 0 noninteger +0
+0 positive finite +∞
+0 +∞ NaN
≥ 0 +∞ +0
-0 +0 NaN
-0 ≥ 0 -∞
noninteger < 0, ⌈x⌉ odd +∞ -∞
noninteger < 0, ⌈x⌉ even +∞ +∞
noninteger < 0 ±0 +∞

Since B(x,y) = B(y,x), if the table states that beta(x, y) is a special value, then beta(y, x) is one as well.