Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -0,0 +1 @@
gamma(x)

View file

@ -0,0 +1,4 @@
gamma_quad(t) = quadgk(x -> x^(t-1)*exp(-x), zero(t), inf(t), reltol=100*eps(t))[1]
# generalize to handle arrays of inputs:
@vectorize_1arg Real gamma_quad

View file

@ -0,0 +1,14 @@
julia> x = rand(10)*20
julia> (gamma_quad(x) - gamma(x)) ./ gamma(x)
10-element Array{Any,1}:
-1.64473e-16
1.30036e-16
0.0
-1.92627e-16
0.0
2.06808e-16
-1.46141e-16
1.65947e-16
0.0
0.0