Displaying 1 result from an estimated 1 matches for "pdhyper".
Did you mean:
dhyper
2004 Apr 15
0
phyper accuracy and efficiency (PR#6772)
...an Smith for ideas.
*/
/*
* Calculate
*
* phyper (i, NR, NB, n, TRUE, FALSE)
* [log] ----------------------------------
* dhyper (i, NR, NB, n, FALSE)
*
* without actually calling phyper. This assumes that
*
* i * (NR + NB) <= n * NR
*
*/
static gnm_float
pdhyper (gnm_float i, gnm_float NR, gnm_float NB, gnm_float n, gboolean log_p)
{
gnm_float sum = 0;
gnm_float term = 1;
while (i > 0 && term >= GNUM_EPSILON * sum) {
term *= i * (NB - n + i) / (n + 1 - i) / (NR + 1 - i);
sum += term;
i--;
}
return log_p ? log1pgnum (sum)...