This is the mail archive of the
mailing list for the libstdc++ project.
Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders
On 01/02/2018 05:59 PM, Ed Smith-Rowland wrote:
For what I could see, 'term' stops to contributing to P, Q few steps
before k = nu /2.
on *third* look summing up to k = nu/2 at minimum will a achieve the
result of not blowing up the asymptotic series:
nu^2 - (2k-1)^2. And it will do that without a check.
This stopping criterion should work even near x=nu which would be the
most difficult case. The sum could go further for larger x but let's
just go with your termination criterion for now. Later, with some
experimentation, we could sum up to nu/2 at a minimum *then* snoop
forward until the terms start drifting up. Or we could just solve
k_max for this case as a function of x. Also, we may never need these
Thanks for doing this.
My "tests" in my work area were not actually testing this case. Bah