Returns the natural logarithm of the gamma function of the sum of two numbers.

You're viewing an older version of this page (#165). View the current version.

View versions (1)

Interface

#include <codecogs/maths/special/gamma/loggammasum.h>

using namespace Maths::Special::Gamma;

Evaluates:

ln( \Gamma(a+b) )
(1)

Example:

#include <codecogs/maths/special/gamma/loggammasum.h>
#include <stdio.h>
int main()
{
  double a[10] = { 1.6, 1.4, 1.7, 2.0, 1.1, 1.1, 1.2, 1.3, 1.2, 1.5 };
  double b[10] = { 1.2, 2.0, 1.0, 1.2, 1.2, 1.7, 2.0, 1.5, 1.4, 1.5 };
  for( int i=0; i<10; i++ )
    printf( "logGammaSum( %2.1f, %2.1f ) = %f\n",
            a[i], b[i], Maths::Special::Gamma::logGammaSum( a[i], b[i] ) );
  return getchar();
}

Output:

logGammaSum( 1.6, 1.2 ) = 0.516703
logGammaSum( 1.4, 2.0 ) = 1.092328
logGammaSum( 1.7, 1.0 ) = 0.434821
logGammaSum( 2.0, 1.2 ) = 0.885405
logGammaSum( 1.1, 1.2 ) = 0.154187
logGammaSum( 1.1, 1.7 ) = 0.516703
logGammaSum( 1.2, 2.0 ) = 0.885405
logGammaSum( 1.3, 1.5 ) = 0.516703
logGammaSum( 1.2, 1.4 ) = 0.357412
logGammaSum( 1.5, 1.5 ) = 0.693147

Parameters

a
1st argument where 1 <= a <= 2
b
2nd argument where 1 <= b <= 2
GPL Licence — free for non commercial use. See Licence details.

Interactive Calculator

a
b
Result