This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [PATCH, PR] Crash of Bessel functions at x==0!
- From: Paolo Carlini <paolo dot carlini at oracle dot com>
- To: Ed Smith-Rowland <3dw4rd at verizon dot net>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Thu, 07 Feb 2013 12:45:37 +0100
- Subject: Re: [PATCH, PR] Crash of Bessel functions at x==0!
- References: <511320DF.2050400@verizon.net>
Hi,
On 02/07/2013 04:34 AM, Ed Smith-Rowland wrote:
All,
This patch catches cyl_bessel_i, and cyl_bessel_j returning -nan for
zero argument. Not sure how i missed that.
Anyhow, this patch cleans that up.
Also, spurious const is removed from numeric arguments of internal
functions throughout the TR1 special maths.
These two hunks look straightforward and can certainly go in now. Thanks.
Also, a better asymptotic treatment of Bessel functions is supplied.
This one worries me a bit: we don't want to introduce regressions on
some less known platform at this stage. Can we delay it to post 4.8.0?
4.8.1 would be also fine.
By the way, in general, in __cyl_bessel_jn_asymp and in other places,
something like an hardcoded 1000, without a comment, without a specific
analysis explaing why 1000 instead of 100 or 10000 is something we
should really, really, really, avoid. At minimum, if we can't do better
in terms of analyzing the behavior of each specific algorithm, those
constants should be given a name (likely bundled together in sets), be
documented in the docs to enable the users to change the values away
from the defaults.
In any case, please remove the "// { dg-do compile }" from the testcase:
we want to *run* it (the default behavior), right? Also, please try to
follow the common format, have a separate function with the tests,
called by main, definining a test variable, etc, etc.
Thanks!
Paolo.