Jump to content

Gamma function: Difference between revisions

→‎{{header|R}}: Issue found in previous R implementation step using 'seq.int' function: imaginary parts discarded in coercion; The edit resolved the issue and retain the imaginary part to make sure the precision. The edited lanczos(z) was benchmarked with gammaz(z) and complex_gamma(z) from 'pracma' and 'hypergeo' libraries to cross validate the solution accuracy
(add lambdatalk code)
(→‎{{header|R}}: Issue found in previous R implementation step using 'seq.int' function: imaginary parts discarded in coercion; The edit resolved the issue and retain the imaginary part to make sure the precision. The edited lanczos(z) was benchmarked with gammaz(z) and complex_gamma(z) from 'pracma' and 'hypergeo' libraries to cross validate the solution accuracy)
Line 3,911:
{
z <- z - 1
x <- p[1] + sum(p[-1]/seq.int(z+1, z+g+1))
for (i in 1:8) {
x <- x+p[i+1]/(z+i)
}
tt <- z + g + 0.5
sqrt(2*pi) * tt^(z+0.5) * exp(-tt) * x
1

edit

Cookies help us deliver our services. By using our services, you agree to our use of cookies.