public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: [PATCH, PR] Crash of Bessel functions at x==0!
       [not found]       ` <5114FB3C.5000003@oracle.com>
@ 2013-02-08 14:12         ` Ed Smith-Rowland
  0 siblings, 0 replies; 2+ messages in thread
From: Ed Smith-Rowland @ 2013-02-08 14:12 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

On 02/08/2013 08:18 AM, Paolo Carlini wrote:
> On 02/08/2013 05:09 AM, Ed Smith-Rowland wrote:
>> Here is a reworked patch...  The asyptotic stuff is removed for now.
>> Builds and tests cleanon x86_64-unknown-linux.
> Please add a:
>
>     bool test __attribute__((unused)) = true;
>
> at the beginning of test01. Also , only for consistency, a:
>
>     return 0;
>
> in the main.
>
> Ok with these changes.
>
> Thanks!
> Paolo.
>

Committed this...
PR libstdc++/56216


[-- Attachment #2: CL_specfun_tr1 --]
[-- Type: text/plain, Size: 777 bytes --]

2013-02-08  Edward Smith-Rowland  <3dw4rd@verizon.net>

	PR libstdc++/56216
	* include/tr1/special_function_util.h: Remove spurious const
	from numeric arguments.
	* include/tr1/riemann_zeta.tcc: Ditto.
	* include/tr1/exp_integral.tcc: Ditto.
	* include/tr1/bessel_function.tcc: Ditto.
	* include/tr1/hypergeometric.tcc: Ditto.
	* include/tr1/modified_bessel_func.tcc: Ditto.
	* include/tr1/poly_laguerre.tcc: Ditto.
	* include/tr1/gamma.tcc: Ditto.
	* include/tr1/legendre_function.tcc: Ditto.
	* include/tr1/poly_hermite.tcc: Ditto.
	* include/tr1/ell_integral.tcc: Ditto.
	* include/tr1/bessel_function.tcc (__cyl_bessel_ij_series):
	If argument is zero return function value.
	* testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/pr56216.cc:
	New file.

[-- Attachment #3: CL_cstring_stdexcept_ctors_6 --]
[-- Type: text/plain, Size: 549 bytes --]

2012-10-26  Edward Smith-Rowland  <3dw4rd@verizon.net>

	* include/std/system_error (system_error(error_code, const char*),
	system_error(int, const error_category&, const char*)): New.
	* include/std/stdexcept ( logic_error(const char*),
	domain_error(const char*), invalid_argument(const char*),
	length_error(const char*), out_of_range(const char*),
	runtime_error(const char*), range_error(const char*),
	overflow_error(const char*), underflow_error(const char*)): New.
	* config/abi/pre/gnu.ver: Add symbols for logic_error const char* ctors.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH, PR] Crash of Bessel functions at x==0!
       [not found]         ` <5115560E.6090405@oracle.com>
@ 2013-02-09 20:56           ` François Dumont
  0 siblings, 0 replies; 2+ messages in thread
From: François Dumont @ 2013-02-09 20:56 UTC (permalink / raw)
  To: Paolo Carlini; +Cc: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1008 bytes --]

Attached patch applied then.

2013-02-09  François Dumont  <fdumont@gcc.gnu.org>

     * include/tr1/bessel_function.tcc (__cyl_bessel_ij_series): Code
     simplification.


On 02/08/2013 08:46 PM, Paolo Carlini wrote:
> On 02/08/2013 07:08 PM, François Dumont wrote:
>> Just a small remark, in bessel_function.tcc, the following:
>>
>> +      if (__x == _Tp(0))
>> +    {
>> +          if (__nu == _Tp(0))
>> +            return _Tp(1);
>> +          else if (__nu == _Tp(1))
>> +            return _Tp(0);
>> +          else
>> +            return _Tp(0);
>> +    }
>>
>> could be simplified into
>>
>> +      if (__x == _Tp(0))
>> +        return (__nu == _Tp(0)) ? _Tp(1) : _Tp(0);
> Thanks Francois. Besides the tiny-winy specific issue, we can all 
> learn why normally unrelated changes should not be bundled together in 
> the same patch, even more so when the more substantive one is by far 
> the smaller.
>
> Anyway, change pre-approved, whoever cares to commit it.
>
> Thanks,
> Paolo.
>


[-- Attachment #2: bessel_function.patch --]
[-- Type: text/x-patch, Size: 651 bytes --]

Index: include/tr1/bessel_function.tcc
===================================================================
--- include/tr1/bessel_function.tcc	(revision 195919)
+++ include/tr1/bessel_function.tcc	(working copy)
@@ -409,14 +409,8 @@
                            unsigned int __max_iter)
     {
       if (__x == _Tp(0))
-	{
-          if (__nu == _Tp(0))
-            return _Tp(1);
-          else if (__nu == _Tp(1))
-            return _Tp(0);
-          else
-            return _Tp(0);
-	}
+	return __nu == _Tp(0) ? _Tp(1) : _Tp(0);
+
       const _Tp __x2 = __x / _Tp(2);
       _Tp __fact = __nu * std::log(__x2);
 #if _GLIBCXX_USE_C99_MATH_TR1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-02-09 20:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <511320DF.2050400@verizon.net>
     [not found] ` <511393E1.1090806@oracle.com>
     [not found]   ` <5113BDBD.2000702@verizon.net>
     [not found]     ` <51147A7F.304@verizon.net>
     [not found]       ` <5114FB3C.5000003@oracle.com>
2013-02-08 14:12         ` [PATCH, PR] Crash of Bessel functions at x==0! Ed Smith-Rowland
     [not found]       ` <51153F2F.20007@gmail.com>
     [not found]         ` <5115560E.6090405@oracle.com>
2013-02-09 20:56           ` François Dumont

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).