Commit 2be75957 by Edward Smith-Rowland Committed by Edward Smith-Rowland

Implement TR29124 C++ special Math Functions.

2016-01-14  Edward Smith-Rowland  <3dw4rd@verizon.net>
	    Jonathan Wakely  <jwakely@redhat.com>
	    Florian Goth <CaptainSifff@gmx.de>

	Implement TR29124 C++ special Math Functions.
	* include/Makefile.am: Add new headers.
	* include/Makefile.in: Regenerate.
	* include/bits/specfun.h: New.
	* include/c_global/cmath: Adjust for both tr1 and tr29124 maths.
	* include/tr1/bessel_function.tcc: Ditto.
	* include/tr1/beta_function.tcc: Ditto.
	* include/tr1/cmath: Ditto.
	* include/tr1/ell_integral.tcc: Ditto.
	* include/tr1/exp_integral.tcc: Ditto.
	* include/tr1/gamma.tcc: Ditto.
	* include/tr1/hypergeometric.tcc: Ditto.
	* include/tr1/legendre_function.tcc: Ditto.
	* include/tr1/modified_bessel_func.tcc: Ditto.
	* include/tr1/poly_hermite.tcc: Ditto.
	* include/tr1/poly_laguerre.tcc: Ditto.
	* include/tr1/riemann_zeta.tcc: Ditto.
	* include/tr1/special_function_util.h: Ditto.
	* testsuite/ext/special_functions/conf_hyperg: New.
	* testsuite/ext/special_functions/conf_hyperg/check_nan.cc: New.
	* testsuite/ext/special_functions/conf_hyperg/check_value.cc: New.
	* testsuite/ext/special_functions/conf_hyperg/compile.cc: New.
	* testsuite/ext/special_functions/hyperg: New.
	* testsuite/ext/special_functions/hyperg/check_nan.cc: New.
	* testsuite/ext/special_functions/hyperg/check_value.cc: New.
	* testsuite/ext/special_functions/hyperg/compile.cc: New.
	* testsuite/libstdc++-dg/conformance.exp: Add special_functions directory.
	* testsuite/special_functions/01_assoc_laguerre/check_nan.cc: New.
	* testsuite/special_functions/01_assoc_laguerre/check_value.cc: New.
	* testsuite/special_functions/01_assoc_laguerre/compile.cc: New.
	* testsuite/special_functions/01_assoc_laguerre/compile_2.cc: New.
	* testsuite/special_functions/02_assoc_legendre/check_nan.cc: New.
	* testsuite/special_functions/02_assoc_legendre/check_value.cc: New.
	* testsuite/special_functions/02_assoc_legendre/compile.cc: New.
	* testsuite/special_functions/02_assoc_legendre/compile_2.cc: New.
	* testsuite/special_functions/03_beta/check_nan.cc: New.
	* testsuite/special_functions/03_beta/check_value.cc: New.
	* testsuite/special_functions/03_beta/compile.cc: New.
	* testsuite/special_functions/03_beta/compile_2.cc: New.
	* testsuite/special_functions/04_comp_ellint_1/check_nan.cc: New.
	* testsuite/special_functions/04_comp_ellint_1/check_value.cc: New.
	* testsuite/special_functions/04_comp_ellint_1/compile.cc: New.
	* testsuite/special_functions/04_comp_ellint_1/compile_2.cc: New.
	* testsuite/special_functions/05_comp_ellint_2/check_nan.cc: New.
	* testsuite/special_functions/05_comp_ellint_2/check_value.cc: New.
	* testsuite/special_functions/05_comp_ellint_2/compile.cc: New.
	* testsuite/special_functions/05_comp_ellint_2/compile_2.cc: New.
	* testsuite/special_functions/06_comp_ellint_3/check_nan.cc: New.
	* testsuite/special_functions/06_comp_ellint_3/check_value.cc: New.
	* testsuite/special_functions/06_comp_ellint_3/compile.cc: New.
	* testsuite/special_functions/06_comp_ellint_3/compile_2.cc: New.
	* testsuite/special_functions/07_cyl_bessel_i/check_nan.cc: New.
	* testsuite/special_functions/07_cyl_bessel_i/check_value.cc: New.
	* testsuite/special_functions/07_cyl_bessel_i/compile.cc: New.
	* testsuite/special_functions/07_cyl_bessel_i/compile_2.cc: New.
	* testsuite/special_functions/07_cyl_bessel_i/pr56216.cc: New.
	* testsuite/special_functions/08_cyl_bessel_j/check_nan.cc: New.
	* testsuite/special_functions/08_cyl_bessel_j/check_value.cc: New.
	* testsuite/special_functions/08_cyl_bessel_j/compile.cc: New.
	* testsuite/special_functions/08_cyl_bessel_j/compile_2.cc: New.
	* testsuite/special_functions/09_cyl_bessel_k/check_nan.cc: New.
	* testsuite/special_functions/09_cyl_bessel_k/check_value.cc: New.
	* testsuite/special_functions/09_cyl_bessel_k/compile.cc: New.
	* testsuite/special_functions/09_cyl_bessel_k/compile_2.cc: New.
	* testsuite/special_functions/10_cyl_neumann/check_nan.cc: New.
	* testsuite/special_functions/10_cyl_neumann/check_value.cc: New.
	* testsuite/special_functions/10_cyl_neumann/compile.cc: New.
	* testsuite/special_functions/10_cyl_neumann/compile_2.cc: New.
	* testsuite/special_functions/11_ellint_1/check_nan.cc: New.
	* testsuite/special_functions/11_ellint_1/check_value.cc: New.
	* testsuite/special_functions/11_ellint_1/compile.cc: New.
	* testsuite/special_functions/11_ellint_1/compile_2.cc: New.
	* testsuite/special_functions/12_ellint_2/check_nan.cc: New.
	* testsuite/special_functions/12_ellint_2/check_value.cc: New.
	* testsuite/special_functions/12_ellint_2/compile.cc: New.
	* testsuite/special_functions/12_ellint_2/compile_2.cc: New.
	* testsuite/special_functions/13_ellint_3/check_nan.cc: New.
	* testsuite/special_functions/13_ellint_3/check_value.cc: New.
	* testsuite/special_functions/13_ellint_3/compile.cc: New.
	* testsuite/special_functions/13_ellint_3/compile_2.cc: New.
	* testsuite/special_functions/14_expint/check_nan.cc: New.
	* testsuite/special_functions/14_expint/check_value.cc: New.
	* testsuite/special_functions/14_expint/compile.cc: New.
	* testsuite/special_functions/14_expint/compile_2.cc: New.
	* testsuite/special_functions/15_hermite/check_nan.cc: New.
	* testsuite/special_functions/15_hermite/check_value.cc: New.
	* testsuite/special_functions/15_hermite/compile.cc: New.
	* testsuite/special_functions/15_hermite/compile_2.cc: New.
	* testsuite/special_functions/16_laguerre/check_nan.cc: New.
	* testsuite/special_functions/16_laguerre/check_value.cc: New.
	* testsuite/special_functions/16_laguerre/compile.cc: New.
	* testsuite/special_functions/16_laguerre/compile_2.cc: New.
	* testsuite/special_functions/17_legendre/check_nan.cc: New.
	* testsuite/special_functions/17_legendre/check_value.cc: New.
	* testsuite/special_functions/17_legendre/compile.cc: New.
	* testsuite/special_functions/17_legendre/compile_2.cc: New.
	* testsuite/special_functions/18_riemann_zeta/check_nan.cc: New.
	* testsuite/special_functions/18_riemann_zeta/check_value.cc: New.
	* testsuite/special_functions/18_riemann_zeta/compile.cc: New.
	* testsuite/special_functions/18_riemann_zeta/compile_2.cc: New.
	* testsuite/special_functions/19_sph_bessel/check_nan.cc: New.
	* testsuite/special_functions/19_sph_bessel/check_value.cc: New.
	* testsuite/special_functions/19_sph_bessel/compile.cc: New.
	* testsuite/special_functions/19_sph_bessel/compile_2.cc: New.
	* testsuite/special_functions/20_sph_legendre/check_nan.cc: New.
	* testsuite/special_functions/20_sph_legendre/check_value.cc: New.
	* testsuite/special_functions/20_sph_legendre/compile.cc: New.
	* testsuite/special_functions/20_sph_legendre/compile_2.cc: New.
	* testsuite/special_functions/21_sph_neumann/check_nan.cc: New.
	* testsuite/special_functions/21_sph_neumann/check_value.cc: New.
	* testsuite/special_functions/21_sph_neumann/compile.cc: New.
	* testsuite/special_functions/21_sph_neumann/compile_2.cc: New.
	* testsuite/util/specfun_testcase.h: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_value.cc: More testcases.
	* testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_value.cc: Ditto.
	* testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_value.cc: Ditto.
	* testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_value.cc: Ditto.
	* testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_value.cc: Ditto.
	* testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_value.cc: Ditto.
	* testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/check_value.cc: New.


Co-Authored-By: Florian Goth <CaptainSifff@gmx.de>
Co-Authored-By: Jonathan Wakely <jwakely@redhat.com>

From-SVN: r232377
parent 00083992
2016-01-14 Edward Smith-Rowland <3dw4rd@verizon.net>
Jonathan Wakely <jwakely@redhat.com>
Florian Goth <CaptainSifff@gmx.de>
Implement TR29124 C++ special Math Functions.
* include/Makefile.am: Add new headers.
* include/Makefile.in: Regenerate.
* include/bits/specfun.h: New.
* include/c_global/cmath: Adjust for both tr1 and tr29124 maths.
* include/tr1/bessel_function.tcc: Ditto.
* include/tr1/beta_function.tcc: Ditto.
* include/tr1/cmath: Ditto.
* include/tr1/ell_integral.tcc: Ditto.
* include/tr1/exp_integral.tcc: Ditto.
* include/tr1/gamma.tcc: Ditto.
* include/tr1/hypergeometric.tcc: Ditto.
* include/tr1/legendre_function.tcc: Ditto.
* include/tr1/modified_bessel_func.tcc: Ditto.
* include/tr1/poly_hermite.tcc: Ditto.
* include/tr1/poly_laguerre.tcc: Ditto.
* include/tr1/riemann_zeta.tcc: Ditto.
* include/tr1/special_function_util.h: Ditto.
* testsuite/ext/special_functions/conf_hyperg: New.
* testsuite/ext/special_functions/conf_hyperg/check_nan.cc: New.
* testsuite/ext/special_functions/conf_hyperg/check_value.cc: New.
* testsuite/ext/special_functions/conf_hyperg/compile.cc: New.
* testsuite/ext/special_functions/hyperg: New.
* testsuite/ext/special_functions/hyperg/check_nan.cc: New.
* testsuite/ext/special_functions/hyperg/check_value.cc: New.
* testsuite/ext/special_functions/hyperg/compile.cc: New.
* testsuite/libstdc++-dg/conformance.exp: Add special_functions directory.
* testsuite/special_functions/01_assoc_laguerre/check_nan.cc: New.
* testsuite/special_functions/01_assoc_laguerre/check_value.cc: New.
* testsuite/special_functions/01_assoc_laguerre/compile.cc: New.
* testsuite/special_functions/01_assoc_laguerre/compile_2.cc: New.
* testsuite/special_functions/02_assoc_legendre/check_nan.cc: New.
* testsuite/special_functions/02_assoc_legendre/check_value.cc: New.
* testsuite/special_functions/02_assoc_legendre/compile.cc: New.
* testsuite/special_functions/02_assoc_legendre/compile_2.cc: New.
* testsuite/special_functions/03_beta/check_nan.cc: New.
* testsuite/special_functions/03_beta/check_value.cc: New.
* testsuite/special_functions/03_beta/compile.cc: New.
* testsuite/special_functions/03_beta/compile_2.cc: New.
* testsuite/special_functions/04_comp_ellint_1/check_nan.cc: New.
* testsuite/special_functions/04_comp_ellint_1/check_value.cc: New.
* testsuite/special_functions/04_comp_ellint_1/compile.cc: New.
* testsuite/special_functions/04_comp_ellint_1/compile_2.cc: New.
* testsuite/special_functions/05_comp_ellint_2/check_nan.cc: New.
* testsuite/special_functions/05_comp_ellint_2/check_value.cc: New.
* testsuite/special_functions/05_comp_ellint_2/compile.cc: New.
* testsuite/special_functions/05_comp_ellint_2/compile_2.cc: New.
* testsuite/special_functions/06_comp_ellint_3/check_nan.cc: New.
* testsuite/special_functions/06_comp_ellint_3/check_value.cc: New.
* testsuite/special_functions/06_comp_ellint_3/compile.cc: New.
* testsuite/special_functions/06_comp_ellint_3/compile_2.cc: New.
* testsuite/special_functions/07_cyl_bessel_i/check_nan.cc: New.
* testsuite/special_functions/07_cyl_bessel_i/check_value.cc: New.
* testsuite/special_functions/07_cyl_bessel_i/compile.cc: New.
* testsuite/special_functions/07_cyl_bessel_i/compile_2.cc: New.
* testsuite/special_functions/07_cyl_bessel_i/pr56216.cc: New.
* testsuite/special_functions/08_cyl_bessel_j/check_nan.cc: New.
* testsuite/special_functions/08_cyl_bessel_j/check_value.cc: New.
* testsuite/special_functions/08_cyl_bessel_j/compile.cc: New.
* testsuite/special_functions/08_cyl_bessel_j/compile_2.cc: New.
* testsuite/special_functions/09_cyl_bessel_k/check_nan.cc: New.
* testsuite/special_functions/09_cyl_bessel_k/check_value.cc: New.
* testsuite/special_functions/09_cyl_bessel_k/compile.cc: New.
* testsuite/special_functions/09_cyl_bessel_k/compile_2.cc: New.
* testsuite/special_functions/10_cyl_neumann/check_nan.cc: New.
* testsuite/special_functions/10_cyl_neumann/check_value.cc: New.
* testsuite/special_functions/10_cyl_neumann/compile.cc: New.
* testsuite/special_functions/10_cyl_neumann/compile_2.cc: New.
* testsuite/special_functions/11_ellint_1/check_nan.cc: New.
* testsuite/special_functions/11_ellint_1/check_value.cc: New.
* testsuite/special_functions/11_ellint_1/compile.cc: New.
* testsuite/special_functions/11_ellint_1/compile_2.cc: New.
* testsuite/special_functions/12_ellint_2/check_nan.cc: New.
* testsuite/special_functions/12_ellint_2/check_value.cc: New.
* testsuite/special_functions/12_ellint_2/compile.cc: New.
* testsuite/special_functions/12_ellint_2/compile_2.cc: New.
* testsuite/special_functions/13_ellint_3/check_nan.cc: New.
* testsuite/special_functions/13_ellint_3/check_value.cc: New.
* testsuite/special_functions/13_ellint_3/compile.cc: New.
* testsuite/special_functions/13_ellint_3/compile_2.cc: New.
* testsuite/special_functions/14_expint/check_nan.cc: New.
* testsuite/special_functions/14_expint/check_value.cc: New.
* testsuite/special_functions/14_expint/compile.cc: New.
* testsuite/special_functions/14_expint/compile_2.cc: New.
* testsuite/special_functions/15_hermite/check_nan.cc: New.
* testsuite/special_functions/15_hermite/check_value.cc: New.
* testsuite/special_functions/15_hermite/compile.cc: New.
* testsuite/special_functions/15_hermite/compile_2.cc: New.
* testsuite/special_functions/16_laguerre/check_nan.cc: New.
* testsuite/special_functions/16_laguerre/check_value.cc: New.
* testsuite/special_functions/16_laguerre/compile.cc: New.
* testsuite/special_functions/16_laguerre/compile_2.cc: New.
* testsuite/special_functions/17_legendre/check_nan.cc: New.
* testsuite/special_functions/17_legendre/check_value.cc: New.
* testsuite/special_functions/17_legendre/compile.cc: New.
* testsuite/special_functions/17_legendre/compile_2.cc: New.
* testsuite/special_functions/18_riemann_zeta/check_nan.cc: New.
* testsuite/special_functions/18_riemann_zeta/check_value.cc: New.
* testsuite/special_functions/18_riemann_zeta/compile.cc: New.
* testsuite/special_functions/18_riemann_zeta/compile_2.cc: New.
* testsuite/special_functions/19_sph_bessel/check_nan.cc: New.
* testsuite/special_functions/19_sph_bessel/check_value.cc: New.
* testsuite/special_functions/19_sph_bessel/compile.cc: New.
* testsuite/special_functions/19_sph_bessel/compile_2.cc: New.
* testsuite/special_functions/20_sph_legendre/check_nan.cc: New.
* testsuite/special_functions/20_sph_legendre/check_value.cc: New.
* testsuite/special_functions/20_sph_legendre/compile.cc: New.
* testsuite/special_functions/20_sph_legendre/compile_2.cc: New.
* testsuite/special_functions/21_sph_neumann/check_nan.cc: New.
* testsuite/special_functions/21_sph_neumann/check_value.cc: New.
* testsuite/special_functions/21_sph_neumann/compile.cc: New.
* testsuite/special_functions/21_sph_neumann/compile_2.cc: New.
* testsuite/util/specfun_testcase.h: New.
* testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_value.cc: More testcases.
* testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_value.cc: Ditto.
* testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_value.cc: Ditto.
* testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_value.cc: Ditto.
* testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_value.cc: Ditto.
* testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_value.cc: Ditto.
* testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/check_value.cc: New.
2016-01-13 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/48891
......
......@@ -120,6 +120,7 @@ bits_headers = \
${bits_srcdir}/locale_facets_nonio.tcc \
${bits_srcdir}/localefwd.h \
${bits_srcdir}/mask_array.h \
${bits_srcdir}/specfun.h \
${bits_srcdir}/memoryfwd.h \
${bits_srcdir}/move.h \
${bits_srcdir}/std_mutex.h \
......
......@@ -410,6 +410,7 @@ bits_headers = \
${bits_srcdir}/locale_facets_nonio.tcc \
${bits_srcdir}/localefwd.h \
${bits_srcdir}/mask_array.h \
${bits_srcdir}/specfun.h \
${bits_srcdir}/memoryfwd.h \
${bits_srcdir}/move.h \
${bits_srcdir}/std_mutex.h \
......
......@@ -1784,4 +1784,8 @@ _GLIBCXX_END_NAMESPACE_VERSION
#endif // C++11
#if __STDCPP_WANT_MATH_SPEC_FUNCS__ == 1
# include <bits/specfun.h>
#endif
#endif
// C++ includes used for precompiling extensions -*- C++ -*-
// Copyright (C) 2006-2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
// Under Section 7 of GPL version 3, you are granted additional
// permissions described in the GCC Runtime Library Exception, version
// 3.1, as published by the Free Software Foundation.
// You should have received a copy of the GNU General Public License and
// a copy of the GCC Runtime Library Exception along with this program;
// see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
// <http://www.gnu.org/licenses/>.
/** @file expc++.h
* This is an implementation file for a precompiled header.
*/
#if __cplusplus < 201103L
#include <bits/extc++.h>
#endif
#if __cplusplus > 201103L
#include <experimental/algorithm>
#include <experimental/any>
#include <experimental/chrono>
#include <experimental/deque>
#include <experimental/filesystem>
#include <experimental/forward_list>
#include <experimental/functional>
#include <experimental/iterator>
#include <experimental/list>
#include <experimental/map>
#include <experimental/memory>
#include <experimental/numeric>
#include <experimental/optional>
#include <experimental/ratio>
#include <experimental/set>
#include <experimental/string>
#include <experimental/string_view>
#include <experimental/system_error>
#include <experimental/tuple>
#include <experimental/type_traits>
#include <experimental/unordered_map>
#include <experimental/unordered_set>
#include <experimental/vector>
#endif
......@@ -50,8 +50,15 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
# define _GLIBCXX_MATH_NS ::std::tr1
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
// [5.2] Special functions
// Implementation-space details.
......@@ -90,8 +97,8 @@ namespace tr1
_Tp & __gam1, _Tp & __gam2, _Tp & __gampl, _Tp & __gammi)
{
#if _GLIBCXX_USE_C99_MATH_TR1
__gampl = _Tp(1) / std::tr1::tgamma(_Tp(1) + __mu);
__gammi = _Tp(1) / std::tr1::tgamma(_Tp(1) - __mu);
__gampl = _Tp(1) / _GLIBCXX_MATH_NS::tgamma(_Tp(1) + __mu);
__gammi = _Tp(1) / _GLIBCXX_MATH_NS::tgamma(_Tp(1) - __mu);
#else
__gampl = _Tp(1) / __gamma(_Tp(1) + __mu);
__gammi = _Tp(1) / __gamma(_Tp(1) - __mu);
......@@ -306,7 +313,7 @@ namespace tr1
const _Tp __gam = (__p - __f) / __q;
__Jmu = std::sqrt(__w / ((__p - __f) * __gam + __q));
#if _GLIBCXX_USE_C99_MATH_TR1
__Jmu = std::tr1::copysign(__Jmu, __Jnul);
__Jmu = _GLIBCXX_MATH_NS::copysign(__Jmu, __Jnul);
#else
if (__Jmu * __Jnul < _Tp(0))
__Jmu = -__Jmu;
......@@ -414,7 +421,7 @@ namespace tr1
const _Tp __x2 = __x / _Tp(2);
_Tp __fact = __nu * std::log(__x2);
#if _GLIBCXX_USE_C99_MATH_TR1
__fact -= std::tr1::lgamma(__nu + _Tp(1));
__fact -= _GLIBCXX_MATH_NS::lgamma(__nu + _Tp(1));
#else
__fact -= __log_gamma(__nu + _Tp(1));
#endif
......@@ -621,8 +628,11 @@ namespace tr1
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std::tr1::__detail
}
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
}
#endif // _GLIBCXX_TR1_BESSEL_FUNCTION_TCC
......@@ -48,8 +48,15 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
# define _GLIBCXX_MATH_NS ::std::tr1
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
// [5.2] Special functions
// Implementation-space details.
......@@ -78,15 +85,15 @@ namespace tr1
#if _GLIBCXX_USE_C99_MATH_TR1
if (__x > __y)
{
__bet = std::tr1::tgamma(__x)
/ std::tr1::tgamma(__x + __y);
__bet *= std::tr1::tgamma(__y);
__bet = _GLIBCXX_MATH_NS::tgamma(__x)
/ _GLIBCXX_MATH_NS::tgamma(__x + __y);
__bet *= _GLIBCXX_MATH_NS::tgamma(__y);
}
else
{
__bet = std::tr1::tgamma(__y)
/ std::tr1::tgamma(__x + __y);
__bet *= std::tr1::tgamma(__x);
__bet = _GLIBCXX_MATH_NS::tgamma(__y)
/ _GLIBCXX_MATH_NS::tgamma(__x + __y);
__bet *= _GLIBCXX_MATH_NS::tgamma(__x);
}
#else
if (__x > __y)
......@@ -122,9 +129,9 @@ namespace tr1
__beta_lgamma(_Tp __x, _Tp __y)
{
#if _GLIBCXX_USE_C99_MATH_TR1
_Tp __bet = std::tr1::lgamma(__x)
+ std::tr1::lgamma(__y)
- std::tr1::lgamma(__x + __y);
_Tp __bet = _GLIBCXX_MATH_NS::lgamma(__x)
+ _GLIBCXX_MATH_NS::lgamma(__y)
- _GLIBCXX_MATH_NS::lgamma(__x + __y);
#else
_Tp __bet = __log_gamma(__x)
+ __log_gamma(__y)
......@@ -190,8 +197,11 @@ namespace tr1
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std::tr1::__detail
}
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
}
#endif // _GLIBCXX_TR1_BETA_FUNCTION_TCC
......@@ -1086,6 +1086,121 @@ _GLIBCXX_END_NAMESPACE_VERSION
}
}
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
namespace std _GLIBCXX_VISIBILITY(default)
{
namespace tr1
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
/**
* @defgroup tr1_math_spec_func Mathematical Special Functions
* @ingroup numerics
*
* A collection of advanced mathematical special functions.
* @{
*/
using std::assoc_laguerref;
using std::assoc_laguerrel;
using std::assoc_laguerre;
using std::assoc_legendref;
using std::assoc_legendrel;
using std::assoc_legendre;
using std::betaf;
using std::betal;
using std::beta;
using std::comp_ellint_1f;
using std::comp_ellint_1l;
using std::comp_ellint_1;
using std::comp_ellint_2f;
using std::comp_ellint_2l;
using std::comp_ellint_2;
using std::comp_ellint_3f;
using std::comp_ellint_3l;
using std::comp_ellint_3;
using __gnu_cxx::conf_hypergf;
using __gnu_cxx::conf_hypergl;
using __gnu_cxx::conf_hyperg;
using std::cyl_bessel_if;
using std::cyl_bessel_il;
using std::cyl_bessel_i;
using std::cyl_bessel_jf;
using std::cyl_bessel_jl;
using std::cyl_bessel_j;
using std::cyl_bessel_kf;
using std::cyl_bessel_kl;
using std::cyl_bessel_k;
using std::cyl_neumannf;
using std::cyl_neumannl;
using std::cyl_neumann;
using std::ellint_1f;
using std::ellint_1l;
using std::ellint_1;
using std::ellint_2f;
using std::ellint_2l;
using std::ellint_2;
using std::ellint_3f;
using std::ellint_3l;
using std::ellint_3;
using std::expintf;
using std::expintl;
using std::expint;
using std::hermitef;
using std::hermitel;
using std::hermite;
using __gnu_cxx::hypergf;
using __gnu_cxx::hypergl;
using __gnu_cxx::hyperg;
using std::laguerref;
using std::laguerrel;
using std::laguerre;
using std::legendref;
using std::legendrel;
using std::legendre;
using std::riemann_zetaf;
using std::riemann_zetal;
using std::riemann_zeta;
using std::sph_besself;
using std::sph_bessell;
using std::sph_bessel;
using std::sph_legendref;
using std::sph_legendrel;
using std::sph_legendre;
using std::sph_neumannf;
using std::sph_neumannl;
using std::sph_neumann;
/* @} */ // tr1_math_spec_func
_GLIBCXX_END_NAMESPACE_VERSION
}
}
#else // ! __STDCPP_WANT_MATH_SPEC_FUNCS__
#include <bits/stl_algobase.h>
#include <limits>
#include <tr1/type_traits>
......@@ -1513,5 +1628,6 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX_END_NAMESPACE_VERSION
}
}
#endif // __STDCPP_WANT_MATH_SPEC_FUNCS__
#endif // _GLIBCXX_TR1_CMATH
......@@ -44,8 +44,13 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
// [5.2] Special functions
// Implementation-space details.
......@@ -742,8 +747,10 @@ namespace tr1
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std::tr1::__detail
}
} // namespace __detail
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
}
#endif // _GLIBCXX_TR1_ELL_INTEGRAL_TCC
......
......@@ -49,8 +49,13 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
// [5.2] Special functions
// Implementation-space details.
......@@ -519,8 +524,10 @@ namespace tr1
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std::tr1::__detail
}
} // namespace __detail
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
}
#endif // _GLIBCXX_TR1_EXP_INTEGRAL_TCC
......@@ -46,12 +46,19 @@
#ifndef _GLIBCXX_TR1_GAMMA_TCC
#define _GLIBCXX_TR1_GAMMA_TCC 1
#include "special_function_util.h"
#include <tr1/special_function_util.h>
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
# define _GLIBCXX_MATH_NS ::std::tr1
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
// Implementation-space details.
namespace __detail
{
......@@ -282,9 +289,9 @@ namespace tr1
= std::numeric_limits<_Tp>::max_exponent10
* std::log(_Tp(10)) - _Tp(1);
#if _GLIBCXX_USE_C99_MATH_TR1
_Tp __coeff = std::tr1::lgamma(_Tp(1 + __n))
- std::tr1::lgamma(_Tp(1 + __k))
- std::tr1::lgamma(_Tp(1 + __n - __k));
_Tp __coeff = _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __n))
- _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __k))
- _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __n - __k));
#else
_Tp __coeff = __log_gamma(_Tp(1 + __n))
- __log_gamma(_Tp(1 + __k))
......@@ -449,7 +456,7 @@ namespace tr1
{
const _Tp __hzeta = __hurwitz_zeta(_Tp(__n + 1), __x);
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __ln_nfact = std::tr1::lgamma(_Tp(__n + 1));
const _Tp __ln_nfact = _GLIBCXX_MATH_NS::lgamma(_Tp(__n + 1));
#else
const _Tp __ln_nfact = __log_gamma(_Tp(__n + 1));
#endif
......@@ -461,9 +468,12 @@ namespace tr1
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std::tr1::__detail
}
}
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
} // namespace std
#endif // _GLIBCXX_TR1_GAMMA_TCC
......@@ -43,8 +43,15 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
# define _GLIBCXX_MATH_NS ::std::tr1
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
// [5.2] Special functions
// Implementation-space details.
......@@ -222,7 +229,7 @@ namespace tr1
__conf_hyperg(_Tp __a, _Tp __c, _Tp __x)
{
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __c_nint = std::tr1::nearbyint(__c);
const _Tp __c_nint = _GLIBCXX_MATH_NS::nearbyint(__c);
#else
const _Tp __c_nint = static_cast<int>(__c + _Tp(0.5L));
#endif
......@@ -723,9 +730,9 @@ namespace tr1
__hyperg(_Tp __a, _Tp __b, _Tp __c, _Tp __x)
{
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __a_nint = std::tr1::nearbyint(__a);
const _Tp __b_nint = std::tr1::nearbyint(__b);
const _Tp __c_nint = std::tr1::nearbyint(__c);
const _Tp __a_nint = _GLIBCXX_MATH_NS::nearbyint(__a);
const _Tp __b_nint = _GLIBCXX_MATH_NS::nearbyint(__b);
const _Tp __c_nint = _GLIBCXX_MATH_NS::nearbyint(__c);
#else
const _Tp __a_nint = static_cast<int>(__a + _Tp(0.5L));
const _Tp __b_nint = static_cast<int>(__b + _Tp(0.5L));
......@@ -768,8 +775,11 @@ namespace tr1
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std::tr1::__detail
}
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
}
#endif // _GLIBCXX_TR1_HYPERGEOMETRIC_TCC
......@@ -48,8 +48,15 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
# define _GLIBCXX_MATH_NS ::std::tr1
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
// [5.2] Special functions
// Implementation-space details.
......@@ -243,14 +250,14 @@ namespace tr1
const _Tp __sgn = ( __m % 2 == 1 ? -_Tp(1) : _Tp(1));
const _Tp __y_mp1m_factor = __x * std::sqrt(_Tp(2 * __m + 3));
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __lncirc = std::tr1::log1p(-__x * __x);
const _Tp __lncirc = _GLIBCXX_MATH_NS::log1p(-__x * __x);
#else
const _Tp __lncirc = std::log(_Tp(1) - __x * __x);
#endif
// Gamma(m+1/2) / Gamma(m)
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __lnpoch = std::tr1::lgamma(_Tp(__m + _Tp(0.5L)))
- std::tr1::lgamma(_Tp(__m));
const _Tp __lnpoch = _GLIBCXX_MATH_NS::lgamma(_Tp(__m + _Tp(0.5L)))
- _GLIBCXX_MATH_NS::lgamma(_Tp(__m));
#else
const _Tp __lnpoch = __log_gamma(_Tp(__m + _Tp(0.5L)))
- __log_gamma(_Tp(__m));
......@@ -296,8 +303,11 @@ namespace tr1
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std::tr1::__detail
}
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
}
#endif // _GLIBCXX_TR1_LEGENDRE_FUNCTION_TCC
......@@ -50,8 +50,13 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
// [5.2] Special functions
// Implementation-space details.
......@@ -427,8 +432,10 @@ namespace tr1
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std::tr1::__detail
}
} // namespace __detail
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
}
#endif // _GLIBCXX_TR1_MODIFIED_BESSEL_FUNC_TCC
......@@ -41,8 +41,13 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
// [5.2] Special functions
// Implementation-space details.
......@@ -117,8 +122,10 @@ namespace tr1
}
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std::tr1::__detail
}
} // namespace __detail
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
}
#endif // _GLIBCXX_TR1_POLY_HERMITE_TCC
......@@ -43,8 +43,15 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
# define _GLIBCXX_MATH_NS ::std::tr1
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
// [5.2] Special functions
// Implementation-space details.
......@@ -80,8 +87,8 @@ namespace tr1
* __eta * __eta * __cos2th * __sin2th;
#if _GLIBCXX_USE_C99_MATH_TR1
const _Tp __lg_b = std::tr1::lgamma(_Tp(__n) + __b);
const _Tp __lnfact = std::tr1::lgamma(_Tp(__n + 1));
const _Tp __lg_b = _GLIBCXX_MATH_NS::lgamma(_Tp(__n) + __b);
const _Tp __lnfact = _GLIBCXX_MATH_NS::lgamma(_Tp(__n + 1));
#else
const _Tp __lg_b = __log_gamma(_Tp(__n) + __b);
const _Tp __lnfact = __log_gamma(_Tp(__n + 1));
......@@ -312,8 +319,11 @@ namespace tr1
{ return __poly_laguerre<unsigned int, _Tp>(__n, 0, __x); }
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std::tr1::__detail
}
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
}
#endif // _GLIBCXX_TR1_POLY_LAGUERRE_TCC
......@@ -46,8 +46,15 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
# define _GLIBCXX_MATH_NS ::std
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
# define _GLIBCXX_MATH_NS ::std::tr1
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
// [5.2] Special functions
// Implementation-space details.
......@@ -163,7 +170,7 @@ namespace tr1
if (__s < _Tp(0))
{
#if _GLIBCXX_USE_C99_MATH_TR1
if (std::tr1::fmod(__s,_Tp(2)) == _Tp(0))
if (_GLIBCXX_MATH_NS::fmod(__s,_Tp(2)) == _Tp(0))
return _Tp(0);
else
#endif
......@@ -173,7 +180,7 @@ namespace tr1
* __numeric_constants<_Tp>::__pi(), __s)
* std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
#if _GLIBCXX_USE_C99_MATH_TR1
* std::exp(std::tr1::lgamma(_Tp(1) - __s))
* std::exp(_GLIBCXX_MATH_NS::lgamma(_Tp(1) - __s))
#else
* std::exp(__log_gamma(_Tp(1) - __s))
#endif
......@@ -192,9 +199,9 @@ namespace tr1
for (unsigned int __j = 0; __j <= __i; ++__j)
{
#if _GLIBCXX_USE_C99_MATH_TR1
_Tp __bincoeff = std::tr1::lgamma(_Tp(1 + __i))
- std::tr1::lgamma(_Tp(1 + __j))
- std::tr1::lgamma(_Tp(1 + __i - __j));
_Tp __bincoeff = _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __i))
- _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __j))
- _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __i - __j));
#else
_Tp __bincoeff = __log_gamma(_Tp(1 + __i))
- __log_gamma(_Tp(1 + __j))
......@@ -297,7 +304,7 @@ namespace tr1
__zeta *= std::pow(_Tp(2) * __numeric_constants<_Tp>::__pi(), __s)
* std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
#if _GLIBCXX_USE_C99_MATH_TR1
* std::exp(std::tr1::lgamma(_Tp(1) - __s))
* std::exp(_GLIBCXX_MATH_NS::lgamma(_Tp(1) - __s))
#else
* std::exp(__log_gamma(_Tp(1) - __s))
#endif
......@@ -320,7 +327,7 @@ namespace tr1
* __numeric_constants<_Tp>::__pi(), __s)
* std::sin(__numeric_constants<_Tp>::__pi_2() * __s)
#if _GLIBCXX_USE_C99_MATH_TR1
* std::tr1::tgamma(_Tp(1) - __s)
* _GLIBCXX_MATH_NS::tgamma(_Tp(1) - __s)
#else
* std::exp(__log_gamma(_Tp(1) - __s))
#endif
......@@ -375,9 +382,9 @@ namespace tr1
for (unsigned int __j = 0; __j <= __i; ++__j)
{
#if _GLIBCXX_USE_C99_MATH_TR1
_Tp __bincoeff = std::tr1::lgamma(_Tp(1 + __i))
- std::tr1::lgamma(_Tp(1 + __j))
- std::tr1::lgamma(_Tp(1 + __i - __j));
_Tp __bincoeff = _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __i))
- _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __j))
- _GLIBCXX_MATH_NS::lgamma(_Tp(1 + __i - __j));
#else
_Tp __bincoeff = __log_gamma(_Tp(1 + __i))
- __log_gamma(_Tp(1 + __j))
......@@ -426,8 +433,11 @@ namespace tr1
{ return __hurwitz_zeta_glob(__a, __s); }
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace std::tr1::__detail
}
} // namespace __detail
#undef _GLIBCXX_MATH_NS
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
}
#endif // _GLIBCXX_TR1_RIEMANN_ZETA_TCC
......@@ -38,8 +38,13 @@
namespace std _GLIBCXX_VISIBILITY(default)
{
#if __STDCPP_WANT_MATH_SPEC_FUNCS__
#elif defined(_GLIBCXX_TR1_CMATH)
namespace tr1
{
#else
# error do not include this header directly, use <cmath> or <tr1/cmath>
#endif
namespace __detail
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
......@@ -128,7 +133,9 @@ namespace tr1
_GLIBCXX_END_NAMESPACE_VERSION
} // namespace __detail
}
#if ! __STDCPP_WANT_MATH_SPEC_FUNCS__ && defined(_GLIBCXX_TR1_CMATH)
} // namespace tr1
#endif
}
#endif // _GLIBCXX_TR1_SPECIAL_FUNCTION_UTIL_H
......
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// conf_hyperg
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float af = std::numeric_limits<float>::quiet_NaN();
double ad = std::numeric_limits<double>::quiet_NaN();
long double al = std::numeric_limits<long double>::quiet_NaN();
float cf = 3.0F;
double cd = 3.0;
long double cl = 3.0L;
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
float a = __gnu_cxx::conf_hyperg(af, cf, xf);
float b = __gnu_cxx::conf_hypergf(af, cf, xf);
double c = __gnu_cxx::conf_hyperg(ad, cd, xd);
long double d = __gnu_cxx::conf_hyperg(al, cl, xl);
long double e = __gnu_cxx::conf_hypergl(al, cl, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test02()
{
float af = 2.0F;
double ad = 2.0;
long double al = 2.0L;
float cf = std::numeric_limits<float>::quiet_NaN();
double cd = std::numeric_limits<double>::quiet_NaN();
long double cl = std::numeric_limits<long double>::quiet_NaN();
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
float a = __gnu_cxx::conf_hyperg(af, cf, xf);
float b = __gnu_cxx::conf_hypergf(af, cf, xf);
double c = __gnu_cxx::conf_hyperg(ad, cd, xd);
long double d = __gnu_cxx::conf_hyperg(al, cl, xl);
long double e = __gnu_cxx::conf_hypergl(al, cl, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test03()
{
float af = 2.0F;
double ad = 2.0;
long double al = 2.0L;
float cf = 3.0F;
double cd = 3.0;
long double cl = 3.0L;
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
float a = __gnu_cxx::conf_hyperg(af, cf, xf);
float b = __gnu_cxx::conf_hypergf(af, cf, xf);
double c = __gnu_cxx::conf_hyperg(ad, cd, xd);
long double d = __gnu_cxx::conf_hyperg(al, cl, xl);
long double e = __gnu_cxx::conf_hypergl(al, cl, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
test02();
test03();
return 0;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// conf_hyperg
#include <cmath>
void
test01()
{
float af = 2.0F, cf = 3.0F, xf = 0.5F;
double ad = 2.0, cd = 3.0, xd = 0.5;
long double al = 2.0L, cl = 3.0L, xl = 0.5L;
__gnu_cxx::conf_hyperg(af, cf, xf);
__gnu_cxx::conf_hypergf(af, cf, xf);
__gnu_cxx::conf_hyperg(ad, cd, xd);
__gnu_cxx::conf_hyperg(al, cl, xl);
__gnu_cxx::conf_hypergl(al, cl, xl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// hyperg
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float af = std::numeric_limits<float>::quiet_NaN();
double ad = std::numeric_limits<double>::quiet_NaN();
long double al = std::numeric_limits<long double>::quiet_NaN();
float bf = 10.0F;
double bd = 10.0;
long double bl = 10.0L;
float cf = 3.0F;
double cd = 3.0;
long double cl = 3.0L;
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
float a = __gnu_cxx::hyperg(af, bf, cf, xf);
float b = __gnu_cxx::hypergf(af, bf, cf, xf);
double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test02()
{
float af = 2.0F;
double ad = 2.0;
long double al = 2.0L;
float bf = std::numeric_limits<float>::quiet_NaN();
double bd = std::numeric_limits<double>::quiet_NaN();
long double bl = std::numeric_limits<long double>::quiet_NaN();
float cf = 3.0F;
double cd = 3.0;
long double cl = 3.0L;
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
float a = __gnu_cxx::hyperg(af, bf, cf, xf);
float b = __gnu_cxx::hypergf(af, bf, cf, xf);
double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test03()
{
float af = 2.0F;
double ad = 2.0;
long double al = 2.0L;
float bf = 10.0F;
double bd = 10.0;
long double bl = 10.0L;
float cf = std::numeric_limits<float>::quiet_NaN();
double cd = std::numeric_limits<double>::quiet_NaN();
long double cl = std::numeric_limits<long double>::quiet_NaN();
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
float a = __gnu_cxx::hyperg(af, bf, cf, xf);
float b = __gnu_cxx::hypergf(af, bf, cf, xf);
double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test04()
{
float af = 2.0F;
double ad = 2.0;
long double al = 2.0L;
float bf = 10.0F;
double bd = 10.0;
long double bl = 10.0L;
float cf = 3.0F;
double cd = 3.0;
long double cl = 3.0L;
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
float a = __gnu_cxx::hyperg(af, bf, cf, xf);
float b = __gnu_cxx::hypergf(af, bf, cf, xf);
double c = __gnu_cxx::hyperg(ad, bd, cd, xd);
long double d = __gnu_cxx::hyperg(al, bl, cl, xl);
long double e = __gnu_cxx::hypergl(al, bl, cl, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
test02();
test03();
test04();
return 0;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// hyperg
#include <cmath>
void
test01()
{
float af = 2.0F, bf = 10.0F, cf = 3.0F, xf = 0.5F;
double ad = 2.0, bd = 10.0, cd = 3.0, xd = 0.5;
long double al = 2.0L, bl = 10.0L, cl = 3.0L, xl = 0.5L;
__gnu_cxx::hyperg(af, bf, cf, xf);
__gnu_cxx::hypergf(af, bf, cf, xf);
__gnu_cxx::hyperg(ad, bd, cd, xd);
__gnu_cxx::hyperg(al, bl, cl, xl);
__gnu_cxx::hypergl(al, bl, cl, xl);
return;
}
......@@ -61,6 +61,7 @@ if {[info exists tests_file] && [file exists $tests_file]} {
lappend subdirs "$srcdir/tr2"
lappend subdirs "$srcdir/decimal"
lappend subdirs "$srcdir/experimental"
lappend subdirs "$srcdir/special_functions"
verbose "subdirs are $subdirs"
# Find all the tests.
......
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.1 assoc_laguerre
#include <cmath>
#include <limits>
#include <testsuite_hooks.h>
void
test01()
{
bool test [[gnu::unused]] = true;
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
unsigned int n = 2, m = 1;
float a = std::assoc_laguerre(n, m, xf);
float b = std::assoc_laguerref(n, m, xf);
double c = std::assoc_laguerre(n, m, xd);
long double d = std::assoc_laguerre(n, m, xl);
long double e = std::assoc_laguerrel(n, m, xl);
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.1 assoc_laguerre
#include <cmath>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int n = 2, m = 1;
std::assoc_laguerre(n, m, xf);
std::assoc_laguerref(n, m, xf);
std::assoc_laguerre(n, m, xd);
std::assoc_laguerre(n, m, xl);
std::assoc_laguerrel(n, m, xl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.1 assoc_laguerre
#include <math.h>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int n = 2, m = 1;
assoc_laguerre(n, m, xf);
assoc_laguerref(n, m, xf);
assoc_laguerre(n, m, xd);
assoc_laguerre(n, m, xl);
assoc_laguerrel(n, m, xl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.2 assoc_legendre
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
unsigned int l = 2, m = 1;
float a = std::assoc_legendre(l, m, xf);
float b = std::assoc_legendref(l, m, xf);
double c = std::assoc_legendre(l, m, xd);
long double d = std::assoc_legendre(l, m, xl);
long double e = std::assoc_legendrel(l, m, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.2 assoc_legendre
#include <cmath>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int l = 2, m = 1;
std::assoc_legendre(l, m, xf);
std::assoc_legendref(l, m, xf);
std::assoc_legendre(l, m, xd);
std::assoc_legendre(l, m, xl);
std::assoc_legendrel(l, m, xl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.2 assoc_legendre
#include <math.h>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int l = 2, m = 1;
assoc_legendre(l, m, xf);
assoc_legendref(l, m, xf);
assoc_legendre(l, m, xd);
assoc_legendre(l, m, xl);
assoc_legendrel(l, m, xl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.3 beta
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
float yf = 0.0F;
double yd = 0.0;
long double yl = 0.0L;
float a = std::beta(xf, yf);
float b = std::betaf(xf, yf);
double c = std::beta(xd, yd);
long double d = std::beta(xl, yl);
long double e = std::betal(xl, yl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test02()
{
float xf = 1.0F;
double xd = 1.0;
long double xl = 1.0L;
float yf = std::numeric_limits<float>::quiet_NaN();
double yd = std::numeric_limits<double>::quiet_NaN();
long double yl = std::numeric_limits<long double>::quiet_NaN();
float a = std::beta(xf, yf);
float b = std::betaf(xf, yf);
double c = std::beta(xd, yd);
long double d = std::beta(xl, yl);
long double e = std::betal(xl, yl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.3 beta
#include <cmath>
void
test01()
{
float xf = 0.5F, yf = 0.5F;
double xd = 0.5, yd = 0.5;
long double xl = 0.5L, yl = 0.5L;
std::beta(xf, yf);
std::betaf(xf, yf);
std::beta(xd, yd);
std::beta(xl, yl);
std::betal(xl, yl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.3 beta
#include <math.h>
void
test01()
{
float xf = 0.5F, yf = 0.5F;
double xd = 0.5, yd = 0.5;
long double xl = 0.5L, yl = 0.5L;
beta(xf, yf);
betaf(xf, yf);
beta(xd, yd);
beta(xl, yl);
betal(xl, yl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.4 comp_ellint_1
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float kf = std::numeric_limits<float>::quiet_NaN();
double kd = std::numeric_limits<double>::quiet_NaN();
long double kl = std::numeric_limits<long double>::quiet_NaN();
float a = std::comp_ellint_1(kf);
float b = std::comp_ellint_1f(kf);
double c = std::comp_ellint_1(kd);
long double d = std::comp_ellint_1(kl);
long double e = std::comp_ellint_1l(kl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
//
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// comp_ellint_1
// Compare against values generated by the GNU Scientific Library.
// The GSL can be found on the web: http://www.gnu.org/software/gsl/
#include <limits>
#include <cmath>
#if defined(__TEST_DEBUG)
# include <iostream>
# define VERIFY(A) \
if (!(A)) \
{ \
std::cout << "line " << __LINE__ \
<< " max_abs_frac = " << max_abs_frac \
<< std::endl; \
}
#else
# include <testsuite_hooks.h>
#endif
#include <specfun_testcase.h>
// Test data.
// max(|f - f_GSL|): 6.6613381477509392e-16
// max(|f - f_GSL| / |f_GSL|): 4.0617918857203532e-16
const testcase_comp_ellint_1<double>
data001[19] =
{
{ 2.2805491384227703, -0.90000000000000002 },
{ 1.9953027776647296, -0.80000000000000004 },
{ 1.8456939983747236, -0.69999999999999996 },
{ 1.7507538029157526, -0.59999999999999998 },
{ 1.6857503548125963, -0.50000000000000000 },
{ 1.6399998658645112, -0.40000000000000002 },
{ 1.6080486199305128, -0.30000000000000004 },
{ 1.5868678474541660, -0.19999999999999996 },
{ 1.5747455615173562, -0.099999999999999978 },
{ 1.5707963267948966, 0.0000000000000000 },
{ 1.5747455615173562, 0.10000000000000009 },
{ 1.5868678474541660, 0.19999999999999996 },
{ 1.6080486199305128, 0.30000000000000004 },
{ 1.6399998658645112, 0.39999999999999991 },
{ 1.6857503548125963, 0.50000000000000000 },
{ 1.7507538029157526, 0.60000000000000009 },
{ 1.8456939983747236, 0.69999999999999996 },
{ 1.9953027776647296, 0.80000000000000004 },
{ 2.2805491384227703, 0.89999999999999991 },
};
const double toler001 = 2.5000000000000020e-13;
template<typename Tp, unsigned int Num>
void
test(const testcase_comp_ellint_1<Tp> (&data)[Num], Tp toler)
{
bool test __attribute__((unused)) = true;
const Tp eps = std::numeric_limits<Tp>::epsilon();
Tp max_abs_diff = -Tp(1);
Tp max_abs_frac = -Tp(1);
unsigned int num_datum = Num;
for (unsigned int i = 0; i < num_datum; ++i)
{
const Tp f = std::comp_ellint_1(data[i].k);
const Tp f0 = data[i].f0;
const Tp diff = f - f0;
if (std::abs(diff) > max_abs_diff)
max_abs_diff = std::abs(diff);
if (std::abs(f0) > Tp(10) * eps
&& std::abs(f) > Tp(10) * eps)
{
const Tp frac = diff / f0;
if (std::abs(frac) > max_abs_frac)
max_abs_frac = std::abs(frac);
}
}
VERIFY(max_abs_frac < toler);
}
int
main()
{
test(data001, toler001);
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.4 comp_ellint_1
#include <cmath>
void
test01()
{
float kf = 0.5F;
double kd = 0.5;
long double kl = 0.5L;
std::comp_ellint_1(kf);
std::comp_ellint_1f(kf);
std::comp_ellint_1(kd);
std::comp_ellint_1(kl);
std::comp_ellint_1l(kl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.4 comp_ellint_1
#include <math.h>
void
test01()
{
float kf = 0.5F;
double kd = 0.5;
long double kl = 0.5L;
comp_ellint_1(kf);
comp_ellint_1f(kf);
comp_ellint_1(kd);
comp_ellint_1(kl);
comp_ellint_1l(kl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.5 comp_ellint_2
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float kf = std::numeric_limits<float>::quiet_NaN();
double kd = std::numeric_limits<double>::quiet_NaN();
long double kl = std::numeric_limits<long double>::quiet_NaN();
float a = std::comp_ellint_2(kf);
float b = std::comp_ellint_2f(kf);
double c = std::comp_ellint_2(kd);
long double d = std::comp_ellint_2(kl);
long double e = std::comp_ellint_2l(kl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
//
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// comp_ellint_2
// Compare against values generated by the GNU Scientific Library.
// The GSL can be found on the web: http://www.gnu.org/software/gsl/
#include <limits>
#include <cmath>
#if defined(__TEST_DEBUG)
# include <iostream>
# define VERIFY(A) \
if (!(A)) \
{ \
std::cout << "line " << __LINE__ \
<< " max_abs_frac = " << max_abs_frac \
<< std::endl; \
}
#else
# include <testsuite_hooks.h>
#endif
#include <specfun_testcase.h>
// Test data.
// max(|f - f_GSL|): 6.6613381477509392e-16
// max(|f - f_GSL| / |f_GSL|): 4.4233707954398090e-16
const testcase_comp_ellint_2<double>
data001[19] =
{
{ 1.1716970527816140, -0.90000000000000002 },
{ 1.2763499431699064, -0.80000000000000004 },
{ 1.3556611355719554, -0.69999999999999996 },
{ 1.4180833944487241, -0.59999999999999998 },
{ 1.4674622093394274, -0.50000000000000000 },
{ 1.5059416123600402, -0.40000000000000002 },
{ 1.5348334649232491, -0.30000000000000004 },
{ 1.5549685462425291, -0.19999999999999996 },
{ 1.5668619420216685, -0.099999999999999978 },
{ 1.5707963267948966, 0.0000000000000000 },
{ 1.5668619420216685, 0.10000000000000009 },
{ 1.5549685462425291, 0.19999999999999996 },
{ 1.5348334649232491, 0.30000000000000004 },
{ 1.5059416123600404, 0.39999999999999991 },
{ 1.4674622093394274, 0.50000000000000000 },
{ 1.4180833944487241, 0.60000000000000009 },
{ 1.3556611355719554, 0.69999999999999996 },
{ 1.2763499431699064, 0.80000000000000004 },
{ 1.1716970527816144, 0.89999999999999991 },
};
const double toler001 = 2.5000000000000020e-13;
template<typename Tp, unsigned int Num>
void
test(const testcase_comp_ellint_2<Tp> (&data)[Num], Tp toler)
{
bool test __attribute__((unused)) = true;
const Tp eps = std::numeric_limits<Tp>::epsilon();
Tp max_abs_diff = -Tp(1);
Tp max_abs_frac = -Tp(1);
unsigned int num_datum = Num;
for (unsigned int i = 0; i < num_datum; ++i)
{
const Tp f = std::comp_ellint_2(data[i].k);
const Tp f0 = data[i].f0;
const Tp diff = f - f0;
if (std::abs(diff) > max_abs_diff)
max_abs_diff = std::abs(diff);
if (std::abs(f0) > Tp(10) * eps
&& std::abs(f) > Tp(10) * eps)
{
const Tp frac = diff / f0;
if (std::abs(frac) > max_abs_frac)
max_abs_frac = std::abs(frac);
}
}
VERIFY(max_abs_frac < toler);
}
int
main()
{
test(data001, toler001);
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.5 comp_ellint_2
#include <cmath>
void
test01()
{
float kf = 0.5F;
double kd = 0.5;
long double kl = 0.5L;
std::comp_ellint_2(kf);
std::comp_ellint_2f(kf);
std::comp_ellint_2(kd);
std::comp_ellint_2(kl);
std::comp_ellint_2l(kl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.5 comp_ellint_2
#include <math.h>
void
test01()
{
float kf = 0.5F;
double kd = 0.5;
long double kl = 0.5L;
comp_ellint_2(kf);
comp_ellint_2f(kf);
comp_ellint_2(kd);
comp_ellint_2(kl);
comp_ellint_2l(kl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.6 comp_ellint_3
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float kf = std::numeric_limits<float>::quiet_NaN();
double kd = std::numeric_limits<double>::quiet_NaN();
long double kl = std::numeric_limits<long double>::quiet_NaN();
float nuf = 0.0F;
double nud = 0.0;
long double nul = 0.0L;
float a = std::comp_ellint_3(kf, nuf);
float b = std::comp_ellint_3f(kf, nuf);
double c = std::comp_ellint_3(kd, nud);
long double d = std::comp_ellint_3(kl, nul);
long double e = std::comp_ellint_3l(kl, nul);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test02()
{
float kf = 1.0F;
double kd = 1.0;
long double kl = 1.0L;
float nuf = std::numeric_limits<float>::quiet_NaN();
double nud = std::numeric_limits<double>::quiet_NaN();
long double nul = std::numeric_limits<long double>::quiet_NaN();
float a = std::comp_ellint_3(kf, nuf);
float b = std::comp_ellint_3f(kf, nuf);
double c = std::comp_ellint_3(kd, nud);
long double d = std::comp_ellint_3(kl, nul);
long double e = std::comp_ellint_3l(kl, nul);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.6 comp_ellint_3
#include <cmath>
void
test01()
{
float kf = 0.5F, nuf = 0.5F;
double kd = 0.5, nud = 0.5;
long double kl = 0.5L, nul = 0.5L;
std::comp_ellint_3(kf, nuf);
std::comp_ellint_3f(kf, nuf);
std::comp_ellint_3(kd, nud);
std::comp_ellint_3(kl, nul);
std::comp_ellint_3l(kl, nul);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.6 comp_ellint_3
#include <math.h>
void
test01()
{
float kf = 0.5F, nuf = 0.5F;
double kd = 0.5, nud = 0.5;
long double kl = 0.5L, nul = 0.5L;
comp_ellint_3(kf, nuf);
comp_ellint_3f(kf, nuf);
comp_ellint_3(kd, nud);
comp_ellint_3(kl, nul);
comp_ellint_3l(kl, nul);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.7 cyl_bessel_i
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
float nuf = 0.0F;
double nud = 0.0;
long double nul = 0.0L;
float a = std::cyl_bessel_i(nuf, xf);
float b = std::cyl_bessel_if(nuf, xf);
double c = std::cyl_bessel_i(nud, xd);
long double d = std::cyl_bessel_i(nul, xl);
long double e = std::cyl_bessel_il(nul, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test02()
{
float xf = 1.0F;
double xd = 1.0;
long double xl = 1.0L;
float nuf = std::numeric_limits<float>::quiet_NaN();
double nud = std::numeric_limits<double>::quiet_NaN();
long double nul = std::numeric_limits<long double>::quiet_NaN();
float a = std::cyl_bessel_i(nuf, xf);
float b = std::cyl_bessel_if(nuf, xf);
double c = std::cyl_bessel_i(nud, xd);
long double d = std::cyl_bessel_i(nul, xl);
long double e = std::cyl_bessel_il(nul, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.7 cyl_bessel_i
#include <cmath>
void
test01()
{
float nuf = 1.0F / 3.0F, xf = 0.5F;
double nud = 1.0 / 3.0, xd = 0.5;
long double nul = 1.0L / 3.0L, xl = 0.5L;
std::cyl_bessel_i(nuf, xf);
std::cyl_bessel_if(nuf, xf);
std::cyl_bessel_i(nud, xd);
std::cyl_bessel_i(nul, xl);
std::cyl_bessel_il(nul, xl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.7 cyl_bessel_i
#include <math.h>
void
test01()
{
float nuf = 1.0F / 3.0F, xf = 0.5F;
double nud = 1.0 / 3.0, xd = 0.5;
long double nul = 1.0L / 3.0L, xl = 0.5L;
cyl_bessel_i(nuf, xf);
cyl_bessel_if(nuf, xf);
cyl_bessel_i(nud, xd);
cyl_bessel_i(nul, xl);
cyl_bessel_il(nul, xl);
return;
}
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// PR libstdc++/56216 - Crash of Bessel functions at x==0!
#include <testsuite_hooks.h>
#include <cmath>
void
test01()
{
double j0 = std::cyl_bessel_j(0.0, 0.0);
double i0 = std::cyl_bessel_i(0.0, 0.0);
double j1 = std::cyl_bessel_j(1.0, 0.0);
double i1 = std::cyl_bessel_i(1.0, 0.0);
bool test [[gnu::unused]] = true;
VERIFY(j0 == 1.0);
VERIFY(i0 == 1.0);
VERIFY(j1 == 0.0);
VERIFY(i1 == 0.0);
}
int
main()
{
test01();
return 0;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.8 cyl_bessel_j
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
float nuf = 0.0F;
double nud = 0.0;
long double nul = 0.0L;
float a = std::cyl_bessel_j(nuf, xf);
float b = std::cyl_bessel_jf(nuf, xf);
double c = std::cyl_bessel_j(nud, xd);
long double d = std::cyl_bessel_j(nul, xl);
long double e = std::cyl_bessel_jl(nul, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test02()
{
float xf = 1.0F;
double xd = 1.0;
long double xl = 1.0L;
float nuf = std::numeric_limits<float>::quiet_NaN();
double nud = std::numeric_limits<double>::quiet_NaN();
long double nul = std::numeric_limits<long double>::quiet_NaN();
float a = std::cyl_bessel_j(nuf, xf);
float b = std::cyl_bessel_jf(nuf, xf);
double c = std::cyl_bessel_j(nud, xd);
long double d = std::cyl_bessel_j(nul, xl);
long double e = std::cyl_bessel_jl(nul, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.8 cyl_bessel_j
#include <cmath>
void
test01()
{
float nuf = 1.0F / 3.0F, xf = 0.5F;
double nud = 1.0 / 3.0, xd = 0.5;
long double nul = 1.0L / 3.0L, xl = 0.5L;
std::cyl_bessel_j(nuf, xf);
std::cyl_bessel_jf(nuf, xf);
std::cyl_bessel_j(nud, xd);
std::cyl_bessel_j(nul, xl);
std::cyl_bessel_jl(nul, xl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.8 cyl_bessel_j
#include <math.h>
void
test01()
{
float nuf = 1.0F / 3.0F, xf = 0.5F;
double nud = 1.0 / 3.0, xd = 0.5;
long double nul = 1.0L / 3.0L, xl = 0.5L;
cyl_bessel_j(nuf, xf);
cyl_bessel_jf(nuf, xf);
cyl_bessel_j(nud, xd);
cyl_bessel_j(nul, xl);
cyl_bessel_jl(nul, xl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.9 cyl_bessel_k
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
float nuf = 0.0F;
double nud = 0.0;
long double nul = 0.0L;
float a = std::cyl_bessel_k(nuf, xf);
float b = std::cyl_bessel_kf(nuf, xf);
double c = std::cyl_bessel_k(nud, xd);
long double d = std::cyl_bessel_k(nul, xl);
long double e = std::cyl_bessel_kl(nul, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test02()
{
float xf = 1.0F;
double xd = 1.0;
long double xl = 1.0L;
float nuf = std::numeric_limits<float>::quiet_NaN();
double nud = std::numeric_limits<double>::quiet_NaN();
long double nul = std::numeric_limits<long double>::quiet_NaN();
float a = std::cyl_bessel_k(nuf, xf);
float b = std::cyl_bessel_kf(nuf, xf);
double c = std::cyl_bessel_k(nud, xd);
long double d = std::cyl_bessel_k(nul, xl);
long double e = std::cyl_bessel_kl(nul, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.9 cyl_bessel_k
#include <cmath>
void
test01()
{
float nuf = 1.0F / 3.0F, xf = 0.5F;
double nud = 1.0 / 3.0, xd = 0.5;
long double nul = 1.0L / 3.0L, xl = 0.5L;
std::cyl_bessel_k(nuf, xf);
std::cyl_bessel_kf(nuf, xf);
std::cyl_bessel_k(nud, xd);
std::cyl_bessel_k(nul, xl);
std::cyl_bessel_kl(nul, xl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.9 cyl_bessel_k
#include <math.h>
void
test01()
{
float nuf = 1.0F / 3.0F, xf = 0.5F;
double nud = 1.0 / 3.0, xd = 0.5;
long double nul = 1.0L / 3.0L, xl = 0.5L;
cyl_bessel_k(nuf, xf);
cyl_bessel_kf(nuf, xf);
cyl_bessel_k(nud, xd);
cyl_bessel_k(nul, xl);
cyl_bessel_kl(nul, xl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.10 cyl_neumann
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
float nuf = 0.0F;
double nud = 0.0;
long double nul = 0.0L;
float a = std::cyl_neumann(nuf, xf);
float b = std::cyl_neumannf(nuf, xf);
double c = std::cyl_neumann(nud, xd);
long double d = std::cyl_neumann(nul, xl);
long double e = std::cyl_neumannl(nul, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test02()
{
float xf = 1.0F;
double xd = 1.0;
long double xl = 1.0L;
float nuf = std::numeric_limits<float>::quiet_NaN();
double nud = std::numeric_limits<double>::quiet_NaN();
long double nul = std::numeric_limits<long double>::quiet_NaN();
float a = std::cyl_neumann(nuf, xf);
float b = std::cyl_neumannf(nuf, xf);
double c = std::cyl_neumann(nud, xd);
long double d = std::cyl_neumann(nul, xl);
long double e = std::cyl_neumannl(nul, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.10 cyl_neumann
#include <cmath>
void
test01()
{
float nuf = 1.0F / 3.0F, xf = 0.5F;
double nud = 1.0 / 3.0, xd = 0.5;
long double nul = 1.0L / 3.0L, xl = 0.5L;
std::cyl_neumann(nuf, xf);
std::cyl_neumannf(nuf, xf);
std::cyl_neumann(nud, xd);
std::cyl_neumann(nul, xl);
std::cyl_neumannl(nul, xl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.10 cyl_neumann
#include <math.h>
void
test01()
{
float nuf = 1.0F / 3.0F, xf = 0.5F;
double nud = 1.0 / 3.0, xd = 0.5;
long double nul = 1.0L / 3.0L, xl = 0.5L;
cyl_neumann(nuf, xf);
cyl_neumannf(nuf, xf);
cyl_neumann(nud, xd);
cyl_neumann(nul, xl);
cyl_neumannl(nul, xl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.11 ellint_1
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float kf = std::numeric_limits<float>::quiet_NaN();
double kd = std::numeric_limits<double>::quiet_NaN();
long double kl = std::numeric_limits<long double>::quiet_NaN();
float phif = std::atan2(1.0F, 1.0F);
double phid = std::atan2(1.0, 1.0);
long double phil = std::atan2(1.0L, 1.0L);
float a = std::ellint_1(kf, phif);
float b = std::ellint_1f(kf, phif);
double c = std::ellint_1(kd, phid);
long double d = std::ellint_1(kl, phil);
long double e = std::ellint_1l(kl, phil);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test02()
{
float kf = 0.5F;
double kd = 0.5;
long double kl = 0.5L;
float phif = std::numeric_limits<float>::quiet_NaN();
double phid = std::numeric_limits<double>::quiet_NaN();
long double phil = std::numeric_limits<long double>::quiet_NaN();
float a = std::ellint_1(kf, phif);
float b = std::ellint_1f(kf, phif);
double c = std::ellint_1(kd, phid);
long double d = std::ellint_1(kl, phil);
long double e = std::ellint_1l(kl, phil);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.11 ellint_1
#include <cmath>
void
test01()
{
float kf = 0.5F, phif = std::atan2(1.0F, 1.0F);
double kd = 0.5, phid = std::atan2(1.0, 1.0);
long double kl = 0.5L, phil = std::atan2(1.0L, 1.0L);
std::ellint_1(kf, phif);
std::ellint_1f(kf, phif);
std::ellint_1(kd, phid);
std::ellint_1(kl, phil);
std::ellint_1l(kl, phil);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.11 ellint_1
#include <math.h>
void
test01()
{
float kf = 0.5F, phif = atan2(1.0F, 1.0F);
double kd = 0.5, phid = atan2(1.0, 1.0);
long double kl = 0.5L, phil = atan2(1.0L, 1.0L);
ellint_1(kf, phif);
ellint_1f(kf, phif);
ellint_1(kd, phid);
ellint_1(kl, phil);
ellint_1l(kl, phil);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.12 ellint_2
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float kf = std::numeric_limits<float>::quiet_NaN();
double kd = std::numeric_limits<double>::quiet_NaN();
long double kl = std::numeric_limits<long double>::quiet_NaN();
float phif = std::atan2(1.0F, 1.0F);
double phid = std::atan2(1.0, 1.0);
long double phil = std::atan2(1.0L, 1.0L);
float a = std::ellint_2(kf, phif);
float b = std::ellint_2f(kf, phif);
double c = std::ellint_2(kd, phid);
long double d = std::ellint_2(kl, phil);
long double e = std::ellint_2l(kl, phil);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test02()
{
float kf = 0.5F;
double kd = 0.5;
long double kl = 0.5L;
float phif = std::numeric_limits<float>::quiet_NaN();
double phid = std::numeric_limits<double>::quiet_NaN();
long double phil = std::numeric_limits<long double>::quiet_NaN();
float a = std::ellint_2(kf, phif);
float b = std::ellint_2f(kf, phif);
double c = std::ellint_2(kd, phid);
long double d = std::ellint_2(kl, phil);
long double e = std::ellint_2l(kl, phil);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.12 ellint_2
#include <cmath>
void
test01()
{
float kf = 0.5F, phif = std::atan2(1.0F, 1.0F);
double kd = 0.5, phid = std::atan2(1.0, 1.0);
long double kl = 0.5L, phil = std::atan2(1.0L, 1.0L);
std::ellint_2(kf, phif);
std::ellint_2f(kf, phif);
std::ellint_2(kd, phid);
std::ellint_2(kl, phil);
std::ellint_2l(kl, phil);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.12 ellint_2
#include <math.h>
void
test01()
{
float kf = 0.5F, phif = atan2(1.0F, 1.0F);
double kd = 0.5, phid = atan2(1.0, 1.0);
long double kl = 0.5L, phil = atan2(1.0L, 1.0L);
ellint_2(kf, phif);
ellint_2f(kf, phif);
ellint_2(kd, phid);
ellint_2(kl, phil);
ellint_2l(kl, phil);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.13 ellint_3
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float kf = std::numeric_limits<float>::quiet_NaN();
double kd = std::numeric_limits<double>::quiet_NaN();
long double kl = std::numeric_limits<long double>::quiet_NaN();
float nuf = 0.2F;
double nud = 0.2;
long double nul = 0.2L;
float phif = std::atan2(1.0F, 1.0F);
double phid = std::atan2(1.0, 1.0);
long double phil = std::atan2(1.0L, 1.0L);
float a = std::ellint_3(kf, nuf, phif);
float b = std::ellint_3f(kf, nuf, phif);
double c = std::ellint_3(kd, nud, phid);
long double d = std::ellint_3(kl, nul, phil);
long double e = std::ellint_3l(kl, nul, phil);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test02()
{
float kf = 0.5F;
double kd = 0.5;
long double kl = 0.5L;
float nuf = std::numeric_limits<float>::quiet_NaN();
double nud = std::numeric_limits<double>::quiet_NaN();
long double nul = std::numeric_limits<long double>::quiet_NaN();
float phif = std::atan2(1.0F, 1.0F);
double phid = std::atan2(1.0, 1.0);
long double phil = std::atan2(1.0L, 1.0L);
float a = std::ellint_3(kf, nuf, phif);
float b = std::ellint_3f(kf, nuf, phif);
double c = std::ellint_3(kd, nud, phid);
long double d = std::ellint_3(kl, nul, phil);
long double e = std::ellint_3l(kl, nul, phil);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
void
test03()
{
float kf = 0.5F;
double kd = 0.5;
long double kl = 0.5L;
float nuf = 0.2F;
double nud = 0.2;
long double nul = 0.2L;
float phif = std::numeric_limits<float>::quiet_NaN();
double phid = std::numeric_limits<double>::quiet_NaN();
long double phil = std::numeric_limits<long double>::quiet_NaN();
float a = std::ellint_3(kf, nuf, phif);
float b = std::ellint_3f(kf, nuf, phif);
double c = std::ellint_3(kd, nud, phid);
long double d = std::ellint_3(kl, nul, phil);
long double e = std::ellint_3l(kl, nul, phil);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
test02();
test03();
return 0;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.13 ellint_3
#include <cmath>
void
test01()
{
float kf = 0.5F, nuf = 0.2F, phif = std::atan2(1.0F, 1.0F);
double kd = 0.5, nud = 0.2, phid = std::atan2(1.0, 1.0);
long double kl = 0.5L, nul = 0.2L, phil = std::atan2(1.0L, 1.0L);
std::ellint_3(kf, nuf, phif);
std::ellint_3f(kf, nuf, phif);
std::ellint_3(kd, nud, phid);
std::ellint_3(kl, nul, phil);
std::ellint_3l(kl, nul, phil);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.13 ellint_3
#include <math.h>
void
test01()
{
float kf = 0.5F, nuf = 0.2F, phif = atan2(1.0F, 1.0F);
double kd = 0.5, nud = 0.2, phid = atan2(1.0, 1.0);
long double kl = 0.5L, nul = 0.2L, phil = atan2(1.0L, 1.0L);
ellint_3(kf, nuf, phif);
ellint_3f(kf, nuf, phif);
ellint_3(kd, nud, phid);
ellint_3(kl, nul, phil);
ellint_3l(kl, nul, phil);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.14 expint
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
float a = std::expint(xf);
float b = std::expintf(xf);
double c = std::expint(xd);
long double d = std::expint(xl);
long double e = std::expintl(xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
//
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// expint
// Compare against values generated by the GNU Scientific Library.
// The GSL can be found on the web: http://www.gnu.org/software/gsl/
#include <limits>
#include <cmath>
#if defined(__TEST_DEBUG)
# include <iostream>
# define VERIFY(A) \
if (!(A)) \
{ \
std::cout << "line " << __LINE__ \
<< " max_abs_frac = " << max_abs_frac \
<< std::endl; \
}
#else
# include <testsuite_hooks.h>
#endif
#include <specfun_testcase.h>
// Test data.
// max(|f - f_GSL|): 4.4408920985006262e-16
// max(|f - f_GSL| / |f_GSL|): 2.0242558374827411e-15
const testcase_expint<double>
data001[50] =
{
{ -3.7832640295504591e-24, -50.000000000000000 },
{ -1.0489811642368024e-23, -49.000000000000000 },
{ -2.9096641904058423e-23, -48.000000000000000 },
{ -8.0741978427258127e-23, -47.000000000000000 },
{ -2.2415317597442998e-22, -46.000000000000000 },
{ -6.2256908094623848e-22, -45.000000000000000 },
{ -1.7299598742816476e-21, -44.000000000000000 },
{ -4.8094965569500181e-21, -43.000000000000000 },
{ -1.3377908810011775e-20, -42.000000000000000 },
{ -3.7231667764599780e-20, -41.000000000000000 },
{ -1.0367732614516570e-19, -40.000000000000000 },
{ -2.8887793015227007e-19, -39.000000000000000 },
{ -8.0541069142907499e-19, -38.000000000000000 },
{ -2.2470206975885714e-18, -37.000000000000000 },
{ -6.2733390097622421e-18, -36.000000000000000 },
{ -1.7527059389947371e-17, -35.000000000000000 },
{ -4.9006761183927874e-17, -34.000000000000000 },
{ -1.3713843484487468e-16, -33.000000000000000 },
{ -3.8409618012250671e-16, -32.000000000000000 },
{ -1.0767670386162383e-15, -31.000000000000000 },
{ -3.0215520106888124e-15, -30.000000000000000 },
{ -8.4877597783535634e-15, -29.000000000000000 },
{ -2.3869415119337330e-14, -28.000000000000000 },
{ -6.7206374352620390e-14, -27.000000000000000 },
{ -1.8946858856749785e-13, -26.000000000000000 },
{ -5.3488997553402167e-13, -25.000000000000000 },
{ -1.5123058939997059e-12, -24.000000000000000 },
{ -4.2826847956656722e-12, -23.000000000000000 },
{ -1.2149378956204371e-11, -22.000000000000000 },
{ -3.4532012671467559e-11, -21.000000000000000 },
{ -9.8355252906498815e-11, -20.000000000000000 },
{ -2.8078290970607954e-10, -19.000000000000000 },
{ -8.0360903448286769e-10, -18.000000000000000 },
{ -2.3064319898216547e-09, -17.000000000000000 },
{ -6.6404872494410427e-09, -16.000000000000000 },
{ -1.9186278921478670e-08, -15.000000000000000 },
{ -5.5656311111451816e-08, -14.000000000000000 },
{ -1.6218662188014328e-07, -13.000000000000000 },
{ -4.7510818246724931e-07, -12.000000000000000 },
{ -1.4003003042474418e-06, -11.000000000000000 },
{ -4.1569689296853246e-06, -10.000000000000000 },
{ -1.2447354178006272e-05, -9.0000000000000000 },
{ -3.7665622843924906e-05, -8.0000000000000000 },
{ -0.00011548173161033820, -7.0000000000000000 },
{ -0.00036008245216265862, -6.0000000000000000 },
{ -0.0011482955912753257, -5.0000000000000000 },
{ -0.0037793524098489058, -4.0000000000000000 },
{ -0.013048381094197037, -3.0000000000000000 },
{ -0.048900510708061125, -2.0000000000000000 },
{ -0.21938393439552029, -1.0000000000000000 },
};
const double toler001 = 2.5000000000000020e-13;
// expint
// Test data.
// max(|f - f_GSL|): 2048.0000000000000
// max(|f - f_GSL| / |f_GSL|): 1.4993769017626171e-15
const testcase_expint<double>
data002[50] =
{
{ 1.8951178163559366, 1.0000000000000000 },
{ 4.9542343560018907, 2.0000000000000000 },
{ 9.9338325706254160, 3.0000000000000000 },
{ 19.630874470056217, 4.0000000000000000 },
{ 40.185275355803178, 5.0000000000000000 },
{ 85.989762142439204, 6.0000000000000000 },
{ 191.50474333550136, 7.0000000000000000 },
{ 440.37989953483833, 8.0000000000000000 },
{ 1037.8782907170896, 9.0000000000000000 },
{ 2492.2289762418782, 10.000000000000000 },
{ 6071.4063740986112, 11.000000000000000 },
{ 14959.532666397528, 12.000000000000000 },
{ 37197.688490689041, 13.000000000000000 },
{ 93192.513633965369, 14.000000000000000 },
{ 234955.85249076830, 15.000000000000000 },
{ 595560.99867083691, 16.000000000000000 },
{ 1516637.8940425171, 17.000000000000000 },
{ 3877904.3305974435, 18.000000000000000 },
{ 9950907.2510468438, 19.000000000000000 },
{ 25615652.664056588, 20.000000000000000 },
{ 66127186.355484925, 21.000000000000000 },
{ 171144671.30036369, 22.000000000000000 },
{ 443966369.83027124, 23.000000000000000 },
{ 1154115391.8491828, 24.000000000000000 },
{ 3005950906.5255494, 25.000000000000000 },
{ 7842940991.8981876, 26.000000000000000 },
{ 20496497119.880810, 27.000000000000000 },
{ 53645118592.314682, 28.000000000000000 },
{ 140599195758.40689, 29.000000000000000 },
{ 368973209407.27417, 30.000000000000000 },
{ 969455575968.39392, 31.000000000000000 },
{ 2550043566357.7871, 32.000000000000000 },
{ 6714640184076.4971, 33.000000000000000 },
{ 17698037244116.266, 34.000000000000000 },
{ 46690550144661.602, 35.000000000000000 },
{ 123285207991209.75, 36.000000000000000 },
{ 325798899867226.50, 37.000000000000000 },
{ 861638819996578.75, 38.000000000000000 },
{ 2280446200301902.5, 39.000000000000000 },
{ 6039718263611242.0, 40.000000000000000 },
{ 16006649143245042., 41.000000000000000 },
{ 42447960921368504., 42.000000000000000 },
{ 1.1263482901669666e+17, 43.000000000000000 },
{ 2.9904447186323366e+17, 44.000000000000000 },
{ 7.9439160357044531e+17, 45.000000000000000 },
{ 2.1113423886478239e+18, 46.000000000000000 },
{ 5.6143296808103424e+18, 47.000000000000000 },
{ 1.4936302131129930e+19, 48.000000000000000 },
{ 3.9754427479037444e+19, 49.000000000000000 },
{ 1.0585636897131690e+20, 50.000000000000000 },
};
const double toler002 = 2.5000000000000020e-13;
template<typename Tp, unsigned int Num>
void
test(const testcase_expint<Tp> (&data)[Num], Tp toler)
{
bool test __attribute__((unused)) = true;
const Tp eps = std::numeric_limits<Tp>::epsilon();
Tp max_abs_diff = -Tp(1);
Tp max_abs_frac = -Tp(1);
unsigned int num_datum = Num;
for (unsigned int i = 0; i < num_datum; ++i)
{
const Tp f = std::expint(data[i].x);
const Tp f0 = data[i].f0;
const Tp diff = f - f0;
if (std::abs(diff) > max_abs_diff)
max_abs_diff = std::abs(diff);
if (std::abs(f0) > Tp(10) * eps
&& std::abs(f) > Tp(10) * eps)
{
const Tp frac = diff / f0;
if (std::abs(frac) > max_abs_frac)
max_abs_frac = std::abs(frac);
}
}
VERIFY(max_abs_frac < toler);
}
int
main()
{
test(data001, toler001);
test(data002, toler002);
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.14 expint
#include <cmath>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
std::expint(xf);
std::expintf(xf);
std::expint(xd);
std::expint(xl);
std::expintl(xl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.14 expint
#include <math.h>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
expint(xf);
expintf(xf);
expint(xd);
expint(xl);
expintl(xl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.15 hermite
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
unsigned int n = 5;
float a = std::hermite(n, xf);
float b = std::hermitef(n, xf);
double c = std::hermite(n, xd);
long double d = std::hermite(n, xl);
long double e = std::hermitel(n, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.15 hermite
#include <cmath>
void
test01()
{
float xf = 2.5F;
double xd = 2.5;
long double xl = 2.5L;
unsigned int n = 5;
std::hermite(n, xf);
std::hermitef(n, xf);
std::hermite(n, xd);
std::hermite(n, xl);
std::hermitel(n, xl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.15 hermite
#include <math.h>
void
test01()
{
float xf = 2.5F;
double xd = 2.5;
long double xl = 2.5L;
unsigned int n = 5;
hermite(n, xf);
hermitef(n, xf);
hermite(n, xd);
hermite(n, xl);
hermitel(n, xl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.16 laguerre
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
unsigned int n = 2;
float a = std::laguerre(n, xf);
float b = std::laguerref(n, xf);
double c = std::laguerre(n, xd);
long double d = std::laguerre(n, xl);
long double e = std::laguerrel(n, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.16 laguerre
#include <cmath>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int n = 2;
std::laguerre(n, xf);
std::laguerref(n, xf);
std::laguerre(n, xd);
std::laguerre(n, xl);
std::laguerrel(n, xl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.16 laguerre
#include <math.h>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int n = 2;
laguerre(n, xf);
laguerref(n, xf);
laguerre(n, xd);
laguerre(n, xl);
laguerrel(n, xl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.17 legendre
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
unsigned int l = 2;
float a = std::legendre(l, xf);
float b = std::legendref(l, xf);
double c = std::legendre(l, xd);
long double d = std::legendre(l, xl);
long double e = std::legendrel(l, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.17 legendre
#include <cmath>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int l = 2;
std::legendre(l, xf);
std::legendref(l, xf);
std::legendre(l, xd);
std::legendre(l, xl);
std::legendrel(l, xl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.17 legendre
#include <math.h>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int l = 2;
legendre(l, xf);
legendref(l, xf);
legendre(l, xd);
legendre(l, xl);
legendrel(l, xl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.18 riemann_zeta
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
float a = std::riemann_zeta(xf);
float b = std::riemann_zetaf(xf);
double c = std::riemann_zeta(xd);
long double d = std::riemann_zeta(xl);
long double e = std::riemann_zetal(xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.18 riemann_zeta
#include <cmath>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
std::riemann_zeta(xf);
std::riemann_zetaf(xf);
std::riemann_zeta(xd);
std::riemann_zeta(xl);
std::riemann_zetal(xl);
return;
}
// { dg-do compile { xfail *-*-* } }
// { dg-excess-errors "" }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.18 riemann_zeta
#include <math.h>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
riemann_zeta(xf);
riemann_zetaf(xf);
riemann_zeta(xd);
riemann_zeta(xl);
riemann_zetal(xl);
return;
}
// { dg-require-c-std "" }
// { dg-add-options ieee }
// { dg-options "-D__STDCPP_WANT_MATH_SPEC_FUNCS__" }
// Copyright (C) 2016 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING3. If not see
// <http://www.gnu.org/licenses/>.
// 8.1.19 sph_bessel
#include <cmath>
#include <testsuite_hooks.h>
void
test01()
{
float xf = std::numeric_limits<float>::quiet_NaN();
double xd = std::numeric_limits<double>::quiet_NaN();
long double xl = std::numeric_limits<long double>::quiet_NaN();
unsigned int n = 0;
float a = std::sph_bessel(n, xf);
float b = std::sph_besself(n, xf);
double c = std::sph_bessel(n, xd);
long double d = std::sph_bessel(n, xl);
long double e = std::sph_bessell(n, xl);
bool test [[gnu::unused]] = true;
VERIFY(std::isnan(a));
VERIFY(std::isnan(b));
VERIFY(std::isnan(c));
VERIFY(std::isnan(d));
VERIFY(std::isnan(e));
return;
}
int
main()
{
test01();
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment