Re: [PATCH, PR libstdc++/83566] - cyl_bessel_j returns wrong result for x>1000

2018-11-16 Thread Michele Pezzutti
Hi. My Copyright assignment process is complete (done in Feb 2018). Michele On 16/11/2018 18:23, Ed Smith-Rowland wrote: All, This patch has been in my queue for a while. I believe it is waiting on Copyright assignment for Michele. Is this still true? Ed

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-05-20 Thread Michele Pezzutti
Hi. This patch intends to fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83566 for issue description.     * libstdc++-v3/include/tr1/bessel_function.tcc   Series expansion in __cyl_bessel_jn_asymp() shall not

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-01-08 Thread Michele Pezzutti
  const _Tp __chi = __x - (__nu + _Tp(0.5L)) * __numeric_constants<_Tp>::__pi_2(); On 01/06/2018 10:23 AM, Paolo Carlini wrote: Hi, On 05/01/2018 23:46, Michele Pezzutti wrote: + __term *= (__k == 0) ? _Tp(1) : -(__mu - (2 * __k - 1) * (2 * __k - 1)) +  

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-01-05 Thread Michele Pezzutti
On 01/05/2018 05:50 PM, Jonathan Wakely wrote: On 05/01/18 09:54 -0500, Ed Smith-Rowland wrote: This looks good to me.  The only nit is that you have to uglify the k loop variable. Right, it needs to be __k. I'm also not sure we can put the copyright notice there, rather than at the top of

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-01-04 Thread Michele Pezzutti
); +  test(data029, toler029);    return 0;  } On 01/04/2018 09:54 PM, Michele Pezzutti wrote: On 01/04/2018 06:16 PM, Ed Smith-Rowland wrote: I've seen their implementation.  It's tight.  Feel free to port it. I assume this is it: int gsl_sf_bessel_Jnu_asympx_e(const double nu, const double x

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-01-04 Thread Michele Pezzutti
On 01/04/2018 06:16 PM, Ed Smith-Rowland wrote: On 01/03/2018 02:49 PM, Michele Pezzutti wrote: Hi. On 01/02/2018 05:43 PM, Michele Pezzutti wrote: On 01/02/2018 02:28 AM, Ed Smith-Rowland wrote: I like the patch. I have a similar one in the tr29124 branch. Anyway, I got held up and I

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-01-03 Thread Michele Pezzutti
Hi. On 01/02/2018 05:43 PM, Michele Pezzutti wrote: On 01/02/2018 02:28 AM, Ed Smith-Rowland wrote: I like the patch. I have a similar one in the tr29124 branch. Anyway, I got held up and I think it's good to have new folks looking into this. It looks good except that you need to uglify

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-01-02 Thread Michele Pezzutti
On 01/02/2018 05:59 PM, Ed Smith-Rowland wrote: OK, 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

Re: Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2018-01-02 Thread Michele Pezzutti
On 01/02/2018 02:28 AM, Ed Smith-Rowland wrote: I like the patch. I have a similar one in the tr29124 branch. Anyway, I got held up and I think it's good to have new folks looking into this. It looks good except that you need to uglify k. I looked at the GSL implementation, based on same

Fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders

2017-12-31 Thread Michele Pezzutti
Hi. This patch intends to fix Bug 83566 - cyl_bessel_j returns wrong result for x>1000 for high orders. Seehttps://gcc.gnu.org/bugzilla/show_bug.cgi?id=83566 forissue description.     * libstdc++-v3/include/tr1/bessel_function.tcc   Series expansion in __cyl_bessel_jn_asymp() shall not be

Re: [PATCH] Fix Bug 83237 - Values returned by std::poisson_distribution are not distributed correctly

2017-12-23 Thread Michele Pezzutti
is doable. Il 13.12.2017 12:51 Jonathan Wakely ha scritto: On 12/12/17 21:37 +0100, Paolo Carlini wrote: Hi, On 12/12/2017 19:42, Michele Pezzutti wrote: Hi. Yes, I looked at the text before submitting the patch. I contacted Devroye and he confirmed that another reader had also pointed out this bug

Re: [PATCH] Fix Bug 83237 - Values returned by std::poisson_distribution are not distributed correctly

2017-12-12 Thread Michele Pezzutti
stand what you mean and I would be glad to help. On 12/12/2017 01:51 AM, Paolo Carlini wrote: Hi, On 11/12/2017 23:16, Michele Pezzutti wrote: I lowered to N = 250 and still fails with a good margin. Good. At the moment however, I think we need a bit of rationale for the change that you are

Re: [PATCH] Fix Bug 83237 - Values returned by std::poisson_distribution are not distributed correctly

2017-12-11 Thread Michele Pezzutti
I lowered to N = 250 and still fails with a good margin. On 12/11/2017 09:58 PM, Michele Pezzutti wrote: I apologize as I am unable to run the test suite in its full form. Nevertheless, I locally tested the following patch for the test suite: *26_numerics/random/poisson_distribution

Re: [PATCH] Fix Bug 83237 - Values returned by std::poisson_distribution are not distributed correctly

2017-12-11 Thread Michele Pezzutti
+  std::poisson_distribution<> pd4(37.17); +  auto bpd4 = std::bind(pd4, eng); +  testDiscreteDist<100, 400>(bpd4, [](int n) { return poisson_pdf(n, 37.17); } );  } On 12/11/2017 10:52 AM, Paolo Carlini wrote: Hi, On 10/12/2017 14:47, Michele Pezzutti wrote: Hi. This patch intends to fix

[PATCH] Fix Bug 83237 - Values returned by std::poisson_distribution are not distributed correctly

2017-12-10 Thread Michele Pezzutti
Hi. This patch intends to fix Bug 83237 - Values returned by std::poisson_distribution are not distributed correctly. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83237for issue description and tests.     * include/bits/random.tcc (poisson_distribution<_IntType>::operator()): Value of