18 lines
726 B
Plaintext
18 lines
726 B
Plaintext
;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.
|
|
|
|
The Gamma function can be defined as:
|
|
|
|
:::::: <big><big> <math>\Gamma(x) = \displaystyle\int_0^\infty t^{x-1}e^{-t} dt</math></big></big>
|
|
|
|
This suggests a straightforward (but inefficient) way of computing the <math>\Gamma</math> through numerical integration.
|
|
|
|
|
|
Better suggested methods:
|
|
* [[wp:Lanczos approximation|Lanczos approximation]]
|
|
* [[wp:Stirling's approximation|Stirling's approximation]]
|
|
<br><br>
|
|
|