X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fgsl-extras%2Fhypergeometric.c;h=265eae29485af71d7e22ab78578d6cea6e256d64;hb=d22c3971e926ceaf62416c6482fe0fb1dc5407f0;hp=2e9cf69267db0f2354e0320daf44f42afd74ea04;hpb=4f71ffe74a94ea89787705f1ba12a3dd810adda5;p=pspp diff --git a/lib/gsl-extras/hypergeometric.c b/lib/gsl-extras/hypergeometric.c index 2e9cf69267..265eae2948 100644 --- a/lib/gsl-extras/hypergeometric.c +++ b/lib/gsl-extras/hypergeometric.c @@ -15,7 +15,7 @@ * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ /* @@ -29,7 +29,7 @@ * * 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 @@ -38,9 +38,8 @@ * 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 #include #include #include @@ -52,7 +51,7 @@ * 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) @@ -126,7 +125,7 @@ gslextras_cdf_hypergeometric_P (const unsigned int k, * 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) @@ -154,7 +153,7 @@ gslextras_cdf_hypergeometric_Q (const unsigned int k, P = 0.0; mode = (int) t*n0 / (n0+n1); relerr = 1.0; - + if(k < mode) { i = mode;