5 The error function is described in Abramowitz & Stegun, Chapter 7. The
6 functions in this section are declared in the header file
11 * Complementary Error Function::
12 * Log Complementary Error Function::
13 * Probability functions::
17 @subsection Error Function
19 @deftypefun double gsl_sf_erf (double @var{x})
20 @deftypefunx int gsl_sf_erf_e (double @var{x}, gsl_sf_result * @var{result})
21 These routines compute the error function @c{$\erf(x)$}
23 @c{$\erf(x) = (2/\sqrt{\pi}) \int_0^x dt \exp(-t^2)$}
24 @math{erf(x) = (2/\sqrt(\pi)) \int_0^x dt \exp(-t^2)}.
25 @comment Exceptional Return Values: none
28 @node Complementary Error Function
29 @subsection Complementary Error Function
31 @deftypefun double gsl_sf_erfc (double @var{x})
32 @deftypefunx int gsl_sf_erfc_e (double @var{x}, gsl_sf_result * @var{result})
33 These routines compute the complementary error function
34 @c{$\erfc(x) = 1 - \erf(x) = (2/\sqrt{\pi}) \int_x^\infty \exp(-t^2)$}
35 @math{erfc(x) = 1 - erf(x) = (2/\sqrt(\pi)) \int_x^\infty \exp(-t^2)}.
36 @comment Exceptional Return Values: none
40 @node Log Complementary Error Function
41 @subsection Log Complementary Error Function
43 @deftypefun double gsl_sf_log_erfc (double @var{x})
44 @deftypefunx int gsl_sf_log_erfc_e (double @var{x}, gsl_sf_result * @var{result})
45 These routines compute the logarithm of the complementary error function
46 @math{\log(\erfc(x))}.
47 @comment Exceptional Return Values: none
51 @node Probability functions
52 @subsection Probability functions
54 The probability functions for the Normal or Gaussian distribution are
55 described in Abramowitz & Stegun, Section 26.2.
57 @deftypefun double gsl_sf_erf_Z (double @var{x})
58 @deftypefunx int gsl_sf_erf_Z_e (double @var{x}, gsl_sf_result * @var{result})
59 These routines compute the Gaussian probability density function
60 @c{$Z(x) = (1/\sqrt{2\pi}) \exp(-x^2/2)$}
61 @math{Z(x) = (1/\sqrt@{2\pi@}) \exp(-x^2/2)}.
64 @deftypefun double gsl_sf_erf_Q (double @var{x})
65 @deftypefunx int gsl_sf_erf_Q_e (double @var{x}, gsl_sf_result * @var{result})
66 These routines compute the upper tail of the Gaussian probability
68 @c{$Q(x) = (1/\sqrt{2\pi}) \int_x^\infty dt \exp(-t^2/2)$}
69 @math{Q(x) = (1/\sqrt@{2\pi@}) \int_x^\infty dt \exp(-t^2/2)}.
70 @comment Exceptional Return Values: none
73 @cindex hazard function, normal distribution
74 @cindex Mill's ratio, inverse
75 The @dfn{hazard function} for the normal distribution,
76 also known as the inverse Mill's ratio, is defined as,
80 h(x) = {Z(x)\over Q(x)} = \sqrt{2 \over \pi} {\exp(-x^2 / 2) \over \erfc(x/\sqrt 2)}
87 h(x) = Z(x)/Q(x) = \sqrt@{2/\pi@} \exp(-x^2 / 2) / \erfc(x/\sqrt 2)
92 It decreases rapidly as @math{x} approaches @math{-\infty} and asymptotes
93 to @math{h(x) \sim x} as @math{x} approaches @math{+\infty}.
95 @deftypefun double gsl_sf_hazard (double @var{x})
96 @deftypefunx int gsl_sf_hazard_e (double @var{x}, gsl_sf_result * @var{result})
97 These routines compute the hazard function for the normal distribution.
98 @comment Exceptional Return Values: GSL_EUNDRFLW