annotate PsiCLASS-1.0.2/gamma.hpp @ 0:903fc43d6227 draft default tip

Uploaded
author lsong10
date Fri, 26 Mar 2021 16:52:45 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
1 #ifndef _LSONG_GAMMA
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
2 #define _LSONG_GAMMA
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
3
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
4 #include <stdio.h>
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
5 #include <math.h>
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
6
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
7 #ifndef M_PIl
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
8 /** The constant Pi in high precision */
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
9 #define M_PIl 3.1415926535897932384626433832795029L
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
10 #endif
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
11 #ifndef M_GAMMAl
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
12 /** Euler's constant in high precision */
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
13 #define M_GAMMAl 0.5772156649015328606065120900824024L
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
14 #endif
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
15 #ifndef M_LN2l
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
16 /** the natural logarithm of 2 in high precision */
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
17 #define M_LN2l 0.6931471805599453094172321214581766L
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
18 #endif
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
19
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
20 /** The digamma function in long double precision.
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
21 * @param x the real value of the argument
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
22 * @return the value of the digamma (psi) function at that point
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
23 * @author Richard J. Mathar
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
24 * @since 2005-11-24
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
25 */
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
26 long double digammal(long double x) ;
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
27
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
28 //https://people.sc.fsu.edu/~jburkardt/cpp_src/asa121/asa121.hpp
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
29 double trigamma ( double x, int *ifault );
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
30
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
31
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
32 double LogGammaDensity( double x, double k, double theta ) ;
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
33 double MixtureGammaAssignment( double x, double pi, double* k, double *theta ) ;
903fc43d6227 Uploaded
lsong10
parents:
diff changeset
34 #endif