*
* References:
*
- * T. Wu. An accurate computation of the hypergeometric distribution
+ * T. Wu. An accurate computation of the hypergeometric distribution
* function. ACM Transactions on Mathematical Software. Volume 19, number 1,
* March 1993.
* This algorithm is not used, since it requires factoring the
* time than the algorithm used here.
*
* W. Feller. An Introduction to Probability Theory and Its Applications,
- * third edition. 1968. Chapter 2, section 6.
+ * third edition. 1968. Chapter 2, section 6.
*/
#include <math.h>
#include <gsl/gsl_math.h>
* Pr (X <= k)
*/
double
-gslextras_cdf_hypergeometric_P (const unsigned int k,
+gslextras_cdf_hypergeometric_P (const unsigned int k,
const unsigned int n0,
const unsigned int n1,
const unsigned int t)
* Pr (X > k)
*/
double
-gslextras_cdf_hypergeometric_Q (const unsigned int k,
+gslextras_cdf_hypergeometric_Q (const unsigned int k,
const unsigned int n0,
const unsigned int n1,
const unsigned int t)
P = 0.0;
mode = (int) t*n0 / (n0+n1);
relerr = 1.0;
-
+
if(k < mode)
{
i = mode;