Computation of besselk fails in some ranges

22 views
Skip to first unread message

David Berghaus

unread,
Feb 3, 2020, 9:00:58 AM2/3/20
to nemo-devel
Hi all,

I noticed that the besselk-function does not produce any results for values in specific ranges:
julia> C = ComplexField(1024)
Complex Field with 1024 bits of precision and error bounds

julia> besselk(C(10,0),C(512,0))
[2.672472211316959679416345885557360368519328784738785586171985571723165750372712779297516989223713226050070181319926635070450843885898899589890145770563334425825233158599032325559463479296526838394854008111657913450654003857366854085030276622179793832717364922953756623560964864506924990986531286369062872458e-224 +/- 5.43e-531] + i*0

julia
> besselk(C(10,0),C(511,0))
[+/- 9.97e-88] + i*[+/- 9.97e-88]

For this specific argument of 10 the evaluation again works properly for values below 200.

Is this a known limit of the algorithm that you have implemented or is there a bug in the arb code?

Best,
David

Fredrik Johansson

unread,
Feb 6, 2020, 9:14:03 AM2/6/20
to David Berghaus, nemo-devel
Some functions switch between algorithms (typically convergent and asymptotic expansions) depending on the precision and the function arguments, and there may be ranges where the chosen algorithm doesn't work. The cutoffs should be such that, for a fixed function argument, you always get a precise result at sufficiently high precision. Indeed:

julia> C = ComplexField(2048)
Complex Field with 2048 bits of precision and error bounds

julia> besselk(C(10,0),C(511,0))
[7.273020821341838085942134079716006248677603685740815703343475360393849406397113138983655448129880380713329514474362135814581244320536267619377708988568445581752386539661e-224 +/- 2.11e-393] + i*0

This is not a strict bug as such, but it's behavior that could be improved...

Fredrik



--
You received this message because you are subscribed to the Google Groups "nemo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nemo-devel+...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/nemo-devel/acbe6ab8-c6ea-4e83-b83a-a7f711381dc0%40googlegroups.com.

David Berghaus

unread,
Feb 7, 2020, 12:33:01 PM2/7/20
to nemo-devel
Yes, I was just surprised by this very sudden cutoff and was expecting the error-bounds to increase more steadily.
I also took the approach of increasing the precision until the error-bounds are sufficient. This is however of course not very efficient from a computational perspective... Still, your bessel implementation seems to be the fastest that I found so I will stick with it.

Best,
David
To unsubscribe from this group and stop receiving emails from it, send an email to nemo-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages