SpecialFunctions.jl
SpecialFunctions.jl copied to clipboard
bessely() sometimes returns bogus
I have found that bessely() with very large argument returns various results. For example,
julia> using SpecialFunctions
julia> bessely(1000.5, 7.745186719805684e8)
-1.65447992609e-312
julia> x = bessely(1000.5, 7.745186719805684e8)
1.3586779285536575e24
The assignment to x enhances the effect, though different answers are returned without assignment as well.
I am using julia-v0.6.1 on x86_64 archlinux. The effect is less severe, but also present, on my macosx machine, which is running 0.6.1-pre3. Finally, on archlinux, I've also seen it with v0.6.2-pre.2, commit 247087d94c.
Well that's odd. Any ideas, @simonbyrne?
It seems like the fortran code is returning an error code of 3, which corresponds to precision loss. My guess is that the variation is due to different values being provided in the initialised Ref objects.