logBeta

Evaluates the logarithm of the real beta function \(\ln \beta(x,y)\).

Synopsis

logBeta (x, y)

Required Arguments

float x (Input)
Point at which the logarithm of the beta function is to be evaluated. It must be positive.
float y (Input)
Point at which the logarithm of the beta function is to be evaluated. It must be positive.

Return Value

The value of the logarithm of the beta function \(\beta(x,y)\).

Description

The beta function, \(\beta(x,y)\), is defined to be

\[\beta(x,y) = \frac{\mathit{\Gamma}(x)\mathit{\Gamma}(y)}{\mathit{\Gamma}(x+y)} = \int_0^1 t^{x-1} (1-t)^{y-1} dt\]

and logBeta returns \(\ln \beta(x,y)\).

The logarithm of the beta function requires that x > 0 and y > 0. It can overflow for very large arguments.

Example

Evaluate the log of the beta function \(\ln \beta(0.5,0.2)\).

from __future__ import print_function
from numpy import *
from pyimsl.math.logBeta import logBeta

x = 0.5
y = 0.2
ans = logBeta(x, y)
print("logBeta(%f,%f) = %f" % (x, y, ans))

Output

logBeta(0.500000,0.200000) = 1.835562

Warning Errors

IMSL_X_IS_TOO_CLOSE_TO_NEG_1 The result is accurate to less than one precision because the expression \(−x/(x+y)\) is too close to −1.