RosettaCodeData/Task/Gamma-function/00DESCRIPTION

17 lines
724 B
Text
Raw Permalink Normal View History

2016-12-05 22:15:40 +01:00
;Task:
Implement one algorithm (or more) to compute the [[wp:Gamma function|Gamma]] (<math>\Gamma</math>) function (in the real field only).
If your language has the function as built-in or you know a library which has it, compare your implementation's results with the results of the built-in/library function.
2013-04-10 21:29:02 -07:00
The Gamma function can be defined as:
2016-12-05 22:15:40 +01:00
:::::: <big><big> <math>\Gamma(x) = \displaystyle\int_0^\infty t^{x-1}e^{-t} dt</math></big></big>
2013-04-10 21:29:02 -07:00
This suggests a straightforward (but inefficient) way of computing the <math>\Gamma</math> through numerical integration.
2016-12-05 22:15:40 +01:00
2013-04-10 21:29:02 -07:00
Better suggested methods:
* [[wp:Lanczos approximation|Lanczos approximation]]
* [[wp:Stirling's approximation|Stirling's approximation]]
2016-12-05 22:15:40 +01:00
<br><br>