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

📄 specfunc.texi

📁 开放gsl矩阵运算
💻 TEXI
字号:
@cindex Special FunctionsThis chapter describes the GSL special function library.  The libraryincludes routines for calculating the values of Airy functions, Besselfunctions, Clausen functions, Coulomb wave functions, Couplingcoefficients, the Dawson function, Debye functions, Dilogarithms,Elliptic integrals, Jacobi elliptic functions, Error functions,Exponential integrals, Fermi-Dirac functions, Gamma functions,Gegenbauer functions, Hypergeometric functions, Laguerre functions,Legendre functions and Spherical Harmonics, the Psi (Digamma) Function,Synchrotron functions, Transport functions, Trigonometric functions andZeta functions.  Each routine also computes an estimate of the numericalerror in the calculated value of the function.The functions are declared in individual header files, such as@file{gsl_sf_airy.h}, @file{gsl_sf_bessel.h}, etc.  The complete set ofheader files can be included using the file @file{gsl_sf.h}.@menu* Special Function Usage::      * The gsl_sf_result struct::    * Special Function Modes::      * Airy Functions and Derivatives::  * Bessel Functions::            * Clausen Functions::           * Coulomb Functions::           * Coupling Coefficients::       * Dawson Function::             * Debye Functions::             * Dilogarithm::                 * Elementary Operations::       * Elliptic Integrals::          * Elliptic Functions (Jacobi)::  * Error Functions::             * Exponential Functions::       * Exponential Integrals::       * Fermi-Dirac Function::        * Gamma Function::              * Gegenbauer Functions::        * Hypergeometric Functions::    * Laguerre Functions::             * Lambert W Functions::        * Legendre Functions and Spherical Harmonics::  * Logarithm and Related Functions::  * Power Function::              * Psi (Digamma) Function::      * Synchrotron Functions::       * Transport Functions::         * Trigonometric Functions::     * Zeta Functions::              * Special Functions Examples::  * Special Functions References and Further Reading::  @end menu@node Special Function Usage@section UsageThe special functions are available in two calling conventions, a@dfn{natural form} which returns the numerical value of the function andan @dfn{error-handling form} which returns an error code.  The two typesof function provide alternative ways of accessing the same underlyingcode.The @dfn{natural form} returns only the value of the function and can beused directly in mathematical expressions..  For example, the followingfunction call will compute the value of the Bessel function@math{J_0(x)},@exampledouble y = gsl_sf_bessel_J0 (x);@end example@noindentThere is no way to access an error code or to estimate the error usingthis method.  To allow access to this information the alternativeerror-handling form stores the value and error in a modifiable argument,@examplegsl_sf_result result;int status = gsl_sf_bessel_J0_e (x, &result);@end example@noindentThe error-handling functions have the suffix @code{_e}. The returnedstatus value indicates error conditions such as overflow, underflow orloss of precision.  If there are no errors the error-handling functionsreturn @code{GSL_SUCCESS}.@node The gsl_sf_result struct@section The gsl_sf_result struct@cindex gsl_sf_result@cindex gsl_sf_result_e10The error handling form of the special functions always calculate anerror estimate along with the value of the result.  Therefore,structures are provided for amalgamating a value and error estimate.These structures are declared in the header file @file{gsl_sf_result.h}.The @code{gsl_sf_result} struct contains value and error fields.@exampletypedef struct@{  double val;  double err;@} gsl_sf_result;@end example@noindentThe field @var{val} contains the value and the field @var{err} containsan estimate of the absolute error in the value.In some cases, an overflow or underflow can be detected and handled by afunction.  In this case, it may be possible to return a scaling exponentas well as an error/value pair in order to save the result fromexceeding the dynamic range of the built-in types.  The@code{gsl_sf_result_e10} struct contains value and error fields as wellas an exponent field such that the actual result is obtained as@code{result * 10^(e10)}.@exampletypedef struct@{  double val;  double err;  int    e10;@} gsl_sf_result_e10;@end example@node Special Function Modes@section ModesThe goal of the library is to achieve double precision accuracy whereverpossible.  However the cost of evaluating some special functions todouble precision can be significant, particularly where very high orderterms are required.  In these cases a @code{mode} argument allows theaccuracy of the function to be reduced in order to improve performance.The following precision levels are available for the mode argument,@table @code@item GSL_PREC_DOUBLEDouble-precision, a relative accuracy of approximately @c{$2 \times 10^{-16}$}@math{2 * 10^-16}.@item GSL_PREC_SINGLESingle-precision, a relative accuracy of approximately @c{$1 \times 10^{-7}$}@math{10^-7}.@item GSL_PREC_APPROXApproximate values, a relative accuracy of approximately @c{$5 \times 10^{-4}$}@math{5 * 10^-4}.@end table@noindentThe approximate mode provides the fastest evaluation at the lowestaccuracy.@node Airy Functions and Derivatives@section Airy Functions and Derivatives@include specfunc-airy.texi@node Bessel Functions@section Bessel Functions@include specfunc-bessel.texi@node Clausen Functions@section Clausen Functions@include specfunc-clausen.texi@node Coulomb Functions@section Coulomb Functions@include specfunc-coulomb.texi@node Coupling Coefficients@section Coupling Coefficients@include specfunc-coupling.texi@node Dawson Function@section Dawson Function@include specfunc-dawson.texi@node Debye Functions@section Debye Functions@include specfunc-debye.texi@node Dilogarithm@section Dilogarithm@include specfunc-dilog.texi@node Elementary Operations@section Elementary Operations@include specfunc-elementary.texi@node Elliptic Integrals@section Elliptic Integrals@include specfunc-ellint.texi@node Elliptic Functions (Jacobi)@section Elliptic Functions (Jacobi)@include specfunc-elljac.texi@node Error Functions@section Error Functions@include specfunc-erf.texi@node Exponential Functions@section Exponential Functions@include specfunc-exp.texi@node Exponential Integrals@section Exponential Integrals@include specfunc-expint.texi@node Fermi-Dirac Function@section Fermi-Dirac Function@include specfunc-fermi-dirac.texi@node Gamma Function@section Gamma Function@include specfunc-gamma.texi@node Gegenbauer Functions@section Gegenbauer Functions@include specfunc-gegenbauer.texi@node Hypergeometric Functions@section Hypergeometric Functions@include specfunc-hyperg.texi@node Laguerre Functions@section Laguerre Functions@include specfunc-laguerre.texi@node Lambert W Functions@section Lambert W Functions@include specfunc-lambert.texi@node Legendre Functions and Spherical Harmonics@section Legendre Functions and Spherical Harmonics@include specfunc-legendre.texi@node Logarithm and Related Functions@section Logarithm and Related Functions@include specfunc-log.texi@node Power Function@section Power Function@include specfunc-pow-int.texi@node Psi (Digamma) Function@section Psi (Digamma) Function@include specfunc-psi.texi@node Synchrotron Functions@section Synchrotron Functions@include specfunc-synchrotron.texi@node Transport Functions@section Transport Functions@include specfunc-transport.texi@node Trigonometric Functions@section Trigonometric Functions@include specfunc-trig.texi@node Zeta Functions@section Zeta Functions@include specfunc-zeta.texi@node Special Functions Examples@section ExamplesThe following example demonstrates the use of the error handling form ofthe special functions, in this case to compute the Bessel function@math{J_0(5.0)},@example#include <stdio.h>#include <gsl/gsl_sf_bessel.h>intmain (void)@{  double x = 5.0;  gsl_sf_result result;  double expected = -0.17759677131433830434739701;    int status = gsl_sf_bessel_J0_e (x, &result);  printf("status  = %s\n", gsl_strerror(status));  printf("J0(5.0) = %.18f\n"         "      +/- % .18f\n",          result.val, result.err);  printf("exact   = %.18f\n", expected);  return status;@}@end example@noindentHere are the results of running the program,@example$ ./a.out status  = successJ0(5.0) = -0.177596771314338292       +/-  0.000000000000000193exact   = -0.177596771314338292@end example@noindentThe next program computes the same quantity using the natural form ofthe function. In this case the error term @var{result.err} and returnstatus are not accessible.@example#include <stdio.h>#include <gsl/gsl_sf_bessel.h>intmain (void)@{  double x = 5.0;  double expected = -0.17759677131433830434739701;    double y = gsl_sf_bessel_J0 (x);  printf("J0(5.0) = %.18f\n", y);  printf("exact   = %.18f\n", expected);  return 0;@}@end example@noindentThe results of the function are the same,@example$ ./a.out J0(5.0) = -0.177596771314338292exact   = -0.177596771314338292@end example@node Special Functions References and Further Reading@section References and Further Reading@noindentThe library follows the conventions of @cite{Abramowitz & Stegun} wherepossible,@itemize @asis@itemAbramowitz & Stegun (eds.), @cite{Handbook of Mathematical Functions}@end itemize@noindentThe following papers contain information on the algorithms used to compute the special functions,@cindex MISCFUN@itemize @asis@itemMISCFUN: A software package to compute uncommon special functions.@cite{ACM Trans. Math. Soft.}, vol. 22, 1996, 288-301@itemG.N. Watson, A Treatise on the Theory of Bessel Functions,2nd Edition (Cambridge University Press, 1944).@itemG. Nemeth, Mathematical Approximations of Special Functions,Nova Science Publishers, ISBN 1-56072-052-2@itemB.C. Carlson, Special Functions of Applied Mathematics (1977)@itemW.J. Thompson, Atlas for Computing Mathematical Functions, John Wiley & Sons,New York (1997).@itemY.Y. Luke, Algorithms for the Computation of Mathematical Functions, AcademicPress, New York (1977).@comment @item@comment Fermi-Dirac functions of orders @math{-1/2}, @math{1/2}, @math{3/2}, and@comment @math{5/2}.  @cite{ACM Trans. Math. Soft.}, vol. 24, 1998, 1-12.@end itemize

⌨️ 快捷键说明

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