Gamma
The gamma function , extending the factorial to real and complex arguments; with two arguments, the upper incomplete gamma function.
Gamma functionMathWorldGammaFunctionWikidataQ190573Encyclopedia of MathematicsGamma-functionnLabGamma functionBritannicascience/gamma-functionDLMF5.2.E1FungrimGamma✓Fungrim entryWolfram LanguageGamma!Gamma(z)the gamma function .Gamma(s, z)the upper incomplete gamma function .gamma_inc(s, z)SymPyuppergamma(s, z)mpmathgammainc(s, z)Juliaenumeratio_ball(gamma, s, z)Rustupper_gamma(s, z)Gamma(s, z0, z1)the generalized incomplete gamma ; at the LOWER incomplete gamma .gammainc(s, z0, z1)Juliaenumeratio_ball((a, z0, z1) -> gamma(a, z0) - gamma(a, z1), s, z0, z1)Typed signatures
| Type | Package | Applies |
|---|---|---|
(complex | infinity, (complex | infinity)?) -> number | compute-engine | always |
(complex | infinity, (complex | infinity)?, (complex | infinity)?) -> number | analyticreplaces compute-engine | always |
Details
The gamma function for (DLMF 5.2.1), continued analytically elsewhere, is the standard extension of the factorial to real and complex arguments. The two- and three-argument forms below split that same integral at a finite endpoint rather than .
- Extends the factorial: for positive integers n, so Factorial is .
- Functional equation: .
- Reflection formula: , linking at z and .
- Poles at the nonpositive integers , where diverges to ComplexInfinity.
- , the constant behind the normal distribution's normalizing factor. See Erf.
- compute-engine's plain evaluation would otherwise leave Gamma at exact integer or rational arguments unevaluated (
@enumeratio/analyticoverrides it, reducing every integer and half-integer exactly); a floating-point argument, or N(), still reduces to a decimal. - The three-argument form (
@enumeratio/analytic) is Wolfram's generalized incomplete gamma, the integral between two limits: . It is the only spelling here for the LOWER incomplete gamma , which is what the Gamma-distribution CDF and the CDF are built from. See GammaRegularized for the normalized version. - , also supplied by
@enumeratio/analytic-- exact and valid for symbolic , which is what makes collapse to as Wolfram's does. - Differs from Wolfram: reduces to on evaluation; Wolfram keeps
Gamma[1/2, x]untilFunctionExpand. Both agree as identities.
Plot
Examples
13 more kept as data, checked against the oraclesBasic #
Three arguments: the integral between two limits. With this is the lower incomplete gamma
live ↗Scope #
Threads over a list and reduces each integer argument to the concrete factorial, overriding compute-engine's plain policy of leaving exact Gamma arguments symbolic
live ↗is Indeterminate -- the poles at every non-positive integer accumulate along the negative real axis
live ↗Known value · Wolfram Gamma[-Infinity]
Gamma of the directed infinity stays unevaluated; the limit along it is in the Limit example above
live ↗Known value · DLMF 5.11.9; Wolfram Gamma[I Infinity]
Properties #
Now that has a closed form, the three-argument difference reduces through it too: . Wolfram's bare Gamma[2, 0, z] stays unevaluated (only FunctionExpand reaches this); this engine reduces both
About
| Examples | 57 |
|---|---|
| Checked against | Wolfram Language 52 agree4 differ1 unevaluatedSageMath 49 agree3 differSymPy 50 agree2 differmpmath 38 agree4 errorJulia 35 agree7 errorRust 19 agree2 unevaluated5 error |
| Crosswalk | WikipediaMathWorldWikidataEncyclopedia of MathematicsnLabBritannicaDLMFFungrimFungrim entry ×101Wolfram LanguageSageMath ×2SymPy ×2mpmath ×3Julia ×3Rust ×2 |
Implementation
wolframpackages/oracle/src/mappings.tssympypackages/oracle/src/mappings.tsmpmathpackages/oracle/src/mappings.tssagepackages/oracle/src/mappings.tsrustpackages/oracle/src/mappings.tssympypackages/oracle/src/mappings.tssympypackages/oracle/src/mappings.tsWolfram's generalized incomplete gamma is the difference of two upper incomplete gammas, written out; at z0 = 0 it is the lower incomplete gamma.
mpmathpackages/oracle/src/mappings.tsmpmathpackages/oracle/src/mappings.tsThe incomplete gamma from z0 to z1, the difference of two upper ones.
sagepackages/oracle/src/mappings.tssagepackages/oracle/src/mappings.tsjuliapackages/oracle/src/mappings.tsjuliapackages/oracle/src/mappings.tsjuliapackages/oracle/src/mappings.tsrustpackages/oracle/src/mappings.tsa, z > 0 only.
See also: Factorial, GammaLn, LogGamma, GammaRegularized, Digamma, Beta