⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 specfunc-gamma.texi

📁 开放gsl矩阵运算
💻 TEXI
字号:
@cindex gamma functionThe Gamma function is defined by the following integral,@tex\beforedisplay$$\Gamma(x) = \int_0^t dt \, t^{x-1} \exp(-t)$$\afterdisplay@end tex@ifinfo@example\Gamma(x) = \int_0^t dt  t^@{x-1@} \exp(-t)@end example@end ifinfo@noindentFurther information on the Gamma function can be found in Abramowitz &Stegun, Chapter 6.  The  functions described in this section are declaredin the header file @file{gsl_sf_gamma.h}.@deftypefun double gsl_sf_gamma (double @var{x})@deftypefunx int gsl_sf_gamma_e (double @var{x}, gsl_sf_result * @var{result})These routines compute the Gamma function @math{\Gamma(x)}, subject to xnot being a negative integer.  The function is computed using the realLanczos method. The maximum value of @math{x} such that @math{\Gamma(x)} is notconsidered an overflow is given by the macro @code{GSL_SF_GAMMA_XMAX}and is 171.0.@comment exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EROUND@end deftypefun@deftypefun double gsl_sf_lngamma (double @var{x})@deftypefunx int gsl_sf_lngamma_e (double @var{x}, gsl_sf_result * @var{result})@cindex logarithm of Gamma functionThese routines compute the logarithm of the Gamma function,@math{\log(\Gamma(x))}, subject to @math{x} not a being negativeinteger.  For @math{x<0} the real part of @math{\log(\Gamma(x))} isreturned, which is equivalent to @math{\log(|\Gamma(x)|)}.  The functionis computed using the real Lanczos method.@comment exceptions: GSL_EDOM, GSL_EROUND@end deftypefun@deftypefun int gsl_sf_lngamma_sgn_e (double @var{x}, gsl_sf_result * @var{result_lg}, double * @var{sgn})This routine computes the sign of the gamma function and the logarithmits magnitude, subject to @math{x} not being a negative integer.  Thefunction is computed using the real Lanczos method.  The value of thegamma function can be reconstructed using the relation @math{\Gamma(x) =sgn * \exp(resultlg)}.@comment exceptions: GSL_EDOM, GSL_EROUND@end deftypefun@deftypefun double gsl_sf_gammastar (double @var{x})@deftypefunx int gsl_sf_gammastar_e (double @var{x}, gsl_sf_result * @var{result})@cindex Regulated Gamma functionThese routines compute the regulated Gamma Function @math{\Gamma^*(x)}for @math{x > 0}. The regulated gamma function is given by,@tex\beforedisplay$$\eqalign{\Gamma^*(x) &= \Gamma(x)/(\sqrt{2\pi} x^{(x-1/2)} \exp(-x))\cr            &= \left(1 + {1 \over 12x} + ...\right) \quad\hbox{for~} x\to \infty\cr}$$\afterdisplay@end tex@ifinfo@example\Gamma^*(x) = \Gamma(x)/(\sqrt@{2\pi@} x^@{(x-1/2)@} \exp(-x))            = (1 + (1/12x) + ...)  for x \to \infty@end example@end ifinfoand is a useful suggestion of Temme.@comment exceptions: GSL_EDOM@end deftypefun@deftypefun double gsl_sf_gammainv (double @var{x})@deftypefunx int gsl_sf_gammainv_e (double @var{x}, gsl_sf_result * @var{result})@cindex Reciprocal Gamma functionThese routines compute the reciprocal of the gamma function,@math{1/\Gamma(x)} using the real Lanczos method.@comment exceptions: GSL_EUNDRFLW, GSL_EROUND@end deftypefun@deftypefun int gsl_sf_lngamma_complex_e (double @var{zr}, double @var{zi}, gsl_sf_result * @var{lnr}, gsl_sf_result * @var{arg})@cindex Complex Gamma functionThis routine computes @math{\log(\Gamma(z))} for complex @math{z=z_r+iz_i} and @math{z} not a negative integer, using the complex Lanczosmethod.  The returned parameters are @math{lnr = \log|\Gamma(z)|} and@math{arg = \arg(\Gamma(z))} in @math{(-\pi,\pi]}.  Note that the phasepart (@var{arg}) is not well-determined when @math{|z|} is very large,due to inevitable roundoff in restricting to @math{(-\pi,\pi]}.  Thiswill result in a @code{GSL_ELOSS} error when it occurs.  The absolutevalue part (@var{lnr}), however, never suffers from loss of precision.@comment exceptions: GSL_EDOM, GSL_ELOSS@end deftypefun@deftypefun double gsl_sf_taylorcoeff (int @var{n}, double @var{x})@deftypefunx int gsl_sf_taylorcoeff_e (int @var{n}, double @var{x}, gsl_sf_result * @var{result})@cindex Taylor coefficients, computation ofThese routines compute the Taylor coefficient @math{x^n / n!} for @c{$x \ge 0$}@math{x >= 0}, @c{$n \ge 0$}@math{n >= 0}.@comment exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW@end deftypefun@deftypefun double gsl_sf_fact (unsigned int @var{n})@deftypefunx int gsl_sf_fact_e (unsigned int @var{n}, gsl_sf_result * @var{result})@cindex factorialThese routines compute the factorial @math{n!}.  The factorial isrelated to the Gamma function by @math{n! = \Gamma(n+1)}.@comment exceptions: GSL_EDOM, GSL_OVRFLW@end deftypefun@deftypefun double gsl_sf_doublefact (unsigned int @var{n})@deftypefunx int gsl_sf_doublefact_e (unsigned int @var{n}, gsl_sf_result * @var{result})@cindex double factorialThese routines compute the double factorial @math{n!! = n(n-2)(n-4) \dots}. @comment exceptions: GSL_EDOM, GSL_OVRFLW@end deftypefun@deftypefun double gsl_sf_lnfact (unsigned int @var{n})@deftypefunx int gsl_sf_lnfact_e (unsigned int @var{n}, gsl_sf_result * @var{result})@cindex logarithm of factorialThese routines compute the logarithm of the factorial of @var{n},@math{\log(n!)}.  The algorithm is faster than computing@math{\ln(\Gamma(n+1))} via @code{gsl_sf_lngamma} for @math{n < 170},but defers for larger @var{n}.@comment exceptions: none@end deftypefun@deftypefun double gsl_sf_lndoublefact (unsigned int @var{n})@deftypefunx int gsl_sf_lndoublefact_e (unsigned int @var{n}, gsl_sf_result * @var{result})@cindex logarithm of double factorialThese routines compute the logarithm of the double factorial of @var{n},@math{\log(n!!)}.@comment exceptions: none@end deftypefun@deftypefun double gsl_sf_choose (unsigned int @var{n}, unsigned int @var{m})@deftypefunx int gsl_sf_choose_e (unsigned int @var{n}, unsigned int @var{m}, gsl_sf_result * @var{result})@cindex combinatorial factor C(m,n)These routines compute the combinatorial factor @code{n choose m}@math{= n!/(m!(n-m)!)}@comment exceptions: GSL_EDOM, GSL_EOVRFLW@end deftypefun@deftypefun double gsl_sf_lnchoose (unsigned int @var{n}, unsigned int @var{m})@deftypefunx int gsl_sf_lnchoose_e (unsigned int @var{n}, unsigned int @var{m}, gsl_sf_result * @var{result})@cindex logarithm of combinatorial factor C(m,n)These routines compute the logarithm of @code{n choose m}.  This isequivalent to the sum @math{\log(n!) - \log(m!) - \log((n-m)!)}.@comment exceptions: GSL_EDOM @end deftypefun@deftypefun double gsl_sf_poch (double @var{a}, double @var{x})@deftypefunx int gsl_sf_poch_e (double @var{a}, double @var{x}, gsl_sf_result * @var{result})@cindex Pochhammer symbol@cindex Apell symbol, see Pochammer symbolThese routines compute the Pochhammer symbol @math{(a)_x := \Gamma(a +x)/\Gamma(x)}, subject to @math{a} and @math{a+x} not being negativeintegers. The Pochhammer symbol is also known as the Apell symbol.@comment exceptions:  GSL_EDOM, GSL_EOVRFLW@end deftypefun@deftypefun double gsl_sf_lnpoch (double @var{a}, double @var{x})@deftypefunx int gsl_sf_lnpoch_e (double @var{a}, double @var{x}, gsl_sf_result * @var{result})@cindex logarithm of Pochhammer symbolThese routines compute the logarithm of the Pochhammer symbol,@math{\log((a)_x) = \log(\Gamma(a + x)/\Gamma(a))} for @math{a > 0},@math{a+x > 0}.@comment exceptions:  GSL_EDOM@end deftypefun@deftypefun int gsl_sf_lnpoch_sgn_e (double @var{a}, double @var{x}, gsl_sf_result * @var{result}, double * @var{sgn})These routines compute the sign of the Pochhammer symbol and thelogarithm of its magnitude.  The computed parameters are @math{result =\log(|(a)_x|)} and @math{sgn = sgn((a)_x)} where @math{(a)_x :=\Gamma(a + x)/\Gamma(a)}, subject to @math{a}, @math{a+x} not beingnegative integers.@comment exceptions:  GSL_EDOM@end deftypefun@deftypefun double gsl_sf_pochrel (double @var{a}, double @var{x})@deftypefunx int gsl_sf_pochrel_e (double @var{a}, double @var{x}, gsl_sf_result * @var{result})@cindex relative Pochhammer symbolThese routines compute the relative Pochhammer symbol @math{((a,x) -1)/x} where @math{(a,x) = (a)_x := \Gamma(a + x)/\Gamma(a)}.@comment exceptions:  GSL_EDOM@end deftypefun@deftypefun double gsl_sf_gamma_inc_Q (double @var{a}, double @var{x})@deftypefunx int gsl_sf_gamma_inc_Q_e (double @var{a}, double @var{x}, gsl_sf_result * @var{result})@cindex incomplete Gamma functionThese routines compute the normalized incomplete Gamma Function@c{$P(a,x) = 1/\Gamma(a) \int_x^\infty dt\, t^{(a-1)} \exp(-t)$}@math{P(a,x) = 1/\Gamma(a) \int_x\infty dt t^@{a-1@} \exp(-t)}for @math{a > 0}, @c{$x \ge 0$}@math{x >= 0}.@comment exceptions: GSL_EDOM@end deftypefun@deftypefun double gsl_sf_gamma_inc_P (double @var{a}, double @var{x})@deftypefunx int gsl_sf_gamma_inc_P_e (double @var{a}, double @var{x}, gsl_sf_result * @var{result})@cindex complementary incomplete Gamma functionThese routines compute the complementary normalized incomplete Gamma Function@c{$P(a,x) = 1/\Gamma(a) \int_0^x dt\, t^{(a-1)} \exp(-t)$}@math{P(a,x) = 1/\Gamma(a) \int_0^x dt t^@{a-1@} \exp(-t)}for @math{a > 0}, @c{$x \ge 0$}@math{x >= 0}.@comment exceptions: GSL_EDOM@end deftypefun@deftypefun double gsl_sf_beta (double @var{a}, double @var{b})@deftypefunx int gsl_sf_beta_e (double @var{a}, double @var{b}, gsl_sf_result * @var{result})@cindex Beta functionThese routines compute the Beta Function, @math{B(a,b) =\Gamma(a)\Gamma(b)/\Gamma(a+b)} for @math{a > 0}, @math{b > 0}.@comment exceptions: GSL_EDOM, GSL_EOVRFLW, GSL_EUNDRFLW@end deftypefun@deftypefun double gsl_sf_lnbeta (double @var{a}, double @var{b})@deftypefunx int gsl_sf_lnbeta_e (double @var{a}, double @var{b}, gsl_sf_result * @var{result})@cindex logarithm of Beta functionThese routines compute the logarithm of the Beta Function, @math{\log(B(a,b))}for @math{a > 0}, @math{b > 0}.@comment exceptions: GSL_EDOM@end deftypefun@deftypefun double gsl_sf_beta_inc (double @var{a}, double @var{b}, double @var{x})@deftypefunx int gsl_sf_beta_inc_e (double @var{a}, double @var{b}, double @var{x}, gsl_sf_result * @var{result})@cindex incomplete Beta function, normalized@cindex normalized incomplete Beta function@cindex Beta function, incomplete normalized These routines compute the normalize incomplete Beta function@math{B_x(a,b)/B(a,b)} for @math{a > 0}, @math{b > 0}, and @c{$0 \le x \le 1$}@math{0 <= x <= 1}.@end deftypefun

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -