JWS C Library
C language utility library
func.c File Reference

Definitions for miscellaneous special functions. More...

#include <jwsc/config.h>
#include <inttypes.h>
#include <math.h>
#include "jwsc/math/func.h"
Include dependency graph for func.c:

Go to the source code of this file.

Functions

double log_gamma_d (double x)
 Computes the log of the gamma function, using the Lanczos approximation.
double beta_d (double x, double y)
 Computes the beta function.
double mult_beta_d (const double *const x, uint32_t num_elts)
 Computes the multinomial beta function.
double log_beta_d (double x, double y)
 Computes the log of the beta function.
double log_mult_beta_d (const double *const x, uint32_t num_elts)
 Computes the log of the multinomial beta function.

Detailed Description

Definitions for miscellaneous special functions.

Author:
Kyle Simek
License:
Creative Commons BY-NC-SA 3.0

Definition in file func.c.


Function Documentation

double log_gamma_d ( double  x)

Computes the log of the gamma function, using the Lanczos approximation.

Numerical approximation of log-gamma

Definition at line 52 of file func.c.

double beta_d ( double  x,
double  y 
)

Computes the beta function.

Compute the Beta function.

Since this computeation relies on the gamma function, which explodes for large values, this is computed in log space using the numerically approximated log_gamma function, and the result is then exponentiated.

Definition at line 75 of file func.c.

double mult_beta_d ( const double *const  x,
uint32_t  num_elts 
)

Computes the multinomial beta function.

Compute the multinomial Beta function.

Since this computeation relies on the gamma function, which explodes for large values, this is computed in log space using the numerically approximated log_gamma function, and the result is then exponentiated.

Definition at line 88 of file func.c.

double log_beta_d ( double  x,
double  y 
)

Computes the log of the beta function.

Compute the log of the Beta function.

Note:
computed using the numerically approximated log_gamma function.

Definition at line 99 of file func.c.

double log_mult_beta_d ( const double *const  x,
uint32_t  num_elts 
)

Computes the log of the multinomial beta function.

Compute the log of the multinomial Beta function.

Note:
computed using the numerically approximated log_gamma function.

Definition at line 109 of file func.c.