Commit 7c62b943 by Benjamin Kosnik

[multiple changes]



2007-03-16  Benjamin Kosnik  <bkoz@redhat.com>
	
	* testsuite/lib/dg-options.exp (dg-require-c-std): New.
	* testsuite/lib/libstdc++.exp (check_v3_target_c_std): New. Check to
	see if _GLIBCXX_USE_C99_MATH is active. 
	* testsuite/tr1/5_numerical_facilities/special_functions/
	08_cyl_bessel_i/check_nan.cc: Use dg-require-c-std.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	17_hyperg/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	13_ellint_2/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	20_riemann_zeta/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	01_assoc_laguerre/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	02_assoc_legendre/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	22_sph_legendre/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	10_cyl_bessel_k/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	09_cyl_bessel_j/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	21_sph_bessel/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	07_conf_hyperg/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	16_hermite/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	12_ellint_1/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	05_comp_ellint_2/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	18_laguerre/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	14_ellint_3/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	04_comp_ellint_1/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	06_comp_ellint_3/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	19_legendre/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	03_beta/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	11_cyl_neumann/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	15_expint/check_nan.cc: Same.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	23_sph_neumann/check_nan.cc: Same.

	* include/tr1/poly_laguerre.tcc (__poly_laguerre): Don't check if
	unsigned int can be a NaN.

2007-03-16  Edward M. Smith-Rowland  <3dw4rd@verizon.net>

	* docs/html/ext/tr1.html : Marked tr1 math special functions done.
	* docs/html/faq/index.html : Ditto.
	* include/Makefile.in : Added new special function header files.
	* include/Makefile.am : Ditto.	
	* include/tr1/common.h : Added type promotion routines for three
	and four args.

	* include/tr1/special_function_util.h: New.
	* include/tr1/bessel_function.tcc: New.
	* include/tr1/beta_function.tcc: New.
	* include/tr1/ell_integral.tcc: New.
	* include/tr1/exp_integral.tcc: New.
	* include/tr1/gamma.tcc: New.
	* include/tr1/hypergeometric.tcc: New.
	* include/tr1/legendre_function.tcc: New.
	* include/tr1/modified_bessel_func.tcc: New.
	* include/tr1/poly_hermite.tcc: New.
	* include/tr1/poly_laguerre.tcc: New.
	* include/tr1/riemann_zeta.tcc: New.
	* include/tr1/cmath : Included tr1 math special functions.
	* include/tr1/math.h : Ditto.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	testcase.h: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	01_assoc_laguerre/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	01_assoc_laguerre/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	01_assoc_laguerre/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	01_assoc_laguerre/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	02_assoc_legendre/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	02_assoc_legendre/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	02_assoc_legendre/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	02_assoc_legendre/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/03_beta/
	compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/03_beta/
	check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/03_beta/
	check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/03_beta/
	compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	04_comp_ellint_1/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	04_comp_ellint_1/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	04_comp_ellint_1/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	04_comp_ellint_1/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	05_comp_ellint_2/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	05_comp_ellint_2/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	05_comp_ellint_2/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	05_comp_ellint_2/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	06_comp_ellint_3/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	06_comp_ellint_3/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	06_comp_ellint_3/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	06_comp_ellint_3/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	07_conf_hyperg/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	07_conf_hyperg/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	07_conf_hyperg/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	07_conf_hyperg/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	08_cyl_bessel_i/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	08_cyl_bessel_i/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	08_cyl_bessel_i/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	08_cyl_bessel_i/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	09_cyl_bessel_j/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	09_cyl_bessel_j/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	09_cyl_bessel_j/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	09_cyl_bessel_j/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	10_cyl_bessel_k/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	10_cyl_bessel_k/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	10_cyl_bessel_k/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	10_cyl_bessel_k/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	11_cyl_neumann/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	11_cyl_neumann/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	11_cyl_neumann/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	11_cyl_neumann/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/
	compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/
	check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/
	check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/
	compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/
	compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/
	check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/
	check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/
	compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/
	compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/
	check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/
	check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/
	compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/15_expint/
	check_value_neg.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/15_expint/
	compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/15_expint/
	check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/15_expint/
	compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/15_expint/
	check_value_pos.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/
	compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/
	check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/
	compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/
	compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/
	check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/
	check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/
	compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/
	compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/
	check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/
	check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/
	compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/
	compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/
	check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/
	check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/
	compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	20_riemann_zeta/check_value_neg.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	20_riemann_zeta/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	20_riemann_zeta/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	20_riemann_zeta/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	20_riemann_zeta/check_value_pos.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	21_sph_bessel/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	21_sph_bessel/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	21_sph_bessel/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	21_sph_bessel/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	22_sph_legendre/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	22_sph_legendre/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	22_sph_legendre/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	22_sph_legendre/compile_2.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	23_sph_neumann/compile.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	23_sph_neumann/check_nan.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	23_sph_neumann/check_value.cc: New.
	* testsuite/tr1/5_numerical_facilities/special_functions/
	23_sph_neumann/ compile_2.cc: New.

From-SVN: r122986
parent 7b1737d0
......@@ -807,209 +807,209 @@ release.
<tr>
<td>5.2</td>
<td>Mathematical special functions</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1</td>
<td>Additions to header <code>&lt;cmath&gt;</code> synopsis</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.1</td>
<td>associated Laguerre polynomials</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.2</td>
<td>associated Legendre functions</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.3</td>
<td>beta function</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.4</td>
<td>(complete) elliptic integral of the first kind</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.5</td>
<td>(complete) elliptic integral of the second kind</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.6</td>
<td>(complete) elliptic integral of the third kind</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.7</td>
<td>confluent hypergeometric functions</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.8</td>
<td>regular modified cylindrical Bessel functions</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.9</td>
<td>cylindrical Bessel functions (of the first kind)</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.10</td>
<td>irregular modified cylindrical Bessel functions</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.11</td>
<td>cylindrical Neumann functions</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.12</td>
<td>(incomplete) elliptic integral of the first kind</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.13</td>
<td>(incomplete) elliptic integral of the second kind</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.14</td>
<td>(incomplete) elliptic integral of the third kind</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.15</td>
<td>exponential integral</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.16</td>
<td>Hermite polynomials</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.17</td>
<td>hypergeometric functions</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.18</td>
<td>Laguerre polynomials</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.19</td>
<td>Legendre polynomials</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.20</td>
<td>Riemann zeta function</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.21</td>
<td>spherical Bessel functions (of the first kind)</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.22</td>
<td>spherical associated Legendre functions</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.1.23</td>
<td>spherical Neumann functions</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
<td>5.2.2</td>
<td>Additions to header <code>&lt;math.h&gt;</code> synopsis</td>
<td>done</td>
<td></td>
<td></td>
<td>missing</td>
<td></td>
</tr>
<tr>
......
......@@ -1047,7 +1047,7 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
and the C++ languages.
</p>
<p><strong>Special functions - Under construction - </strong>
<p><strong>Special functions - Complete - </strong>
Twenty-three mathematical functions familiar to physicists and
engineers are included: cylindrical and spherical Bessel and Neumann
functions, hypergeometric functions, Laguerre polynomials, Legendre
......
......@@ -533,6 +533,8 @@ tr1_srcdir = ${glibcxx_srcdir}/include/tr1
tr1_builddir = ./tr1
tr1_headers = \
${tr1_srcdir}/array \
${tr1_srcdir}/bessel_function.tcc \
${tr1_srcdir}/beta_function.tcc \
${tr1_srcdir}/boost_shared_ptr.h \
${tr1_srcdir}/ccomplex \
${tr1_srcdir}/cctype \
......@@ -554,19 +556,29 @@ tr1_headers = \
${tr1_srcdir}/ctype.h \
${tr1_srcdir}/cwchar \
${tr1_srcdir}/cwctype \
${tr1_srcdir}/ell_integral.tcc \
${tr1_srcdir}/exp_integral.tcc \
${tr1_srcdir}/fenv.h \
${tr1_srcdir}/float.h \
${tr1_srcdir}/functional \
${tr1_srcdir}/functional_hash.h \
${tr1_srcdir}/gamma.tcc \
${tr1_srcdir}/hashtable \
${tr1_srcdir}/hypergeometric.tcc \
${tr1_srcdir}/hashtable_policy.h \
${tr1_srcdir}/inttypes.h \
${tr1_srcdir}/limits.h \
${tr1_srcdir}/math.h \
${tr1_srcdir}/memory \
${tr1_srcdir}/modified_bessel_func.tcc \
${tr1_srcdir}/poly_hermite.tcc \
${tr1_srcdir}/poly_laguerre.tcc \
${tr1_srcdir}/legendre_function.tcc \
${tr1_srcdir}/random \
${tr1_srcdir}/random.tcc \
${tr1_srcdir}/regex \
${tr1_srcdir}/riemann_zeta.tcc \
${tr1_srcdir}/special_function_util.h \
${tr1_srcdir}/stdarg.h \
${tr1_srcdir}/stdbool.h \
${tr1_srcdir}/stdint.h \
......
......@@ -763,6 +763,8 @@ tr1_srcdir = ${glibcxx_srcdir}/include/tr1
tr1_builddir = ./tr1
tr1_headers = \
${tr1_srcdir}/array \
${tr1_srcdir}/bessel_function.tcc \
${tr1_srcdir}/beta_function.tcc \
${tr1_srcdir}/boost_shared_ptr.h \
${tr1_srcdir}/ccomplex \
${tr1_srcdir}/cctype \
......@@ -784,19 +786,29 @@ tr1_headers = \
${tr1_srcdir}/ctype.h \
${tr1_srcdir}/cwchar \
${tr1_srcdir}/cwctype \
${tr1_srcdir}/ell_integral.tcc \
${tr1_srcdir}/exp_integral.tcc \
${tr1_srcdir}/fenv.h \
${tr1_srcdir}/float.h \
${tr1_srcdir}/functional \
${tr1_srcdir}/functional_hash.h \
${tr1_srcdir}/gamma.tcc \
${tr1_srcdir}/hashtable \
${tr1_srcdir}/hypergeometric.tcc \
${tr1_srcdir}/hashtable_policy.h \
${tr1_srcdir}/inttypes.h \
${tr1_srcdir}/limits.h \
${tr1_srcdir}/math.h \
${tr1_srcdir}/memory \
${tr1_srcdir}/modified_bessel_func.tcc \
${tr1_srcdir}/poly_hermite.tcc \
${tr1_srcdir}/poly_laguerre.tcc \
${tr1_srcdir}/legendre_function.tcc \
${tr1_srcdir}/random \
${tr1_srcdir}/random.tcc \
${tr1_srcdir}/regex \
${tr1_srcdir}/riemann_zeta.tcc \
${tr1_srcdir}/special_function_util.h \
${tr1_srcdir}/stdarg.h \
${tr1_srcdir}/stdbool.h \
${tr1_srcdir}/stdint.h \
......
// Special functions -*- C++ -*-
// Copyright (C) 2006-2007
// 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
//
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1/beta_function.tcc
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
//
// ISO C++ 14882 TR1: 5.2 Special functions
//
// Written by Edward Smith-Rowland based on:
// (1) Handbook of Mathematical Functions,
// ed. Milton Abramowitz and Irene A. Stegun,
// Dover Publications,
// Section 6, pp. 253-266
// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl
// (3) Numerical Recipes in C, by W. H. Press, S. A. Teukolsky,
// W. T. Vetterling, B. P. Flannery, Cambridge University Press (1992),
// 2nd ed, pp. 213-216
// (4) Gamma, Exploring Euler's Constant, Julian Havil,
// Princeton, 2003.
#ifndef _TR1_BETA_FUNCTION_TCC
#define _TR1_BETA_FUNCTION_TCC 1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
// [5.2] Special functions
/**
* @ingroup tr1_math_spec_func
* @{
*/
//
// Implementation-space details.
//
namespace __detail
{
/**
* @brief Return the beta function: \f$B(x,y)\f$.
*
* The beta function is defined by
* @f[
* B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
* @f]
*
* @param __x The first argument of the beta function.
* @param __y The second argument of the beta function.
* @return The beta function.
*/
template<typename _Tp>
_Tp
__beta_gamma(_Tp __x, _Tp __y)
{
_Tp __bet;
#if _GLIBCXX_USE_C99_MATH_TR1
if (__x > __y)
{
__bet = std::_GLIBCXX_TR1::tgamma(__x)
/ std::_GLIBCXX_TR1::tgamma(__x + __y);
__bet *= std::_GLIBCXX_TR1::tgamma(__y);
}
else
{
__bet = std::_GLIBCXX_TR1::tgamma(__y)
/ std::_GLIBCXX_TR1::tgamma(__x + __y);
__bet *= std::_GLIBCXX_TR1::tgamma(__x);
}
#else
if (__x > __y)
{
__bet = __gamma(__x) / __gamma(__x + __y);
__bet *= __gamma(__y);
}
else
{
__bet = __gamma(__y) / __gamma(__x + __y);
__bet *= __gamma(__x);
}
#endif
return __bet;
}
/**
* @brief Return the beta function \f$B(x,y)\f$ using
* the log gamma functions.
*
* The beta function is defined by
* @f[
* B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
* @f]
*
* @param __x The first argument of the beta function.
* @param __y The second argument of the beta function.
* @return The beta function.
*/
template<typename _Tp>
_Tp
__beta_lgamma(_Tp __x, _Tp __y)
{
#if _GLIBCXX_USE_C99_MATH_TR1
_Tp __bet = std::_GLIBCXX_TR1::lgamma(__x)
+ std::_GLIBCXX_TR1::lgamma(__y)
- std::_GLIBCXX_TR1::lgamma(__x + __y);
#else
_Tp __bet = __log_gamma(__x)
+ __log_gamma(__y)
- __log_gamma(__x + __y);
#endif
__bet = std::exp(__bet);
return __bet;
}
/**
* @brief Return the beta function \f$B(x,y)\f$ using
* the product form.
*
* The beta function is defined by
* @f[
* B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
* @f]
*
* @param __x The first argument of the beta function.
* @param __y The second argument of the beta function.
* @return The beta function.
*/
template<typename _Tp>
_Tp
__beta_product(_Tp __x, _Tp __y)
{
_Tp __bet = (__x + __y) / (__x * __y);
unsigned int __max_iter = 1000000;
for (unsigned int __k = 1; __k < __max_iter; ++__k)
{
_Tp __term = (_Tp(1) + (__x + __y) / __k)
/ ((_Tp(1) + __x / __k) * (_Tp(1) + __y / __k));
__bet *= __term;
}
return __bet;
}
/**
* @brief Return the beta function \f$ B(x,y) \f$.
*
* The beta function is defined by
* @f[
* B(x,y) = \frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)}
* @f]
*
* @param __x The first argument of the beta function.
* @param __y The second argument of the beta function.
* @return The beta function.
*/
template<typename _Tp>
inline _Tp
__beta(_Tp __x, _Tp __y)
{
if (__isnan(__x) || __isnan(__y))
return std::numeric_limits<_Tp>::quiet_NaN();
else
return __beta_lgamma(__x, __y);
}
} // namespace std::tr1::__detail
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
#endif // _TR1_BETA_FUNCTION_TCC
......@@ -72,6 +72,19 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
typedef __typeof__(__type1() + __type2() + __type3()) __type;
};
template<typename _Tp, typename _Up, typename _Vp, typename _Wp>
struct __promote_4
{
private:
typedef typename __promote<_Tp>::__type __type1;
typedef typename __promote<_Up>::__type __type2;
typedef typename __promote<_Vp>::__type __type3;
typedef typename __promote<_Wp>::__type __type4;
public:
typedef __typeof__(__type1() + __type2() + __type3() + __type4()) __type;
};
_GLIBCXX_END_NAMESPACE
} // namespace std
......
......@@ -96,4 +96,96 @@ using std::_GLIBCXX_TR1::trunc;
#endif
using std::_GLIBCXX_TR1::assoc_laguerref;
using std::_GLIBCXX_TR1::assoc_laguerre;
using std::_GLIBCXX_TR1::assoc_laguerrel;
using std::_GLIBCXX_TR1::assoc_legendref;
using std::_GLIBCXX_TR1::assoc_legendre;
using std::_GLIBCXX_TR1::assoc_legendrel;
using std::_GLIBCXX_TR1::betaf;
using std::_GLIBCXX_TR1::beta;
using std::_GLIBCXX_TR1::betal;
using std::_GLIBCXX_TR1::comp_ellint_1f;
using std::_GLIBCXX_TR1::comp_ellint_1;
using std::_GLIBCXX_TR1::comp_ellint_1l;
using std::_GLIBCXX_TR1::comp_ellint_2f;
using std::_GLIBCXX_TR1::comp_ellint_2;
using std::_GLIBCXX_TR1::comp_ellint_2l;
using std::_GLIBCXX_TR1::comp_ellint_3f;
using std::_GLIBCXX_TR1::comp_ellint_3;
using std::_GLIBCXX_TR1::comp_ellint_3l;
using std::_GLIBCXX_TR1::conf_hypergf;
using std::_GLIBCXX_TR1::conf_hyperg;
using std::_GLIBCXX_TR1::conf_hypergl;
using std::_GLIBCXX_TR1::cyl_bessel_if;
using std::_GLIBCXX_TR1::cyl_bessel_i;
using std::_GLIBCXX_TR1::cyl_bessel_il;
using std::_GLIBCXX_TR1::cyl_bessel_jf;
using std::_GLIBCXX_TR1::cyl_bessel_j;
using std::_GLIBCXX_TR1::cyl_bessel_jl;
using std::_GLIBCXX_TR1::cyl_bessel_kf;
using std::_GLIBCXX_TR1::cyl_bessel_k;
using std::_GLIBCXX_TR1::cyl_bessel_kl;
using std::_GLIBCXX_TR1::cyl_neumannf;
using std::_GLIBCXX_TR1::cyl_neumann;
using std::_GLIBCXX_TR1::cyl_neumannl;
using std::_GLIBCXX_TR1::ellint_1f;
using std::_GLIBCXX_TR1::ellint_1;
using std::_GLIBCXX_TR1::ellint_1l;
using std::_GLIBCXX_TR1::ellint_2f;
using std::_GLIBCXX_TR1::ellint_2;
using std::_GLIBCXX_TR1::ellint_2l;
using std::_GLIBCXX_TR1::ellint_3f;
using std::_GLIBCXX_TR1::ellint_3;
using std::_GLIBCXX_TR1::ellint_3l;
using std::_GLIBCXX_TR1::expintf;
using std::_GLIBCXX_TR1::expint;
using std::_GLIBCXX_TR1::expintl;
using std::_GLIBCXX_TR1::hermitef;
using std::_GLIBCXX_TR1::hermite;
using std::_GLIBCXX_TR1::hermitel;
using std::_GLIBCXX_TR1::hypergf;
using std::_GLIBCXX_TR1::hyperg;
using std::_GLIBCXX_TR1::hypergl;
using std::_GLIBCXX_TR1::laguerref;
using std::_GLIBCXX_TR1::laguerre;
using std::_GLIBCXX_TR1::laguerrel;
using std::_GLIBCXX_TR1::legendref;
using std::_GLIBCXX_TR1::legendre;
using std::_GLIBCXX_TR1::legendrel;
using std::_GLIBCXX_TR1::riemann_zetaf;
using std::_GLIBCXX_TR1::riemann_zeta;
using std::_GLIBCXX_TR1::riemann_zetal;
using std::_GLIBCXX_TR1::sph_besself;
using std::_GLIBCXX_TR1::sph_bessel;
using std::_GLIBCXX_TR1::sph_bessell;
using std::_GLIBCXX_TR1::sph_legendref;
using std::_GLIBCXX_TR1::sph_legendre;
using std::_GLIBCXX_TR1::sph_legendrel;
using std::_GLIBCXX_TR1::sph_neumannf;
using std::_GLIBCXX_TR1::sph_neumann;
using std::_GLIBCXX_TR1::sph_neumannl;
#endif
// Special functions -*- C++ -*-
// Copyright (C) 2006-2007
// 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
//
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1/poly_hermite.tcc
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
//
// ISO C++ 14882 TR1: 5.2 Special functions
//
// Written by Edward Smith-Rowland based on:
// (1) Handbook of Mathematical Functions,
// Ed. Milton Abramowitz and Irene A. Stegun,
// Dover Publications, Section 22 pp. 773-802
#ifndef _TR1_POLY_HERMITE_TCC
#define _TR1_POLY_HERMITE_TCC 1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
// [5.2] Special functions
/**
* @ingroup tr1_math_spec_func
* @{
*/
//
// Implementation-space details.
//
namespace __detail
{
/**
* @brief This routine returns the Hermite polynomial
* of order n: \f$ H_n(x) \f$ by recursion on n.
*
* The Hermite polynomial is defined by:
* @f[
* H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n} e^{-x^2}
* @f]
*
* @param __n The order of the Hermite polynomial.
* @param __x The argument of the Hermite polynomial.
* @return The value of the Hermite polynomial of order n
* and argument x.
*/
template<typename _Tp>
_Tp
__poly_hermite_recursion(const unsigned int __n, const _Tp __x)
{
// Compute H_0.
_Tp __H_0 = 1;
if (__n == 0)
return __H_0;
// Compute H_1.
_Tp __H_1 = 2 * __x;
if (__n == 1)
return __H_1;
// Compute H_n.
_Tp __H_n, __H_nm1, __H_nm2;
unsigned int __i;
for (__H_nm2 = __H_0, __H_nm1 = __H_1, __i = 2; __i <= __n; ++__i)
{
__H_n = 2 * (__x * __H_nm1 + (__i - 1) * __H_nm2);
__H_nm2 = __H_nm1;
__H_nm1 = __H_n;
}
return __H_n;
}
/**
* @brief This routine returns the Hermite polynomial
* of order n: \f$ H_n(x) \f$.
*
* The Hermite polynomial is defined by:
* @f[
* H_n(x) = (-1)^n e^{x^2} \frac{d^n}{dx^n} e^{-x^2}
* @f]
*
* @param __n The order of the Hermite polynomial.
* @param __x The argument of the Hermite polynomial.
* @return The value of the Hermite polynomial of order n
* and argument x.
*/
template<typename _Tp>
inline _Tp
__poly_hermite(const unsigned int __n, const _Tp __x)
{
if (__isnan(__x))
return std::numeric_limits<_Tp>::quiet_NaN();
else
return __poly_hermite_recursion(__n, __x);
}
} // namespace std::tr1::__detail
/* @} */ // group tr1_math_spec_func
_GLIBCXX_END_NAMESPACE
}
#endif // _TR1_POLY_HERMITE_TCC
// Special functions -*- C++ -*-
// Copyright (C) 2006
// 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
// library without restriction. Specifically, if other files instantiate
// templates or use macros or inline functions from this file, or you compile
// this file and link it with other files to produce an executable, this
// file does not by itself cause the resulting executable to be covered by
// the GNU General Public License. This exception does not however
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
/** @file tr1/special_function_util.h
* This is an internal header file, included by other library headers.
* You should not attempt to use it directly.
*/
//
// ISO C++ 14882 TR1: 5.2 Special functions
//
// Written by Edward Smith-Rowland based on numerous mathematics books.
#ifndef _TR1_SPECIAL_FUNCTION_UTIL_H
#define _TR1_SPECIAL_FUNCTION_UTIL_H 1
// namespace std::tr1
namespace std
{
_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1)
namespace __detail
{
///
/// @brief A class to encapsulate type dependent floating point
/// constants. Not everything will be able to be expressed
/// as type logic.
///
template <typename _Tp>
struct __floating_point_constant
{
static const _Tp __value;
};
///
/// @brief A structure for numeric constants.
///
template<typename _Tp>
struct __numeric_constants
{
/// Constant @f$ \pi @f$.
static _Tp __pi() throw()
{ return static_cast<_Tp>(3.1415926535897932384626433832795029L); }
/// Constant @f$ \pi / 2 @f$.
static _Tp __pi_2() throw()
{ return static_cast<_Tp>(1.5707963267948966192313216916397514L); }
/// Constant @f$ \pi / 3 @f$.
static _Tp __pi_3() throw()
{ return static_cast<_Tp>(1.0471975511965977461542144610931676L); }
/// Constant @f$ \pi / 4 @f$.
static _Tp __pi_4() throw()
{ return static_cast<_Tp>(0.7853981633974483096156608458198757L); }
/// Constant @f$ 1 / \pi @f$.
static _Tp __1_pi() throw()
{ return static_cast<_Tp>(0.3183098861837906715377675267450287L); }
/// Constant @f$ 2 / \sqrt(\pi) @f$.
static _Tp __2_sqrtpi() throw()
{ return static_cast<_Tp>(1.1283791670955125738961589031215452L); }
/// Constant @f$ \sqrt(2) @f$.
static _Tp __sqrt2() throw()
{ return static_cast<_Tp>(1.4142135623730950488016887242096981L); }
/// Constant @f$ \sqrt(3) @f$.
static _Tp __sqrt3() throw()
{ return static_cast<_Tp>(1.7320508075688772935274463415058723L); }
/// Constant @f$ \sqrt(\pi/2) @f$.
static _Tp __sqrtpio2() throw()
{ return static_cast<_Tp>(1.2533141373155002512078826424055226L); }
/// Constant @f$ 1 / sqrt(2) @f$.
static _Tp __sqrt1_2() throw()
{ return static_cast<_Tp>(0.7071067811865475244008443621048490L); }
/// Constant @f$ \log(\pi) @f$.
static _Tp __lnpi() throw()
{ return static_cast<_Tp>(1.1447298858494001741434273513530587L); }
/// Constant Euler's constant @f$ \gamma_E @f$.
static _Tp __gamma_e() throw()
{ return static_cast<_Tp>(0.5772156649015328606065120900824024L); }
/// Constant Euler-Mascheroni @f$ e @f$
static _Tp __euler() throw()
{ return static_cast<_Tp>(2.7182818284590452353602874713526625L); }
};
///
/// @brief This is a wrapper for the isnan function.
/// Otherwise, for NaN, all comparisons result in false.
/// If/when we build a std::isnan out of intrinsics, this
/// will disappear completely in favor of std::isnan.
///
#if _GLIBCXX_USE_C99_MATH && !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
template <typename _Tp>
inline bool __isnan(const _Tp __x)
{
return std::isnan(__x);
}
#else
template <typename _Tp>
inline bool __isnan(const _Tp __x)
{
return __builtin_isnan(__x);
}
template <>
inline bool __isnan<float>(const float __x)
{
return __builtin_isnanf(__x);
}
template <>
inline bool __isnan<long double>(const long double __x)
{
return __builtin_isnanl(__x);
}
#endif
} // namespace __detail
_GLIBCXX_END_NAMESPACE
}
#endif // _TR1_SPECIAL_FUNCTION_UTIL_H
# Handlers for additional dg-xxx keywords in tests.
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
# Copyright (C) 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -14,11 +14,20 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301, USA.
proc dg-require-c-std { args } {
if { ![ check_v3_target_c_std ] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
return
}
return
}
proc dg-require-namedlocale { args } {
if { ![ check_v3_target_namedlocale ] } {
proc dg-require-debug-mode { args } {
if { ![ check_v3_target_debug_mode ] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
return
......@@ -35,8 +44,8 @@ proc dg-require-fileio { args } {
return
}
proc dg-require-time { args } {
if { ![ check_v3_target_time ] } {
proc dg-require-namedlocale { args } {
if { ![ check_v3_target_namedlocale ] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
return
......@@ -53,8 +62,8 @@ proc dg-require-sharedlib { args } {
return
}
proc dg-require-debug-mode { args } {
if { ![ check_v3_target_debug_mode ] } {
proc dg-require-time { args } {
if { ![ check_v3_target_time ] } {
upvar dg-do-what dg-do-what
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
return
......
......@@ -579,6 +579,67 @@ proc check_v3_target_fileio { } {
return $et_fileio_saved
}
proc check_v3_target_c_std { } {
global et_c_std_saved
global et_c_std_target_name
global tool
if { ![info exists et_c_std_target_name] } {
set et_c_std_target_name ""
}
# If the target has changed since we set the cached value, clear it.
set current_target [current_target_name]
if { $current_target != $et_c_std_target_name } {
verbose "check_v3_target_c_std: `$et_c_std_target_name'" 2
set et_c_std_target_name $current_target
if [info exists et_c_std_saved] {
verbose "check_v3_target_c_std: removing cached result" 2
unset et_c_std_saved
}
}
if [info exists et_c_std_saved] {
verbose "check_v3_target_c_std: using cached result" 2
} else {
set et_c_std_saved 0
# Set up, compile, and execute a C++ test program that tries to use
# C99 functionality.
set src fileio[pid].cc
set exe fileio[pid].x
set f [open $src "w"]
puts $f "#include <tr1/cmath>"
puts $f "int main ()"
puts $f "{"
puts $f " float f = 45.55;"
puts $f " int i = std::tr1::isnan(f);"
puts $f " return 0;"
puts $f "}"
close $f
set lines [v3_target_compile $src $exe executable ""]
file delete $src
if [string match "" $lines] {
# No error message, compilation succeeded.
set result [${tool}_load "./$exe" "" ""]
set status [lindex $result 0]
remote_file build delete $exe
verbose "check_v3_target_c_std: status is <$status>" 2
if { $status == "pass" } {
set et_c_std_saved 1
}
} else {
verbose "check_v3_target_c_std: compilation failed" 2
}
}
return $et_c_std_saved
}
proc check_v3_target_sharedlib { } {
global v3-sharedlib
return ${v3-sharedlib}
......
// { dg-require-c-std "" }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.1 assoc_laguerre
#include <tr1/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, m = 1;
float a = std::tr1::assoc_laguerre(n, m, xf);
float b = std::tr1::assoc_laguerref(n, m, xf);
double c = std::tr1::assoc_laguerre(n, m, xd);
long double d = std::tr1::assoc_laguerre(n, m, xl);
long double e = std::tr1::assoc_laguerrel(n, m, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
return 0;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.1 assoc_laguerre
#include <tr1/cmath>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int n = 2, m = 1;
float a = std::tr1::assoc_laguerre(n, m, xf);
float b = std::tr1::assoc_laguerref(n, m, xf);
double c = std::tr1::assoc_laguerre(n, m, xd);
long double d = std::tr1::assoc_laguerre(n, m, xl);
long double e = std::tr1::assoc_laguerrel(n, m, xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.1 assoc_laguerre
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.2 assoc_legendre
#include <tr1/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::tr1::assoc_legendre(l, m, xf);
float b = std::tr1::assoc_legendref(l, m, xf);
double c = std::tr1::assoc_legendre(l, m, xd);
long double d = std::tr1::assoc_legendre(l, m, xl);
long double e = std::tr1::assoc_legendrel(l, m, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.2 assoc_legendre
#include <tr1/cmath>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int l = 2, m = 1;
std::tr1::assoc_legendre(l, m, xf);
std::tr1::assoc_legendref(l, m, xf);
std::tr1::assoc_legendre(l, m, xd);
std::tr1::assoc_legendre(l, m, xl);
std::tr1::assoc_legendrel(l, m, xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.2 assoc_legendre
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.3 beta
#include <tr1/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::tr1::beta(xf, yf);
float b = std::tr1::betaf(xf, yf);
double c = std::tr1::beta(xd, yd);
long double d = std::tr1::beta(xl, yl);
long double e = std::tr1::betal(xl, yl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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::tr1::beta(xf, yf);
float b = std::tr1::betaf(xf, yf);
double c = std::tr1::beta(xd, yd);
long double d = std::tr1::beta(xl, yl);
long double e = std::tr1::betal(xl, yl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.3 beta
#include <tr1/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::tr1::beta(xf, yf);
std::tr1::betaf(xf, yf);
std::tr1::beta(xd, yd);
std::tr1::beta(xl, yl);
std::tr1::betal(xl, yl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.3 beta
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.4 comp_ellint_1
#include <tr1/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::tr1::comp_ellint_1(kf);
float b = std::tr1::comp_ellint_1f(kf);
double c = std::tr1::comp_ellint_1(kd);
long double d = std::tr1::comp_ellint_1(kl);
long double e = std::tr1::comp_ellint_1l(kl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
return 0;
}
// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 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 <tr1/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 "../testcase.h"
// Test data.
testcase_comp_ellint_1<double> data001[] = {
{ 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.6080486199305126, -0.30000000000000004 },
{ 1.5868678474541664, -0.19999999999999996 },
{ 1.5747455615173562, -0.099999999999999978 },
{ 1.5707963267948966, 0.0000000000000000 },
{ 1.5747455615173562, 0.10000000000000009 },
{ 1.5868678474541664, 0.19999999999999996 },
{ 1.6080486199305126, 0.30000000000000004 },
{ 1.6399998658645112, 0.39999999999999991 },
{ 1.6857503548125963, 0.50000000000000000 },
{ 1.7507538029157526, 0.60000000000000009 },
{ 1.8456939983747236, 0.69999999999999996 },
{ 1.9953027776647296, 0.80000000000000004 },
{ 2.2805491384227699, 0.89999999999999991 },
};
// Test function.
template <typename Tp>
void test001()
{
const Tp eps = std::numeric_limits<Tp>::epsilon();
Tp max_abs_diff = -Tp(1);
Tp max_abs_frac = -Tp(1);
unsigned int num_datum = sizeof(data001)
/ sizeof(testcase_comp_ellint_1<double>);
for (unsigned int i = 0; i < num_datum; ++i)
{
const Tp f = std::tr1::comp_ellint_1(Tp(data001[i].k));
const Tp f0 = data001[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 < Tp(2.5000000000000020e-13));
}
int main(int, char**)
{
test001<double>();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.4 comp_ellint_1
#include <tr1/cmath>
void
test01()
{
float kf = 0.5F;
double kd = 0.5;
long double kl = 0.5L;
std::tr1::comp_ellint_1(kf);
std::tr1::comp_ellint_1f(kf);
std::tr1::comp_ellint_1(kd);
std::tr1::comp_ellint_1(kl);
std::tr1::comp_ellint_1l(kl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.4 comp_ellint_1
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.5 comp_ellint_2
#include <tr1/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::tr1::comp_ellint_2(kf);
float b = std::tr1::comp_ellint_2f(kf);
double c = std::tr1::comp_ellint_2(kd);
long double d = std::tr1::comp_ellint_2(kl);
long double e = std::tr1::comp_ellint_2l(kl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
return 0;
}
// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 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 <tr1/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 "../testcase.h"
// Test data.
testcase_comp_ellint_2<double> data001[] = {
{ 1.1716970527816140, -0.90000000000000002 },
{ 1.2763499431699066, -0.80000000000000004 },
{ 1.3556611355719557, -0.69999999999999996 },
{ 1.4180833944487243, -0.59999999999999998 },
{ 1.4674622093394274, -0.50000000000000000 },
{ 1.5059416123600402, -0.40000000000000002 },
{ 1.5348334649232489, -0.30000000000000004 },
{ 1.5549685462425296, -0.19999999999999996 },
{ 1.5668619420216685, -0.099999999999999978 },
{ 1.5707963267948966, 0.0000000000000000 },
{ 1.5668619420216685, 0.10000000000000009 },
{ 1.5549685462425296, 0.19999999999999996 },
{ 1.5348334649232489, 0.30000000000000004 },
{ 1.5059416123600404, 0.39999999999999991 },
{ 1.4674622093394274, 0.50000000000000000 },
{ 1.4180833944487241, 0.60000000000000009 },
{ 1.3556611355719557, 0.69999999999999996 },
{ 1.2763499431699066, 0.80000000000000004 },
{ 1.1716970527816142, 0.89999999999999991 },
};
// Test function.
template <typename Tp>
void test001()
{
const Tp eps = std::numeric_limits<Tp>::epsilon();
Tp max_abs_diff = -Tp(1);
Tp max_abs_frac = -Tp(1);
unsigned int num_datum = sizeof(data001)
/ sizeof(testcase_comp_ellint_2<double>);
for (unsigned int i = 0; i < num_datum; ++i)
{
const Tp f = std::tr1::comp_ellint_2(Tp(data001[i].k));
const Tp f0 = data001[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 < Tp(5.0000000000000039e-13));
}
int main(int, char**)
{
test001<double>();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.5 comp_ellint_2
#include <tr1/cmath>
void
test01()
{
float kf = 0.5F;
double kd = 0.5;
long double kl = 0.5L;
std::tr1::comp_ellint_2(kf);
std::tr1::comp_ellint_2f(kf);
std::tr1::comp_ellint_2(kd);
std::tr1::comp_ellint_2(kl);
std::tr1::comp_ellint_2l(kl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.4 comp_ellint_2
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.6 comp_ellint_3
#include <tr1/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::tr1::comp_ellint_3(kf, nuf);
float b = std::tr1::comp_ellint_3f(kf, nuf);
double c = std::tr1::comp_ellint_3(kd, nud);
long double d = std::tr1::comp_ellint_3(kl, nul);
long double e = std::tr1::comp_ellint_3l(kl, nul);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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::tr1::comp_ellint_3(kf, nuf);
float b = std::tr1::comp_ellint_3f(kf, nuf);
double c = std::tr1::comp_ellint_3(kd, nud);
long double d = std::tr1::comp_ellint_3(kl, nul);
long double e = std::tr1::comp_ellint_3l(kl, nul);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.6 comp_ellint_3
#include <tr1/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::tr1::comp_ellint_3(kf, nuf);
std::tr1::comp_ellint_3f(kf, nuf);
std::tr1::comp_ellint_3(kd, nud);
std::tr1::comp_ellint_3(kl, nul);
std::tr1::comp_ellint_3l(kl, nul);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.6 comp_ellint_3
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.7 conf_hyperg
#include <tr1/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 = std::tr1::conf_hyperg(af, cf, xf);
float b = std::tr1::conf_hypergf(af, cf, xf);
double c = std::tr1::conf_hyperg(ad, cd, xd);
long double d = std::tr1::conf_hyperg(al, cl, xl);
long double e = std::tr1::conf_hypergl(al, cl, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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 = std::tr1::conf_hyperg(af, cf, xf);
float b = std::tr1::conf_hypergf(af, cf, xf);
double c = std::tr1::conf_hyperg(ad, cd, xd);
long double d = std::tr1::conf_hyperg(al, cl, xl);
long double e = std::tr1::conf_hypergl(al, cl, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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 = std::tr1::conf_hyperg(af, cf, xf);
float b = std::tr1::conf_hypergf(af, cf, xf);
double c = std::tr1::conf_hyperg(ad, cd, xd);
long double d = std::tr1::conf_hyperg(al, cl, xl);
long double e = std::tr1::conf_hypergl(al, cl, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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 }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.7 conf_hyperg
#include <tr1/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;
std::tr1::conf_hyperg(af, cf, xf);
std::tr1::conf_hypergf(af, cf, xf);
std::tr1::conf_hyperg(ad, cd, xd);
std::tr1::conf_hyperg(al, cl, xl);
std::tr1::conf_hypergl(al, cl, xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.7 conf_hyperg
#include <tr1/math.h>
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;
conf_hyperg(af, cf, xf);
conf_hypergf(af, cf, xf);
conf_hyperg(ad, cd, xd);
conf_hyperg(al, cl, xl);
conf_hypergl(al, cl, xl);
return;
}
// { dg-require-c-std "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.8 cyl_bessel_i
#include <tr1/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::tr1::cyl_bessel_i(nuf, xf);
float b = std::tr1::cyl_bessel_if(nuf, xf);
double c = std::tr1::cyl_bessel_i(nud, xd);
long double d = std::tr1::cyl_bessel_i(nul, xl);
long double e = std::tr1::cyl_bessel_il(nul, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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::tr1::cyl_bessel_i(nuf, xf);
float b = std::tr1::cyl_bessel_if(nuf, xf);
double c = std::tr1::cyl_bessel_i(nud, xd);
long double d = std::tr1::cyl_bessel_i(nul, xl);
long double e = std::tr1::cyl_bessel_il(nul, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.8 cyl_bessel_i
#include <tr1/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::tr1::cyl_bessel_i(nuf, xf);
std::tr1::cyl_bessel_if(nuf, xf);
std::tr1::cyl_bessel_i(nud, xd);
std::tr1::cyl_bessel_i(nul, xl);
std::tr1::cyl_bessel_il(nul, xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.8 cyl_bessel_i
#include <tr1/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-require-c-std "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.9 cyl_bessel_j
#include <tr1/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::tr1::cyl_bessel_j(nuf, xf);
float b = std::tr1::cyl_bessel_jf(nuf, xf);
double c = std::tr1::cyl_bessel_j(nud, xd);
long double d = std::tr1::cyl_bessel_j(nul, xl);
long double e = std::tr1::cyl_bessel_jl(nul, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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::tr1::cyl_bessel_j(nuf, xf);
float b = std::tr1::cyl_bessel_jf(nuf, xf);
double c = std::tr1::cyl_bessel_j(nud, xd);
long double d = std::tr1::cyl_bessel_j(nul, xl);
long double e = std::tr1::cyl_bessel_jl(nul, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.9 cyl_bessel_j
#include <tr1/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::tr1::cyl_bessel_j(nuf, xf);
std::tr1::cyl_bessel_jf(nuf, xf);
std::tr1::cyl_bessel_j(nud, xd);
std::tr1::cyl_bessel_j(nul, xl);
std::tr1::cyl_bessel_jl(nul, xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.9 cyl_bessel_j
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.10 cyl_bessel_k
#include <tr1/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::tr1::cyl_bessel_k(nuf, xf);
float b = std::tr1::cyl_bessel_kf(nuf, xf);
double c = std::tr1::cyl_bessel_k(nud, xd);
long double d = std::tr1::cyl_bessel_k(nul, xl);
long double e = std::tr1::cyl_bessel_kl(nul, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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::tr1::cyl_bessel_k(nuf, xf);
float b = std::tr1::cyl_bessel_kf(nuf, xf);
double c = std::tr1::cyl_bessel_k(nud, xd);
long double d = std::tr1::cyl_bessel_k(nul, xl);
long double e = std::tr1::cyl_bessel_kl(nul, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.10 cyl_bessel_k
#include <tr1/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::tr1::cyl_bessel_k(nuf, xf);
std::tr1::cyl_bessel_kf(nuf, xf);
std::tr1::cyl_bessel_k(nud, xd);
std::tr1::cyl_bessel_k(nul, xl);
std::tr1::cyl_bessel_kl(nul, xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.10 cyl_bessel_k
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.11 cyl_neumann
#include <tr1/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::tr1::cyl_neumann(nuf, xf);
float b = std::tr1::cyl_neumannf(nuf, xf);
double c = std::tr1::cyl_neumann(nud, xd);
long double d = std::tr1::cyl_neumann(nul, xl);
long double e = std::tr1::cyl_neumannl(nul, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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::tr1::cyl_neumann(nuf, xf);
float b = std::tr1::cyl_neumannf(nuf, xf);
double c = std::tr1::cyl_neumann(nud, xd);
long double d = std::tr1::cyl_neumann(nul, xl);
long double e = std::tr1::cyl_neumannl(nul, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.11 cyl_neumann
#include <tr1/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::tr1::cyl_neumann(nuf, xf);
std::tr1::cyl_neumannf(nuf, xf);
std::tr1::cyl_neumann(nud, xd);
std::tr1::cyl_neumann(nul, xl);
std::tr1::cyl_neumannl(nul, xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.11 cyl_neumann
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.12 ellint_1
#include <tr1/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::tr1::ellint_1(kf, phif);
float b = std::tr1::ellint_1f(kf, phif);
double c = std::tr1::ellint_1(kd, phid);
long double d = std::tr1::ellint_1(kl, phil);
long double e = std::tr1::ellint_1l(kl, phil);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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::tr1::ellint_1(kf, phif);
float b = std::tr1::ellint_1f(kf, phif);
double c = std::tr1::ellint_1(kd, phid);
long double d = std::tr1::ellint_1(kl, phil);
long double e = std::tr1::ellint_1l(kl, phil);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.12 ellint_1
#include <tr1/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::tr1::ellint_1(kf, phif);
std::tr1::ellint_1f(kf, phif);
std::tr1::ellint_1(kd, phid);
std::tr1::ellint_1(kl, phil);
std::tr1::ellint_1l(kl, phil);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.12 ellint_1
#include <tr1/math.h>
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);
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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.13 ellint_2
#include <tr1/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::tr1::ellint_2(kf, phif);
float b = std::tr1::ellint_2f(kf, phif);
double c = std::tr1::ellint_2(kd, phid);
long double d = std::tr1::ellint_2(kl, phil);
long double e = std::tr1::ellint_2l(kl, phil);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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::tr1::ellint_2(kf, phif);
float b = std::tr1::ellint_2f(kf, phif);
double c = std::tr1::ellint_2(kd, phid);
long double d = std::tr1::ellint_2(kl, phil);
long double e = std::tr1::ellint_2l(kl, phil);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
test02();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.13 ellint_2
#include <tr1/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::tr1::ellint_2(kf, phif);
std::tr1::ellint_2f(kf, phif);
std::tr1::ellint_2(kd, phid);
std::tr1::ellint_2(kl, phil);
std::tr1::ellint_2l(kl, phil);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.13 ellint_2
#include <tr1/math.h>
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);
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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.13 ellint_3
#include <tr1/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::tr1::ellint_3(kf, nuf, phif);
float b = std::tr1::ellint_3f(kf, nuf, phif);
double c = std::tr1::ellint_3(kd, nud, phid);
long double d = std::tr1::ellint_3(kl, nul, phil);
long double e = std::tr1::ellint_3l(kl, nul, phil);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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::tr1::ellint_3(kf, nuf, phif);
float b = std::tr1::ellint_3f(kf, nuf, phif);
double c = std::tr1::ellint_3(kd, nud, phid);
long double d = std::tr1::ellint_3(kl, nul, phil);
long double e = std::tr1::ellint_3l(kl, nul, phil);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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::tr1::ellint_3(kf, nuf, phif);
float b = std::tr1::ellint_3f(kf, nuf, phif);
double c = std::tr1::ellint_3(kd, nud, phid);
long double d = std::tr1::ellint_3(kl, nul, phil);
long double e = std::tr1::ellint_3l(kl, nul, phil);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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 }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.14 ellint_3
#include <tr1/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::tr1::ellint_3(kf, nuf, phif);
std::tr1::ellint_3f(kf, nuf, phif);
std::tr1::ellint_3(kd, nud, phid);
std::tr1::ellint_3(kl, nul, phil);
std::tr1::ellint_3l(kl, nul, phil);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.14 ellint_3
#include <tr1/math.h>
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);
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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.15 expint
#include <tr1/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::tr1::expint(xf);
float b = std::tr1::expintf(xf);
double c = std::tr1::expint(xd);
long double d = std::tr1::expint(xl);
long double e = std::tr1::expintl(xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
return 0;
}
// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 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 <tr1/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 "../testcase.h"
// Test data.
testcase_expint<double> data001[] = {
{ -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.2256908094623838e-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.8409618012250666e-16, -32.000000000000000 },
{ -1.0767670386162383e-15, -31.000000000000000 },
{ -3.0215520106888128e-15, -30.000000000000000 },
{ -8.4877597783535618e-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.00036008245216265867, -6.0000000000000000 },
{ -0.0011482955912753257, -5.0000000000000000 },
{ -0.0037793524098489058, -4.0000000000000000 },
{ -0.013048381094197037, -3.0000000000000000 },
{ -0.048900510708061125, -2.0000000000000000 },
{ -0.21938393439552029, -1.0000000000000000 },
};
// Test function.
template <typename Tp>
void test001()
{
const Tp eps = std::numeric_limits<Tp>::epsilon();
Tp max_abs_diff = -Tp(1);
Tp max_abs_frac = -Tp(1);
unsigned int num_datum = sizeof(data001)
/ sizeof(testcase_expint<double>);
for (unsigned int i = 0; i < num_datum; ++i)
{
const Tp f = std::tr1::expint(Tp(data001[i].x));
const Tp f0 = data001[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 < Tp(2.5000000000000020e-13));
}
int main(int, char**)
{
test001<double>();
return 0;
}
// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 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 <tr1/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 "../testcase.h"
// Test data.
testcase_expint<double> data001[] = {
{ 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.50474333550139, 7.0000000000000000 },
{ 440.37989953483827, 8.0000000000000000 },
{ 1037.8782907170896, 9.0000000000000000 },
{ 2492.2289762418782, 10.000000000000000 },
{ 6071.4063740986112, 11.000000000000000 },
{ 14959.532666397527, 12.000000000000000 },
{ 37197.688490689041, 13.000000000000000 },
{ 93192.513633965369, 14.000000000000000 },
{ 234955.85249076830, 15.000000000000000 },
{ 595560.99867083703, 16.000000000000000 },
{ 1516637.8940425171, 17.000000000000000 },
{ 3877904.3305974435, 18.000000000000000 },
{ 9950907.2510468438, 19.000000000000000 },
{ 25615652.664056588, 20.000000000000000 },
{ 66127186.355484918, 21.000000000000000 },
{ 171144671.30036369, 22.000000000000000 },
{ 443966369.83027118, 23.000000000000000 },
{ 1154115391.8491828, 24.000000000000000 },
{ 3005950906.5255489, 25.000000000000000 },
{ 7842940991.8981876, 26.000000000000000 },
{ 20496497119.880810, 27.000000000000000 },
{ 53645118592.314682, 28.000000000000000 },
{ 140599195758.40689, 29.000000000000000 },
{ 368973209407.27423, 30.000000000000000 },
{ 969455575968.39392, 31.000000000000000 },
{ 2550043566357.7866, 32.000000000000000 },
{ 6714640184076.4980, 33.000000000000000 },
{ 17698037244116.266, 34.000000000000000 },
{ 46690550144661.594, 35.000000000000000 },
{ 123285207991209.75, 36.000000000000000 },
{ 325798899867226.44, 37.000000000000000 },
{ 861638819996578.62, 38.000000000000000 },
{ 2280446200301902.5, 39.000000000000000 },
{ 6039718263611242.0, 40.000000000000000 },
{ 16006649143245042., 41.000000000000000 },
{ 42447960921368504., 42.000000000000000 },
{ 1.1263482901669667e+17, 43.000000000000000 },
{ 2.9904447186323366e+17, 44.000000000000000 },
{ 7.9439160357044531e+17, 45.000000000000000 },
{ 2.1113423886478239e+18, 46.000000000000000 },
{ 5.6143296808103434e+18, 47.000000000000000 },
{ 1.4936302131129930e+19, 48.000000000000000 },
{ 3.9754427479037444e+19, 49.000000000000000 },
{ 1.0585636897131690e+20, 50.000000000000000 },
};
// Test function.
template <typename Tp>
void test001()
{
const Tp eps = std::numeric_limits<Tp>::epsilon();
Tp max_abs_diff = -Tp(1);
Tp max_abs_frac = -Tp(1);
unsigned int num_datum = sizeof(data001)
/ sizeof(testcase_expint<double>);
for (unsigned int i = 0; i < num_datum; ++i)
{
const Tp f = std::tr1::expint(Tp(data001[i].x));
const Tp f0 = data001[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 < Tp(2.5000000000000020e-13));
}
int main(int, char**)
{
test001<double>();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.15 expint
#include <tr1/cmath>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
std::tr1::expint(xf);
std::tr1::expintf(xf);
std::tr1::expint(xd);
std::tr1::expint(xl);
std::tr1::expintl(xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.15 expint
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.4 hermite
#include <tr1/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::tr1::hermite(n, xf);
float b = std::tr1::hermitef(n, xf);
double c = std::tr1::hermite(n, xd);
long double d = std::tr1::hermite(n, xl);
long double e = std::tr1::hermitel(n, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.16 hermite
#include <tr1/cmath>
void
test01()
{
float xf = 2.5F;
double xd = 2.5;
long double xl = 2.5L;
unsigned int n = 5;
std::tr1::hermite(n, xf);
std::tr1::hermitef(n, xf);
std::tr1::hermite(n, xd);
std::tr1::hermite(n, xl);
std::tr1::hermitel(n, xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.16 hermite
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.17 hyperg
#include <tr1/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 = std::tr1::hyperg(af, bf, cf, xf);
float b = std::tr1::hypergf(af, bf, cf, xf);
double c = std::tr1::hyperg(ad, bd, cd, xd);
long double d = std::tr1::hyperg(al, bl, cl, xl);
long double e = std::tr1::hypergl(al, bl, cl, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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 = std::tr1::hyperg(af, bf, cf, xf);
float b = std::tr1::hypergf(af, bf, cf, xf);
double c = std::tr1::hyperg(ad, bd, cd, xd);
long double d = std::tr1::hyperg(al, bl, cl, xl);
long double e = std::tr1::hypergl(al, bl, cl, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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 = std::tr1::hyperg(af, bf, cf, xf);
float b = std::tr1::hypergf(af, bf, cf, xf);
double c = std::tr1::hyperg(ad, bd, cd, xd);
long double d = std::tr1::hyperg(al, bl, cl, xl);
long double e = std::tr1::hypergl(al, bl, cl, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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 = std::tr1::hyperg(af, bf, cf, xf);
float b = std::tr1::hypergf(af, bf, cf, xf);
double c = std::tr1::hyperg(ad, bd, cd, xd);
long double d = std::tr1::hyperg(al, bl, cl, xl);
long double e = std::tr1::hypergl(al, bl, cl, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(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 }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.17 hyperg
#include <tr1/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;
std::tr1::hyperg(af, bf, cf, xf);
std::tr1::hypergf(af, bf, cf, xf);
std::tr1::hyperg(ad, bd, cd, xd);
std::tr1::hyperg(al, bl, cl, xl);
std::tr1::hypergl(al, bl, cl, xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.17 hyperg
#include <tr1/math.h>
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;
hyperg(af, bf, cf, xf);
hypergf(af, bf, cf, xf);
hyperg(ad, bd, cd, xd);
hyperg(al, bl, cl, xl);
hypergl(al, bl, cl, xl);
return;
}
// { dg-require-c-std "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.18 laguerre
#include <tr1/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::tr1::laguerre(n, xf);
float b = std::tr1::laguerref(n, xf);
double c = std::tr1::laguerre(n, xd);
long double d = std::tr1::laguerre(n, xl);
long double e = std::tr1::laguerrel(n, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.18 laguerre
#include <tr1/cmath>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int n = 2;
std::tr1::laguerre(n, xf);
std::tr1::laguerref(n, xf);
std::tr1::laguerre(n, xd);
std::tr1::laguerre(n, xl);
std::tr1::laguerrel(n, xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.18 laguerre
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.19 legendre
#include <tr1/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::tr1::legendre(l, xf);
float b = std::tr1::legendref(l, xf);
double c = std::tr1::legendre(l, xd);
long double d = std::tr1::legendre(l, xl);
long double e = std::tr1::legendrel(l, xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
return 0;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.19 legendre
#include <tr1/cmath>
void
test01()
{
float xf = 0.5F;
double xd = 0.5;
long double xl = 0.5L;
unsigned int l = 2;
std::tr1::legendre(l, xf);
std::tr1::legendref(l, xf);
std::tr1::legendre(l, xd);
std::tr1::legendre(l, xl);
std::tr1::legendrel(l, xl);
return;
}
// { dg-do compile }
// 2006-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.19 legendre
#include <tr1/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 "" }
// 2007-01-10 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2006-2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// 5.2.1.20 riemann_zeta
#include <tr1/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::tr1::riemann_zeta(xf);
float b = std::tr1::riemann_zetaf(xf);
double c = std::tr1::riemann_zeta(xd);
long double d = std::tr1::riemann_zeta(xl);
long double e = std::tr1::riemann_zetal(xl);
VERIFY(std::tr1::isnan<float>(a));
VERIFY(std::tr1::isnan<float>(b));
VERIFY(std::tr1::isnan<double>(c));
VERIFY(std::tr1::isnan<long double>(d));
VERIFY(std::tr1::isnan<long double>(e));
return;
}
int
main()
{
test01();
return 0;
}
// 2007-02-04 Edward Smith-Rowland <3dw4rd@verizon.net>
//
// Copyright (C) 2007 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 2, 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 COPYING. If not, write to the Free
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
// riemann_zeta
// Compare against values generated by the GNU Scientific Library.
// The GSL can be found on the web: http://www.gnu.org/software/gsl/
#include <tr1/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 "../testcase.h"
// Test data.
testcase_riemann_zeta<double> data001[] = {
{ 0.0000000000000000, -10.000000000000000 },
{ -0.0033669820451019579, -9.8000000000000007 },
{ -0.0058129517767319039, -9.5999999999999996 },
{ -0.0072908732290557004, -9.4000000000000004 },
{ -0.0078420910654484442, -9.1999999999999993 },
{ -0.0075757575757575803, -9.0000000000000000 },
{ -0.0066476555677551898, -8.8000000000000007 },
{ -0.0052400095350859429, -8.5999999999999996 },
{ -0.0035434308017674959, -8.4000000000000004 },
{ -0.0017417330388368585, -8.1999999999999993 },
{ 0.0000000000000000, -8.0000000000000000 },
{ 0.0015440036789213965, -7.7999999999999998 },
{ 0.0027852131086497423, -7.5999999999999996 },
{ 0.0036537321227995880, -7.4000000000000004 },
{ 0.0041147930817053468, -7.2000000000000002 },
{ 0.0041666666666666683, -7.0000000000000000 },
{ 0.0038369975032738366, -6.7999999999999998 },
{ 0.0031780270571782981, -6.5999999999999996 },
{ 0.0022611282027338573, -6.4000000000000004 },
{ 0.0011710237049390511, -6.2000000000000002 },
{ 0.0000000000000000, -6.0000000000000000 },
{ -0.0011576366649881879, -5.7999999999999998 },
{ -0.0022106784318564345, -5.5999999999999996 },
{ -0.0030755853460586891, -5.4000000000000004 },
{ -0.0036804380477934787, -5.2000000000000002 },
{ -0.0039682539682539698, -5.0000000000000000 },
{ -0.0038996891301999797, -4.7999999999999998 },
{ -0.0034551830834302711, -4.5999999999999996 },
{ -0.0026366345018725115, -4.4000000000000004 },
{ -0.0014687209305056974, -4.2000000000000002 },
{ 0.0000000000000000, -4.0000000000000000 },
{ 0.0016960463875825209, -3.7999999999999998 },
{ 0.0035198355903356747, -3.5999999999999996 },
{ 0.0053441503206513421, -3.4000000000000004 },
{ 0.0070119720770910540, -3.2000000000000002 },
{ 0.0083333333333333350, -3.0000000000000000 },
{ 0.0090807294856852811, -2.7999999999999998 },
{ 0.0089824623788396681, -2.5999999999999996 },
{ 0.0077130239874243630, -2.4000000000000004 },
{ 0.0048792123593036068, -2.2000000000000002 },
{ 0.0000000000000000, -2.0000000000000000 },
{ -0.0075229347765968010, -1.8000000000000007 },
{ -0.018448986678963775, -1.5999999999999996 },
{ -0.033764987694047593, -1.4000000000000004 },
{ -0.054788441243880631, -1.1999999999999993 },
{ -0.083333333333333398, -1.0000000000000000 },
{ -0.12198707766977103, -0.80000000000000071 },
{ -0.17459571193801401, -0.59999999999999964 },
{ -0.24716546083171492, -0.40000000000000036 },
{ -0.34966628059831484, -0.19999999999999929 },
{ -0.49999999999999994, 0.0000000000000000 },
{ -0.73392092489633953, 0.19999999999999929 },
{ -1.1347977838669825, 0.40000000000000036 },
{ -1.9526614482239983, 0.59999999999999964 },
{ -4.4375384158955677, 0.80000000000000071 },
};
// Test function.
template <typename Tp>
void test001()
{
const Tp eps = std::numeric_limits<Tp>::epsilon();
Tp max_abs_diff = -Tp(1);
Tp max_abs_frac = -Tp(1);
unsigned int num_datum = sizeof(data001)
/ sizeof(testcase_riemann_zeta<double>);
for (unsigned int i = 0; i < num_datum; ++i)
{
const Tp f = std::tr1::riemann_zeta(Tp(data001[i].x));
const Tp f0 = data001[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 < Tp(5.0000000000000039e-13));
}
int main(int, char**)
{
test001<double>();
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