Summary: | cyl_bessel_j returns wrong result for x>1000 for high orders. | ||
---|---|---|---|
Product: | gcc | Reporter: | Ruslan <b7.10110111> |
Component: | libstdc++ | Assignee: | Ed Smith-Rowland <emsr> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | daniel.kruegler, emsr, webrown.cpp |
Priority: | P3 | Keywords: | wrong-code |
Version: | 7.2.0 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Known to work: | ||
Known to fail: | Last reconfirmed: | 2018-01-04 00:00:00 |
Description
Ruslan
2017-12-23 23:02:05 UTC
> As n decreases, the imprecision gradually gets smaller.
To avoid confusion: this statement is for fixed x>1000.
Series expansion in __cyl_bessel_jn_asymp() shall not be truncated at the first terms. At least nu/2 terms shall be added, in order to have a guaranteed error bound. Patch proposed to mailing list. Author: emsr Date: Sun Nov 18 18:32:26 2018 New Revision: 266252 URL: https://gcc.gnu.org/viewcvs?rev=266252&root=gcc&view=rev Log: 2018-11-16 Michele Pezzutti <mpezz@tiscali.it> Edward Smith-Rowland <3dw4rd@verizon.net> PR libstdc++/83566 - cyl_bessel_j returns wrong result for x>1000 for high orders. * include/tr1/bessel_function.tcc: Perform no fewer than nu/2 iterations of the asymptotic series (nu is the Bessel order). * testsuite/tr1/5_numerical_facilities/special_functions/ 09_cyl_bessel_j/check_value.cc: Add tests at nu=100, 1000<=x<=2000. * testsuite/tr1/5_numerical_facilities/special_functions/ 11_cyl_neumann/check_value.cc: Ditto. * testsuite/special_functions/08_cyl_bessel_j/check_value.cc: Ditto. * testsuite/special_functions/10_cyl_neumann/check_value.cc: Ditto. Modified: trunk/libstdc++-v3/ChangeLog trunk/libstdc++-v3/include/tr1/bessel_function.tcc trunk/libstdc++-v3/testsuite/special_functions/08_cyl_bessel_j/check_value.cc trunk/libstdc++-v3/testsuite/special_functions/10_cyl_neumann/check_value.cc trunk/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_value.cc trunk/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_value.cc 2018-11-16 Michele Pezzutti <mpezz@tiscali.it> Edward Smith-Rowland <3dw4rd@verizon.net> PR libstdc++/83566 - cyl_bessel_j returns wrong result for x>1000 for high orders. * include/tr1/bessel_function.tcc: Perform no fewer than nu/2 iterations of the asymptotic series (nu is the Bessel order). * testsuite/tr1/5_numerical_facilities/special_functions/ 09_cyl_bessel_j/check_value.cc: Add tests at nu=100, 1000<=x<=2000. * testsuite/tr1/5_numerical_facilities/special_functions/ 11_cyl_neumann/check_value.cc: Ditto. * testsuite/special_functions/08_cyl_bessel_j/check_value.cc: Ditto. * testsuite/special_functions/10_cyl_neumann/check_value.cc: Ditto. |