Data update
This commit is contained in:
parent
8e4e15fa56
commit
72eb4943cb
1853 changed files with 35514 additions and 9441 deletions
19
Task/Gamma-function/EMal/gamma-function.emal
Normal file
19
Task/Gamma-function/EMal/gamma-function.emal
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
fun stirling ← <real x|√(2 * PI / x) * ((x / E) ** x)
|
||||
fun lanczos ← real by real x
|
||||
List p ← real[0.99999999999980993, 676.5203681218851, -1259.1392167224028,
|
||||
771.32342877765313, -176.61502916214059, 12.507343278686905,
|
||||
-0.13857109526572012, 0.0000099843695780195716, 0.00000015056327351493116]
|
||||
int g ← 7
|
||||
if x < 0.5 do return PI / (sin(PI * x) * lanczos(1 - x)) end
|
||||
x -← 1
|
||||
real a ← p[0]
|
||||
real t ← x + g + 0.5
|
||||
for int i ← 1; i < p.length; ++i
|
||||
a +← p[i] / (x + i)
|
||||
end
|
||||
return √(2 * PI) * (t ** (x + 0.5)) * (E ** (-t)) * a
|
||||
end
|
||||
writeLine("x", "\t", "Stirling", "\t\t\t", "Lanczos")
|
||||
for real x ← 0.1; x ≤ 2 ; x +← 0.1
|
||||
writeLine(x, "\t", stirling(x), "\t", lanczos(x))
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue