FUNCTION
logBeta
Returns the natural logarithm of the complete beta function.
You're viewing an older version of this page (#5458). View the current version.
Interface
#include <codecogs/maths/special/gamma/logbeta.h>
using namespace Maths::Special::Gamma;
Returns the natural logarithm of the complete beta function, which is fundamentally just
However when either a or b are large (typically above 8) then there are more appropriate methods of computing an accurate value efficiently. An illustration of this curve is given below: \graph a=0:20 b=1:5:5 .size=medium
Example:
#include <stdio.h>
#include <codecogs/maths/special/gamma/logbeta.h>
int main()
{
double a[6] = { 0.5, 1.5, 2.5, 3.5, 9.0, 20.0 };
double b[6] = { 0.5, 9.0, 5.0, 1500.0, 12.0, 15.0 };
for( int i=0; i<6; i++ )
printf( "logBeta( %.1f, %.1f ) = %f\n", a[i], b[i], Maths::Special::Gamma::logBeta( a[i], b[i] ) );
return 0;
}Output:
logBeta( 0.5, 0.5 ) = 1.144730
logBeta( 1.5, 9.0 ) = -3.456805
logBeta( 2.5, 5.0 ) = -4.071628
logBeta( 3.5, 1500.0 ) = -24.398212
logBeta( 9.0, 12.0 ) = -14.228706
logBeta( 20.0, 15.0 ) = -24.049722
References
DiDonato, A. R. and Morris, A. H. Algorithm 708: Significant Digit Computation of the Incomplete Beta Function Ratios. ACM Trans. Math. Softw. 18 (1993), 360-373.
Parameters
Interactive Calculator
Computing…
Set a range above first to export a graph.