3 * Copyright (C) 2002 Przemyslaw Sliwa and Jason H. Stover.
4 * Copyright (C) 2006, 2007 Brian Gough
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or (at
9 * your option) any later version.
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
23 #include <gsl/gsl_cdf.h>
24 #include <gsl/gsl_sf_gamma.h>
25 #include <gsl/gsl_math.h>
26 #include <gsl/gsl_errno.h>
36 gsl_cdf_fdist_P (const double x, const double nu1, const double nu2)
43 double u = x / (r + x);
45 P = beta_inc_AXPY (1.0, 0.0, nu1 / 2.0, nu2 / 2.0, u);
49 double u = r / (r + x);
51 P = beta_inc_AXPY (-1.0, 1.0, nu2 / 2.0, nu1 / 2.0, u);
62 gsl_cdf_fdist_Q (const double x, const double nu1, const double nu2)
69 double u = x / (r + x);
71 Q = beta_inc_AXPY (-1.0, 1.0, nu1 / 2.0, nu2 / 2.0, u);
75 double u = r / (r + x);
77 Q = beta_inc_AXPY (1.0, 0.0, nu2 / 2.0, nu1 / 2.0, u);