It is:
julia> function poisson(x,λ=1)
if isnan(λ^x*exp(-λ)/gamma(x+1))
@show λ^x; @show exp(-λ); @show gamma(x+1)
end
return λ^x*exp(-λ)/gamma(x+1)
end
poisson (generic function with 2 methods)
julia> poisson(1871.5213495195621,2)
λ ^ x = Inf
exp(-λ) = 0.1353352832366127
gamma(x + 1) = Inf
NaN
You have Inf/Inf