Beta Function |
Unit
QESBPCSMath
Declaration
Function Beta(const X, Y: Extended): Extended;
Description
Defined for all values of X and Y except negative integers and 0.
Accuracy: Gives about 15 digits.
Parameters |
X | First Value to process. |
Y | Second Value to process. |
Category
Arithmetic Routines for FloatsImplementation
function Beta (const X, Y: Extended): Extended; var R1, R2: Extended; begin if FloatIsZero (X) or (FloatIsNegative (X) and SameFloat (X, Int (X))) then raise EMathError.Create (rsNotDefinedForValue); if FloatIsZero (Y) or (FloatIsNegative (Y) and SameFloat (Y, Int (Y))) then raise EMathError.Create (rsNotDefinedForValue); R1 := InverseGamma (X); R2 := InverseGamma (Y); if FloatIsZero (R1) or FloatIsZero (R2) then raise EMathError.Create (rsNotDefinedForValue); Result := InverseGamma (X + Y) / (R1 * R2); End; |
|