diff options
author | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-16 10:35:16 +0000 |
---|---|---|
committer | bkoz <bkoz@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-16 10:35:16 +0000 |
commit | b34f60accb416680ed11789c89296e3c68ed68f1 (patch) | |
tree | decac71c7af454edb119868a1763aff3b7c70e56 /libstdc++-v3 | |
parent | 15ec875c733b473953eae3637f13665dffb0589b (diff) | |
download | gcc-b34f60accb416680ed11789c89296e3c68ed68f1.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122986 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3')
116 files changed, 60128 insertions, 39 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index e042e395628..22107cd83dc 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,270 @@ +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. + 2007-03-15 Hans-Peter Nilsson <hp@axis.com> * testsuite/lib/libstdc++.exp (v3-build_support) <ar>: If it @@ -145,9 +412,12 @@ * testsuite/27_io/basic_filebuf/sputn/char/9339.cc: Use it. * testsuite/27_io/basic_filebuf/pbackfail/char/9761.cc: Use it. * testsuite/27_io/basic_filebuf/sync/char/9182-1.cc: Use it. - * testsuite/21_strings/basic_string/inserters_extractors/char/10.cc: Use it. - * testsuite/21_strings/basic_string/inserters_extractors/char/11.cc: Use it. - * testsuite/21_strings/basic_string/inserters_extractors/char/5.cc: Use it. + * testsuite/21_strings/basic_string/inserters_extractors/ + char/10.cc: Use it. + * testsuite/21_strings/basic_string/inserters_extractors/ + char/11.cc: Use it. + * testsuite/21_strings/basic_string/inserters_extractors/ + char/5.cc: Use it. 2007-03-13 Paolo Carlini <pcarlini@suse.de> diff --git a/libstdc++-v3/docs/html/ext/tr1.html b/libstdc++-v3/docs/html/ext/tr1.html index d8ae3971540..4a021df09a6 100644 --- a/libstdc++-v3/docs/html/ext/tr1.html +++ b/libstdc++-v3/docs/html/ext/tr1.html @@ -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><cmath></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><math.h></code> synopsis</td> + <td>done</td> <td></td> <td></td> - <td>missing</td> <td></td> </tr> <tr> diff --git a/libstdc++-v3/docs/html/faq/index.html b/libstdc++-v3/docs/html/faq/index.html index 3c907beff9c..298ae37cdb6 100644 --- a/libstdc++-v3/docs/html/faq/index.html +++ b/libstdc++-v3/docs/html/faq/index.html @@ -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 diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am index 9cc39c16eba..e3ca800a27e 100644 --- a/libstdc++-v3/include/Makefile.am +++ b/libstdc++-v3/include/Makefile.am @@ -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 \ diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in index 2f8417a0362..02de25c272f 100644 --- a/libstdc++-v3/include/Makefile.in +++ b/libstdc++-v3/include/Makefile.in @@ -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 \ diff --git a/libstdc++-v3/include/tr1/bessel_function.tcc b/libstdc++-v3/include/tr1/bessel_function.tcc new file mode 100644 index 00000000000..68ca9a31703 --- /dev/null +++ b/libstdc++-v3/include/tr1/bessel_function.tcc @@ -0,0 +1,641 @@ +// 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/bessel_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. +// +// References: +// (1) Handbook of Mathematical Functions, +// ed. Milton Abramowitz and Irene A. Stegun, +// Dover Publications, +// Section 9, pp. 355-434, Section 10 pp. 435-478 +// (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. 240-245 + +#ifndef _TR1_BESSEL_FUNCTION_TCC +#define _TR1_BESSEL_FUNCTION_TCC 1 + +#include "special_function_util.h" + +namespace std +{ +_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) + + // [5.2] Special functions + + /** + * @ingroup tr1_math_spec_func + * @{ + */ + + // + // Implementation-space details. + // + namespace __detail + { + + /** + * @brief Compute the gamma functions required by the Temme series + * expansions of @f$ N_\nu(x) @f$ and @f$ K_\nu(x) @f$. + * @f[ + * \Gamma_1 = \frac{1}{2\mu} + * [\frac{1}{\Gamma(1 - \mu)} - \frac{1}{\Gamma(1 + \mu)}] + * @f] + * and + * @f[ + * \Gamma_2 = \frac{1}{2} + * [\frac{1}{\Gamma(1 - \mu)} + \frac{1}{\Gamma(1 + \mu)}] + * @f] + * where @f$ -1/2 <= \mu <= 1/2 @f$ is @f$ \mu = \nu - N @f$ and @f$ N @f$. + * is the nearest integer to @f$ \nu @f$. + * The values of \f$ \Gamma(1 + \mu) \f$ and \f$ \Gamma(1 - \mu) \f$ + * are returned as well. + * + * The accuracy requirements on this are exquisite. + * + * @param __mu The input parameter of the gamma functions. + * @param __gam1 The output function \f$ \Gamma_1(\mu) \f$ + * @param __gam2 The output function \f$ \Gamma_2(\mu) \f$ + * @param __gampl The output function \f$ \Gamma(1 + \mu) \f$ + * @param __gammi The output function \f$ \Gamma(1 - \mu) \f$ + */ + template <typename _Tp> + void + __gamma_temme(const _Tp __mu, + _Tp & __gam1, _Tp & __gam2, _Tp & __gampl, _Tp & __gammi) + { +#if _GLIBCXX_USE_C99_MATH_TR1 + __gampl = _Tp(1) / std::_GLIBCXX_TR1::tgamma(_Tp(1) + __mu); + __gammi = _Tp(1) / std::_GLIBCXX_TR1::tgamma(_Tp(1) - __mu); +#else + __gampl = _Tp(1) / __gamma(_Tp(1) + __mu); + __gammi = _Tp(1) / __gamma(_Tp(1) - __mu); +#endif + + if (std::abs(__mu) < std::numeric_limits<_Tp>::epsilon()) + __gam1 = -_Tp(__numeric_constants<_Tp>::__gamma_e()); + else + __gam1 = (__gammi - __gampl) / (_Tp(2) * __mu); + + __gam2 = (__gammi + __gampl) / (_Tp(2)); + + return; + } + + + /** + * @brief Compute the Bessel @f$ J_\nu(x) @f$ and Neumann + * @f$ N_\nu(x) @f$ functions and their first derivatives + * @f$ J'_\nu(x) @f$ and @f$ N'_\nu(x) @f$ respectively. + * These four functions are computed together for numerical + * stability. + * + * @param __nu The order of the Bessel functions. + * @param __x The argument of the Bessel functions. + * @param __Jnu The output Bessel function of the first kind. + * @param __Nnu The output Neumann function (Bessel fuction of the second kind). + * @param __Jpnu The output derivative of the Bessel function of the first kind. + * @param __Npnu The output derivative of the Neumann function. + */ + template <typename _Tp> + void + __bessel_jn(const _Tp __nu, const _Tp __x, + _Tp & __Jnu, _Tp & __Nnu, _Tp & __Jpnu, _Tp & __Npnu) + { + if (__x == _Tp(0)) + { + if (__nu == _Tp(0)) + { + __Jnu = _Tp(1); + __Jpnu = _Tp(0); + } + else if (__nu == _Tp(1)) + { + __Jnu = _Tp(0); + __Jpnu = _Tp(0.5L); + } + else + { + __Jnu = _Tp(0); + __Jpnu = _Tp(0); + } + __Nnu = -std::numeric_limits<_Tp>::infinity(); + __Npnu = std::numeric_limits<_Tp>::infinity(); + return; + } + + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + // When the multiplier is N i.e. + // fp_min = N * min() + // Then J_0 and N_0 tank at x = 8 * N (J_0 = 0 and N_0 = nan)! + //const _Tp __fp_min = _Tp(20) * std::numeric_limits<_Tp>::min(); + const _Tp __fp_min = std::sqrt(std::numeric_limits<_Tp>::min()); + const int __max_iter = 15000; + const _Tp __x_min = _Tp(2); + + const int __nl = (__x < __x_min + ? static_cast<int>(__nu + _Tp(0.5L)) + : std::max(0, static_cast<int>(__nu - __x + _Tp(1.5L)))); + + const _Tp __mu = __nu - __nl; + const _Tp __mu2 = __mu * __mu; + const _Tp __xi = _Tp(1) / __x; + const _Tp __xi2 = _Tp(2) * __xi; + _Tp __w = __xi2 / __numeric_constants<_Tp>::__pi(); + int __isign = 1; + _Tp __h = __nu * __xi; + if (__h < __fp_min) + __h = __fp_min; + _Tp __b = __xi2 * __nu; + _Tp __d = _Tp(0); + _Tp __c = __h; + int __i; + for (__i = 1; __i <= __max_iter; ++__i) + { + __b += __xi2; + __d = __b - __d; + if (std::abs(__d) < __fp_min) + __d = __fp_min; + __c = __b - _Tp(1) / __c; + if (std::abs(__c) < __fp_min) + __c = __fp_min; + __d = _Tp(1) / __d; + const _Tp __del = __c * __d; + __h *= __del; + if (__d < _Tp(0)) + __isign = -__isign; + if (std::abs(__del - _Tp(1)) < __eps) + break; + } + if (__i > __max_iter) + std::__throw_runtime_error(__N("Argument x too large in __bessel_jn; " + "try asymptotic expansion.")); + _Tp __Jnul = __isign * __fp_min; + _Tp __Jpnul = __h * __Jnul; + _Tp __Jnul1 = __Jnul; + _Tp __Jpnu1 = __Jpnul; + _Tp __fact = __nu * __xi; + for ( int __l = __nl; __l >= 1; --__l ) + { + const _Tp __Jnutemp = __fact * __Jnul + __Jpnul; + __fact -= __xi; + __Jpnul = __fact * __Jnutemp - __Jnul; + __Jnul = __Jnutemp; + } + if (__Jnul == _Tp(0)) + __Jnul = __eps; + _Tp __f= __Jpnul / __Jnul; + _Tp __Nmu, __Nnu1, __Npmu, __Jmu; + if (__x < __x_min) + { + const _Tp __x2 = __x / _Tp(2); + const _Tp __pimu = __numeric_constants<_Tp>::__pi() * __mu; + _Tp __fact = (std::abs(__pimu) < __eps + ? _Tp(1) : __pimu / std::sin(__pimu)); + _Tp __d = -std::log(__x2); + _Tp __e = __mu * __d; + _Tp __fact2 = (std::abs(__e) < __eps + ? _Tp(1) : std::sinh(__e) / __e); + _Tp __gam1, __gam2, __gampl, __gammi; + __gamma_temme(__mu, __gam1, __gam2, __gampl, __gammi); + _Tp __ff = (_Tp(2) / __numeric_constants<_Tp>::__pi()) + * __fact * (__gam1 * std::cosh(__e) + __gam2 * __fact2 * __d); + __e = std::exp(__e); + _Tp __p = __e / (__numeric_constants<_Tp>::__pi() * __gampl); + _Tp __q = _Tp(1) / (__e * __numeric_constants<_Tp>::__pi() * __gammi); + const _Tp __pimu2 = __pimu / _Tp(2); + _Tp __fact3 = (std::abs(__pimu2) < __eps + ? _Tp(1) : std::sin(__pimu2) / __pimu2 ); + _Tp __r = __numeric_constants<_Tp>::__pi() * __pimu2 * __fact3 * __fact3; + _Tp __c = _Tp(1); + __d = -__x2 * __x2; + _Tp __sum = __ff + __r * __q; + _Tp __sum1 = __p; + for (__i = 1; __i <= __max_iter; ++__i) + { + __ff = (__i * __ff + __p + __q) / (__i * __i - __mu2); + __c *= __d / _Tp(__i); + __p /= _Tp(__i) - __mu; + __q /= _Tp(__i) + __mu; + const _Tp __del = __c * (__ff + __r * __q); + __sum += __del; + const _Tp __del1 = __c * __p - __i * __del; + __sum1 += __del1; + if ( std::abs(__del) < __eps * (_Tp(1) + std::abs(__sum)) ) + break; + } + if ( __i > __max_iter ) + std::__throw_runtime_error(__N("Bessel y series failed to converge " + "in __bessel_jn.")); + __Nmu = -__sum; + __Nnu1 = -__sum1 * __xi2; + __Npmu = __mu * __xi * __Nmu - __Nnu1; + __Jmu = __w / (__Npmu - __f * __Nmu); + } + else + { + _Tp __a = _Tp(0.25L) - __mu2; + _Tp __q = _Tp(1); + _Tp __p = -__xi / _Tp(2); + _Tp __br = _Tp(2) * __x; + _Tp __bi = _Tp(2); + _Tp __fact = __a * __xi / (__p * __p + __q * __q); + _Tp __cr = __br + __q * __fact; + _Tp __ci = __bi + __p * __fact; + _Tp __den = __br * __br + __bi * __bi; + _Tp __dr = __br / __den; + _Tp __di = -__bi / __den; + _Tp __dlr = __cr * __dr - __ci * __di; + _Tp __dli = __cr * __di + __ci * __dr; + _Tp __temp = __p * __dlr - __q * __dli; + __q = __p * __dli + __q * __dlr; + __p = __temp; + int __i; + for (__i = 2; __i <= __max_iter; ++__i) + { + __a += _Tp(2 * (__i - 1)); + __bi += _Tp(2); + __dr = __a * __dr + __br; + __di = __a * __di + __bi; + if (std::abs(__dr) + std::abs(__di) < __fp_min) + __dr = __fp_min; + __fact = __a / (__cr * __cr + __ci * __ci); + __cr = __br + __cr * __fact; + __ci = __bi - __ci * __fact; + if (std::abs(__cr) + std::abs(__ci) < __fp_min) + __cr = __fp_min; + __den = __dr * __dr + __di * __di; + __dr /= __den; + __di /= -__den; + __dlr = __cr * __dr - __ci * __di; + __dli = __cr * __di + __ci * __dr; + __temp = __p * __dlr - __q * __dli; + __q = __p * __dli + __q * __dlr; + __p = __temp; + if (std::abs(__dlr - _Tp(1)) + std::abs(__dli) < __eps) + break; + } + if (__i > __max_iter) + std::__throw_runtime_error(__N("Lentz's method failed " + "in __bessel_jn.")); + const _Tp __gam = (__p - __f) / __q; + __Jmu = std::sqrt(__w / ((__p - __f) * __gam + __q)); +#if _GLIBCXX_USE_C99_MATH_TR1 + __Jmu = std::_GLIBCXX_TR1::copysign(__Jmu, __Jnul); +#else + if (__Jmu * __Jnul < _Tp(0)) + __Jmu = -__Jmu; +#endif + __Nmu = __gam * __Jmu; + __Npmu = (__p + __q / __gam) * __Nmu; + __Nnu1 = __mu * __xi * __Nmu - __Npmu; + } + __fact = __Jmu / __Jnul; + __Jnu = __fact * __Jnul1; + __Jpnu = __fact * __Jpnu1; + for (__i = 1; __i <= __nl; ++__i) + { + const _Tp __Nnutemp = (__mu + __i) * __xi2 * __Nnu1 - __Nmu; + __Nmu = __Nnu1; + __Nnu1 = __Nnutemp; + } + __Nnu = __Nmu; + __Npnu = __nu * __xi * __Nmu - __Nnu1; + + return; + } + + + /** + * @brief This routine computes the asyptotic cylindrical Bessel + * and Neumann functions of order nu: \f$ J_{\nu} \f$, + * \f$ N_{\nu} \f$. + * + * References: + * (1) Handbook of Mathematical Functions, + * ed. Milton Abramowitz and Irene A. Stegun, + * Dover Publications, + * Section 9 p. 364, Equations 9.2.5-9.2.10 + * + * @param __nu The order of the Bessel functions. + * @param __x The argument of the Bessel functions. + * @param __Jnu The output Bessel function of the first kind. + * @param __Nnu The output Neumann function (Bessel fuction of the second kind). + */ + template <typename _Tp> + void + __cyl_bessel_jn_asymp(const _Tp __nu, const _Tp __x, + _Tp & __Jnu, _Tp & __Nnu) + { + const _Tp __coef = std::sqrt(_Tp(2) + / (__numeric_constants<_Tp>::__pi() * __x)); + const _Tp __mu = _Tp(4) * __nu * __nu; + const _Tp __mum1 = __mu - _Tp(1); + const _Tp __mum9 = __mu - _Tp(9); + const _Tp __mum25 = __mu - _Tp(25); + const _Tp __mum49 = __mu - _Tp(49); + const _Tp __xx = _Tp(64) * __x * __x; + const _Tp __P = _Tp(1) - __mum1 * __mum9 / (_Tp(2) * __xx) + * (_Tp(1) - __mum25 * __mum49 / (_Tp(12) * __xx)); + const _Tp __Q = __mum1 / (_Tp(8) * __x) + * (_Tp(1) - __mum9 * __mum25 / (_Tp(6) * __xx)); + + const _Tp __chi = __x - (__nu + _Tp(0.5L)) + * __numeric_constants<_Tp>::__pi_2(); + const _Tp __c = std::cos(__chi); + const _Tp __s = std::sin(__chi); + + __Jnu = __coef * (__c * __P - __s * __Q); + __Nnu = __coef * (__s * __P + __c * __Q); + + return; + } + + + /** + * @brief This routine returns the cylindrical Bessel functions + * of order \f$ \nu \f$: \f$ J_{\nu} \f$ or \f$ I_{\nu} \f$ + * by series expansion. + * + * The modified cylindrical Bessel function is: + * @f[ + * Z_{\nu}(x) = \sum_{k=0}^{\infty} + * \frac{\sigma^k (x/2)^{\nu + 2k}}{k!\Gamma(\nu+k+1)} + * @f] + * where \f$ \sigma = +1 \f$ or\f$ -1 \f$ for + * \f$ Z = I \f$ or \f$ J \f$ respecively. + * + * See Abramowitz & Stegun, 9.1.10 + * Abramowitz & Stegun, 9.6.7 + * (1) Handbook of Mathematical Functions, + * ed. Milton Abramowitz and Irene A. Stegun, + * Dover Publications, + * Equation 9.1.10 p. 360 and Equation 9.6.10 p. 375 + * + * @param __nu The order of the Bessel function. + * @param __x The argument of the Bessel function. + * @param __sgn The sign of the alternate terms + * -1 for the Bessel function of the first kind. + * +1 for the modified Bessel function of the first kind. + * @return The output Bessel function. + */ + template <typename _Tp> + _Tp + __cyl_bessel_ij_series(const _Tp __nu, const _Tp __x, const _Tp __sgn, + const unsigned int __max_iter) + { + + const _Tp __x2 = __x / _Tp(2); + _Tp __fact = __nu * std::log(__x2); +#if _GLIBCXX_USE_C99_MATH_TR1 + __fact -= std::_GLIBCXX_TR1::lgamma(__nu + _Tp(1)); +#else + __fact -= __log_gamma(__nu + _Tp(1)); +#endif + __fact = std::exp(__fact); + const _Tp __xx4 = __sgn * __x2 * __x2; + _Tp __Jn = _Tp(1); + _Tp __term = _Tp(1); + + for (unsigned int __i = 1; __i < __max_iter; ++__i) + { + __term *= __xx4 / (_Tp(__i) * (__nu + _Tp(__i))); + __Jn += __term; + if (std::abs(__term / __Jn) < std::numeric_limits<_Tp>::epsilon()) + break; + } + + return __fact * __Jn; + } + + + /** + * @brief Return the Bessel function of order \f$ \nu \f$: + * \f$ J_{\nu}(x) \f$. + * + * The cylindrical Bessel function is: + * @f[ + * J_{\nu}(x) = \sum_{k=0}^{\infty} + * \frac{(-1)^k (x/2)^{\nu + 2k}}{k!\Gamma(\nu+k+1)} + * @f] + * + * @param __nu The order of the Bessel function. + * @param __x The argument of the Bessel function. + * @return The output Bessel function. + */ + template<typename _Tp> + _Tp + __cyl_bessel_j(const _Tp __nu, const _Tp __x) + { + if (__nu < _Tp(0) || __x < _Tp(0)) + std::__throw_domain_error(__N("Bad argument " + "in __cyl_bessel_j.")); + else if (__isnan(__nu) || __isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__x * __x < _Tp(10) * (__nu + _Tp(1))) + return __cyl_bessel_ij_series(__nu, __x, -_Tp(1), 200); + else if (__x > _Tp(1000)) + { + _Tp __J_nu, __N_nu; + __cyl_bessel_jn_asymp(__nu, __x, __J_nu, __N_nu); + return __J_nu; + } + else + { + _Tp __J_nu, __N_nu, __Jp_nu, __Np_nu; + __bessel_jn(__nu, __x, __J_nu, __N_nu, __Jp_nu, __Np_nu); + return __J_nu; + } + } + + + /** + * @brief Return the Neunamm function of order \f$ \nu \f$: + * \f$ N_{\nu}(x) \f$. + * + * The Neumann function is defined by: + * @f[ + * N_{\nu}(x) = \frac{J_{\nu}(x) \cos \nu\pi - J_{-\nu}(x)} + * {\sin \nu\pi} + * @f] + * where for integral \f$ \nu = n \f$ a limit is taken: + * \f$ lim_{\nu \to n} \f$. + * + * @param __nu The order of the Neumann function. + * @param __x The argument of the Neumann function. + * @return The output Neumann function. + */ + template<typename _Tp> + _Tp + __cyl_neumann_n(const _Tp __nu, const _Tp __x) + { + if (__nu < _Tp(0) || __x < _Tp(0)) + std::__throw_domain_error(__N("Bad argument " + "in __cyl_neumann_n.")); + else if (__isnan(__nu) || __isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__x > _Tp(1000)) + { + _Tp __J_nu, __N_nu; + __cyl_bessel_jn_asymp(__nu, __x, __J_nu, __N_nu); + return __N_nu; + } + else + { + _Tp __J_nu, __N_nu, __Jp_nu, __Np_nu; + __bessel_jn(__nu, __x, __J_nu, __N_nu, __Jp_nu, __Np_nu); + return __N_nu; + } + } + + + /** + * @brief Compute the spherical Bessel @f$ j_n(x) @f$ + * and Neumann @f$ n_n(x) @f$ functions and their first + * derivatives @f$ j'_n(x) @f$ and @f$ n'_n(x) @f$ + * respectively. + * + * @param __n The order of the spherical Bessel function. + * @param __x The argument of the spherical Bessel function. + * @param __j_n The output spherical Bessel function. + * @param __n_n The output spherical Neumann function. + * @param __jp_n The output derivative of the spherical Bessel function. + * @param __np_n The output derivative of the spherical Neumann function. + */ + template <typename _Tp> + void + __sph_bessel_jn(const unsigned int __n, const _Tp __x, + _Tp & __j_n, _Tp & __n_n, _Tp & __jp_n, _Tp & __np_n) + { + const _Tp __nu = _Tp(__n) + _Tp(0.5L); + + _Tp __J_nu, __N_nu, __Jp_nu, __Np_nu; + __bessel_jn(__nu, __x, __J_nu, __N_nu, __Jp_nu, __Np_nu); + + const _Tp __factor = __numeric_constants<_Tp>::__sqrtpio2() + / std::sqrt(__x); + + __j_n = __factor * __J_nu; + __n_n = __factor * __N_nu; + __jp_n = __factor * __Jp_nu - __j_n / (_Tp(2) * __x); + __np_n = __factor * __Np_nu - __n_n / (_Tp(2) * __x); + + return; + } + + + /** + * @brief Return the spherical Bessel function + * @f$ j_n(x) @f$ of order n. + * + * The spherical Bessel function is defined by: + * @f[ + * j_n(x) = \left( \frac{\pi}{2x} \right) ^{1/2} J_{n+1/2}(x) + * @f] + * + * @param __n The order of the spherical Bessel function. + * @param __x The argument of the spherical Bessel function. + * @return The output spherical Bessel function. + */ + template <typename _Tp> + _Tp + __sph_bessel(const unsigned int __n, const _Tp __x) + { + if (__x < _Tp(0)) + std::__throw_domain_error(__N("Bad argument " + "in __sph_bessel.")); + else if (__isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__x == _Tp(0)) + { + if (__n == 0) + return _Tp(1); + else + return _Tp(0); + } + else + { + _Tp __j_n, __n_n, __jp_n, __np_n; + __sph_bessel_jn(__n, __x, __j_n, __n_n, __jp_n, __np_n); + return __j_n; + } + } + + + /** + * @brief Return the spherical Neumann function + * @f$ n_n(x) @f$. + * + * The spherical Neumann function is defined by: + * @f[ + * n_n(x) = \left( \frac{\pi}{2x} \right) ^{1/2} N_{n+1/2}(x) + * @f] + * + * @param __n The order of the spherical Neumann function. + * @param __x The argument of the spherical Neumann function. + * @return The output spherical Neumann function. + */ + template <typename _Tp> + _Tp + __sph_neumann(const unsigned int __n, const _Tp __x) + { + if (__x < _Tp(0)) + std::__throw_domain_error(__N("Bad argument " + "in __sph_neumann.")); + else if (__isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__x == _Tp(0)) + return -std::numeric_limits<_Tp>::infinity(); + else + { + _Tp __j_n, __n_n, __jp_n, __np_n; + __sph_bessel_jn(__n, __x, __j_n, __n_n, __jp_n, __np_n); + return __n_n; + } + } + + } // namespace std::tr1::__detail + + /* @} */ // group tr1_math_spec_func + +_GLIBCXX_END_NAMESPACE +} + +#endif // _TR1_BESSEL_FUNCTION_TCC diff --git a/libstdc++-v3/include/tr1/beta_function.tcc b/libstdc++-v3/include/tr1/beta_function.tcc new file mode 100644 index 00000000000..a46011708f1 --- /dev/null +++ b/libstdc++-v3/include/tr1/beta_function.tcc @@ -0,0 +1,211 @@ +// 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 diff --git a/libstdc++-v3/include/tr1/cmath b/libstdc++-v3/include/tr1/cmath index 65115e67350..b07add26156 100644 --- a/libstdc++-v3/include/tr1/cmath +++ b/libstdc++-v3/include/tr1/cmath @@ -1,6 +1,6 @@ // TR1 cmath -*- C++ -*- -// Copyright (C) 2006 Free Software Foundation, Inc. +// 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 @@ -35,6 +35,7 @@ #define _TR1_CMATH 1 #include <bits/c++config.h> +#include <algorithm> #include <cmath> #include <tr1/common.h> @@ -940,4 +941,470 @@ _GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) _GLIBCXX_END_NAMESPACE } + /** + * @defgroup tr1_math_spec_func Mathematical Special Functions + * A collection of advanced mathematical special functions. + * @{ + */ + +#include <tr1/gamma.tcc> +#include <tr1/bessel_function.tcc> +#include <tr1/beta_function.tcc> +#include <tr1/ell_integral.tcc> +#include <tr1/exp_integral.tcc> +#include <tr1/hypergeometric.tcc> +#include <tr1/legendre_function.tcc> +#include <tr1/modified_bessel_func.tcc> +#include <tr1/poly_hermite.tcc> +#include <tr1/poly_laguerre.tcc> +#include <tr1/riemann_zeta.tcc> + +// namespace std::tr1 +namespace std +{ +_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) + + // 5.2.1.1 Associated Laguerre polynomials. + + inline float + assoc_laguerref(unsigned int __n, unsigned int __m, float __x) + { return __detail::__assoc_laguerre<float>(__n, __m, __x); } + + inline long double + assoc_laguerrel(unsigned int __n, unsigned int __m, long double __x) + { + return __detail::__assoc_laguerre<long double>(__n, __m, __x); + } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + assoc_laguerre(unsigned int __n, unsigned int __m, _Tp __x) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__assoc_laguerre<__type>(__n, __m, __x); + } + + + // 5.2.1.2 Associated Legendre functions. + + inline float + assoc_legendref(unsigned int __l, unsigned int __m, float __x) + { return __detail::__assoc_legendre_p<float>(__l, __m, __x); } + + inline long double + assoc_legendrel(unsigned int __l, unsigned int __m, long double __x) + { return __detail::__assoc_legendre_p<long double>(__l, __m, __x); } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + assoc_legendre(unsigned int __l, unsigned int __m, _Tp __x) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__assoc_legendre_p<__type>(__l, __m, __x); + } + + + // 5.2.1.3 Beta functions. + + inline float + betaf(float __x, float __y) + { return __detail::__beta<float>(__x, __y); } + + inline long double + betal(long double __x, long double __y) + { return __detail::__beta<long double>(__x, __y); } + + template<typename _Tpx, typename _Tpy> + inline typename __promote_2<_Tpx, _Tpy>::__type + beta(_Tpx __x, _Tpy __y) + { + typedef typename __promote_2<_Tpx, _Tpy>::__type __type; + return __detail::__beta<__type>(__x, __y); + } + + + // 5.2.1.4 Complete elliptic interals of the first kind. + + inline float + comp_ellint_1f(float __k) + { return __detail::__comp_ellint_1<float>(__k); } + + inline long double + comp_ellint_1l(long double __k) + { return __detail::__comp_ellint_1<long double>(__k); } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + comp_ellint_1(_Tp __k) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__comp_ellint_1<__type>(__k); + } + + + // 5.2.1.5 Complete elliptic interals of the second kind. + + inline float + comp_ellint_2f(float __k) + { return __detail::__comp_ellint_2<float>(__k); } + + inline long double + comp_ellint_2l(long double __k) + { return __detail::__comp_ellint_2<long double>(__k); } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + comp_ellint_2(_Tp __k) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__comp_ellint_2<__type>(__k); + } + + + // 5.2.1.6 Complete elliptic interals of the third kind. + + inline float + comp_ellint_3f(float __k, float __nu) + { return __detail::__comp_ellint_3<float>(__k, __nu); } + + inline long double + comp_ellint_3l(long double __k, long double __nu) + { return __detail::__comp_ellint_3<long double>(__k, __nu); } + + template<typename _Tp, typename _Tpn> + inline typename __promote_2<_Tp, _Tpn>::__type + comp_ellint_3(_Tp __k, _Tpn __nu) + { + typedef typename __promote_2<_Tp, _Tpn>::__type __type; + return __detail::__comp_ellint_3<__type>(__k, __nu); + } + + + // 5.2.1.7 Confluent hypergeometric functions. + + inline float + conf_hypergf(float __a, float __c, float __x) + { return __detail::__conf_hyperg<float>(__a, __c, __x); } + + inline long double + conf_hypergl(long double __a, long double __c, long double __x) + { return __detail::__conf_hyperg<long double>(__a, __c, __x); } + + template<typename _Tpa, typename _Tpc, typename _Tp> + inline typename __promote_3<_Tpa, _Tpc, _Tp>::__type + conf_hyperg(_Tpa __a, _Tpc __c, _Tp __x) + { + typedef typename __promote_3<_Tpa, _Tpc, _Tp>::__type __type; + return __detail::__conf_hyperg<__type>(__a, __c, __x); + } + + + // 5.2.1.8 Regular modified cylindrical Bessel functions. + + inline float + cyl_bessel_if(float __nu, float __x) + { return __detail::__cyl_bessel_i<float>(__nu, __x); } + + inline long double + cyl_bessel_il(long double __nu, long double __x) + { return __detail::__cyl_bessel_i<long double>(__nu, __x); } + + template<typename _Tpnu, typename _Tp> + inline typename __promote_2<_Tpnu, _Tp>::__type + cyl_bessel_i(_Tpnu __nu, _Tp __x) + { + typedef typename __promote_2<_Tpnu, _Tp>::__type __type; + return __detail::__cyl_bessel_i<__type>(__nu, __x); + } + + + // 5.2.1.9 Cylindrical Bessel functions (of the first kind). + + inline float + cyl_bessel_jf(float __nu, float __x) + { return __detail::__cyl_bessel_j<float>(__nu, __x); } + + inline long double + cyl_bessel_jl(long double __nu, long double __x) + { return __detail::__cyl_bessel_j<long double>(__nu, __x); } + + template<typename _Tpnu, typename _Tp> + inline typename __promote_2<_Tpnu, _Tp>::__type + cyl_bessel_j(_Tpnu __nu, _Tp __x) + { + typedef typename __promote_2<_Tpnu, _Tp>::__type __type; + return __detail::__cyl_bessel_j<__type>(__nu, __x); + } + + + // 5.2.1.10 Irregular modified cylindrical Bessel functions. + + inline float + cyl_bessel_kf(float __nu, float __x) + { return __detail::__cyl_bessel_k<float>(__nu, __x); } + + inline long double + cyl_bessel_kl(long double __nu, long double __x) + { return __detail::__cyl_bessel_k<long double>(__nu, __x); } + + template<typename _Tpnu, typename _Tp> + inline typename __promote_2<_Tpnu, _Tp>::__type + cyl_bessel_k(_Tpnu __nu, _Tp __x) + { + typedef typename __promote_2<_Tpnu, _Tp>::__type __type; + return __detail::__cyl_bessel_k<__type>(__nu, __x); + } + + + // 5.2.1.11 Cylindrical Neumann functions. + + inline float + cyl_neumannf(float __nu, float __x) + { return __detail::__cyl_neumann_n<float>(__nu, __x); } + + inline long double + cyl_neumannl(long double __nu, long double __x) + { return __detail::__cyl_neumann_n<long double>(__nu, __x); } + + template<typename _Tpnu, typename _Tp> + inline typename __promote_2<_Tpnu, _Tp>::__type + cyl_neumann(_Tpnu __nu, _Tp __x) + { + typedef typename __promote_2<_Tpnu, _Tp>::__type __type; + return __detail::__cyl_neumann_n<__type>(__nu, __x); + } + + + // 5.2.1.12 Incomplete elliptic interals of the first kind. + + inline float + ellint_1f(float __k, float __phi) + { return __detail::__ellint_1<float>(__k, __phi); } + + inline long double + ellint_1l(long double __k, long double __phi) + { return __detail::__ellint_1<long double>(__k, __phi); } + + template<typename _Tp, typename _Tpp> + inline typename __promote_2<_Tp, _Tpp>::__type + ellint_1(_Tp __k, _Tpp __phi) + { + typedef typename __promote_2<_Tp, _Tpp>::__type __type; + return __detail::__ellint_1<__type>(__k, __phi); + } + + + // 5.2.1.13 Incomplete elliptic interals of the second kind. + + inline float + ellint_2f(float __k, float __phi) + { return __detail::__ellint_2<float>(__k, __phi); } + + inline long double + ellint_2l(long double __k, long double __phi) + { return __detail::__ellint_2<long double>(__k, __phi); } + + template<typename _Tp, typename _Tpp> + inline typename __promote_2<_Tp, _Tpp>::__type + ellint_2(_Tp __k, _Tpp __phi) + { + typedef typename __promote_2<_Tp, _Tpp>::__type __type; + return __detail::__ellint_2<__type>(__k, __phi); + } + + + // 5.2.1.14 Incomplete elliptic interals of the third kind. + + inline float + ellint_3f(float __k, float __nu, float __phi) + { return __detail::__ellint_3<float>(__k, __nu, __phi); } + + inline long double + ellint_3l(long double __k, long double __nu, long double __phi) + { return __detail::__ellint_3<long double>(__k, __nu, __phi); } + + template<typename _Tp, typename _Tpn, typename _Tpp> + inline typename __promote_3<_Tp, _Tpn, _Tpp>::__type + ellint_3(_Tp __k, _Tpn __nu, _Tpp __phi) + { + typedef typename __promote_3<_Tp, _Tpn, _Tpp>::__type __type; + return __detail::__ellint_3<__type>(__k, __nu, __phi); + } + + + // 5.2.1.15 Exponential integrals. + + inline float + expintf(float __x) + { return __detail::__expint<float>(__x); } + + inline long double + expintl(long double __x) + { return __detail::__expint<long double>(__x); } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + expint(_Tp __x) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__expint<__type>(__x); + } + + + // 5.2.1.16 Hermite polynomials. + + inline float + hermitef(unsigned int __n, float __x) + { return __detail::__poly_hermite<float>(__n, __x); } + + inline long double + hermitel(unsigned int __n, long double __x) + { return __detail::__poly_hermite<long double>(__n, __x); } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + hermite(unsigned int __n, _Tp __x) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__poly_hermite<__type>(__n, __x); + } + + + // 5.2.1.17 Hypergeometric functions. + + inline float + hypergf(float __a, float __b, float __c, float __x) + { return __detail::__hyperg<float>(__a, __b, __c, __x); } + + inline long double + hypergl(long double __a, long double __b, long double __c, long double __x) + { return __detail::__hyperg<long double>(__a, __b, __c, __x); } + + template<typename _Tpa, typename _Tpb, typename _Tpc, typename _Tp> + inline typename __promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type + hyperg(_Tpa __a, _Tpb __b, _Tpc __c, _Tp __x) + { + typedef typename __promote_4<_Tpa, _Tpb, _Tpc, _Tp>::__type __type; + return __detail::__hyperg<__type>(__a, __b, __c, __x); + } + + + // 5.2.1.18 Laguerre polynomials. + + inline float + laguerref(unsigned int __n, float __x) + { return __detail::__laguerre<float>(__n, __x); } + + inline long double + laguerrel(unsigned int __n, long double __x) + { return __detail::__laguerre<long double>(__n, __x); } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + laguerre(unsigned int __n, _Tp __x) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__laguerre<__type>(__n, __x); + } + + + // 5.2.1.19 Legendre polynomials. + + inline float + legendref(unsigned int __n, float __x) + { return __detail::__poly_legendre_p<float>(__n, __x); } + + inline long double + legendrel(unsigned int __n, long double __x) + { return __detail::__poly_legendre_p<long double>(__n, __x); } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + legendre(unsigned int __n, _Tp __x) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__poly_legendre_p<__type>(__n, __x); + } + + + // 5.2.1.20 Riemann zeta function. + + inline float + riemann_zetaf(float __x) + { return __detail::__riemann_zeta<float>(__x); } + + inline long double + riemann_zetal(long double __x) + { return __detail::__riemann_zeta<long double>(__x); } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + riemann_zeta(_Tp __x) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__riemann_zeta<__type>(__x); + } + + + // 5.2.1.21 Spherical Bessel functions. + + inline float + sph_besself(unsigned int __n, float __x) + { return __detail::__sph_bessel<float>(__n, __x); } + + inline long double + sph_bessell(unsigned int __n, long double __x) + { return __detail::__sph_bessel<long double>(__n, __x); } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + sph_bessel(unsigned int __n, _Tp __x) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__sph_bessel<__type>(__n, __x); + } + + + // 5.2.1.22 Spherical associated Legendre functions. + + inline float + sph_legendref(unsigned int __l, unsigned int __m, float __theta) + { return __detail::__sph_legendre<float>(__l, __m, __theta); } + + inline long double + sph_legendrel(unsigned int __l, unsigned int __m, long double __theta) + { return __detail::__sph_legendre<long double>(__l, __m, __theta); } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + sph_legendre(unsigned int __l, unsigned int __m, _Tp __theta) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__sph_legendre<__type>(__l, __m, __theta); + } + + + // 5.2.1.23 Spherical Neumann functions. + + inline float + sph_neumannf(unsigned int __n, float __x) + { return __detail::__sph_neumann<float>(__n, __x); } + + inline long double + sph_neumannl(unsigned int __n, long double __x) + { return __detail::__sph_neumann<long double>(__n, __x); } + + template<typename _Tp> + inline typename __promote<_Tp>::__type + sph_neumann(unsigned int __n, _Tp __x) + { + typedef typename __promote<_Tp>::__type __type; + return __detail::__sph_neumann<__type>(__n, __x); + } + + /* @} */ // group tr1_math_spec_func + +_GLIBCXX_END_NAMESPACE +} + #endif diff --git a/libstdc++-v3/include/tr1/common.h b/libstdc++-v3/include/tr1/common.h index fb13cdea320..d26fdd6da5c 100644 --- a/libstdc++-v3/include/tr1/common.h +++ b/libstdc++-v3/include/tr1/common.h @@ -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 diff --git a/libstdc++-v3/include/tr1/ell_integral.tcc b/libstdc++-v3/include/tr1/ell_integral.tcc new file mode 100644 index 00000000000..2f2da376bf1 --- /dev/null +++ b/libstdc++-v3/include/tr1/ell_integral.tcc @@ -0,0 +1,762 @@ +// 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/ell_integral.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) B. C. Carlson Numer. Math. 33, 1 (1979) +// (2) B. C. Carlson, Special Functions of Applied Mathematics (1977) +// (3) The Gnu Scientific Library, http://www.gnu.org/software/gsl +// (4) Numerical Recipes in C, 2nd ed, by W. H. Press, S. A. Teukolsky, +// W. T. Vetterling, B. P. Flannery, Cambridge University Press +// (1992), pp. 261-269 + +#ifndef _TR1_ELL_INTEGRAL_TCC +#define _TR1_ELL_INTEGRAL_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 Carlson elliptic function @f$ R_F(x,y,z) @f$ + * of the first kind. + * + * The Carlson elliptic function of the first kind is defined by: + * @f[ + * R_F(x,y,z) = \frac{1}{2} \int_0^\infty + * \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{1/2}} + * @f] + * + * @param __x The first of three symmetric arguments. + * @param __y The second of three symmetric arguments. + * @param __z The third of three symmetric arguments. + * @return The Carlson elliptic function of the first kind. + */ + template<typename _Tp> + _Tp + __ellint_rf(const _Tp __x, const _Tp __y, const _Tp __z) + { + const _Tp __min = std::numeric_limits<_Tp>::min(); + const _Tp __max = std::numeric_limits<_Tp>::max(); + const _Tp __lolim = _Tp(5) * __min; + const _Tp __uplim = __max / _Tp(5); + + if (__x < _Tp(0) || __y < _Tp(0) || __z < _Tp(0)) + std::__throw_domain_error(__N("Argument less than zero " + "in __ellint_rf.")); + else if (__x + __y < __lolim || __x + __z < __lolim + || __y + __z < __lolim) + std::__throw_domain_error(__N("Argument too small in __ellint_rf")); + else + { + const _Tp __c0 = _Tp(1) / _Tp(4); + const _Tp __c1 = _Tp(1) / _Tp(24); + const _Tp __c2 = _Tp(1) / _Tp(10); + const _Tp __c3 = _Tp(3) / _Tp(44); + const _Tp __c4 = _Tp(1) / _Tp(14); + + _Tp __xn = __x; + _Tp __yn = __y; + _Tp __zn = __z; + + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + const _Tp __errtol = std::pow(__eps, _Tp(1) / _Tp(6)); + _Tp __mu; + _Tp __xndev, __yndev, __zndev; + + const unsigned int __max_iter = 100; + for (unsigned int __iter = 0; __iter < __max_iter; ++__iter) + { + __mu = (__xn + __yn + __zn) / _Tp(3); + __xndev = 2 - (__mu + __xn) / __mu; + __yndev = 2 - (__mu + __yn) / __mu; + __zndev = 2 - (__mu + __zn) / __mu; + _Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev)); + __epsilon = std::max(__epsilon, std::abs(__zndev)); + if (__epsilon < __errtol) + break; + const _Tp __xnroot = std::sqrt(__xn); + const _Tp __ynroot = std::sqrt(__yn); + const _Tp __znroot = std::sqrt(__zn); + const _Tp __lambda = __xnroot * (__ynroot + __znroot) + + __ynroot * __znroot; + __xn = __c0 * (__xn + __lambda); + __yn = __c0 * (__yn + __lambda); + __zn = __c0 * (__zn + __lambda); + } + + const _Tp __e2 = __xndev * __yndev - __zndev * __zndev; + const _Tp __e3 = __xndev * __yndev * __zndev; + const _Tp __s = _Tp(1) + (__c1 * __e2 - __c2 - __c3 * __e3) * __e2 + + __c4 * __e3; + + return __s / std::sqrt(__mu); + } + } + + + /** + * @brief Return the complete elliptic integral of the first kind + * @f$ K(k) @f$ by series expansion. + * + * The complete elliptic integral of the first kind is defined as + * @f[ + * K(k) = F(k,\pi/2) = \int_0^{\pi/2}\frac{d\theta} + * {\sqrt{1 - k^2sin^2\theta}} + * @f] + * + * This routine is not bad as long as |k| is somewhat smaller than 1 + * but is not is good as the Carlson elliptic integral formulation. + * + * @param __k The argument of the complete elliptic function. + * @return The complete elliptic function of the first kind. + */ + template<typename _Tp> + _Tp + __comp_ellint_1_series(const _Tp __k) + { + + const _Tp __kk = __k * __k; + + _Tp __term = __kk / _Tp(4); + _Tp __sum = _Tp(1) + __term; + + const unsigned int __max_iter = 1000; + for (unsigned int __i = 2; __i < __max_iter; ++__i) + { + __term *= (2 * __i - 1) * __kk / (2 * __i); + if (__term < std::numeric_limits<_Tp>::epsilon()) + break; + __sum += __term; + } + + return __numeric_constants<_Tp>::__pi_2() * __sum; + } + + + /** + * @brief Return the complete elliptic integral of the first kind + * @f$ K(k) @f$ using the Carlson formulation. + * + * The complete elliptic integral of the first kind is defined as + * @f[ + * K(k) = F(k,\pi/2) = \int_0^{\pi/2}\frac{d\theta} + * {\sqrt{1 - k^2 sin^2\theta}} + * @f] + * where @f$ F(k,\phi) @f$ is the incomplete elliptic integral of the + * first kind. + * + * @param __k The argument of the complete elliptic function. + * @return The complete elliptic function of the first kind. + */ + template<typename _Tp> + _Tp + __comp_ellint_1(const _Tp __k) + { + + if (__isnan(__k)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (std::abs(__k) >= _Tp(1)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else + return __ellint_rf(_Tp(0), _Tp(1) - __k * __k, _Tp(1)); + } + + + /** + * @brief Return the incomplete elliptic integral of the first kind + * @f$ F(k,\phi) @f$ using the Carlson formulation. + * + * The incomplete elliptic integral of the first kind is defined as + * @f[ + * F(k,\phi) = \int_0^{\phi}\frac{d\theta} + * {\sqrt{1 - k^2 sin^2\theta}} + * @f] + * + * @param __k The argument of the elliptic function. + * @param __phi The integral limit argument of the elliptic function. + * @return The elliptic function of the first kind. + */ + template<typename _Tp> + _Tp + __ellint_1(const _Tp __k, const _Tp __phi) + { + + if (__isnan(__k) || __isnan(__phi)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (std::abs(__k) > _Tp(1)) + std::__throw_domain_error(__N("Bad argument in __ellint_1.")); + else + { + // Reduce phi to -pi/2 < phi < +pi/2. + const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi() + + _Tp(0.5L)); + const _Tp __phi_red = __phi + - __n * __numeric_constants<_Tp>::__pi(); + + const _Tp __s = std::sin(__phi_red); + const _Tp __c = std::cos(__phi_red); + + const _Tp __F = __s + * __ellint_rf(__c * __c, + _Tp(1) - __k * __k * __s * __s, _Tp(1)); + + if (__n == 0) + return __F; + else + return __F + _Tp(2) * __n * __comp_ellint_1(__k); + } + } + + + /** + * @brief Return the complete elliptic integral of the second kind + * @f$ E(k) @f$ by series expansion. + * + * The complete elliptic integral of the second kind is defined as + * @f[ + * E(k,\pi/2) = \int_0^{\pi/2}\sqrt{1 - k^2 sin^2\theta} + * @f] + * + * This routine is not bad as long as |k| is somewhat smaller than 1 + * but is not is good as the Carlson elliptic integral formulation. + * + * @param __k The argument of the complete elliptic function. + * @return The complete elliptic function of the second kind. + */ + template<typename _Tp> + _Tp + __comp_ellint_2_series(const _Tp __k) + { + + const _Tp __kk = __k * __k; + + _Tp __term = __kk; + _Tp __sum = __term; + + const unsigned int __max_iter = 1000; + for (unsigned int __i = 2; __i < __max_iter; ++__i) + { + const _Tp __i2m = 2 * __i - 1; + const _Tp __i2 = 2 * __i; + __term *= __i2m * __i2m * __kk / (__i2 * __i2); + if (__term < std::numeric_limits<_Tp>::epsilon()) + break; + __sum += __term / __i2m; + } + + return __numeric_constants<_Tp>::__pi_2() * (_Tp(1) - __sum); + } + + + /** + * @brief Return the Carlson elliptic function of the second kind + * @f$ R_D(x,y,z) = R_J(x,y,z,z) @f$ where + * @f$ R_J(x,y,z,p) @f$ is the Carlson elliptic function + * of the third kind. + * + * The Carlson elliptic function of the second kind is defined by: + * @f[ + * R_D(x,y,z) = \frac{3}{2} \int_0^\infty + * \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{3/2}} + * @f] + * + * Based on Carlson's algorithms: + * - B. C. Carlson Numer. Math. 33, 1 (1979) + * - B. C. Carlson, Special Functions of Applied Mathematics (1977) + * - Nunerical Recipes in C, 2nd ed, pp. 261-269, + * by Press, Teukolsky, Vetterling, Flannery (1992) + * + * @param __x The first of two symmetric arguments. + * @param __y The second of two symmetric arguments. + * @param __z The third argument. + * @return The Carlson elliptic function of the second kind. + */ + template<typename _Tp> + _Tp + __ellint_rd(const _Tp __x, const _Tp __y, const _Tp __z) + { + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + const _Tp __errtol = std::pow(__eps / _Tp(8), _Tp(1) / _Tp(6)); + const _Tp __min = std::numeric_limits<_Tp>::min(); + const _Tp __max = std::numeric_limits<_Tp>::max(); + const _Tp __lolim = _Tp(2) / std::pow(__max, _Tp(2) / _Tp(3)); + const _Tp __uplim = std::pow(_Tp(0.1L) * __errtol / __min, _Tp(2) / _Tp(3)); + + if (__x < _Tp(0) || __y < _Tp(0)) + std::__throw_domain_error(__N("Argument less than zero " + "in __ellint_rd.")); + else if (__x + __y < __lolim || __z < __lolim) + std::__throw_domain_error(__N("Argument too small " + "in __ellint_rd.")); + else + { + const _Tp __c0 = _Tp(1) / _Tp(4); + const _Tp __c1 = _Tp(3) / _Tp(14); + const _Tp __c2 = _Tp(1) / _Tp(6); + const _Tp __c3 = _Tp(9) / _Tp(22); + const _Tp __c4 = _Tp(3) / _Tp(26); + + _Tp __xn = __x; + _Tp __yn = __y; + _Tp __zn = __z; + _Tp __sigma = _Tp(0); + _Tp __power4 = _Tp(1); + + _Tp __mu; + _Tp __xndev, __yndev, __zndev; + + const unsigned int __max_iter = 100; + for (unsigned int __iter = 0; __iter < __max_iter; ++__iter) + { + __mu = (__xn + __yn + _Tp(3) * __zn) / _Tp(5); + __xndev = (__mu - __xn) / __mu; + __yndev = (__mu - __yn) / __mu; + __zndev = (__mu - __zn) / __mu; + _Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev)); + __epsilon = std::max(__epsilon, std::abs(__zndev)); + if (__epsilon < __errtol) + break; + _Tp __xnroot = std::sqrt(__xn); + _Tp __ynroot = std::sqrt(__yn); + _Tp __znroot = std::sqrt(__zn); + _Tp __lambda = __xnroot * (__ynroot + __znroot) + + __ynroot * __znroot; + __sigma += __power4 / (__znroot * (__zn + __lambda)); + __power4 *= __c0; + __xn = __c0 * (__xn + __lambda); + __yn = __c0 * (__yn + __lambda); + __zn = __c0 * (__zn + __lambda); + } + + _Tp __ea = __xndev * __yndev; + _Tp __eb = __zndev * __zndev; + _Tp __ec = __ea - __eb; + _Tp __ed = __ea - _Tp(6) * __eb; + _Tp __ef = __ed + __ec + __ec; + _Tp __s1 = __ed * (-__c1 + __c3 * __ed + / _Tp(3) - _Tp(3) * __c4 * __zndev * __ef + / _Tp(2)); + _Tp __s2 = __zndev + * (__c2 * __ef + + __zndev * (-__c3 * __ec - __zndev * __c4 - __ea)); + + return _Tp(3) * __sigma + __power4 * (_Tp(1) + __s1 + __s2) + / (__mu * std::sqrt(__mu)); + } + } + + + /** + * @brief Return the complete elliptic integral of the second kind + * @f$ E(k) @f$ using the Carlson formulation. + * + * The complete elliptic integral of the second kind is defined as + * @f[ + * E(k,\pi/2) = \int_0^{\pi/2}\sqrt{1 - k^2 sin^2\theta} + * @f] + * + * @param __k The argument of the complete elliptic function. + * @return The complete elliptic function of the second kind. + */ + template<typename _Tp> + _Tp + __comp_ellint_2(const _Tp __k) + { + + if (__isnan(__k)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (std::abs(__k) == 1) + return _Tp(1); + else if (std::abs(__k) > _Tp(1)) + std::__throw_domain_error(__N("Bad argument in __comp_ellint_2.")); + else + { + const _Tp __kk = __k * __k; + + return __ellint_rf(_Tp(0), _Tp(1) - __kk, _Tp(1)) + - __kk * __ellint_rd(_Tp(0), _Tp(1) - __kk, _Tp(1)) / _Tp(3); + } + } + + + /** + * @brief Return the incomplete elliptic integral of the second kind + * @f$ E(k,\phi) @f$ using the Carlson formulation. + * + * The incomplete elliptic integral of the second kind is defined as + * @f[ + * E(k,\phi) = \int_0^{\phi} \sqrt{1 - k^2 sin^2\theta} + * @f] + * + * @param __k The argument of the elliptic function. + * @param __phi The integral limit argument of the elliptic function. + * @return The elliptic function of the second kind. + */ + template<typename _Tp> + _Tp + __ellint_2(const _Tp __k, const _Tp __phi) + { + + if (__isnan(__k) || __isnan(__phi)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (std::abs(__k) > _Tp(1)) + std::__throw_domain_error(__N("Bad argument in __ellint_2.")); + else + { + // Reduce phi to -pi/2 < phi < +pi/2. + const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi() + + _Tp(0.5L)); + const _Tp __phi_red = __phi + - __n * __numeric_constants<_Tp>::__pi(); + + const _Tp __kk = __k * __k; + const _Tp __s = std::sin(__phi_red); + const _Tp __ss = __s * __s; + const _Tp __sss = __ss * __s; + const _Tp __c = std::cos(__phi_red); + const _Tp __cc = __c * __c; + + const _Tp __E = __s + * __ellint_rf(__cc, _Tp(1) - __kk * __ss, _Tp(1)) + - __kk * __sss + * __ellint_rd(__cc, _Tp(1) - __kk * __ss, _Tp(1)) + / _Tp(3); + + if (__n == 0) + return __E; + else + return __E + _Tp(2) * __n * __comp_ellint_2(__k); + } + } + + + /** + * @brief Return the Carlson elliptic function + * @f$ R_C(x,y) = R_F(x,y,y) @f$ where @f$ R_F(x,y,z) @f$ + * is the Carlson elliptic function of the first kind. + * + * The Carlson elliptic function is defined by: + * @f[ + * R_C(x,y) = \frac{1}{2} \int_0^\infty + * \frac{dt}{(t + x)^{1/2}(t + y)} + * @f] + * + * Based on Carlson's algorithms: + * - B. C. Carlson Numer. Math. 33, 1 (1979) + * - B. C. Carlson, Special Functions of Applied Mathematics (1977) + * - Nunerical Recipes in C, 2nd ed, pp. 261-269, + * by Press, Teukolsky, Vetterling, Flannery (1992) + * + * @param __x The first argument. + * @param __y The second argument. + * @return The Carlson elliptic function. + */ + template<typename _Tp> + _Tp + __ellint_rc(const _Tp __x, const _Tp __y) + { + const _Tp __min = std::numeric_limits<_Tp>::min(); + const _Tp __max = std::numeric_limits<_Tp>::max(); + const _Tp __lolim = _Tp(5) * __min; + const _Tp __uplim = __max / _Tp(5); + + if (__x < _Tp(0) || __y < _Tp(0) || __x + __y < __lolim) + std::__throw_domain_error(__N("Argument less than zero " + "in __ellint_rc.")); + else + { + const _Tp __c0 = _Tp(1) / _Tp(4); + const _Tp __c1 = _Tp(1) / _Tp(7); + const _Tp __c2 = _Tp(9) / _Tp(22); + const _Tp __c3 = _Tp(3) / _Tp(10); + const _Tp __c4 = _Tp(3) / _Tp(8); + + _Tp __xn = __x; + _Tp __yn = __y; + + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + const _Tp __errtol = std::pow(__eps / _Tp(30), _Tp(1) / _Tp(6)); + _Tp __mu; + _Tp __sn; + + const unsigned int __max_iter = 100; + for (unsigned int __iter = 0; __iter < __max_iter; ++__iter) + { + __mu = (__xn + _Tp(2) * __yn) / _Tp(3); + __sn = (__yn + __mu) / __mu - _Tp(2); + if (std::abs(__sn) < __errtol) + break; + const _Tp __lambda = _Tp(2) * std::sqrt(__xn) * std::sqrt(__yn) + + __yn; + __xn = __c0 * (__xn + __lambda); + __yn = __c0 * (__yn + __lambda); + } + + _Tp __s = __sn * __sn + * (__c3 + __sn*(__c1 + __sn * (__c4 + __sn * __c2))); + + return (_Tp(1) + __s) / std::sqrt(__mu); + } + } + + + /** + * @brief Return the Carlson elliptic function @f$ R_J(x,y,z,p) @f$ + * of the third kind. + * + * The Carlson elliptic function of the third kind is defined by: + * @f[ + * R_J(x,y,z,p) = \frac{3}{2} \int_0^\infty + * \frac{dt}{(t + x)^{1/2}(t + y)^{1/2}(t + z)^{1/2}(t + p)} + * @f] + * + * Based on Carlson's algorithms: + * - B. C. Carlson Numer. Math. 33, 1 (1979) + * - B. C. Carlson, Special Functions of Applied Mathematics (1977) + * - Nunerical Recipes in C, 2nd ed, pp. 261-269, + * by Press, Teukolsky, Vetterling, Flannery (1992) + * + * @param __x The first of three symmetric arguments. + * @param __y The second of three symmetric arguments. + * @param __z The third of three symmetric arguments. + * @param __p The fourth argument. + * @return The Carlson elliptic function of the fourth kind. + */ + template<typename _Tp> + _Tp + __ellint_rj(const _Tp __x, const _Tp __y, const _Tp __z, const _Tp __p) + { + const _Tp __min = std::numeric_limits<_Tp>::min(); + const _Tp __max = std::numeric_limits<_Tp>::max(); + const _Tp __lolim = std::pow(_Tp(5) * __min, _Tp(1)/_Tp(3)); + const _Tp __uplim = _Tp(0.3L) + * std::pow(_Tp(0.2L) * __max, _Tp(1)/_Tp(3)); + + if (__x < _Tp(0) || __y < _Tp(0) || __z < _Tp(0)) + std::__throw_domain_error(__N("Argument less than zero " + "in __ellint_rj.")); + else if (__x + __y < __lolim || __x + __z < __lolim + || __y + __z < __lolim || __p < __lolim) + std::__throw_domain_error(__N("Argument too small " + "in __ellint_rj")); + else + { + const _Tp __c0 = _Tp(1) / _Tp(4); + const _Tp __c1 = _Tp(3) / _Tp(14); + const _Tp __c2 = _Tp(1) / _Tp(3); + const _Tp __c3 = _Tp(3) / _Tp(22); + const _Tp __c4 = _Tp(3) / _Tp(26); + + _Tp __xn = __x; + _Tp __yn = __y; + _Tp __zn = __z; + _Tp __pn = __p; + _Tp __sigma = _Tp(0); + _Tp __power4 = _Tp(1); + + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + const _Tp __errtol = std::pow(__eps / _Tp(8), _Tp(1) / _Tp(6)); + + _Tp __lambda, __mu; + _Tp __xndev, __yndev, __zndev, __pndev; + + const unsigned int __max_iter = 100; + for (unsigned int __iter = 0; __iter < __max_iter; ++__iter) + { + __mu = (__xn + __yn + __zn + _Tp(2) * __pn) / _Tp(5); + __xndev = (__mu - __xn) / __mu; + __yndev = (__mu - __yn) / __mu; + __zndev = (__mu - __zn) / __mu; + __pndev = (__mu - __pn) / __mu; + _Tp __epsilon = std::max(std::abs(__xndev), std::abs(__yndev)); + __epsilon = std::max(__epsilon, std::abs(__zndev)); + __epsilon = std::max(__epsilon, std::abs(__pndev)); + if (__epsilon < __errtol) + break; + const _Tp __xnroot = std::sqrt(__xn); + const _Tp __ynroot = std::sqrt(__yn); + const _Tp __znroot = std::sqrt(__zn); + const _Tp __lambda = __xnroot * (__ynroot + __znroot) + + __ynroot * __znroot; + const _Tp __alpha = __pn * (__xnroot + __ynroot + __znroot) + + __xnroot * __ynroot * __znroot; + const _Tp __alpha2 = __alpha * __alpha; + const _Tp __beta = __pn * (__pn + __lambda) + * (__pn + __lambda); + __sigma += __power4 * __ellint_rc(__alpha2, __beta); + __power4 *= __c0; + __xn = __c0 * (__xn + __lambda); + __yn = __c0 * (__yn + __lambda); + __zn = __c0 * (__zn + __lambda); + __pn = __c0 * (__pn + __lambda); + } + + _Tp __ea = __xndev * (__yndev + __zndev) + __yndev * __zndev; + _Tp __eb = __xndev * __yndev * __zndev; + _Tp __ec = __pndev * __pndev; + _Tp __e2 = __ea - _Tp(3) * __ec; + _Tp __e3 = __eb + _Tp(2) * __pndev * (__ea - __ec); + _Tp __s1 = _Tp(1) + __e2 * (-__c1 + _Tp(3) * __c3 * __e2 / _Tp(4) + - _Tp(3) * __c4 * __e3 / _Tp(2)); + _Tp __s2 = __eb * (__c2 / _Tp(2) + + __pndev * (-__c3 - __c3 + __pndev * __c4)); + _Tp __s3 = __pndev * __ea * (__c2 - __pndev * __c3) + - __c2 * __pndev * __ec; + + return _Tp(3) * __sigma + __power4 * (__s1 + __s2 + __s3) + / (__mu * std::sqrt(__mu)); + } + } + + + /** + * @brief Return the complete elliptic integral of the third kind + * @f$ \Pi(k,\nu) = \Pi(k,\nu,\pi/2) @f$ using the + * Carlson formulation. + * + * The complete elliptic integral of the third kind is defined as + * @f[ + * \Pi(k,\nu) = \int_0^{\pi/2} + * \frac{d\theta} + * {(1 - \nu \sin^2\theta)\sqrt{1 - k^2 \sin^2\theta}} + * @f] + * + * @param __k The argument of the elliptic function. + * @param __nu The second argument of the elliptic function. + * @return The complete elliptic function of the third kind. + */ + template<typename _Tp> + _Tp + __comp_ellint_3(const _Tp __k, const _Tp __nu) + { + + if (__isnan(__k) || __isnan(__nu)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__nu == _Tp(1)) + return std::numeric_limits<_Tp>::infinity(); + else if (std::abs(__k) > _Tp(1)) + std::__throw_domain_error(__N("Bad argument in __comp_ellint_3.")); + else + { + const _Tp __kk = __k * __k; + + return __ellint_rf(_Tp(0), _Tp(1) - __kk, _Tp(1)) + - __nu + * __ellint_rj(_Tp(0), _Tp(1) - __kk, _Tp(1), _Tp(1) + __nu) + / _Tp(3); + } + } + + + /** + * @brief Return the incomplete elliptic integral of the third kind + * @f$ \Pi(k,\nu,\phi) @f$ using the Carlson formulation. + * + * The incomplete elliptic integral of the third kind is defined as + * @f[ + * \Pi(k,\nu,\phi) = \int_0^{\phi} + * \frac{d\theta} + * {(1 - \nu \sin^2\theta) + * \sqrt{1 - k^2 \sin^2\theta}} + * @f] + * + * @param __k The argument of the elliptic function. + * @param __nu The second argument of the elliptic function. + * @param __phi The integral limit argument of the elliptic function. + * @return The elliptic function of the third kind. + */ + template<typename _Tp> + _Tp + __ellint_3(const _Tp __k, const _Tp __nu, const _Tp __phi) + { + + if (__isnan(__k) || __isnan(__nu) || __isnan(__phi)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (std::abs(__k) > _Tp(1)) + std::__throw_domain_error(__N("Bad argument in __ellint_3.")); + else + { + // Reduce phi to -pi/2 < phi < +pi/2. + const int __n = std::floor(__phi / __numeric_constants<_Tp>::__pi() + + _Tp(0.5L)); + const _Tp __phi_red = __phi + - __n * __numeric_constants<_Tp>::__pi(); + + const _Tp __kk = __k * __k; + const _Tp __s = std::sin(__phi_red); + const _Tp __ss = __s * __s; + const _Tp __sss = __ss * __s; + const _Tp __c = std::cos(__phi_red); + const _Tp __cc = __c * __c; + + const _Tp __Pi = __s + * __ellint_rf(__cc, _Tp(1) - __kk * __ss, _Tp(1)) + - __nu * __sss + * __ellint_rj(__cc, _Tp(1) - __kk * __ss, _Tp(1), + _Tp(1) + __nu * __ss) / _Tp(3); + + if (__n == 0) + return __Pi; + else + return __Pi + _Tp(2) * __n * __comp_ellint_3(__k, __nu); + } + } + + } // namespace std::tr1::__detail + + /* @} */ // group tr1_math_spec_func + +_GLIBCXX_END_NAMESPACE +} + +#endif // _TR1_ELL_INTEGRAL_TCC + diff --git a/libstdc++-v3/include/tr1/exp_integral.tcc b/libstdc++-v3/include/tr1/exp_integral.tcc new file mode 100644 index 00000000000..d6acc72dba1 --- /dev/null +++ b/libstdc++-v3/include/tr1/exp_integral.tcc @@ -0,0 +1,538 @@ +// 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/exp_integral.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. by Milton Abramowitz and Irene A. Stegun, +// Dover Publications, New-York, Section 5, pp. 228-251. +// (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. 222-225. +// + +#ifndef _TR1_EXP_INTEGRAL_TCC +#define _TR1_EXP_INTEGRAL_TCC 1 + +#include "special_function_util.h" + +namespace std +{ +_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) + + // [5.2] Special functions + + /** + * @ingroup tr1_math_spec_func + * @{ + */ + + // + // Implementation-space details. + // + namespace __detail + { + + /** + * @brief Return the exponential integral @f$ E_1(x) @f$ + * by series summation. This should be good + * for @f$ x < 1 @f$. + * + * The exponential integral is given by + * \f[ + * E_1(x) = \int_{1}^{\infty} \frac{e^{-xt}}{t} dt + * \f] + * + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint_E1_series(const _Tp __x) + { + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + _Tp __term = _Tp(1); + _Tp __esum = _Tp(0); + _Tp __osum = _Tp(0); + const unsigned int __max_iter = 100; + for (unsigned int __i = 1; __i < __max_iter; ++__i) + { + __term *= - __x / __i; + if (std::abs(__term) < __eps) + break; + if (__term >= _Tp(0)) + __esum += __term / __i; + else + __osum += __term / __i; + } + + return - __esum - __osum + - __numeric_constants<_Tp>::__gamma_e() - std::log(__x); + } + + + /** + * @brief Return the exponential integral @f$ E_1(x) @f$ + * by asymptotic expansion. + * + * The exponential integral is given by + * \f[ + * E_1(x) = \int_{1}^\infty \frac{e^{-xt}}{t} dt + * \f] + * + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint_E1_asymp(const _Tp __x) + { + _Tp __term = _Tp(1); + _Tp __esum = _Tp(1); + _Tp __osum = _Tp(0); + const unsigned int __max_iter = 1000; + for (unsigned int __i = 1; __i < __max_iter; ++__i) + { + _Tp __prev = __term; + __term *= - __i / __x; + if (std::abs(__term) > std::abs(__prev)) + break; + if (__term >= _Tp(0)) + __esum += __term; + else + __osum += __term; + } + + return std::exp(- __x) * (__esum + __osum) / __x; + } + + + /** + * @brief Return the exponential integral @f$ E_n(x) @f$ + * by series summation. + * + * The exponential integral is given by + * \f[ + * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt + * \f] + * + * @param __n The order of the exponential integral function. + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint_En_series(const unsigned int __n, const _Tp __x) + { + const unsigned int __max_iter = 100; + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + const int __nm1 = __n - 1; + _Tp __ans = (__nm1 != 0 + ? _Tp(1) / __nm1 : -std::log(__x) + - __numeric_constants<_Tp>::__gamma_e()); + _Tp __fact = _Tp(1); + for (int __i = 1; __i <= __max_iter; ++__i) + { + __fact *= -__x / _Tp(__i); + _Tp __del; + if ( __i != __nm1 ) + __del = -__fact / _Tp(__i - __nm1); + else + { + _Tp __psi = -_TR1_GAMMA_TCC; + for (int __ii = 1; __ii <= __nm1; ++__ii) + __psi += _Tp(1) / _Tp(__ii); + __del = __fact * (__psi - std::log(__x)); + } + __ans += __del; + if (std::abs(__del) < __eps * std::abs(__ans)) + return __ans; + } + std::__throw_runtime_error(__N("Series summation failed " + "in __expint_En_series.")); + } + + + /** + * @brief Return the exponential integral @f$ E_n(x) @f$ + * by continued fractions. + * + * The exponential integral is given by + * \f[ + * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt + * \f] + * + * @param __n The order of the exponential integral function. + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint_En_cont_frac(const unsigned int __n, const _Tp __x) + { + const unsigned int __max_iter = 100; + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + const _Tp __fp_min = std::numeric_limits<_Tp>::min(); + const int __nm1 = __n - 1; + _Tp __b = __x + _Tp(__n); + _Tp __c = _Tp(1) / __fp_min; + _Tp __d = _Tp(1) / __b; + _Tp __h = __d; + for ( unsigned int __i = 1; __i <= __max_iter; ++__i ) + { + _Tp __a = -_Tp(__i * (__nm1 + __i)); + __b += _Tp(2); + __d = _Tp(1) / (__a * __d + __b); + __c = __b + __a / __c; + const _Tp __del = __c * __d; + __h *= __del; + if (std::abs(__del - _Tp(1)) < __eps) + { + const _Tp __ans = __h * std::exp(-__x); + return __ans; + } + } + std::__throw_runtime_error(__N("Continued fraction failed " + "in __expint_En_cont_frac.")); + } + + + /** + * @brief Return the exponential integral @f$ E_n(x) @f$ + * by recursion. Use upward recursion for @f$ x < n @f$ + * and downward recursion (Miller's algorithm) otherwise. + * + * The exponential integral is given by + * \f[ + * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt + * \f] + * + * @param __n The order of the exponential integral function. + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint_En_recursion(const unsigned int __n, const _Tp __x) + { + _Tp __En; + _Tp __E1 = __expint_E1(__x); + if (__x < _Tp(__n)) + { + // Forward recursion is stable only for n < x. + __En = __E1; + for (unsigned int __j = 2; __j < __n; ++__j) + __En = (std::exp(-__x) - __x * __En) / _Tp(__j - 1); + } + else + { + // Backward recursion is stable only for n >= x. + __En = _Tp(1); + const int __N = __n + 20; // TODO: Check this starting number. + _Tp __save = _Tp(0); + for (int __j = __N; __j > 0; --__j) + { + __En = (std::exp(-__x) - __j * __En) / __x; + if (__j == __n) + __save = __En; + } + _Tp __norm = __En / __E1; + __En /= __norm; + } + + return __En; + } + + /** + * @brief Return the exponential integral @f$ Ei(x) @f$ + * by series summation. + * + * The exponential integral is given by + * \f[ + * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt + * \f] + * + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint_Ei_series(const _Tp __x) + { + _Tp __term = _Tp(1); + _Tp __sum = _Tp(0); + const unsigned int __max_iter = 1000; + for (unsigned int __i = 1; __i < __max_iter; ++__i) + { + __term *= __x / __i; + __sum += __term / __i; + if (__term < std::numeric_limits<_Tp>::epsilon() * __sum) + break; + } + + return __numeric_constants<_Tp>::__gamma_e() + __sum + std::log(__x); + } + + + /** + * @brief Return the exponential integral @f$ Ei(x) @f$ + * by asymptotic expansion. + * + * The exponential integral is given by + * \f[ + * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt + * \f] + * + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint_Ei_asymp(const _Tp __x) + { + _Tp __term = _Tp(1); + _Tp __sum = _Tp(1); + const unsigned int __max_iter = 1000; + for (unsigned int __i = 1; __i < __max_iter; ++__i) + { + _Tp __prev = __term; + __term *= __i / __x; + if (__term < std::numeric_limits<_Tp>::epsilon()) + break; + if (__term >= __prev) + break; + __sum += __term; + } + + return std::exp(__x) * __sum / __x; + } + + + /** + * @brief Return the exponential integral @f$ Ei(x) @f$. + * + * The exponential integral is given by + * \f[ + * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt + * \f] + * + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint_Ei(const _Tp __x) + { + if (__x < _Tp(0)) + return -__expint_E1(-__x); + else if (__x < -std::log(std::numeric_limits<_Tp>::epsilon())) + return __expint_Ei_series(__x); + else + return __expint_Ei_asymp(__x); + } + + + /** + * @brief Return the exponential integral @f$ E_1(x) @f$. + * + * The exponential integral is given by + * \f[ + * E_1(x) = \int_{1}^\infty \frac{e^{-xt}}{t} dt + * \f] + * + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint_E1(const _Tp __x) + { + if (__x < _Tp(0)) + return -__expint_Ei(-__x); + else if (__x < _Tp(1)) + return __expint_E1_series(__x); + else if (__x < _Tp(100)) // TODO: Find a good asymptotic switch point. + return __expint_En_cont_frac(1, __x); + else + return __expint_E1_asymp(__x); + } + + + /** + * @brief Return the exponential integral @f$ E_n(x) @f$ + * for large argument. + * + * The exponential integral is given by + * \f[ + * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt + * \f] + * + * This is something of an extension. + * + * @param __n The order of the exponential integral function. + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint_asymp(const unsigned int __n, const _Tp __x) + { + _Tp __term = _Tp(1); + _Tp __sum = _Tp(1); + for (unsigned int __i = 1; __i <= __n; ++__i) + { + _Tp __prev = __term; + __term *= -(__n - __i + 1) / __x; + if (std::abs(__term) > std::abs(__prev)) + break; + __sum += __term; + } + + return std::exp(-__x) * __sum / __x; + } + + + /** + * @brief Return the exponential integral @f$ E_n(x) @f$ + * for large order. + * + * The exponential integral is given by + * \f[ + * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt + * \f] + * + * This is something of an extension. + * + * @param __n The order of the exponential integral function. + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint_large_n(const unsigned int __n, const _Tp __x) + { + const _Tp __xpn = __x + __n; + const _Tp __xpn2 = __xpn * __xpn; + _Tp __term = _Tp(1); + _Tp __sum = _Tp(1); + for (unsigned int __i = 1; __i <= __n; ++__i) + { + _Tp __prev = __term; + __term *= (__n - 2 * (__i - 1) * __x) / __xpn2; + if (std::abs(__term) < std::numeric_limits<_Tp>::epsilon()) + break; + __sum += __term; + } + + return std::exp(-__x) * __sum / __xpn; + } + + + /** + * @brief Return the exponential integral @f$ E_n(x) @f$. + * + * The exponential integral is given by + * \f[ + * E_n(x) = \int_{1}^\infty \frac{e^{-xt}}{t^n} dt + * \f] + * This is something of an extension. + * + * @param __n The order of the exponential integral function. + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + _Tp + __expint(const unsigned int __n, const _Tp __x) + { + // Return NaN on NaN input. + if (__isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__n <= 1 && __x == _Tp(0)) + return std::numeric_limits<_Tp>::infinity(); + else + { + _Tp __E0 = std::exp(__x) / __x; + if (__n == 0) + return __E0; + + _Tp __E1 = __expint_E1(__x); + if (__n == 1) + return __E1; + + if (__x == _Tp(0)) + return _Tp(1) / static_cast<_Tp>(__n - 1); + + _Tp __En = __expint_En_recursion(__n, __x); + + return __En; + } + } + + + /** + * The exponential integral @f$ Ei(x) @f$. + * + * The exponential integral is given by + * \f[ + * Ei(x) = -\int_{-x}^\infty \frac{e^t}{t} dt + * \f] + * + * @param __x The argument of the exponential integral function. + * @return The exponential integral. + */ + template<typename _Tp> + inline _Tp + __expint(const _Tp __x) + { + if (__isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else + return __expint_Ei(__x); + } + + } // namespace std::tr1::__detail + + /* @} */ // group tr1_math_spec_func + +_GLIBCXX_END_NAMESPACE +} + +#endif // _TR1_EXP_INTEGRAL_TCC diff --git a/libstdc++-v3/include/tr1/gamma.tcc b/libstdc++-v3/include/tr1/gamma.tcc new file mode 100644 index 00000000000..407bafcaf9c --- /dev/null +++ b/libstdc++-v3/include/tr1/gamma.tcc @@ -0,0 +1,486 @@ +// 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/gamma.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_GAMMA_TCC +#define _TR1_GAMMA_TCC 1 + +#include "special_function_util.h" + +namespace std +{ +_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) + + /** + * @ingroup tr1_math_spec_func + * @{ + */ + + // + // Implementation-space details. + // + namespace __detail + { + + /** + * @brief This returns Bernoulli numbers from a table or by summation + * for larger values. + * + * Recursion is unstable. + * + * @param __n the order n of the Bernoulli number. + * @return The Bernoulli number of order n. + */ + template <typename _Tp> + _Tp __bernoulli_series(unsigned int __n) + { + + static const _Tp __num[28] = { + _Tp(1UL), -_Tp(1UL) / _Tp(2UL), + _Tp(1UL) / _Tp(6UL), _Tp(0UL), + -_Tp(1UL) / _Tp(30UL), _Tp(0UL), + _Tp(1UL) / _Tp(42UL), _Tp(0UL), + -_Tp(1UL) / _Tp(30UL), _Tp(0UL), + _Tp(5UL) / _Tp(66UL), _Tp(0UL), + -_Tp(691UL) / _Tp(2730UL), _Tp(0UL), + _Tp(7UL) / _Tp(6UL), _Tp(0UL), + -_Tp(3617UL) / _Tp(510UL), _Tp(0UL), + _Tp(43867UL) / _Tp(798UL), _Tp(0UL), + -_Tp(174611) / _Tp(330UL), _Tp(0UL), + _Tp(854513UL) / _Tp(138UL), _Tp(0UL), + -_Tp(236364091UL) / _Tp(2730UL), _Tp(0UL), + _Tp(8553103UL) / _Tp(6UL), _Tp(0UL) + }; + + if (__n == 0) + return _Tp(1); + + if (__n == 1) + return -_Tp(1) / _Tp(2); + + // Take care of the rest of the odd ones. + if (__n % 2 == 1) + return _Tp(0); + + // Take care of some small evens that are painful for the series. + if (__n < 28) + return __num[__n]; + + + _Tp __fact = _Tp(1); + if ((__n / 2) % 2 == 0) + __fact *= _Tp(-1); + for (unsigned int __k = 1; __k <= __n; ++__k) + __fact *= __k / (_Tp(2) * __numeric_constants<_Tp>::__pi()); + __fact *= _Tp(2); + + _Tp __sum = _Tp(0); + for (unsigned int __i = 1; __i < 1000; ++__i) + { + _Tp __term = std::pow(_Tp(__i), -_Tp(__n)); + if (__term < std::numeric_limits<_Tp>::epsilon()) + break; + __sum += __term; + } + + return __fact * __sum; + } + + + /** + * @brief This returns Bernoulli number \f$B_n\f$. + * + * @param __n the order n of the Bernoulli number. + * @return The Bernoulli number of order n. + */ + template<typename _Tp> + inline _Tp + __bernoulli(const int __n) + { + return __bernoulli_series<_Tp>(__n); + } + + + /** + * @brief Return \f$log(\Gamma(x))\f$ by asymptotic expansion + * with Bernoulli number coefficients. This is like + * Sterling's approximation. + * + * @param __x The argument of the log of the gamma function. + * @return The logarithm of the gamma function. + */ + template<typename _Tp> + _Tp + __log_gamma_bernoulli(const _Tp __x) + { + _Tp __lg = (__x - _Tp(0.5L)) * std::log(__x) - __x + + _Tp(0.5L) * std::log(_Tp(2) + * __numeric_constants<_Tp>::__pi()); + + const _Tp __xx = __x * __x; + _Tp __help = _Tp(1) / __x; + for ( unsigned int __i = 1; __i < 20; ++__i ) + { + const _Tp __2i = _Tp(2 * __i); + __help /= __2i * (__2i - _Tp(1)) * __xx; + __lg += __bernoulli<_Tp>(2 * __i) * __help; + } + + return __lg; + } + + + /** + * @brief Return \f$log(\Gamma(x))\f$ by the Lanczos method. + * This method dominates all others on the positive axis I think. + * + * @param __x The argument of the log of the gamma function. + * @return The logarithm of the gamma function. + */ + template<typename _Tp> + _Tp + __log_gamma_lanczos(const _Tp __x) + { + const _Tp __xm1 = __x - _Tp(1); + + static const _Tp __lanczos_cheb_7[9] = { + _Tp( 0.99999999999980993227684700473478L), + _Tp( 676.520368121885098567009190444019L), + _Tp(-1259.13921672240287047156078755283L), + _Tp( 771.3234287776530788486528258894L), + _Tp(-176.61502916214059906584551354L), + _Tp( 12.507343278686904814458936853L), + _Tp(-0.13857109526572011689554707L), + _Tp( 9.984369578019570859563e-6L), + _Tp( 1.50563273514931155834e-7L) + }; + + static const _Tp __LOGROOT2PI + = _Tp(0.9189385332046727417803297364056176L); + + _Tp __sum = __lanczos_cheb_7[0]; + for(unsigned int __k = 1; __k < 9; ++__k) + __sum += __lanczos_cheb_7[__k] / (__xm1 + __k); + + const _Tp __term1 = (__xm1 + _Tp(0.5L)) + * std::log((__xm1 + _Tp(7.5L)) + / __numeric_constants<_Tp>::__euler()); + const _Tp __term2 = __LOGROOT2PI + std::log(__sum); + const _Tp __result = __term1 + (__term2 - _Tp(7)); + + return __result; + } + + + /** + * @brief Return \f$ log(|\Gamma(x)|) \f$. + * This will return values even for \f$ x < 0 \f$. + * To recover the sign of \f$ \Gamma(x) \f$ for + * any argument use @a __log_gamma_sign. + * + * @param __x The argument of the log of the gamma function. + * @return The logarithm of the gamma function. + */ + template<typename _Tp> + _Tp + __log_gamma(const _Tp __x) + { + if (__x > _Tp(0.5L)) + return __log_gamma_lanczos(__x); + else + { + const _Tp __sin_fact + = std::abs(std::sin(__numeric_constants<_Tp>::__pi() * __x)); + if (__sin_fact == _Tp(0)) + std::__throw_domain_error(__N("Argument is nonpositive integer " + "in __log_gamma")); + return __numeric_constants<_Tp>::__lnpi() + - std::log(__sin_fact) + - __log_gamma_lanczos(_Tp(1) - __x); + } + } + + + /** + * @brief Return the sign of \f$ \Gamma(x) \f$. + * At nonpositive integers zero is returned. + * + * @param __x The argument of the gamma function. + * @return The sign of the gamma function. + */ + template<typename _Tp> + _Tp + __log_gamma_sign(const _Tp __x) + { + if (__x > _Tp(0)) + return _Tp(1); + else + { + const _Tp __sin_fact + = std::sin(__numeric_constants<_Tp>::__pi() * __x); + if (__sin_fact > _Tp(0)) + return (1); + else if (__sin_fact < _Tp(0)) + return -_Tp(1); + else + return _Tp(0); + } + } + + + /** + * @brief Return the logarithm of the binomial coefficient. + * The binomial coefficient is given by: + * @f[ + * \left( \right) = \frac{n!}{(n-k)! k!} + * @f] + * + * @param __n The first argument of the binomial coefficient. + * @param __k The second argument of the binomial coefficient. + * @return The binomial coefficient. + */ + template<typename _Tp> + _Tp + __log_bincoef(const unsigned int __n, const unsigned int __k) + { + // Max e exponent before overflow. + static const _Tp __max_bincoeff + = std::numeric_limits<_Tp>::max_exponent10 + * std::log(_Tp(10)) - _Tp(1); +#if _GLIBCXX_USE_C99_MATH_TR1 + _Tp __coeff = std::_GLIBCXX_TR1::lgamma(_Tp(1 + __n)) + - std::_GLIBCXX_TR1::lgamma(_Tp(1 + __k)) + - std::_GLIBCXX_TR1::lgamma(_Tp(1 + __n - __k)); +#else + _Tp __coeff = __log_gamma(_Tp(1 + __n)) + - __log_gamma(_Tp(1 + __k)) + - __log_gamma(_Tp(1 + __n - __k)); +#endif + } + + + /** + * @brief Return the binomial coefficient. + * The binomial coefficient is given by: + * @f[ + * \left( \right) = \frac{n!}{(n-k)! k!} + * @f] + * + * @param __n The first argument of the binomial coefficient. + * @param __k The second argument of the binomial coefficient. + * @return The binomial coefficient. + */ + template<typename _Tp> + _Tp + __bincoef(const unsigned int __n, const unsigned int __k) + { + // Max e exponent before overflow. + static const _Tp __max_bincoeff + = std::numeric_limits<_Tp>::max_exponent10 + * std::log(_Tp(10)) - _Tp(1); + + const _Tp __log_coeff = __log_bincoef<_Tp>(__n, __k); + if (__log_coeff > __max_bincoeff) + return std::numeric_limits<_Tp>::quiet_NaN(); + else + return std::exp(__log_coeff); + } + + + /** + * @brief Return \f$ \Gamma(x) \f$. + * + * @param __x The argument of the gamma function. + * @return The gamma function. + */ + template<typename _Tp> + inline _Tp + __gamma(const _Tp __x) + { + return std::exp(__log_gamma(__x)); + } + + + /** + * @brief Return the digamma function by series expansion. + * The digamma or @f$ \psi(x) @f$ function is defined by + * @f[ + * \psi(x) = \frac{\Gamma'(x)}{\Gamma(x)} + * @f] + * + * The series is given by: + * @f[ + * \psi(x) = -\gamma_E - \frac{1}{x} + * \sum_{k=1}^{\infty} \frac{x}{k(x + k)} + * @f] + */ + template<typename _Tp> + _Tp + __psi_series(const _Tp __x) + { + _Tp __sum = -__numeric_constants<_Tp>::__gamma_e() - _Tp(1) / __x; + const unsigned int __max_iter = 100000; + for (unsigned int __k = 1; __k < __max_iter; ++__k) + { + const _Tp __term = __x / (__k * (__k + __x)); + __sum += __term; + if (std::abs(__term / __sum) < std::numeric_limits<_Tp>::epsilon()) + break; + } + return __sum; + } + + + /** + * @brief Return the digamma function for large argument. + * The digamma or @f$ \psi(x) @f$ function is defined by + * @f[ + * \psi(x) = \frac{Gamma'(x)}{\Gamma(x)} + * @f] + * + * The asymptotic series is given by: + * @f[ + * \psi(x) = \ln(x) - \frac{1}{2x} + * - \sum_{n=1}^{\infty} \frac{B_{2n}}{2 n x^{2n}} + * @f] + */ + template<typename _Tp> + _Tp + __psi_asymp(const _Tp __x) + { + _Tp __sum = std::log(__x) - _Tp(0.5L) / __x; + const _Tp __xx = __x * __x; + _Tp __xp = __xx; + const unsigned int __max_iter = 100; + for (unsigned int __k = 1; __k < __max_iter; ++__k) + { + const _Tp __term = __bernoulli<_Tp>(2 * __k) / (2 * __k * __xp); + __sum -= __term; + if (std::abs(__term / __sum) < std::numeric_limits<_Tp>::epsilon()) + break; + __xp *= __xx; + } + return __sum; + } + + + /** + * @brief Return the digamma function. + * The digamma or @f$ \psi(x) @f$ function is defined by + * @f[ + * \psi(x) = \frac{Gamma'(x)}{\Gamma(x)} + * @f] + * For negative argument the reflection formula is used: + * @f[ + * \psi(x) = \psi(1-x) - \pi \cot(\pi x) + * @f] + */ + template<typename _Tp> + _Tp + __psi(const _Tp __x) + { + const int __n = static_cast<int>(__x + 0.5L); + const _Tp __eps = _Tp(4) * std::numeric_limits<_Tp>::epsilon(); + if (__n <= 0 && std::abs(__x - _Tp(__n)) < __eps) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__x < _Tp(0)) + { + const _Tp __pi = __numeric_constants<_Tp>::__pi(); + return __psi(_Tp(1) - __x) + - __pi * std::cos(__pi * __x) / std::sin(__pi * __x); + } + else if (__x > _Tp(100)) + return __psi_asymp(__x); + else + return __psi_series(__x); + } + + + /** + * @brief Return the polygamma function @f$ \psi^{(n)}(x) @f$. + * + * The polygamma function is related to the Hurwitz zeta function: + * @f[ + * \psi^{(n)}(x) = (-1)^{n+1} m! \zeta(m+1,x) + * @f] + */ + template<typename _Tp> + _Tp + __psi(const unsigned int __n, const _Tp __x) + { + if (__x <= _Tp(0)) + std::__throw_domain_error(__N("Argument out of range " + "in __psi")); + else if (__n == 0) + return __psi(__x); + else + { + const _Tp __hzeta = __hurwitz_zeta(_Tp(__n + 1), __x); +#if _GLIBCXX_USE_C99_MATH_TR1 + const _Tp __ln_nfact = std::_GLIBCXX_TR1::lgamma(_Tp(__n + 1)); +#else + const _Tp __ln_nfact = __log_gamma(_Tp(__n + 1)); +#endif + _Tp __result = std::exp(__ln_nfact) * __hzeta; + if (__n % 2 == 1) + __result = -__result; + return __result; + } + } + + } // namespace std::tr1::__detail + + /* @} */ // group tr1_math_spec_func + +_GLIBCXX_END_NAMESPACE +} + +#endif // _TR1_GAMMA_TCC + diff --git a/libstdc++-v3/include/tr1/hypergeometric.tcc b/libstdc++-v3/include/tr1/hypergeometric.tcc new file mode 100644 index 00000000000..d54e6fecde3 --- /dev/null +++ b/libstdc++-v3/include/tr1/hypergeometric.tcc @@ -0,0 +1,788 @@ +// 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/hypergeometric.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: +// (1) Handbook of Mathematical Functions, +// ed. Milton Abramowitz and Irene A. Stegun, +// Dover Publications, +// Section 6, pp. 555-566 +// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl + +#ifndef _TR1_HYPERGEOMETRIC_TCC +#define _TR1_HYPERGEOMETRIC_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 confluent hypereometric function + * by series expansion. + * + * @f[ + * _1F_1(a;c;x) = \frac{\Gamma(c)}{\Gamma(a)} + * \sum_{n=0}^{\infty} + * \frac{\Gamma(a+n)}{\Gamma(c+n)} + * \frac{x^n}{n!} + * @f] + * + * If a and b are integers and a < 0 and either b > 0 or b < a then the + * series is a polynomial with a finite number of terms. If b is an integer + * and b <= 0 the the confluent hypergeometric function is undefined. + * + * @param __a The "numerator" parameter. + * @param __c The "denominator" parameter. + * @param __x The argument of the confluent hypergeometric function. + * @return The confluent hypergeometric function. + */ + template<typename _Tp> + _Tp + __conf_hyperg_series(const _Tp __a, const _Tp __c, const _Tp __x) + { + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + + _Tp __term = _Tp(1); + _Tp __Fac = _Tp(1); + const unsigned int __max_iter = 100000; + unsigned int __i; + for (__i = 0; __i < __max_iter; ++__i) + { + __term *= (__a + _Tp(__i)) * __x + / ((__c + _Tp(__i)) * _Tp(1 + __i)); + if (std::abs(__term) < __eps) + { + break; + } + __Fac += __term; + } + if (__i == __max_iter) + std::__throw_runtime_error(__N("Series failed to converge " + "in __conf_hyperg_series.")); + + return __Fac; + } + + + /** + * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$ + * by an iterative procedure described in + * Luke, Algorithms for the Computation of Mathematical Functions. + * + * Like the case of the 2F1 rational approximations, these are + * probably guaranteed to converge for x < 0, barring gross + * numerical instability in the pre-asymptotic regime. + */ + template<typename _Tp> + _Tp + __conf_hyperg_luke(const _Tp __a, const _Tp __c, const _Tp __xin) + { + const _Tp __big = std::pow(std::numeric_limits<_Tp>::max(), _Tp(0.16L)); + const int __nmax = 20000; + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + const _Tp __x = -__xin; + const _Tp __x3 = __x * __x * __x; + const _Tp __t0 = __a / __c; + const _Tp __t1 = (__a + _Tp(1)) / (_Tp(2) * __c); + const _Tp __t2 = (__a + _Tp(2)) / (_Tp(2) * (__c + _Tp(1))); + _Tp __F = _Tp(1); + _Tp __prec; + + _Tp __Bnm3 = _Tp(1); + _Tp __Bnm2 = _Tp(1) + __t1 * __x; + _Tp __Bnm1 = _Tp(1) + __t2 * __x * (_Tp(1) + __t1 / _Tp(3) * __x); + + _Tp __Anm3 = _Tp(1); + _Tp __Anm2 = __Bnm2 - __t0 * __x; + _Tp __Anm1 = __Bnm1 - __t0 * (_Tp(1) + __t2 * __x) * __x + + __t0 * __t1 * (__c / (__c + _Tp(1))) * __x * __x; + + int __n = 3; + while(1) + { + _Tp __npam1 = _Tp(__n - 1) + __a; + _Tp __npcm1 = _Tp(__n - 1) + __c; + _Tp __npam2 = _Tp(__n - 2) + __a; + _Tp __npcm2 = _Tp(__n - 2) + __c; + _Tp __tnm1 = _Tp(2 * __n - 1); + _Tp __tnm3 = _Tp(2 * __n - 3); + _Tp __tnm5 = _Tp(2 * __n - 5); + _Tp __F1 = (_Tp(__n - 2) - __a) / (_Tp(2) * __tnm3 * __npcm1); + _Tp __F2 = (_Tp(__n) + __a) * __npam1 + / (_Tp(4) * __tnm1 * __tnm3 * __npcm2 * __npcm1); + _Tp __F3 = -__npam2 * __npam1 * (_Tp(__n - 2) - __a) + / (_Tp(8) * __tnm3 * __tnm3 * __tnm5 + * (_Tp(__n - 3) + __c) * __npcm2 * __npcm1); + _Tp __E = -__npam1 * (_Tp(__n - 1) - __c) + / (_Tp(2) * __tnm3 * __npcm2 * __npcm1); + + _Tp __An = (_Tp(1) + __F1 * __x) * __Anm1 + + (__E + __F2 * __x) * __x * __Anm2 + __F3 * __x3 * __Anm3; + _Tp __Bn = (_Tp(1) + __F1 * __x) * __Bnm1 + + (__E + __F2 * __x) * __x * __Bnm2 + __F3 * __x3 * __Bnm3; + _Tp __r = __An / __Bn; + + __prec = std::abs((__F - __r) / __F); + __F = __r; + + if (__prec < __eps || __n > __nmax) + break; + + if (std::abs(__An) > __big || std::abs(__Bn) > __big) + { + __An /= __big; + __Bn /= __big; + __Anm1 /= __big; + __Bnm1 /= __big; + __Anm2 /= __big; + __Bnm2 /= __big; + __Anm3 /= __big; + __Bnm3 /= __big; + } + else if (std::abs(__An) < _Tp(1) / __big + || std::abs(__Bn) < _Tp(1) / __big) + { + __An *= __big; + __Bn *= __big; + __Anm1 *= __big; + __Bnm1 *= __big; + __Anm2 *= __big; + __Bnm2 *= __big; + __Anm3 *= __big; + __Bnm3 *= __big; + } + + ++__n; + __Bnm3 = __Bnm2; + __Bnm2 = __Bnm1; + __Bnm1 = __Bn; + __Anm3 = __Anm2; + __Anm2 = __Anm1; + __Anm1 = __An; + } + + if (__n >= __nmax) + std::__throw_runtime_error(__N("Iteration failed to converge " + "in __conf_hyperg_luke.")); + + return __F; + } + + + /** + * @brief Return the confluent hypogeometric function + * @f$ _1F_1(a;c;x) @f$. + * + * @todo Handle b == nonpositive integer blowup - return NaN. + * + * @param __a The "numerator" parameter. + * @param __c The "denominator" parameter. + * @param __x The argument of the confluent hypergeometric function. + * @return The confluent hypergeometric function. + */ + template<typename _Tp> + inline _Tp + __conf_hyperg(const _Tp __a, const _Tp __c, const _Tp __x) + { +#if _GLIBCXX_USE_C99_MATH_TR1 + const _Tp __c_nint = std::_GLIBCXX_TR1::nearbyint(__c); +#else + const _Tp __c_nint = static_cast<int>(__c + _Tp(0.5L)); +#endif + if (__isnan(__a) || __isnan(__c) || __isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__c_nint == __c && __c_nint <= 0) + return std::numeric_limits<_Tp>::infinity(); + else if (__a == _Tp(0)) + return _Tp(1); + else if (__c == __a) + return std::exp(__x); + else if (__x < _Tp(0)) + return __conf_hyperg_luke(__a, __c, __x); + else + return __conf_hyperg_series(__a, __c, __x); + } + + + /** + * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$ + * by series expansion. + * + * The hypogeometric function is defined by + * @f[ + * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)} + * \sum_{n=0}^{\infty} + * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)} + * \frac{x^n}{n!} + * @f] + * + * This works and it's pretty fast. + * + * @param __a The first "numerator" parameter. + * @param __a The second "numerator" parameter. + * @param __c The "denominator" parameter. + * @param __x The argument of the confluent hypergeometric function. + * @return The confluent hypergeometric function. + */ + template<typename _Tp> + _Tp + __hyperg_series(const _Tp __a, const _Tp __b, + const _Tp __c, const _Tp __x) + { + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + + _Tp __term = _Tp(1); + _Tp __Fabc = _Tp(1); + const unsigned int __max_iter = 100000; + unsigned int __i; + for (__i = 0; __i < __max_iter; ++__i) + { + __term *= (__a + _Tp(__i)) * (__b + _Tp(__i)) * __x + / ((__c + _Tp(__i)) * _Tp(1 + __i)); + if (std::abs(__term) < __eps) + { + break; + } + __Fabc += __term; + } + if (__i == __max_iter) + std::__throw_runtime_error(__N("Series failed to converge " + "in __hyperg_series.")); + + return __Fabc; + } + + + /** + * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$ + * by an iterative procedure described in + * Luke, Algorithms for the Computation of Mathematical Functions. + */ + template<typename _Tp> + _Tp + __hyperg_luke(const _Tp __a, const _Tp __b, const _Tp __c, + const _Tp __xin) + { + const _Tp __big = std::pow(std::numeric_limits<_Tp>::max(), _Tp(0.16L)); + const int __nmax = 20000; + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + const _Tp __x = -__xin; + const _Tp __x3 = __x * __x * __x; + const _Tp __t0 = __a * __b / __c; + const _Tp __t1 = (__a + _Tp(1)) * (__b + _Tp(1)) / (_Tp(2) * __c); + const _Tp __t2 = (__a + _Tp(2)) * (__b + _Tp(2)) + / (_Tp(2) * (__c + _Tp(1))); + + _Tp __F = _Tp(1); + + _Tp __Bnm3 = _Tp(1); + _Tp __Bnm2 = _Tp(1) + __t1 * __x; + _Tp __Bnm1 = _Tp(1) + __t2 * __x * (_Tp(1) + __t1 / _Tp(3) * __x); + + _Tp __Anm3 = _Tp(1); + _Tp __Anm2 = __Bnm2 - __t0 * __x; + _Tp __Anm1 = __Bnm1 - __t0 * (_Tp(1) + __t2 * __x) * __x + + __t0 * __t1 * (__c / (__c + _Tp(1))) * __x * __x; + + int __n = 3; + while (1) + { + const _Tp __npam1 = _Tp(__n - 1) + __a; + const _Tp __npbm1 = _Tp(__n - 1) + __b; + const _Tp __npcm1 = _Tp(__n - 1) + __c; + const _Tp __npam2 = _Tp(__n - 2) + __a; + const _Tp __npbm2 = _Tp(__n - 2) + __b; + const _Tp __npcm2 = _Tp(__n - 2) + __c; + const _Tp __tnm1 = _Tp(2 * __n - 1); + const _Tp __tnm3 = _Tp(2 * __n - 3); + const _Tp __tnm5 = _Tp(2 * __n - 5); + const _Tp __n2 = __n * __n; + const _Tp __F1 = (_Tp(3) * __n2 + (__a + __b - _Tp(6)) * __n + + _Tp(2) - __a * __b - _Tp(2) * (__a + __b)) + / (_Tp(2) * __tnm3 * __npcm1); + const _Tp __F2 = -(_Tp(3) * __n2 - (__a + __b + _Tp(6)) * __n + + _Tp(2) - __a * __b) * __npam1 * __npbm1 + / (_Tp(4) * __tnm1 * __tnm3 * __npcm2 * __npcm1); + const _Tp __F3 = (__npam2 * __npam1 * __npbm2 * __npbm1 + * (_Tp(__n - 2) - __a) * (_Tp(__n - 2) - __b)) + / (_Tp(8) * __tnm3 * __tnm3 * __tnm5 + * (_Tp(__n - 3) + __c) * __npcm2 * __npcm1); + const _Tp __E = -__npam1 * __npbm1 * (_Tp(__n - 1) - __c) + / (_Tp(2) * __tnm3 * __npcm2 * __npcm1); + + _Tp __An = (_Tp(1) + __F1 * __x) * __Anm1 + + (__E + __F2 * __x) * __x * __Anm2 + __F3 * __x3 * __Anm3; + _Tp __Bn = (_Tp(1) + __F1 * __x) * __Bnm1 + + (__E + __F2 * __x) * __x * __Bnm2 + __F3 * __x3 * __Bnm3; + const _Tp __r = __An / __Bn; + + const _Tp __prec = std::abs((__F - __r) / __F); + __F = __r; + + if (__prec < __eps || __n > __nmax) + break; + + if (std::abs(__An) > __big || std::abs(__Bn) > __big) + { + __An /= __big; + __Bn /= __big; + __Anm1 /= __big; + __Bnm1 /= __big; + __Anm2 /= __big; + __Bnm2 /= __big; + __Anm3 /= __big; + __Bnm3 /= __big; + } + else if (std::abs(__An) < _Tp(1) / __big + || std::abs(__Bn) < _Tp(1) / __big) + { + __An *= __big; + __Bn *= __big; + __Anm1 *= __big; + __Bnm1 *= __big; + __Anm2 *= __big; + __Bnm2 *= __big; + __Anm3 *= __big; + __Bnm3 *= __big; + } + + ++__n; + __Bnm3 = __Bnm2; + __Bnm2 = __Bnm1; + __Bnm1 = __Bn; + __Anm3 = __Anm2; + __Anm2 = __Anm1; + __Anm1 = __An; + } + + if (__n >= __nmax) + std::__throw_runtime_error(__N("Iteration failed to converge " + "in __hyperg_luke.")); + + return __F; + } + + + /** + * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$ by the reflection + * formulae in Abramowitz & Stegun formula 15.3.6 for d = c - a - b not integral + * and formula 15.3.11 for d = c - a - b integral. + * This assumes a, b, c != negative integer. + * + * The hypogeometric function is defined by + * @f[ + * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)} + * \sum_{n=0}^{\infty} + * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)} + * \frac{x^n}{n!} + * @f] + * + * The reflection formula for nonintegral @f$ d = c - a - b @f$ is: + * @f[ + * _2F_1(a,b;c;x) = \frac{\Gamma(c)\Gamma(d)}{\Gamma(c-a)\Gamma(c-b)} + * _2F_1(a,b;1-d;1-x) + * + \frac{\Gamma(c)\Gamma(-d)}{\Gamma(a)\Gamma(b)} + * _2F_1(c-a,c-b;1+d;1-x) + * @f] + * + * The reflection formula for integral @f$ m = c - a - b @f$ is: + * @f[ + * _2F_1(a,b;a+b+m;x) = \frac{\Gamma(m)\Gamma(a+b+m)}{\Gamma(a+m)\Gamma(b+m)} + * \sum_{k=0}^{m-1} \frac{(m+a)_k(m+b)_k}{k!(1-m)_k} + * - + * @f] + */ + template<typename _Tp> + _Tp + __hyperg_reflect(const _Tp __a, const _Tp __b, const _Tp __c, + const _Tp __x) + { + const _Tp __d = __c - __a - __b; + const int __intd = std::floor(__d + _Tp(0.5L)); + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + const _Tp __toler = _Tp(1000) * __eps; + const _Tp __log_max = std::log(std::numeric_limits<_Tp>::max()); + const bool __d_integer = (std::abs(__d - __intd) < __toler); + + if (__d_integer) + { + const _Tp __ln_omx = std::log(_Tp(1) - __x); + const _Tp __ad = std::abs(__d); + _Tp __F1, __F2; + + _Tp __d1, __d2; + if (__d >= _Tp(0)) + { + __d1 = __d; + __d2 = _Tp(0); + } + else + { + __d1 = _Tp(0); + __d2 = __d; + } + + const _Tp __lng_c = __log_gamma(__c); + + // Evaluate F1. + if (__ad < __eps) + { + // d = c - a - b = 0. + __F1 = _Tp(0); + } + else + { + + bool __ok_d1 = true; + _Tp __lng_ad, __lng_ad1, __lng_bd1; + try + { + __lng_ad = __log_gamma(__ad); + __lng_ad1 = __log_gamma(__a + __d1); + __lng_bd1 = __log_gamma(__b + __d1); + } + catch(...) + { + __ok_d1 = false; + } + + if (__ok_d1) + { + /* Gamma functions in the denominator are ok. + * Proceed with evaluation. + */ + _Tp __sum1 = _Tp(1); + _Tp __term = _Tp(1); + _Tp __ln_pre1 = __lng_ad + __lng_c + __d2 * __ln_omx + - __lng_ad1 - __lng_bd1; + + /* Do F1 sum. + */ + for (int __i = 1; __i < __ad; ++__i) + { + const int __j = __i - 1; + __term *= (__a + __d2 + __j) * (__b + __d2 + __j) + / (_Tp(1) + __d2 + __j) / __i * (_Tp(1) - __x); + __sum1 += __term; + } + + if (__ln_pre1 > __log_max) + std::__throw_runtime_error(__N("Overflow of gamma functions " + "in __hyperg_luke.")); + else + __F1 = std::exp(__ln_pre1) * __sum1; + } + else + { + // Gamma functions in the denominator were not ok. + // So the F1 term is zero. + __F1 = _Tp(0); + } + } // end F1 evaluation + + // Evaluate F2. + bool __ok_d2 = true; + _Tp __lng_ad2, __lng_bd2; + try + { + __lng_ad2 = __log_gamma(__a + __d2); + __lng_bd2 = __log_gamma(__b + __d2); + } + catch(...) + { + __ok_d2 = false; + } + + if (__ok_d2) + { + // Gamma functions in the denominator are ok. + // Proceed with evaluation. + const int __maxiter = 2000; + const _Tp __psi_1 = -__numeric_constants<_Tp>::__gamma_e(); + const _Tp __psi_1pd = __psi(_Tp(1) + __ad); + const _Tp __psi_apd1 = __psi(__a + __d1); + const _Tp __psi_bpd1 = __psi(__b + __d1); + + _Tp __psi_term = __psi_1 + __psi_1pd - __psi_apd1 + - __psi_bpd1 - __ln_omx; + _Tp __fact = _Tp(1); + _Tp __sum2 = __psi_term; + _Tp __ln_pre2 = __lng_c + __d1 * __ln_omx + - __lng_ad2 - __lng_bd2; + + // Do F2 sum. + int __j; + for (__j = 1; __j < __maxiter; ++__j) + { + // Values for psi functions use recurrence; Abramowitz & Stegun 6.3.5 + const _Tp __term1 = _Tp(1) / _Tp(__j) + + _Tp(1) / (__ad + __j); + const _Tp __term2 = _Tp(1) / (__a + __d1 + _Tp(__j - 1)) + + _Tp(1) / (__b + __d1 + _Tp(__j - 1)); + __psi_term += __term1 - __term2; + __fact *= (__a + __d1 + _Tp(__j - 1)) + * (__b + __d1 + _Tp(__j - 1)) + / ((__ad + __j) * __j) * (_Tp(1) - __x); + const _Tp __delta = __fact * __psi_term; + __sum2 += __delta; + if (std::abs(__delta) < __eps * std::abs(__sum2)) + break; + } + if (__j == __maxiter) + std::__throw_runtime_error(__N("Sum F2 failed to converge " + "in __hyperg_reflect")); + + if (__sum2 == _Tp(0)) + __F2 = _Tp(0); + else + __F2 = std::exp(__ln_pre2) * __sum2; + } + else + { + // Gamma functions in the denominator not ok. + // So the F2 term is zero. + __F2 = _Tp(0); + } // end F2 evaluation + + const _Tp __sgn_2 = (__intd % 2 == 1 ? -_Tp(1) : _Tp(1)); + const _Tp __F = __F1 + __sgn_2 * __F2; + + return __F; + } + else + { + // d = c - a - b not an integer. + + // These gamma functions appear in the denominator, so we + // catch their harmless domain errors and set the terms to zero. + bool __ok1 = true; + _Tp __sgn_g1ca = _Tp(0), __ln_g1ca = _Tp(0); + _Tp __sgn_g1cb = _Tp(0), __ln_g1cb = _Tp(0); + try + { + __sgn_g1ca = __log_gamma_sign(__c - __a); + __ln_g1ca = __log_gamma(__c - __a); + __sgn_g1cb = __log_gamma_sign(__c - __b); + __ln_g1cb = __log_gamma(__c - __b); + } + catch (...) + { + __ok1 = false; + } + + bool __ok2 = true; + _Tp __sgn_g2a = _Tp(0), __ln_g2a = _Tp(0); + _Tp __sgn_g2b = _Tp(0), __ln_g2b = _Tp(0); + try + { + __sgn_g2a = __log_gamma_sign(__a); + __ln_g2a = __log_gamma(__a); + __sgn_g2b = __log_gamma_sign(__b); + __ln_g2b = __log_gamma(__b); + } + catch (...) + { + __ok2 = false; + } + + const _Tp __sgn_gc = __log_gamma_sign(__c); + const _Tp __ln_gc = __log_gamma(__c); + const _Tp __sgn_gd = __log_gamma_sign(__d); + const _Tp __ln_gd = __log_gamma(__d); + const _Tp __sgn_gmd = __log_gamma_sign(-__d); + const _Tp __ln_gmd = __log_gamma(-__d); + + const _Tp __sgn1 = __sgn_gc * __sgn_gd * __sgn_g1ca * __sgn_g1cb; + const _Tp __sgn2 = __sgn_gc * __sgn_gmd * __sgn_g2a * __sgn_g2b; + + _Tp __pre1, __pre2; + if (__ok1 && __ok2) + { + _Tp __ln_pre1 = __ln_gc + __ln_gd - __ln_g1ca - __ln_g1cb; + _Tp __ln_pre2 = __ln_gc + __ln_gmd - __ln_g2a - __ln_g2b + + __d * std::log(_Tp(1) - __x); + if (__ln_pre1 < __log_max && __ln_pre2 < __log_max) + { + __pre1 = std::exp(__ln_pre1); + __pre2 = std::exp(__ln_pre2); + __pre1 *= __sgn1; + __pre2 *= __sgn2; + } + else + { + std::__throw_runtime_error(__N("Overflow of gamma functions " + "in __hyperg_reflect")); + } + } + else if (__ok1 && !__ok2) + { + _Tp __ln_pre1 = __ln_gc + __ln_gd - __ln_g1ca - __ln_g1cb; + if (__ln_pre1 < __log_max) + { + __pre1 = std::exp(__ln_pre1); + __pre1 *= __sgn1; + __pre2 = _Tp(0); + } + else + { + std::__throw_runtime_error(__N("Overflow of gamma functions " + "in __hyperg_reflect")); + } + } + else if (!__ok1 && __ok2) + { + _Tp __ln_pre2 = __ln_gc + __ln_gmd - __ln_g2a - __ln_g2b + + __d * std::log(_Tp(1) - __x); + if (__ln_pre2 < __log_max) + { + __pre1 = _Tp(0); + __pre2 = std::exp(__ln_pre2); + __pre2 *= __sgn2; + } + else + { + std::__throw_runtime_error(__N("Overflow of gamma functions " + "in __hyperg_reflect")); + } + } + else + { + __pre1 = _Tp(0); + __pre2 = _Tp(0); + std::__throw_runtime_error(__N("Underflow of gamma functions " + "in __hyperg_reflect")); + } + + const _Tp __F1 = __hyperg_series(__a, __b, _Tp(1) - __d, + _Tp(1) - __x); + const _Tp __F2 = __hyperg_series(__c - __a, __c - __b, _Tp(1) + __d, + _Tp(1) - __x); + + const _Tp __F = __pre1 * __F1 + __pre2 * __F2; + + return __F; + } + } + + + /* + * @brief Return the hypogeometric function @f$ _2F_1(a,b;c;x) @f$. + * + * The hypogeometric function is defined by + * @f[ + * _2F_1(a,b;c;x) = \frac{\Gamma(c)}{\Gamma(a)\Gamma(b)} + * \sum_{n=0}^{\infty} + * \frac{\Gamma(a+n)\Gamma(b+n)}{\Gamma(c+n)} + * \frac{x^n}{n!} + * @f] + * + * @param __a The first "numerator" parameter. + * @param __a The second "numerator" parameter. + * @param __c The "denominator" parameter. + * @param __x The argument of the confluent hypergeometric function. + * @return The confluent hypergeometric function. + */ + template<typename _Tp> + inline _Tp + __hyperg(const _Tp __a, const _Tp __b, const _Tp __c, const _Tp __x) + { +#if _GLIBCXX_USE_C99_MATH_TR1 + const _Tp __a_nint = std::_GLIBCXX_TR1::nearbyint(__a); + const _Tp __b_nint = std::_GLIBCXX_TR1::nearbyint(__b); + const _Tp __c_nint = std::_GLIBCXX_TR1::nearbyint(__c); +#else + const _Tp __a_nint = static_cast<int>(__a + _Tp(0.5L)); + const _Tp __b_nint = static_cast<int>(__b + _Tp(0.5L)); + const _Tp __c_nint = static_cast<int>(__c + _Tp(0.5L)); +#endif + const _Tp __toler = _Tp(1000) * std::numeric_limits<_Tp>::epsilon(); + if (std::abs(__x) >= _Tp(1)) + std::__throw_domain_error(__N("Argument outside unit circle " + "in __hyperg.")); + else if (__isnan(__a) || __isnan(__b) + || __isnan(__c) || __isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__c_nint == __c && __c_nint <= _Tp(0)) + return std::numeric_limits<_Tp>::infinity(); + else if (std::abs(__c - __b) < __toler || std::abs(__c - __a) < __toler) + return std::pow(_Tp(1) - __x, __c - __a - __b); + else if (__a >= _Tp(0) && __b >= _Tp(0) && __c >= _Tp(0) + && __x >= _Tp(0) && __x < _Tp(0.995L)) + return __hyperg_series(__a, __b, __c, __x); + else if (std::abs(__a) < _Tp(10) && std::abs(__b) < _Tp(10)) + { + // For integer a and b the hypergeometric function is a finite polynomial. + if (__a < _Tp(0) && std::abs(__a - __a_nint) < __toler) + return __hyperg_series(__a_nint, __b, __c, __x); + else if (__b < _Tp(0) && std::abs(__b - __b_nint) < __toler) + return __hyperg_series(__a, __b_nint, __c, __x); + else if (__x < -_Tp(0.25L)) + return __hyperg_luke(__a, __b, __c, __x); + else if (__x < _Tp(0.5L)) + return __hyperg_series(__a, __b, __c, __x); + else + if (std::abs(__c) > _Tp(10)) + return __hyperg_series(__a, __b, __c, __x); + else + return __hyperg_reflect(__a, __b, __c, __x); + } + else + return __hyperg_luke(__a, __b, __c, __x); + } + + } // namespace std::tr1::__detail + + /* @} */ // group tr1_math_spec_func + +_GLIBCXX_END_NAMESPACE +} + +#endif // _TR1_HYPERGEOMETRIC_TCC diff --git a/libstdc++-v3/include/tr1/legendre_function.tcc b/libstdc++-v3/include/tr1/legendre_function.tcc new file mode 100644 index 00000000000..323bd18861c --- /dev/null +++ b/libstdc++-v3/include/tr1/legendre_function.tcc @@ -0,0 +1,318 @@ +// 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/legendre_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 8, pp. 331-341 +// (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. 252-254 + +#ifndef _TR1_LEGENDRE_FUNCTION_TCC +#define _TR1_LEGENDRE_FUNCTION_TCC 1 + +#include "special_function_util.h" + +namespace std +{ +_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) + + // [5.2] Special functions + + /** + * @ingroup tr1_math_spec_func + * @{ + */ + + // + // Implementation-space details. + // + namespace __detail + { + + /** + * @brief Return the Legendre polynomial by recursion on order + * @f$ l @f$. + * + * The Legendre function of @f$ l @f$ and @f$ x @f$, + * @f$ P_l(x) @f$, is defined by: + * @f[ + * P_l(x) = \frac{1}{2^l l!}\frac{d^l}{dx^l}(x^2 - 1)^{l} + * @f] + * + * @param l The order of the Legendre polynomial. @f$l >= 0@f$. + * @param x The argument of the Legendre polynomial. @f$|x| <= 1@f$. + */ + template<typename _Tp> + _Tp + __poly_legendre_p(const unsigned int __l, const _Tp __x) + { + + if ((__x < _Tp(-1)) || (__x > _Tp(+1))) + std::__throw_domain_error(__N("Argument out of range" + " in __poly_legendre_p.")); + else if (__isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__x == +_Tp(1)) + return +_Tp(1); + else if (__x == -_Tp(1)) + return (__l % 2 == 1 ? -_Tp(1) : +_Tp(1)); + else + { + _Tp __p_lm2 = _Tp(1); + if (__l == 0) + return __p_lm2; + + _Tp __p_lm1 = __x; + if (__l == 1) + return __p_lm1; + + _Tp __p_l = 0; + for (unsigned int __ll = 2; __ll <= __l; ++__ll) + { + // This arrangement is supposed to be better for roundoff + // protection, Arfken, 2nd Ed, Eq 12.17a. + __p_l = _Tp(2) * __x * __p_lm1 - __p_lm2 + - (__x * __p_lm1 - __p_lm2) / _Tp(__ll); + __p_lm2 = __p_lm1; + __p_lm1 = __p_l; + } + + return __p_l; + } + } + + + /** + * @brief Return the associated Legendre function by recursion + * on @f$ l @f$. + * + * The associated Legendre function is derived from the Legendre function + * @f$ P_l(x) @f$ by the Rodruigez formula: + * @f[ + * P_l^m(x) = (1 - x^2)^{m/2}\frac{d^m}{dx^m}P_l(x) + * @f] + * + * @param l The order of the associated Legendre function. + * @f$ l >= 0 @f$. + * @param m The order of the associated Legendre function. + * @f$ m <= l @f$. + * @param x The argument of the associated Legendre function. + * @f$ |x| <= 1 @f$. + */ + template<typename _Tp> + _Tp + __assoc_legendre_p(const unsigned int __l, const unsigned int __m, + const _Tp __x) + { + + if (__x < _Tp(-1) || __x > _Tp(+1)) + std::__throw_domain_error(__N("Argument out of range" + " in __assoc_legendre_p.")); + else if (__m > __l) + std::__throw_domain_error(__N("Degree out of range" + " in __assoc_legendre_p.")); + else if (__isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__m == 0) + return __poly_legendre_p(__l, __x); + else + { + _Tp __p_mm = _Tp(1); + if (__m > 0) + { + // Two square roots seem more accurate more of the time than just one. + _Tp __root = std::sqrt(_Tp(1) - __x) * std::sqrt(_Tp(1) + __x); + _Tp __fact = _Tp(1); + for (unsigned int __i = 1; __i <= __m; ++__i) + { + __p_mm *= -__fact * __root; + __fact += _Tp(2); + } + } + if (__l == __m) + return __p_mm; + + _Tp __p_mp1m = _Tp(2 * __m + 1) * __x * __p_mm; + if (__l == __m + 1) + return __p_mp1m; + + _Tp __p_lm2m = __p_mm; + _Tp __P_lm1m = __p_mp1m; + _Tp __p_lm = _Tp(0); + for (unsigned int __j = __m + 2; __j <= __l; ++__j) + { + __p_lm = (_Tp(2 * __j - 1) * __x * __P_lm1m + - _Tp(__j + __m - 1) * __p_lm2m) / _Tp(__j - __m); + __p_lm2m = __P_lm1m; + __P_lm1m = __p_lm; + } + + return __p_lm; + } + } + + + /** + * @brief Return the spherical associated Legendre function. + * + * The spherical associated Legendre function of @f$ l @f$, @f$ m @f$, + * and @f$ \theta @f$ is defined as @f$ Y_l^m(\theta,0) @f$ where + * @f[ + * Y_l^m(\theta,\phi) = (-1)^m[\frac{(2l+1)}{4\pi} + * \frac{(l-m)!}{(l+m)!}] + * P_l^m(\cos\theta) \exp^{im\phi} + * @f] + * is the spherical harmonic function and @f$ P_l^m(x) @f$ is the + * associated Legendre function. + * + * This function differs from the associated Legendre function by + * argument (@f$x = \cos(\theta)@f$) and by a normalization factor + * but this factor is rather large for large @f$ l @f$ and @f$ m @f$ + * and so this function is stable for larger differences of @f$ l @f$ + * and @f$ m @f$. + * + * @param l The order of the spherical associated Legendre function. + * @f$ l >= 0 @f$. + * @param m The order of the spherical associated Legendre function. + * @f$ m <= l @f$. + * @param theta The radian angle argument of the spherical associated + * Legendre function. + */ + template <typename _Tp> + _Tp + __sph_legendre(const unsigned int __l, const unsigned int __m, + const _Tp __theta) + { + if (__isnan(__theta)) + return std::numeric_limits<_Tp>::quiet_NaN(); + + const _Tp __x = std::cos(__theta); + + if (__l < __m) + { + std::__throw_domain_error(__N("Bad argument " + "in __sph_legendre.")); + } + else if (__m == 0) + { + _Tp __P = __poly_legendre_p(__l, __x); + _Tp __fact = std::sqrt(_Tp(2 * __l + 1) + / (_Tp(4) * __numeric_constants<_Tp>::__pi())); + __P *= __fact; + return __P; + } + else if (__x == _Tp(1) || __x == -_Tp(1)) + { + // m > 0 here + return _Tp(0); + } + else + { + // m > 0 and |x| < 1 here + + // Starting value for recursion. + // Y_m^m(x) = sqrt( (2m+1)/(4pi m) gamma(m+1/2)/gamma(m) ) + // (-1)^m (1-x^2)^(m/2) / pi^(1/4) + const _Tp __sgn = ( __m % 2 == 1 ? -_Tp(1) : _Tp(1)); + const _Tp __y_mp1m_factor = __x * std::sqrt(_Tp(2 * __m + 3)); +#if _GLIBCXX_USE_C99_MATH_TR1 + const _Tp __lncirc = std::_GLIBCXX_TR1::log1p(-__x * __x); +#else + const _Tp __lncirc = std::log(_Tp(1) - __x * __x); +#endif + // Gamma(m+1/2) / Gamma(m) +#if _GLIBCXX_USE_C99_MATH_TR1 + const _Tp __lnpoch = std::_GLIBCXX_TR1::lgamma(_Tp(__m + _Tp(0.5L))) + - std::_GLIBCXX_TR1::lgamma(_Tp(__m)); +#else + const _Tp __lnpoch = __log_gamma(_Tp(__m + _Tp(0.5L))) + - __log_gamma(_Tp(__m)); +#endif + const _Tp __lnpre_val = + -_Tp(0.25L) * __numeric_constants<_Tp>::__lnpi() + + _Tp(0.5L) * (__lnpoch + __m * __lncirc); + _Tp __sr = std::sqrt((_Tp(2) + _Tp(1) / __m) + / (_Tp(4) * __numeric_constants<_Tp>::__pi())); + _Tp __y_mm = __sgn * __sr * std::exp(__lnpre_val); + _Tp __y_mp1m = __y_mp1m_factor * __y_mm; + + if (__l == __m) + { + return __y_mm; + } + else if (__l == __m + 1) + { + return __y_mp1m; + } + else + { + _Tp __y_lm = _Tp(0); + + // Compute Y_l^m, l > m+1, upward recursion on l. + for ( int __ll = __m + 2; __ll <= __l; ++__ll) + { + const _Tp __rat1 = _Tp(__ll - __m) / _Tp(__ll + __m); + const _Tp __rat2 = _Tp(__ll - __m - 1) / _Tp(__ll + __m - 1); + const _Tp __fact1 = std::sqrt(__rat1 * _Tp(2 * __ll + 1) + * _Tp(2 * __ll - 1)); + const _Tp __fact2 = std::sqrt(__rat1 * __rat2 * _Tp(2 * __ll + 1) + / _Tp(2 * __ll - 3)); + __y_lm = (__x * __y_mp1m * __fact1 + - (__ll + __m - 1) * __y_mm * __fact2) / _Tp(__ll - __m); + __y_mm = __y_mp1m; + __y_mp1m = __y_lm; + } + + return __y_lm; + } + } + } + + } // namespace std::tr1::__detail + + /* @} */ // group tr1_math_spec_func + +_GLIBCXX_END_NAMESPACE +} + +#endif // _TR1_LEGENDRE_FUNCTION_TCC diff --git a/libstdc++-v3/include/tr1/math.h b/libstdc++-v3/include/tr1/math.h index dcf75376326..0698cb2df9c 100644 --- a/libstdc++-v3/include/tr1/math.h +++ b/libstdc++-v3/include/tr1/math.h @@ -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 diff --git a/libstdc++-v3/include/tr1/modified_bessel_func.tcc b/libstdc++-v3/include/tr1/modified_bessel_func.tcc new file mode 100644 index 00000000000..c7065a2251e --- /dev/null +++ b/libstdc++-v3/include/tr1/modified_bessel_func.tcc @@ -0,0 +1,450 @@ +// 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/modified_bessel_func.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. +// +// References: +// (1) Handbook of Mathematical Functions, +// Ed. Milton Abramowitz and Irene A. Stegun, +// Dover Publications, +// Section 9, pp. 355-434, Section 10 pp. 435-478 +// (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. 246-249. + +#ifndef _TR1_MODIFIED_BESSEL_FUNC_TCC +#define _TR1_MODIFIED_BESSEL_FUNC_TCC 1 + +#include "special_function_util.h" + +namespace std +{ +_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) + + // [5.2] Special functions + + /** + * @ingroup tr1_math_spec_func + * @{ + */ + + // + // Implementation-space details. + // + namespace __detail + { + + /** + * @brief Compute the modified Bessel functions @f$ I_\nu(x) @f$ and + * @f$ K_\nu(x) @f$ and their first derivatives + * @f$ I'_\nu(x) @f$ and @f$ K'_\nu(x) @f$ respectively. + * These four functions are computed together for numerical + * stability. + * + * @param __nu The order of the Bessel functions. + * @param __x The argument of the Bessel functions. + * @param __Inu The output regular modified Bessel function. + * @param __Knu The output irregular modified Bessel function. + * @param __Ipnu The output derivative of the regular + * modified Bessel function. + * @param __Kpnu The output derivative of the irregular + * modified Bessel function. + */ + template <typename _Tp> + void + __bessel_ik(const _Tp __nu, const _Tp __x, + _Tp & __Inu, _Tp & __Knu, _Tp & __Ipnu, _Tp & __Kpnu) + { + if (__x == _Tp(0)) + { + if (__nu == _Tp(0)) + { + __Inu = _Tp(1); + __Ipnu = _Tp(0); + } + else if (__nu == _Tp(1)) + { + __Inu = _Tp(0); + __Ipnu = _Tp(0.5L); + } + else + { + __Inu = _Tp(0); + __Ipnu = _Tp(0); + } + __Knu = std::numeric_limits<_Tp>::infinity(); + __Kpnu = -std::numeric_limits<_Tp>::infinity(); + return; + } + + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + const _Tp __fp_min = _Tp(10) * std::numeric_limits<_Tp>::epsilon(); + const int __max_iter = 15000; + const _Tp __x_min = _Tp(2); + + const int __nl = static_cast<int>(__nu + _Tp(0.5L)); + + const _Tp __mu = __nu - __nl; + const _Tp __mu2 = __mu * __mu; + const _Tp __xi = _Tp(1) / __x; + const _Tp __xi2 = _Tp(2) * __xi; + _Tp __h = __nu * __xi; + if ( __h < __fp_min ) + __h = __fp_min; + _Tp __b = __xi2 * __nu; + _Tp __d = _Tp(0); + _Tp __c = __h; + int __i; + for ( __i = 1; __i <= __max_iter; ++__i ) + { + __b += __xi2; + __d = _Tp(1) / (__b + __d); + __c = __b + _Tp(1) / __c; + const _Tp __del = __c * __d; + __h *= __del; + if (std::abs(__del - _Tp(1)) < __eps) + break; + } + if (__i > __max_iter) + std::__throw_runtime_error(__N("Argument x too large " + "in __bessel_jn; " + "try asymptotic expansion.")); + _Tp __Inul = __fp_min; + _Tp __Ipnul = __h * __Inul; + _Tp __Inul1 = __Inul; + _Tp __Ipnu1 = __Ipnul; + _Tp __fact = __nu * __xi; + for (int __l = __nl; __l >= 1; --__l) + { + const _Tp __Inutemp = __fact * __Inul + __Ipnul; + __fact -= __xi; + __Ipnul = __fact * __Inutemp + __Inul; + __Inul = __Inutemp; + } + _Tp __f = __Ipnul / __Inul; + _Tp __Kmu, __Knu1; + if (__x < __x_min) + { + const _Tp __x2 = __x / _Tp(2); + const _Tp __pimu = __numeric_constants<_Tp>::__pi() * __mu; + const _Tp __fact = (std::abs(__pimu) < __eps + ? _Tp(1) : __pimu / std::sin(__pimu)); + _Tp __d = -std::log(__x2); + _Tp __e = __mu * __d; + const _Tp __fact2 = (std::abs(__e) < __eps + ? _Tp(1) : std::sinh(__e) / __e); + _Tp __gam1, __gam2, __gampl, __gammi; + __gamma_temme(__mu, __gam1, __gam2, __gampl, __gammi); + _Tp __ff = __fact + * (__gam1 * std::cosh(__e) + __gam2 * __fact2 * __d); + _Tp __sum = __ff; + __e = std::exp(__e); + _Tp __p = __e / (_Tp(2) * __gampl); + _Tp __q = _Tp(1) / (_Tp(2) * __e * __gammi); + _Tp __c = _Tp(1); + __d = __x2 * __x2; + _Tp __sum1 = __p; + int __i; + for (__i = 1; __i <= __max_iter; ++__i) + { + __ff = (__i * __ff + __p + __q) / (__i * __i - __mu2); + __c *= __d / __i; + __p /= __i - __mu; + __q /= __i + __mu; + const _Tp __del = __c * __ff; + __sum += __del; + const _Tp __del1 = __c * (__p - __i * __ff); + __sum1 += __del1; + if (std::abs(__del) < __eps * std::abs(__sum)) + break; + } + if (__i > __max_iter) + std::__throw_runtime_error(__N("Bessel k series failed to converge " + "in __bessel_jn.")); + __Kmu = __sum; + __Knu1 = __sum1 * __xi2; + } + else + { + _Tp __b = _Tp(2) * (_Tp(1) + __x); + _Tp __d = _Tp(1) / __b; + _Tp __delh = __d; + _Tp __h = __delh; + _Tp __q1 = _Tp(0); + _Tp __q2 = _Tp(1); + _Tp __a1 = _Tp(0.25L) - __mu2; + _Tp __q = __c = __a1; + _Tp __a = -__a1; + _Tp __s = _Tp(1) + __q * __delh; + int __i; + for (__i = 2; __i <= __max_iter; ++__i) + { + __a -= 2 * (__i - 1); + __c = -__a * __c / __i; + const _Tp __qnew = (__q1 - __b * __q2) / __a; + __q1 = __q2; + __q2 = __qnew; + __q += __c * __qnew; + __b += _Tp(2); + __d = _Tp(1) / (__b + __a * __d); + __delh = (__b * __d - _Tp(1)) * __delh; + __h += __delh; + const _Tp __dels = __q * __delh; + __s += __dels; + if ( std::abs(__dels / __s) < __eps ) + break; + } + if (__i > __max_iter) + std::__throw_runtime_error(__N("Steed's method failed " + "in __bessel_jn.")); + __h = __a1 * __h; + __Kmu = std::sqrt(__numeric_constants<_Tp>::__pi() / (_Tp(2) * __x)) + * std::exp(-__x) / __s; + __Knu1 = __Kmu * (__mu + __x + _Tp(0.5L) - __h) * __xi; + } + + _Tp __Kpmu = __mu * __xi * __Kmu - __Knu1; + _Tp __Inumu = __xi / (__f * __Kmu - __Kpmu); + __Inu = __Inumu * __Inul1 / __Inul; + __Ipnu = __Inumu * __Ipnu1 / __Inul; + for ( __i = 1; __i <= __nl; ++__i ) + { + const _Tp __Knutemp = (__mu + __i) * __xi2 * __Knu1 + __Kmu; + __Kmu = __Knu1; + __Knu1 = __Knutemp; + } + __Knu = __Kmu; + __Kpnu = __nu * __xi * __Kmu - __Knu1; + + return; + } + + + /** + * @brief Return the regular modified Bessel function of order + * \f$ \nu \f$: \f$ I_{\nu}(x) \f$. + * + * The regular modified cylindrical Bessel function is: + * @f[ + * I_{\nu}(x) = \sum_{k=0}^{\infty} + * \frac{(x/2)^{\nu + 2k}}{k!\Gamma(\nu+k+1)} + * @f] + * + * @param __nu The order of the regular modified Bessel function. + * @param __x The argument of the regular modified Bessel function. + * @return The output regular modified Bessel function. + */ + template<typename _Tp> + _Tp + __cyl_bessel_i(const _Tp __nu, const _Tp __x) + { + if (__nu < _Tp(0) || __x < _Tp(0)) + std::__throw_domain_error(__N("Bad argument " + "in __cyl_bessel_i.")); + else if (__isnan(__nu) || __isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__x * __x < _Tp(10) * (__nu + _Tp(1))) + return __cyl_bessel_ij_series(__nu, __x, +_Tp(1), 200); + else + { + _Tp __I_nu, __K_nu, __Ip_nu, __Kp_nu; + __bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu); + return __I_nu; + } + } + + + /** + * @brief Return the irregular modified Bessel function + * \f$ K_{\nu}(x) \f$ of order \f$ \nu \f$. + * + * The irregular modified Bessel function is defined by: + * @f[ + * K_{\nu}(x) = \frac{\pi}{2} + * \frac{I_{-\nu}(x) - I_{\nu}(x)}{\sin \nu\pi} + * @f] + * where for integral \f$ \nu = n \f$ a limit is taken: + * \f$ lim_{\nu \to n} \f$. + * + * @param __nu The order of the irregular modified Bessel function. + * @param __x The argument of the irregular modified Bessel function. + * @return The output irregular modified Bessel function. + */ + template<typename _Tp> + _Tp + __cyl_bessel_k(const _Tp __nu, const _Tp __x) + { + if (__nu < _Tp(0) || __x < _Tp(0)) + std::__throw_domain_error(__N("Bad argument " + "in __cyl_bessel_k.")); + else if (__isnan(__nu) || __isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else + { + _Tp __I_nu, __K_nu, __Ip_nu, __Kp_nu; + __bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu); + return __K_nu; + } + } + + + /** + * @brief Compute the spherical modified Bessel functions + * @f$ i_n(x) @f$ and @f$ k_n(x) @f$ and their first + * derivatives @f$ i'_n(x) @f$ and @f$ k'_n(x) @f$ + * respectively. + * + * @param __n The order of the modified spherical Bessel function. + * @param __x The argument of the modified spherical Bessel function. + * @param __i_n The output regular modified spherical Bessel function. + * @param __k_n The output irregular modified spherical + * Bessel function. + * @param __ip_n The output derivative of the regular modified + * spherical Bessel function. + * @param __kp_n The output derivative of the irregular modified + * spherical Bessel function. + */ + template <typename _Tp> + void + __sph_bessel_ik(const unsigned int __n, const _Tp __x, + _Tp & __i_n, _Tp & __k_n, _Tp & __ip_n, _Tp & __kp_n) + { + const _Tp __nu = _Tp(__n) + _Tp(0.5L); + + _Tp __I_nu, __Ip_nu, __K_nu, __Kp_nu; + __bessel_ik(__nu, __x, __I_nu, __K_nu, __Ip_nu, __Kp_nu); + + const _Tp __factor = __numeric_constants<_Tp>::__sqrtpio2() + / std::sqrt(__x); + + __i_n = __factor * __I_nu; + __k_n = __factor * __K_nu; + __ip_n = __factor * __Ip_nu - __i_n / (_Tp(2) * __x); + __kp_n = __factor * __Kp_nu - __k_n / (_Tp(2) * __x); + + return; + } + + + /** + * @brief Compute the Airy functions + * @f$ Ai(x) @f$ and @f$ Bi(x) @f$ and their first + * derivatives @f$ Ai'(x) @f$ and @f$ Bi(x) @f$ + * respectively. + * + * @param __n The order of the Airy functions. + * @param __x The argument of the Airy functions. + * @param __i_n The output Airy function. + * @param __k_n The output Airy function. + * @param __ip_n The output derivative of the Airy function. + * @param __kp_n The output derivative of the Airy function. + */ + template <typename _Tp> + void + __airy(const _Tp __x, + _Tp & __Ai, _Tp & __Bi, _Tp & __Aip, _Tp & __Bip) + { + const _Tp __absx = std::abs(__x); + const _Tp __rootx = std::sqrt(__absx); + const _Tp __z = _Tp(2) * __absx * __rootx / _Tp(3); + + if (__isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__x > _Tp(0)) + { + _Tp __I_nu, __Ip_nu, __K_nu, __Kp_nu; + + __bessel_ik(_Tp(1) / _Tp(3), __z, __I_nu, __K_nu, __Ip_nu, __Kp_nu); + __Ai = __rootx * __K_nu + / (__numeric_constants<_Tp>::__sqrt3() + * __numeric_constants<_Tp>::__pi()); + __Bi = __rootx * (__K_nu / __numeric_constants<_Tp>::__pi() + + _Tp(2) * __I_nu / __numeric_constants<_Tp>::__sqrt3()); + + __bessel_ik(_Tp(2) / _Tp(3), __z, __I_nu, __K_nu, __Ip_nu, __Kp_nu); + __Aip = -__x * __K_nu + / (__numeric_constants<_Tp>::__sqrt3() + * __numeric_constants<_Tp>::__pi()); + __Bip = __x * (__K_nu / __numeric_constants<_Tp>::__pi() + + _Tp(2) * __I_nu + / __numeric_constants<_Tp>::__sqrt3()); + } + else if (__x < _Tp(0)) + { + _Tp __J_nu, __Jp_nu, __N_nu, __Np_nu; + + __bessel_jn(_Tp(1) / _Tp(3), __z, __J_nu, __N_nu, __Jp_nu, __Np_nu); + __Ai = __rootx * (__J_nu + - __N_nu / __numeric_constants<_Tp>::__sqrt3()) / _Tp(2); + __Bi = -__rootx * (__N_nu + + __J_nu / __numeric_constants<_Tp>::__sqrt3()) / _Tp(2); + + __bessel_jn(_Tp(2) / _Tp(3), __z, __J_nu, __N_nu, __Jp_nu, __Np_nu); + __Aip = __absx * (__N_nu / __numeric_constants<_Tp>::__sqrt3() + + __J_nu) / _Tp(2); + __Bip = __absx * (__J_nu / __numeric_constants<_Tp>::__sqrt3() + - __N_nu) / _Tp(2); + } + else + { + // Reference: + // Abramowitz & Stegun, page 446 section 10.4.4 on Airy functions. + // The number is Ai(0) = 3^{-2/3}/\Gamma(2/3). + __Ai = _Tp(0.35502805388781723926L); + __Bi = __Ai * __numeric_constants<_Tp>::__sqrt3(); + + // Reference: + // Abramowitz & Stegun, page 446 section 10.4.5 on Airy functions. + // The number is Ai'(0) = -3^{-1/3}/\Gamma(1/3). + __Aip = -_Tp(0.25881940379280679840L); + __Bip = -__Aip * __numeric_constants<_Tp>::__sqrt3(); + } + + return; + } + + } // namespace std::tr1::__detail + + /* @} */ // group tr1_math_spec_func + +_GLIBCXX_END_NAMESPACE +} + +#endif // _TR1_MODIFIED_BESSEL_FUNC_TCC diff --git a/libstdc++-v3/include/tr1/poly_hermite.tcc b/libstdc++-v3/include/tr1/poly_hermite.tcc new file mode 100644 index 00000000000..3a7bf921833 --- /dev/null +++ b/libstdc++-v3/include/tr1/poly_hermite.tcc @@ -0,0 +1,138 @@ +// 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 diff --git a/libstdc++-v3/include/tr1/poly_laguerre.tcc b/libstdc++-v3/include/tr1/poly_laguerre.tcc new file mode 100644 index 00000000000..5200cab79c0 --- /dev/null +++ b/libstdc++-v3/include/tr1/poly_laguerre.tcc @@ -0,0 +1,342 @@ +// 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_laguerre.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 13, pp. 509-510, Section 22 pp. 773-802 +// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl + +#ifndef _TR1_POLY_LAGUERRE_TCC +#define _TR1_POLY_LAGUERRE_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 associated Laguerre polynomial + * of order @f$ n @f$, degree @f$ \alpha @f$ for large n. + * Abramowitz & Stegun, 13.5.21 + * + * @param __n The order of the Laguerre function. + * @param __alpha The degree of the Laguerre function. + * @param __x The argument of the Laguerre function. + * @return The value of the Laguerre function of order n, + * degree @f$ \alpha @f$, and argument x. + * + * This is from the GNU Scientific Library. + */ + template<typename _Tpa, typename _Tp> + _Tp + __poly_laguerre_large_n(const unsigned __n, const _Tpa __alpha, + const _Tp __x) + { + const _Tp __a = -_Tp(__n); + const _Tp __b = _Tp(__alpha) + _Tp(1); + const _Tp __eta = _Tp(2) * __b - _Tp(4) * __a; + const _Tp __cos2th = __x / __eta; + const _Tp __sin2th = _Tp(1) - __cos2th; + const _Tp __th = std::acos(std::sqrt(__cos2th)); + const _Tp __pre_h = __numeric_constants<_Tp>::__pi_2() + * __numeric_constants<_Tp>::__pi_2() + * __eta * __eta * __cos2th * __sin2th; + +#if _GLIBCXX_USE_C99_MATH_TR1 + const _Tp __lg_b = std::_GLIBCXX_TR1::lgamma(_Tp(__n) + __b); + const _Tp __lnfact = std::_GLIBCXX_TR1::lgamma(_Tp(__n + 1)); +#else + const _Tp __lg_b = __log_gamma(_Tp(__n) + __b); + const _Tp __lnfact = __log_gamma(_Tp(__n + 1)); +#endif + + _Tp __pre_term1 = _Tp(0.5L) * (_Tp(1) - __b) + * std::log(_Tp(0.25L) * __x * __eta); + _Tp __pre_term2 = _Tp(0.25L) * std::log(__pre_h); + _Tp __lnpre = __lg_b - __lnfact + _Tp(0.5L) * __x + + __pre_term1 - __pre_term2; + _Tp __ser_term1 = std::sin(__a * __numeric_constants<_Tp>::__pi()); + _Tp __ser_term2 = std::sin(_Tp(0.25L) * __eta + * (_Tp(2) * __th + - std::sin(_Tp(2) * __th)) + + __numeric_constants<_Tp>::__pi_4()); + _Tp __ser = __ser_term1 + __ser_term2; + + return std::exp(__lnpre) * __ser; + } + + + /** + * @brief Evaluate the polynomial based on the confluent hypergeometric + * function in a safe way, with no restriction on the arguments. + * + * The associated Laguerre function is defined by + * @f[ + * L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!} + * _1F_1(-n; \alpha + 1; x) + * @f] + * where @f$ (\alpha)_n @f$ is the Pochhammer symbol and + * @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function. + * + * This function assumes x != 0. + * + * This is from the GNU Scientific Library. + */ + template<typename _Tpa, typename _Tp> + _Tp + __poly_laguerre_hyperg(const unsigned int __n, const _Tpa __alpha, const _Tp __x) + { + const _Tp __b = _Tp(__alpha) + _Tp(1); + const _Tp __mx = -__x; + const _Tp __tc_sgn = (__x < _Tp(0) ? _Tp(1) + : ((__n % 2 == 1) ? -_Tp(1) : _Tp(1))); + // Get |x|^n/n! + _Tp __tc = _Tp(1); + const _Tp __ax = std::abs(__x); + for (unsigned int __k = 1; __k <= __n; ++__k) + __tc *= (__ax / __k); + + _Tp __term = __tc * __tc_sgn; + _Tp __sum = __term; + for (int __k = int(__n) - 1; __k >= 0; --__k) + { + __term *= ((__b + _Tp(__k)) / _Tp(int(__n) - __k)) + * _Tp(__k + 1) / __mx; + __sum += __term; + } + + return __sum; + } + + + /** + * @brief This routine returns the associated Laguerre polynomial + * of order @f$ n @f$, degree @f$ \alpha @f$: @f$ L_n^\alpha(x) @f$ + * by recursion. + * + * The associated Laguerre function is defined by + * @f[ + * L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!} + * _1F_1(-n; \alpha + 1; x) + * @f] + * where @f$ (\alpha)_n @f$ is the Pochhammer symbol and + * @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function. + * + * The associated Laguerre polynomial is defined for integral + * @f$ \alpha = m @f$ by: + * @f[ + * L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x) + * @f] + * where the Laguerre polynomial is defined by: + * @f[ + * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x}) + * @f] + * + * @param __n The order of the Laguerre function. + * @param __alpha The degree of the Laguerre function. + * @param __x The argument of the Laguerre function. + * @return The value of the Laguerre function of order n, + * degree @f$ \alpha @f$, and argument x. + */ + template<typename _Tpa, typename _Tp> + _Tp + __poly_laguerre_recursion(const unsigned int __n, + const _Tpa __alpha, const _Tp __x) + { + // Compute l_0. + _Tp __l_0 = _Tp(1); + if (__n == 0) + return __l_0; + + // Compute l_1^alpha. + _Tp __l_1 = -__x + _Tp(1) + _Tp(__alpha); + if (__n == 1) + return __l_1; + + // Compute l_n^alpha by recursion on n. + _Tp __l_n2 = __l_0; + _Tp __l_n1 = __l_1; + _Tp __l_n = _Tp(0); + for (unsigned int __nn = 2; __nn <= __n; ++__nn) + { + __l_n = (_Tp(2 * __nn - 1) + _Tp(__alpha) - __x) + * __l_n1 / _Tp(__nn) + - (_Tp(__nn - 1) + _Tp(__alpha)) * __l_n2 / _Tp(__nn); + __l_n2 = __l_n1; + __l_n1 = __l_n; + } + + return __l_n; + } + + + /** + * @brief This routine returns the associated Laguerre polynomial + * of order n, degree @f$ \alpha @f$: @f$ L_n^alpha(x) @f$. + * + * The associated Laguerre function is defined by + * @f[ + * L_n^\alpha(x) = \frac{(\alpha + 1)_n}{n!} + * _1F_1(-n; \alpha + 1; x) + * @f] + * where @f$ (\alpha)_n @f$ is the Pochhammer symbol and + * @f$ _1F_1(a; c; x) @f$ is the confluent hypergeometric function. + * + * The associated Laguerre polynomial is defined for integral + * @f$ \alpha = m @f$ by: + * @f[ + * L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x) + * @f] + * where the Laguerre polynomial is defined by: + * @f[ + * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x}) + * @f] + * + * @param __n The order of the Laguerre function. + * @param __alpha The degree of the Laguerre function. + * @param __x The argument of the Laguerre function. + * @return The value of the Laguerre function of order n, + * degree @f$ \alpha @f$, and argument x. + */ + template<typename _Tpa, typename _Tp> + inline _Tp + __poly_laguerre(const unsigned int __n, const _Tpa __alpha, + const _Tp __x) + { + if (__x < _Tp(0)) + std::__throw_domain_error(__N("Negative argument " + "in __poly_laguerre.")); + // Return NaN on NaN input. + else if (__isnan(__x)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__n == 0) + return _Tp(1); + else if (__n == 1) + return _Tp(1) + _Tp(__alpha) - __x; + else if (__x == _Tp(0)) + { + _Tp __prod = _Tp(__alpha) + _Tp(1); + for (unsigned int __k = 2; __k <= __n; ++__k) + __prod *= (_Tp(__alpha) + _Tp(__k)) / _Tp(__k); + return __prod; + } + else if (__n > 10000000 && _Tp(__alpha) > -_Tp(1) + && __x < _Tp(2) * (_Tp(__alpha) + _Tp(1)) + _Tp(4 * __n)) + return __poly_laguerre_large_n(__n, __alpha, __x); + else if (_Tp(__alpha) >= _Tp(0) + || (__x > _Tp(0) && _Tp(__alpha) < -_Tp(__n + 1))) + return __poly_laguerre_recursion(__n, __alpha, __x); + else + return __poly_laguerre_hyperg(__n, __alpha, __x); + } + + + /** + * @brief This routine returns the associated Laguerre polynomial + * of order n, degree m: @f$ L_n^m @f$. + * + * The associated Laguerre polynomial is defined for integral + * @f$ \alpha = m @f$ by: + * @f[ + * L_n^m(x) = (-1)^m \frac{d^m}{dx^m} L_{n + m}(x) + * @f] + * where the Laguerre polynomial is defined by: + * @f[ + * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x}) + * @f] + * + * @param __n The order of the Laguerre polynomial. + * @param __m The degree of the Laguerre polynomial. + * @param __x The argument of the Laguerre polynomial. + * @return The value of the associated Laguerre polynomial of order n, + * degree m, and argument x. + */ + template<typename _Tp> + inline _Tp + __assoc_laguerre(const unsigned int __n, const unsigned int __m, + const _Tp __x) + { + return __poly_laguerre<unsigned int, _Tp>(__n, __m, __x); + } + + + /** + * @brief This routine returns the associated Laguerre polynomial + * of order n: @f$ L_n(x) @f$. + * + * The Laguerre polynomial is defined by: + * @f[ + * L_n(x) = \frac{e^x}{n!} \frac{d^n}{dx^n} (x^ne^{-x}) + * @f] + * + * @param __n The order of the Laguerre polynomial. + * @param __x The argument of the Laguerre polynomial. + * @return The value of the Laguerre polynomial of order n + * and argument x. + */ + template<typename _Tp> + inline _Tp + __laguerre(const unsigned int __n, const _Tp __x) + { + return __poly_laguerre<unsigned int, _Tp>(__n, 0, __x); + } + + } // namespace std::tr1::__detail + + /* @} */ // group tr1_math_spec_func + +_GLIBCXX_END_NAMESPACE +} + +#endif // _TR1_POLY_LAGUERRE_TCC diff --git a/libstdc++-v3/include/tr1/riemann_zeta.tcc b/libstdc++-v3/include/tr1/riemann_zeta.tcc new file mode 100644 index 00000000000..598d73e6411 --- /dev/null +++ b/libstdc++-v3/include/tr1/riemann_zeta.tcc @@ -0,0 +1,449 @@ +// 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/riemann_zeta.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. by Milton Abramowitz and Irene A. Stegun, +// Dover Publications, New-York, Section 5, pp. 807-808. +// (2) The Gnu Scientific Library, http://www.gnu.org/software/gsl +// (3) Gamma, Exploring Euler's Constant, Julian Havil, +// Princeton, 2003. + +#ifndef _TR1_RIEMANN_ZETA_TCC +#define _TR1_RIEMANN_ZETA_TCC 1 + +#include "special_function_util.h" + +namespace std +{ +_GLIBCXX_BEGIN_NAMESPACE(_GLIBCXX_TR1) + + // [5.2] Special functions + + /** + * @ingroup tr1_math_spec_func + * @{ + */ + + // + // Implementation-space details. + // + namespace __detail + { + + /** + * @brief Compute the Riemann zeta function @f$ \zeta(s) @f$ + * by summation for s > 1. + * + * The Riemann zeta function is defined by: + * \f[ + * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1 + * \f] + * For s < 1 use the reflection formula: + * \f[ + * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s) + * \f] + */ + template<typename _Tp> + _Tp + __riemann_zeta_sum(const _Tp __s) + { + // A user shouldn't get to this. + if (__s < _Tp(1)) + std::__throw_domain_error(__N("Bad argument in zeta sum.")); + + const unsigned int max_iter = 10000; + _Tp __zeta = _Tp(0); + for (unsigned int __k = 1; __k < max_iter; ++__k) + { + _Tp __term = std::pow(static_cast<_Tp>(__k), -__s); + if (__term < std::numeric_limits<_Tp>::epsilon()) + { + break; + } + __zeta += __term; + } + + return __zeta; + } + + + /** + * @brief Evaluate the Riemann zeta function @f$ \zeta(s) @f$ + * by an alternate series for s > 0. + * + * The Riemann zeta function is defined by: + * \f[ + * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1 + * \f] + * For s < 1 use the reflection formula: + * \f[ + * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s) + * \f] + */ + template<typename _Tp> + _Tp + __riemann_zeta_alt(const _Tp __s) + { + _Tp __sgn = _Tp(1); + _Tp __zeta = _Tp(0); + for (unsigned int __i = 1; __i < 10000000; ++__i) + { + _Tp __term = __sgn / std::pow(__i, __s); + if (std::abs(__term) < std::numeric_limits<_Tp>::epsilon()) + break; + __zeta += __term; + __sgn *= _Tp(-1); + } + __zeta /= _Tp(1) - std::pow(_Tp(2), _Tp(1) - __s); + + return __zeta; + } + + + /** + * @brief Evaluate the Riemann zeta function by series for all s != 1. + * Convergence is great until largish negative numbers. + * Then the convergence of the > 0 sum gets better. + * + * The series is: + * \f[ + * \zeta(s) = \frac{1}{1-2^{1-s}} + * \sum_{n=0}^{\infty} \frac{1}{2^{n+1}} + * \sum_{k=0}^{n} (-1)^k \frac{n!}{(n-k)!k!} (k+1)^{-s} + * \f] + * Havil 2003, p. 206. + * + * The Riemann zeta function is defined by: + * \f[ + * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1 + * \f] + * For s < 1 use the reflection formula: + * \f[ + * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s) + * \f] + */ + template<typename _Tp> + _Tp + __riemann_zeta_glob(const _Tp __s) + { + _Tp __zeta = _Tp(0); + + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + // Max e exponent before overflow. + const _Tp __max_bincoeff = std::numeric_limits<_Tp>::max_exponent10 + * std::log(_Tp(10)) - _Tp(1); + + // This series works until the binomial coefficient blows up + // so use reflection. + if (__s < _Tp(0)) + { +#if _GLIBCXX_USE_C99_MATH_TR1 + if (std::_GLIBCXX_TR1::fmod(__s,_Tp(2)) == _Tp(0)) + return _Tp(0); + else +#endif + { + _Tp __zeta = __riemann_zeta_glob(_Tp(1) - __s); + __zeta *= std::pow(_Tp(2) + * __numeric_constants<_Tp>::__pi(), __s) + * std::sin(__numeric_constants<_Tp>::__pi_2() * __s) +#if _GLIBCXX_USE_C99_MATH_TR1 + * std::exp(std::_GLIBCXX_TR1::lgamma(_Tp(1) - __s)) +#else + * std::exp(__log_gamma(_Tp(1) - __s)) +#endif + / __numeric_constants<_Tp>::__pi(); + return __zeta; + } + } + + _Tp __num = _Tp(0.5L); + const unsigned int __maxit = 10000; + for (unsigned int __i = 0; __i < __maxit; ++__i) + { + bool __punt = false; + _Tp __sgn = _Tp(1); + _Tp __term = _Tp(0); + for (unsigned int __j = 0; __j <= __i; ++__j) + { +#if _GLIBCXX_USE_C99_MATH_TR1 + _Tp __bincoeff = std::_GLIBCXX_TR1::lgamma(_Tp(1 + __i)) + - std::_GLIBCXX_TR1::lgamma(_Tp(1 + __j)) + - std::_GLIBCXX_TR1::lgamma(_Tp(1 + __i - __j)); +#else + _Tp __bincoeff = __log_gamma(_Tp(1 + __i)) + - __log_gamma(_Tp(1 + __j)) + - __log_gamma(_Tp(1 + __i - __j)); +#endif + if (__bincoeff > __max_bincoeff) + { + // This only gets hit for x << 0. + __punt = true; + break; + } + __bincoeff = std::exp(__bincoeff); + __term += __sgn * __bincoeff * std::pow(_Tp(1 + __j), -__s); + __sgn *= _Tp(-1); + } + if (__punt) + break; + __term *= __num; + __zeta += __term; + if (std::abs(__term/__zeta) < __eps) + break; + __num *= _Tp(0.5L); + } + + __zeta /= _Tp(1) - std::pow(_Tp(2), _Tp(1) - __s); + + return __zeta; + } + + + /** + * @brief Compute the Riemann zeta function @f$ \zeta(s) @f$ + * using the product over prime factors. + * \f[ + * \zeta(s) = \Pi_{i=1}^\infty \frac{1}{1 - p_i^{-s}} + * \f] + * where @f$ {p_i} @f$ are the prime numbers. + * + * The Riemann zeta function is defined by: + * \f[ + * \zeta(s) = \sum_{k=1}^{\infty} \frac{1}{k^{s}} for s > 1 + * \f] + * For s < 1 use the reflection formula: + * \f[ + * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s) + * \f] + */ + template<typename _Tp> + _Tp + __riemann_zeta_product(const _Tp __s) + { + static const _Tp __prime[] = { + _Tp(2), _Tp(3), _Tp(5), _Tp(7), _Tp(11), _Tp(13), _Tp(17), _Tp(19), + _Tp(23), _Tp(29), _Tp(31), _Tp(37), _Tp(41), _Tp(43), _Tp(47), + _Tp(53), _Tp(59), _Tp(61), _Tp(67), _Tp(71), _Tp(73), _Tp(79), + _Tp(83), _Tp(89), _Tp(97), _Tp(101), _Tp(103), _Tp(107), _Tp(109) + }; + static const unsigned int __num_primes = sizeof(__prime) / sizeof(_Tp); + + _Tp __zeta = _Tp(1); + for (unsigned int __i = 0; __i < __num_primes; ++__i) + { + const _Tp __fact = _Tp(1) - std::pow(__prime[__i], -__s); + __zeta *= __fact; + if (_Tp(1) - __fact < std::numeric_limits<_Tp>::epsilon()) + break; + } + + __zeta = _Tp(1) / __zeta; + + return __zeta; + } + + + /** + * @brief Return the Riemann zeta function @f$ \zeta(s) @f$. + * + * The Riemann zeta function is defined by: + * \f[ + * \zeta(s) = \sum_{k=1}^{\infty} k^{-s} for s > 1 + * \frac{(2\pi)^s}{pi} sin(\frac{\pi s}{2}) + * \Gamma (1 - s) \zeta (1 - s) for s < 1 + * \f] + * For s < 1 use the reflection formula: + * \f[ + * \zeta(s) = 2^s \pi^{s-1} \Gamma(1-s) \zeta(1-s) + * \f] + */ + template<typename _Tp> + _Tp + __riemann_zeta(const _Tp __s) + { + if (__isnan(__s)) + return std::numeric_limits<_Tp>::quiet_NaN(); + else if (__s == _Tp(1)) + return std::numeric_limits<_Tp>::infinity(); + else if (__s < -_Tp(19)) + { + _Tp __zeta = __riemann_zeta_product(_Tp(1) - __s); + __zeta *= std::pow(_Tp(2) * __numeric_constants<_Tp>::__pi(), __s) + * std::sin(__numeric_constants<_Tp>::__pi_2() * __s) +#if _GLIBCXX_USE_C99_MATH_TR1 + * std::exp(std::_GLIBCXX_TR1::lgamma(_Tp(1) - __s)) +#else + * std::exp(__log_gamma(_Tp(1) - __s)) +#endif + / __numeric_constants<_Tp>::__pi(); + return __zeta; + } + else if (__s < _Tp(20)) + { + // Global double sum or McLaurin? + bool __glob = true; + if (__glob) + return __riemann_zeta_glob(__s); + else + { + if (__s > _Tp(1)) + return __riemann_zeta_sum(__s); + else + { + _Tp __zeta = std::pow(_Tp(2) + * __numeric_constants<_Tp>::__pi(), __s) + * std::sin(__numeric_constants<_Tp>::__pi_2() * __s) +#if _GLIBCXX_USE_C99_MATH_TR1 + * std::_GLIBCXX_TR1::tgamma(_Tp(1) - __s) +#else + * std::exp(__log_gamma(_Tp(1) - __s)) +#endif + * __riemann_zeta_sum(_Tp(1) - __s); + return __zeta; + } + } + } + else + return __riemann_zeta_product(__s); + } + + + /** + * @brief Return the Hurwitz zeta function @f$ \zeta(x,s) @f$ + * for all s != 1 and x > -1. + * + * The Hurwitz zeta function is defined by: + * @f[ + * \zeta(x,s) = \sum_{n=0}^{\infty} \frac{1}{(n + x)^s} + * @f] + * The Riemann zeta function is a special case: + * @f[ + * \zeta(s) = \zeta(1,s) + * @f] + * + * This functions uses the double sum that converges for s != 1 + * and x > -1: + * @f[ + * \zeta(x,s) = \frac{1}{s-1} + * \sum_{n=0}^{\infty} \frac{1}{n + 1} + * \sum_{k=0}^{n} (-1)^k \frac{n!}{(n-k)!k!} (x+k)^{-s} + * @f] + */ + template<typename _Tp> + _Tp + __hurwitz_zeta_glob(const _Tp __a, const _Tp __s) + { + _Tp __zeta = _Tp(0); + + const _Tp __eps = std::numeric_limits<_Tp>::epsilon(); + // Max e exponent before overflow. + const _Tp __max_bincoeff = std::numeric_limits<_Tp>::max_exponent10 + * std::log(_Tp(10)) - _Tp(1); + + const unsigned int __maxit = 10000; + for (unsigned int __i = 0; __i < __maxit; ++__i) + { + bool __punt = false; + _Tp __sgn = _Tp(1); + _Tp __term = _Tp(0); + for (unsigned int __j = 0; __j <= __i; ++__j) + { +#if _GLIBCXX_USE_C99_MATH_TR1 + _Tp __bincoeff = std::_GLIBCXX_TR1::lgamma(_Tp(1 + __i)) + - std::_GLIBCXX_TR1::lgamma(_Tp(1 + __j)) + - std::_GLIBCXX_TR1::lgamma(_Tp(1 + __i - __j)); +#else + _Tp __bincoeff = __log_gamma(_Tp(1 + __i)) + - __log_gamma(_Tp(1 + __j)) + - __log_gamma(_Tp(1 + __i - __j)); +#endif + if (__bincoeff > __max_bincoeff) + { + // This only gets hit for x << 0. + __punt = true; + break; + } + __bincoeff = std::exp(__bincoeff); + __term += __sgn * __bincoeff * std::pow(_Tp(__a + __j), -__s); + __sgn *= _Tp(-1); + } + if (__punt) + break; + __term /= _Tp(__i + 1); + if (std::abs(__term / __zeta) < __eps) + break; + __zeta += __term; + } + + __zeta /= __s - _Tp(1); + + return __zeta; + } + + + /** + * @brief Return the Hurwitz zeta function @f$ \zeta(x,s) @f$ + * for all s != 1 and x > -1. + * + * The Hurwitz zeta function is defined by: + * @f[ + * \zeta(x,s) = \sum_{n=0}^{\infty} \frac{1}{(n + x)^s} + * @f] + * The Riemann zeta function is a special case: + * @f[ + * \zeta(s) = \zeta(1,s) + * @f] + */ + template<typename _Tp> + inline _Tp + __hurwitz_zeta(const _Tp __a, const _Tp __s) + { + return __hurwitz_zeta_glob(__a, __s); + } + + } // namespace std::tr1::__detail + + /* @} */ // group tr1_math_spec_func + +_GLIBCXX_END_NAMESPACE +} + +#endif // _TR1_RIEMANN_ZETA_TCC diff --git a/libstdc++-v3/include/tr1/special_function_util.h b/libstdc++-v3/include/tr1/special_function_util.h new file mode 100644 index 00000000000..ac55165b164 --- /dev/null +++ b/libstdc++-v3/include/tr1/special_function_util.h @@ -0,0 +1,155 @@ +// 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 + diff --git a/libstdc++-v3/testsuite/lib/dg-options.exp b/libstdc++-v3/testsuite/lib/dg-options.exp index ccc3fb69e31..29943ce2a6b 100644 --- a/libstdc++-v3/testsuite/lib/dg-options.exp +++ b/libstdc++-v3/testsuite/lib/dg-options.exp @@ -1,6 +1,6 @@ # 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 diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp index 79cbd9b1e88..a8e8a31d955 100644 --- a/libstdc++-v3/testsuite/lib/libstdc++.exp +++ b/libstdc++-v3/testsuite/lib/libstdc++.exp @@ -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} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_nan.cc new file mode 100644 index 00000000000..98f174fa7b1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_nan.cc @@ -0,0 +1,57 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_value.cc new file mode 100644 index 00000000000..b79b5c1fac0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/check_value.cc @@ -0,0 +1,3566 @@ +// 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. + +// assoc_laguerre + + +// 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 for n=0, m=0. +testcase_assoc_laguerre<double> data001[] = { + { 1.0000000000000000, 0, 0, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 0, + 10.000000000000000 }, + { 1.0000000000000000, 0, 0, + 20.000000000000000 }, + { 1.0000000000000000, 0, 0, + 30.000000000000000 }, + { 1.0000000000000000, 0, 0, + 40.000000000000000 }, + { 1.0000000000000000, 0, 0, + 50.000000000000000 }, + { 1.0000000000000000, 0, 0, + 60.000000000000000 }, + { 1.0000000000000000, 0, 0, + 70.000000000000000 }, + { 1.0000000000000000, 0, 0, + 80.000000000000000 }, + { 1.0000000000000000, 0, 0, + 90.000000000000000 }, + { 1.0000000000000000, 0, 0, + 100.00000000000000 }, +}; + +// Test function for n=0, m=0. +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_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data001[i].n), Tp(data001[i].m), + 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)); +} + +// Test data for n=0, m=1. +testcase_assoc_laguerre<double> data002[] = { + { 1.0000000000000000, 0, 1, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 1, + 10.000000000000000 }, + { 1.0000000000000000, 0, 1, + 20.000000000000000 }, + { 1.0000000000000000, 0, 1, + 30.000000000000000 }, + { 1.0000000000000000, 0, 1, + 40.000000000000000 }, + { 1.0000000000000000, 0, 1, + 50.000000000000000 }, + { 1.0000000000000000, 0, 1, + 60.000000000000000 }, + { 1.0000000000000000, 0, 1, + 70.000000000000000 }, + { 1.0000000000000000, 0, 1, + 80.000000000000000 }, + { 1.0000000000000000, 0, 1, + 90.000000000000000 }, + { 1.0000000000000000, 0, 1, + 100.00000000000000 }, +}; + +// Test function for n=0, m=1. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data002[i].n), Tp(data002[i].m), + Tp(data002[i].x)); + const Tp f0 = data002[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)); +} + +// Test data for n=0, m=2. +testcase_assoc_laguerre<double> data003[] = { + { 1.0000000000000000, 0, 2, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 2, + 10.000000000000000 }, + { 1.0000000000000000, 0, 2, + 20.000000000000000 }, + { 1.0000000000000000, 0, 2, + 30.000000000000000 }, + { 1.0000000000000000, 0, 2, + 40.000000000000000 }, + { 1.0000000000000000, 0, 2, + 50.000000000000000 }, + { 1.0000000000000000, 0, 2, + 60.000000000000000 }, + { 1.0000000000000000, 0, 2, + 70.000000000000000 }, + { 1.0000000000000000, 0, 2, + 80.000000000000000 }, + { 1.0000000000000000, 0, 2, + 90.000000000000000 }, + { 1.0000000000000000, 0, 2, + 100.00000000000000 }, +}; + +// Test function for n=0, m=2. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data003[i].n), Tp(data003[i].m), + Tp(data003[i].x)); + const Tp f0 = data003[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)); +} + +// Test data for n=0, m=5. +testcase_assoc_laguerre<double> data004[] = { + { 1.0000000000000000, 0, 5, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 5, + 10.000000000000000 }, + { 1.0000000000000000, 0, 5, + 20.000000000000000 }, + { 1.0000000000000000, 0, 5, + 30.000000000000000 }, + { 1.0000000000000000, 0, 5, + 40.000000000000000 }, + { 1.0000000000000000, 0, 5, + 50.000000000000000 }, + { 1.0000000000000000, 0, 5, + 60.000000000000000 }, + { 1.0000000000000000, 0, 5, + 70.000000000000000 }, + { 1.0000000000000000, 0, 5, + 80.000000000000000 }, + { 1.0000000000000000, 0, 5, + 90.000000000000000 }, + { 1.0000000000000000, 0, 5, + 100.00000000000000 }, +}; + +// Test function for n=0, m=5. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data004[i].n), Tp(data004[i].m), + Tp(data004[i].x)); + const Tp f0 = data004[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)); +} + +// Test data for n=0, m=10. +testcase_assoc_laguerre<double> data005[] = { + { 1.0000000000000000, 0, 10, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 10, + 10.000000000000000 }, + { 1.0000000000000000, 0, 10, + 20.000000000000000 }, + { 1.0000000000000000, 0, 10, + 30.000000000000000 }, + { 1.0000000000000000, 0, 10, + 40.000000000000000 }, + { 1.0000000000000000, 0, 10, + 50.000000000000000 }, + { 1.0000000000000000, 0, 10, + 60.000000000000000 }, + { 1.0000000000000000, 0, 10, + 70.000000000000000 }, + { 1.0000000000000000, 0, 10, + 80.000000000000000 }, + { 1.0000000000000000, 0, 10, + 90.000000000000000 }, + { 1.0000000000000000, 0, 10, + 100.00000000000000 }, +}; + +// Test function for n=0, m=10. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data005[i].n), Tp(data005[i].m), + Tp(data005[i].x)); + const Tp f0 = data005[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)); +} + +// Test data for n=0, m=20. +testcase_assoc_laguerre<double> data006[] = { + { 1.0000000000000000, 0, 20, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 20, + 10.000000000000000 }, + { 1.0000000000000000, 0, 20, + 20.000000000000000 }, + { 1.0000000000000000, 0, 20, + 30.000000000000000 }, + { 1.0000000000000000, 0, 20, + 40.000000000000000 }, + { 1.0000000000000000, 0, 20, + 50.000000000000000 }, + { 1.0000000000000000, 0, 20, + 60.000000000000000 }, + { 1.0000000000000000, 0, 20, + 70.000000000000000 }, + { 1.0000000000000000, 0, 20, + 80.000000000000000 }, + { 1.0000000000000000, 0, 20, + 90.000000000000000 }, + { 1.0000000000000000, 0, 20, + 100.00000000000000 }, +}; + +// Test function for n=0, m=20. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data006[i].n), Tp(data006[i].m), + Tp(data006[i].x)); + const Tp f0 = data006[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)); +} + +// Test data for n=0, m=50. +testcase_assoc_laguerre<double> data007[] = { + { 1.0000000000000000, 0, 50, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 50, + 10.000000000000000 }, + { 1.0000000000000000, 0, 50, + 20.000000000000000 }, + { 1.0000000000000000, 0, 50, + 30.000000000000000 }, + { 1.0000000000000000, 0, 50, + 40.000000000000000 }, + { 1.0000000000000000, 0, 50, + 50.000000000000000 }, + { 1.0000000000000000, 0, 50, + 60.000000000000000 }, + { 1.0000000000000000, 0, 50, + 70.000000000000000 }, + { 1.0000000000000000, 0, 50, + 80.000000000000000 }, + { 1.0000000000000000, 0, 50, + 90.000000000000000 }, + { 1.0000000000000000, 0, 50, + 100.00000000000000 }, +}; + +// Test function for n=0, m=50. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data007[i].n), Tp(data007[i].m), + Tp(data007[i].x)); + const Tp f0 = data007[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)); +} + +// Test data for n=0, m=100. +testcase_assoc_laguerre<double> data008[] = { + { 1.0000000000000000, 0, 100, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 100, + 10.000000000000000 }, + { 1.0000000000000000, 0, 100, + 20.000000000000000 }, + { 1.0000000000000000, 0, 100, + 30.000000000000000 }, + { 1.0000000000000000, 0, 100, + 40.000000000000000 }, + { 1.0000000000000000, 0, 100, + 50.000000000000000 }, + { 1.0000000000000000, 0, 100, + 60.000000000000000 }, + { 1.0000000000000000, 0, 100, + 70.000000000000000 }, + { 1.0000000000000000, 0, 100, + 80.000000000000000 }, + { 1.0000000000000000, 0, 100, + 90.000000000000000 }, + { 1.0000000000000000, 0, 100, + 100.00000000000000 }, +}; + +// Test function for n=0, m=100. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data008[i].n), Tp(data008[i].m), + Tp(data008[i].x)); + const Tp f0 = data008[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)); +} + +// Test data for n=1, m=0. +testcase_assoc_laguerre<double> data009[] = { + { 1.0000000000000000, 1, 0, + 0.0000000000000000 }, + { -9.0000000000000000, 1, 0, + 10.000000000000000 }, + { -19.000000000000000, 1, 0, + 20.000000000000000 }, + { -29.000000000000000, 1, 0, + 30.000000000000000 }, + { -39.000000000000000, 1, 0, + 40.000000000000000 }, + { -49.000000000000000, 1, 0, + 50.000000000000000 }, + { -59.000000000000000, 1, 0, + 60.000000000000000 }, + { -69.000000000000000, 1, 0, + 70.000000000000000 }, + { -79.000000000000000, 1, 0, + 80.000000000000000 }, + { -89.000000000000000, 1, 0, + 90.000000000000000 }, + { -99.000000000000000, 1, 0, + 100.00000000000000 }, +}; + +// Test function for n=1, m=0. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data009[i].n), Tp(data009[i].m), + Tp(data009[i].x)); + const Tp f0 = data009[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)); +} + +// Test data for n=1, m=1. +testcase_assoc_laguerre<double> data010[] = { + { 2.0000000000000000, 1, 1, + 0.0000000000000000 }, + { -8.0000000000000000, 1, 1, + 10.000000000000000 }, + { -18.000000000000000, 1, 1, + 20.000000000000000 }, + { -28.000000000000000, 1, 1, + 30.000000000000000 }, + { -38.000000000000000, 1, 1, + 40.000000000000000 }, + { -48.000000000000000, 1, 1, + 50.000000000000000 }, + { -58.000000000000000, 1, 1, + 60.000000000000000 }, + { -68.000000000000000, 1, 1, + 70.000000000000000 }, + { -78.000000000000000, 1, 1, + 80.000000000000000 }, + { -88.000000000000000, 1, 1, + 90.000000000000000 }, + { -98.000000000000000, 1, 1, + 100.00000000000000 }, +}; + +// Test function for n=1, m=1. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data010[i].n), Tp(data010[i].m), + Tp(data010[i].x)); + const Tp f0 = data010[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)); +} + +// Test data for n=1, m=2. +testcase_assoc_laguerre<double> data011[] = { + { 3.0000000000000000, 1, 2, + 0.0000000000000000 }, + { -7.0000000000000000, 1, 2, + 10.000000000000000 }, + { -17.000000000000000, 1, 2, + 20.000000000000000 }, + { -27.000000000000000, 1, 2, + 30.000000000000000 }, + { -37.000000000000000, 1, 2, + 40.000000000000000 }, + { -47.000000000000000, 1, 2, + 50.000000000000000 }, + { -57.000000000000000, 1, 2, + 60.000000000000000 }, + { -67.000000000000000, 1, 2, + 70.000000000000000 }, + { -77.000000000000000, 1, 2, + 80.000000000000000 }, + { -87.000000000000000, 1, 2, + 90.000000000000000 }, + { -97.000000000000000, 1, 2, + 100.00000000000000 }, +}; + +// Test function for n=1, m=2. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data011[i].n), Tp(data011[i].m), + Tp(data011[i].x)); + const Tp f0 = data011[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)); +} + +// Test data for n=1, m=5. +testcase_assoc_laguerre<double> data012[] = { + { 6.0000000000000000, 1, 5, + 0.0000000000000000 }, + { -4.0000000000000000, 1, 5, + 10.000000000000000 }, + { -14.000000000000000, 1, 5, + 20.000000000000000 }, + { -24.000000000000000, 1, 5, + 30.000000000000000 }, + { -34.000000000000000, 1, 5, + 40.000000000000000 }, + { -44.000000000000000, 1, 5, + 50.000000000000000 }, + { -54.000000000000000, 1, 5, + 60.000000000000000 }, + { -64.000000000000000, 1, 5, + 70.000000000000000 }, + { -74.000000000000000, 1, 5, + 80.000000000000000 }, + { -84.000000000000000, 1, 5, + 90.000000000000000 }, + { -94.000000000000000, 1, 5, + 100.00000000000000 }, +}; + +// Test function for n=1, m=5. +template <typename Tp> +void test012() +{ + 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(data012) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data012[i].n), Tp(data012[i].m), + Tp(data012[i].x)); + const Tp f0 = data012[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)); +} + +// Test data for n=1, m=10. +testcase_assoc_laguerre<double> data013[] = { + { 11.000000000000000, 1, 10, + 0.0000000000000000 }, + { 1.0000000000000000, 1, 10, + 10.000000000000000 }, + { -9.0000000000000000, 1, 10, + 20.000000000000000 }, + { -19.000000000000000, 1, 10, + 30.000000000000000 }, + { -29.000000000000000, 1, 10, + 40.000000000000000 }, + { -39.000000000000000, 1, 10, + 50.000000000000000 }, + { -49.000000000000000, 1, 10, + 60.000000000000000 }, + { -59.000000000000000, 1, 10, + 70.000000000000000 }, + { -69.000000000000000, 1, 10, + 80.000000000000000 }, + { -79.000000000000000, 1, 10, + 90.000000000000000 }, + { -89.000000000000000, 1, 10, + 100.00000000000000 }, +}; + +// Test function for n=1, m=10. +template <typename Tp> +void test013() +{ + 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(data013) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data013[i].n), Tp(data013[i].m), + Tp(data013[i].x)); + const Tp f0 = data013[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)); +} + +// Test data for n=1, m=20. +testcase_assoc_laguerre<double> data014[] = { + { 21.000000000000000, 1, 20, + 0.0000000000000000 }, + { 11.000000000000000, 1, 20, + 10.000000000000000 }, + { 1.0000000000000000, 1, 20, + 20.000000000000000 }, + { -9.0000000000000000, 1, 20, + 30.000000000000000 }, + { -19.000000000000000, 1, 20, + 40.000000000000000 }, + { -29.000000000000000, 1, 20, + 50.000000000000000 }, + { -39.000000000000000, 1, 20, + 60.000000000000000 }, + { -49.000000000000000, 1, 20, + 70.000000000000000 }, + { -59.000000000000000, 1, 20, + 80.000000000000000 }, + { -69.000000000000000, 1, 20, + 90.000000000000000 }, + { -79.000000000000000, 1, 20, + 100.00000000000000 }, +}; + +// Test function for n=1, m=20. +template <typename Tp> +void test014() +{ + 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(data014) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data014[i].n), Tp(data014[i].m), + Tp(data014[i].x)); + const Tp f0 = data014[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)); +} + +// Test data for n=1, m=50. +testcase_assoc_laguerre<double> data015[] = { + { 51.000000000000000, 1, 50, + 0.0000000000000000 }, + { 41.000000000000000, 1, 50, + 10.000000000000000 }, + { 31.000000000000000, 1, 50, + 20.000000000000000 }, + { 21.000000000000000, 1, 50, + 30.000000000000000 }, + { 11.000000000000000, 1, 50, + 40.000000000000000 }, + { 1.0000000000000000, 1, 50, + 50.000000000000000 }, + { -9.0000000000000000, 1, 50, + 60.000000000000000 }, + { -19.000000000000000, 1, 50, + 70.000000000000000 }, + { -29.000000000000000, 1, 50, + 80.000000000000000 }, + { -39.000000000000000, 1, 50, + 90.000000000000000 }, + { -49.000000000000000, 1, 50, + 100.00000000000000 }, +}; + +// Test function for n=1, m=50. +template <typename Tp> +void test015() +{ + 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(data015) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data015[i].n), Tp(data015[i].m), + Tp(data015[i].x)); + const Tp f0 = data015[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)); +} + +// Test data for n=1, m=100. +testcase_assoc_laguerre<double> data016[] = { + { 101.00000000000000, 1, 100, + 0.0000000000000000 }, + { 91.000000000000000, 1, 100, + 10.000000000000000 }, + { 81.000000000000000, 1, 100, + 20.000000000000000 }, + { 71.000000000000000, 1, 100, + 30.000000000000000 }, + { 61.000000000000000, 1, 100, + 40.000000000000000 }, + { 51.000000000000000, 1, 100, + 50.000000000000000 }, + { 41.000000000000000, 1, 100, + 60.000000000000000 }, + { 31.000000000000000, 1, 100, + 70.000000000000000 }, + { 21.000000000000000, 1, 100, + 80.000000000000000 }, + { 11.000000000000000, 1, 100, + 90.000000000000000 }, + { 1.0000000000000000, 1, 100, + 100.00000000000000 }, +}; + +// Test function for n=1, m=100. +template <typename Tp> +void test016() +{ + 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(data016) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data016[i].n), Tp(data016[i].m), + Tp(data016[i].x)); + const Tp f0 = data016[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)); +} + +// Test data for n=2, m=0. +testcase_assoc_laguerre<double> data017[] = { + { 1.0000000000000000, 2, 0, + 0.0000000000000000 }, + { 31.000000000000000, 2, 0, + 10.000000000000000 }, + { 161.00000000000000, 2, 0, + 20.000000000000000 }, + { 391.00000000000000, 2, 0, + 30.000000000000000 }, + { 721.00000000000000, 2, 0, + 40.000000000000000 }, + { 1151.0000000000000, 2, 0, + 50.000000000000000 }, + { 1681.0000000000000, 2, 0, + 60.000000000000000 }, + { 2311.0000000000000, 2, 0, + 70.000000000000000 }, + { 3041.0000000000000, 2, 0, + 80.000000000000000 }, + { 3871.0000000000000, 2, 0, + 90.000000000000000 }, + { 4801.0000000000000, 2, 0, + 100.00000000000000 }, +}; + +// Test function for n=2, m=0. +template <typename Tp> +void test017() +{ + 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(data017) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data017[i].n), Tp(data017[i].m), + Tp(data017[i].x)); + const Tp f0 = data017[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)); +} + +// Test data for n=2, m=1. +testcase_assoc_laguerre<double> data018[] = { + { 3.0000000000000000, 2, 1, + 0.0000000000000000 }, + { 23.000000000000000, 2, 1, + 10.000000000000000 }, + { 143.00000000000000, 2, 1, + 20.000000000000000 }, + { 363.00000000000000, 2, 1, + 30.000000000000000 }, + { 683.00000000000000, 2, 1, + 40.000000000000000 }, + { 1103.0000000000000, 2, 1, + 50.000000000000000 }, + { 1623.0000000000000, 2, 1, + 60.000000000000000 }, + { 2243.0000000000000, 2, 1, + 70.000000000000000 }, + { 2963.0000000000000, 2, 1, + 80.000000000000000 }, + { 3783.0000000000000, 2, 1, + 90.000000000000000 }, + { 4703.0000000000000, 2, 1, + 100.00000000000000 }, +}; + +// Test function for n=2, m=1. +template <typename Tp> +void test018() +{ + 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(data018) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data018[i].n), Tp(data018[i].m), + Tp(data018[i].x)); + const Tp f0 = data018[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)); +} + +// Test data for n=2, m=2. +testcase_assoc_laguerre<double> data019[] = { + { 6.0000000000000000, 2, 2, + 0.0000000000000000 }, + { 16.000000000000000, 2, 2, + 10.000000000000000 }, + { 126.00000000000000, 2, 2, + 20.000000000000000 }, + { 336.00000000000000, 2, 2, + 30.000000000000000 }, + { 646.00000000000000, 2, 2, + 40.000000000000000 }, + { 1056.0000000000000, 2, 2, + 50.000000000000000 }, + { 1566.0000000000000, 2, 2, + 60.000000000000000 }, + { 2176.0000000000000, 2, 2, + 70.000000000000000 }, + { 2886.0000000000000, 2, 2, + 80.000000000000000 }, + { 3696.0000000000000, 2, 2, + 90.000000000000000 }, + { 4606.0000000000000, 2, 2, + 100.00000000000000 }, +}; + +// Test function for n=2, m=2. +template <typename Tp> +void test019() +{ + 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(data019) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data019[i].n), Tp(data019[i].m), + Tp(data019[i].x)); + const Tp f0 = data019[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)); +} + +// Test data for n=2, m=5. +testcase_assoc_laguerre<double> data020[] = { + { 21.000000000000000, 2, 5, + 0.0000000000000000 }, + { 0.99999999999999645, 2, 5, + 10.000000000000000 }, + { 81.000000000000000, 2, 5, + 20.000000000000000 }, + { 261.00000000000000, 2, 5, + 30.000000000000000 }, + { 541.00000000000000, 2, 5, + 40.000000000000000 }, + { 921.00000000000000, 2, 5, + 50.000000000000000 }, + { 1401.0000000000000, 2, 5, + 60.000000000000000 }, + { 1981.0000000000000, 2, 5, + 70.000000000000000 }, + { 2661.0000000000000, 2, 5, + 80.000000000000000 }, + { 3441.0000000000000, 2, 5, + 90.000000000000000 }, + { 4321.0000000000000, 2, 5, + 100.00000000000000 }, +}; + +// Test function for n=2, m=5. +template <typename Tp> +void test020() +{ + 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(data020) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data020[i].n), Tp(data020[i].m), + Tp(data020[i].x)); + const Tp f0 = data020[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)); +} + +// Test data for n=2, m=10. +testcase_assoc_laguerre<double> data021[] = { + { 66.000000000000000, 2, 10, + 0.0000000000000000 }, + { -4.0000000000000089, 2, 10, + 10.000000000000000 }, + { 25.999999999999964, 2, 10, + 20.000000000000000 }, + { 156.00000000000000, 2, 10, + 30.000000000000000 }, + { 386.00000000000000, 2, 10, + 40.000000000000000 }, + { 716.00000000000000, 2, 10, + 50.000000000000000 }, + { 1146.0000000000000, 2, 10, + 60.000000000000000 }, + { 1676.0000000000000, 2, 10, + 70.000000000000000 }, + { 2306.0000000000000, 2, 10, + 80.000000000000000 }, + { 3036.0000000000000, 2, 10, + 90.000000000000000 }, + { 3866.0000000000000, 2, 10, + 100.00000000000000 }, +}; + +// Test function for n=2, m=10. +template <typename Tp> +void test021() +{ + 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(data021) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data021[i].n), Tp(data021[i].m), + Tp(data021[i].x)); + const Tp f0 = data021[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)); +} + +// Test data for n=2, m=20. +testcase_assoc_laguerre<double> data022[] = { + { 231.00000000000000, 2, 20, + 0.0000000000000000 }, + { 61.000000000000206, 2, 20, + 10.000000000000000 }, + { -8.9999999999999982, 2, 20, + 20.000000000000000 }, + { 21.000000000000135, 2, 20, + 30.000000000000000 }, + { 151.00000000000054, 2, 20, + 40.000000000000000 }, + { 381.00000000000000, 2, 20, + 50.000000000000000 }, + { 711.00000000000000, 2, 20, + 60.000000000000000 }, + { 1141.0000000000000, 2, 20, + 70.000000000000000 }, + { 1670.9999999999998, 2, 20, + 80.000000000000000 }, + { 2301.0000000000000, 2, 20, + 90.000000000000000 }, + { 3031.0000000000000, 2, 20, + 100.00000000000000 }, +}; + +// Test function for n=2, m=20. +template <typename Tp> +void test022() +{ + 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(data022) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data022[i].n), Tp(data022[i].m), + Tp(data022[i].x)); + const Tp f0 = data022[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)); +} + +// Test data for n=2, m=50. +testcase_assoc_laguerre<double> data023[] = { + { 1326.0000000000000, 2, 50, + 0.0000000000000000 }, + { 855.99999999999716, 2, 50, + 10.000000000000000 }, + { 485.99999999999829, 2, 50, + 20.000000000000000 }, + { 215.99999999999935, 2, 50, + 30.000000000000000 }, + { 45.999999999999787, 2, 50, + 40.000000000000000 }, + { -23.999999999999684, 2, 50, + 50.000000000000000 }, + { 6.0000000000001217, 2, 50, + 60.000000000000000 }, + { 135.99999999999972, 2, 50, + 70.000000000000000 }, + { 365.99999999999892, 2, 50, + 80.000000000000000 }, + { 695.99999999999784, 2, 50, + 90.000000000000000 }, + { 1125.9999999999964, 2, 50, + 100.00000000000000 }, +}; + +// Test function for n=2, m=50. +template <typename Tp> +void test023() +{ + 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(data023) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data023[i].n), Tp(data023[i].m), + Tp(data023[i].x)); + const Tp f0 = data023[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.5000000000000015e-12)); +} + +// Test data for n=2, m=100. +testcase_assoc_laguerre<double> data024[] = { + { 5151.0000000000000, 2, 100, + 0.0000000000000000 }, + { 4181.0000000000655, 2, 100, + 10.000000000000000 }, + { 3311.0000000000518, 2, 100, + 20.000000000000000 }, + { 2541.0000000000400, 2, 100, + 30.000000000000000 }, + { 1871.0000000000291, 2, 100, + 40.000000000000000 }, + { 1301.0000000000207, 2, 100, + 50.000000000000000 }, + { 831.00000000001364, 2, 100, + 60.000000000000000 }, + { 461.00000000000682, 2, 100, + 70.000000000000000 }, + { 191.00000000000227, 2, 100, + 80.000000000000000 }, + { 21.000000000000128, 2, 100, + 90.000000000000000 }, + { -49.000000000000369, 2, 100, + 100.00000000000000 }, +}; + +// Test function for n=2, m=100. +template <typename Tp> +void test024() +{ + 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(data024) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data024[i].n), Tp(data024[i].m), + Tp(data024[i].x)); + const Tp f0 = data024[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(1.0000000000000008e-12)); +} + +// Test data for n=5, m=0. +testcase_assoc_laguerre<double> data025[] = { + { 1.0000000000000000, 5, 0, + 0.0000000000000000 }, + { 34.333333333333329, 5, 0, + 10.000000000000000 }, + { -4765.6666666666670, 5, 0, + 20.000000000000000 }, + { -74399.000000000000, 5, 0, + 30.000000000000000 }, + { -418865.66666666663, 5, 0, + 40.000000000000000 }, + { -1498165.6666666665, 5, 0, + 50.000000000000000 }, + { -4122299.0000000000, 5, 0, + 60.000000000000000 }, + { -9551265.6666666679, 5, 0, + 70.000000000000000 }, + { -19595065.666666664, 5, 0, + 80.000000000000000 }, + { -36713699.000000000, 5, 0, + 90.000000000000000 }, + { -64117165.666666664, 5, 0, + 100.00000000000000 }, +}; + +// Test function for n=5, m=0. +template <typename Tp> +void test025() +{ + 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(data025) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data025[i].n), Tp(data025[i].m), + Tp(data025[i].x)); + const Tp f0 = data025[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)); +} + +// Test data for n=5, m=1. +testcase_assoc_laguerre<double> data026[] = { + { 6.0000000000000000, 5, 1, + 0.0000000000000000 }, + { 22.666666666666661, 5, 1, + 10.000000000000000 }, + { -2960.6666666666661, 5, 1, + 20.000000000000000 }, + { -58944.000000000000, 5, 1, + 30.000000000000000 }, + { -357927.33333333326, 5, 1, + 40.000000000000000 }, + { -1329910.6666666665, 5, 1, + 50.000000000000000 }, + { -3744894.0000000000, 5, 1, + 60.000000000000000 }, + { -8812877.3333333321, 5, 1, + 70.000000000000000 }, + { -18283860.666666664, 5, 1, + 80.000000000000000 }, + { -34547844.000000000, 5, 1, + 90.000000000000000 }, + { -60734827.333333336, 5, 1, + 100.00000000000000 }, +}; + +// Test function for n=5, m=1. +template <typename Tp> +void test026() +{ + 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(data026) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data026[i].n), Tp(data026[i].m), + Tp(data026[i].x)); + const Tp f0 = data026[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)); +} + +// Test data for n=5, m=2. +testcase_assoc_laguerre<double> data027[] = { + { 21.000000000000000, 5, 2, + 0.0000000000000000 }, + { 4.3333333333333339, 5, 2, + 10.000000000000000 }, + { -1679.0000000000000, 5, 2, + 20.000000000000000 }, + { -46029.000000000000, 5, 2, + 30.000000000000000 }, + { -304045.66666666669, 5, 2, + 40.000000000000000 }, + { -1176729.0000000002, 5, 2, + 50.000000000000000 }, + { -3395079.0000000000, 5, 2, + 60.000000000000000 }, + { -8120095.6666666660, 5, 2, + 70.000000000000000 }, + { -17042778.999999996, 5, 2, + 80.000000000000000 }, + { -32484129.000000000, 5, 2, + 90.000000000000000 }, + { -57495145.666666664, 5, 2, + 100.00000000000000 }, +}; + +// Test function for n=5, m=2. +template <typename Tp> +void test027() +{ + 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(data027) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data027[i].n), Tp(data027[i].m), + Tp(data027[i].x)); + const Tp f0 = data027[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)); +} + +// Test data for n=5, m=5. +testcase_assoc_laguerre<double> data028[] = { + { 252.00000000000000, 5, 5, + 0.0000000000000000 }, + { -14.666666666666657, 5, 5, + 10.000000000000000 }, + { 51.999999999999957, 5, 5, + 20.000000000000000 }, + { -19548.000000000000, 5, 5, + 30.000000000000000 }, + { -178814.66666666660, 5, 5, + 40.000000000000000 }, + { -797747.99999999977, 5, 5, + 50.000000000000000 }, + { -2496348.0000000000, 5, 5, + 60.000000000000000 }, + { -6294614.6666666660, 5, 5, + 70.000000000000000 }, + { -13712547.999999996, 5, 5, + 80.000000000000000 }, + { -26870147.999999993, 5, 5, + 90.000000000000000 }, + { -48587414.666666672, 5, 5, + 100.00000000000000 }, +}; + +// Test function for n=5, m=5. +template <typename Tp> +void test028() +{ + 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(data028) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data028[i].n), Tp(data028[i].m), + Tp(data028[i].x)); + const Tp f0 = data028[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)); +} + +// Test data for n=5, m=10. +testcase_assoc_laguerre<double> data029[] = { + { 3003.0000000000000, 5, 10, + 0.0000000000000000 }, + { 19.666666666666668, 5, 10, + 10.000000000000000 }, + { 36.333333333333272, 5, 10, + 20.000000000000000 }, + { -1947.0000000000000, 5, 10, + 30.000000000000000 }, + { -60930.333333333314, 5, 10, + 40.000000000000000 }, + { -381913.66666666651, 5, 10, + 50.000000000000000 }, + { -1419897.0000000000, 5, 10, + 60.000000000000000 }, + { -3979880.3333333330, 5, 10, + 70.000000000000000 }, + { -9316863.6666666642, 5, 10, + 80.000000000000000 }, + { -19235847.000000000, 5, 10, + 90.000000000000000 }, + { -36191830.333333328, 5, 10, + 100.00000000000000 }, +}; + +// Test function for n=5, m=10. +template <typename Tp> +void test029() +{ + 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(data029) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data029[i].n), Tp(data029[i].m), + Tp(data029[i].x)); + const Tp f0 = data029[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)); +} + +// Test data for n=5, m=20. +testcase_assoc_laguerre<double> data030[] = { + { 53130.000000000000, 5, 20, + 0.0000000000000000 }, + { 1213.3333333333335, 5, 20, + 10.000000000000000 }, + { 129.99999999999963, 5, 20, + 20.000000000000000 }, + { -119.99999999999974, 5, 20, + 30.000000000000000 }, + { 463.33333333333320, 5, 20, + 40.000000000000000 }, + { -48120.000000000015, 5, 20, + 50.000000000000000 }, + { -345870.00000000017, 5, 20, + 60.000000000000000 }, + { -1342786.6666666667, 5, 20, + 70.000000000000000 }, + { -3838870.0000000009, 5, 20, + 80.000000000000000 }, + { -9084120.0000000000, 5, 20, + 90.000000000000000 }, + { -18878536.666666668, 5, 20, + 100.00000000000000 }, +}; + +// Test function for n=5, m=20. +template <typename Tp> +void test030() +{ + 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(data030) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data030[i].n), Tp(data030[i].m), + Tp(data030[i].x)); + const Tp f0 = data030[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)); +} + +// Test data for n=5, m=50. +testcase_assoc_laguerre<double> data031[] = { + { 3478761.0000000000, 5, 50, + 0.0000000000000000 }, + { 1154544.3333333335, 5, 50, + 10.000000000000000 }, + { 264661.00000000006, 5, 50, + 20.000000000000000 }, + { 24111.000000000000, 5, 50, + 30.000000000000000 }, + { -2105.6666666666665, 5, 50, + 40.000000000000000 }, + { 1011.0000000000000, 5, 50, + 50.000000000000000 }, + { -1538.9999999999955, 5, 50, + 60.000000000000000 }, + { 5244.3333333333449, 5, 50, + 70.000000000000000 }, + { -13639.000000000015, 5, 50, + 80.000000000000000 }, + { -243189.00000000006, 5, 50, + 90.000000000000000 }, + { -1118405.6666666667, 5, 50, + 100.00000000000000 }, +}; + +// Test function for n=5, m=50. +template <typename Tp> +void test031() +{ + 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(data031) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data031[i].n), Tp(data031[i].m), + Tp(data031[i].x)); + const Tp f0 = data031[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)); +} + +// Test data for n=5, m=100. +testcase_assoc_laguerre<double> data032[] = { + { 96560646.000000000, 5, 100, + 0.0000000000000000 }, + { 57264262.666666649, 5, 100, + 10.000000000000000 }, + { 31841379.333333332, 5, 100, + 20.000000000000000 }, + { 16281996.000000000, 5, 100, + 30.000000000000000 }, + { 7426112.6666666670, 5, 100, + 40.000000000000000 }, + { 2863729.3333333330, 5, 100, + 50.000000000000000 }, + { 834846.00000000000, 5, 100, + 60.000000000000000 }, + { 129462.66666666663, 5, 100, + 70.000000000000000 }, + { -12420.666666666666, 5, 100, + 80.000000000000000 }, + { -804.00000000000000, 5, 100, + 90.000000000000000 }, + { 4312.6666666666661, 5, 100, + 100.00000000000000 }, +}; + +// Test function for n=5, m=100. +template <typename Tp> +void test032() +{ + 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(data032) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data032[i].n), Tp(data032[i].m), + Tp(data032[i].x)); + const Tp f0 = data032[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)); +} + +// Test data for n=10, m=0. +testcase_assoc_laguerre<double> data033[] = { + { 1.0000000000000000, 10, 0, + 0.0000000000000000 }, + { 27.984126984126981, 10, 0, + 10.000000000000000 }, + { 3227.8077601410932, 10, 0, + 20.000000000000000 }, + { 15129.571428571489, 10, 0, + 30.000000000000000 }, + { 79724066.608465582, 10, 0, + 40.000000000000000 }, + { 2037190065.3738980, 10, 0, + 50.000000000000000 }, + { 21804200401.000000, 10, 0, + 60.000000000000000 }, + { 144688291819.51855, 10, 0, + 70.000000000000000 }, + { 703324772760.08276, 10, 0, + 80.000000000000000 }, + { 2741055412243.8569, 10, 0, + 90.000000000000000 }, + { 9051283795429.5723, 10, 0, + 100.00000000000000 }, +}; + +// Test function for n=10, m=0. +template <typename Tp> +void test033() +{ + 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(data033) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data033[i].n), Tp(data033[i].m), + Tp(data033[i].x)); + const Tp f0 = data033[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)); +} + +// Test data for n=10, m=1. +testcase_assoc_laguerre<double> data034[] = { + { 11.000000000000000, 10, 1, + 0.0000000000000000 }, + { 14.791887125220455, 10, 1, + 10.000000000000000 }, + { 2704.6507936507933, 10, 1, + 20.000000000000000 }, + { -182924.71428571426, 10, 1, + 30.000000000000000 }, + { 48066036.749559075, 10, 1, + 40.000000000000000 }, + { 1486264192.2169311, 10, 1, + 50.000000000000000 }, + { 17239562282.428574, 10, 1, + 60.000000000000000 }, + { 119837491630.13579, 10, 1, + 70.000000000000000 }, + { 600681375251.21167, 10, 1, + 80.000000000000000 }, + { 2392908405632.4287, 10, 1, + 90.000000000000000 }, + { 8033035722509.2373, 10, 1, + 100.00000000000000 }, +}; + +// Test function for n=10, m=1. +template <typename Tp> +void test034() +{ + 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(data034) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data034[i].n), Tp(data034[i].m), + Tp(data034[i].x)); + const Tp f0 = data034[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)); +} + +// Test data for n=10, m=2. +testcase_assoc_laguerre<double> data035[] = { + { 66.000000000000000, 10, 2, + 0.0000000000000000 }, + { -14.511463844797174, 10, 2, + 10.000000000000000 }, + { 1064.5890652557318, 10, 2, + 20.000000000000000 }, + { -194569.71428571426, 10, 2, + 30.000000000000000 }, + { 27343569.350970022, 10, 2, + 40.000000000000000 }, + { 1067807661.6790125, 10, 2, + 50.000000000000000 }, + { 13529451580.285713, 10, 2, + 60.000000000000000 }, + { 98812724224.641937, 10, 2, + 70.000000000000000 }, + { 511482736187.34021, 10, 2, + 80.000000000000000 }, + { 2084478393087.4285, 10, 2, + 90.000000000000000 }, + { 7117724862237.0752, 10, 2, + 100.00000000000000 }, +}; + +// Test function for n=10, m=2. +template <typename Tp> +void test035() +{ + 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(data035) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data035[i].n), Tp(data035[i].m), + Tp(data035[i].x)); + const Tp f0 = data035[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)); +} + +// Test data for n=10, m=5. +testcase_assoc_laguerre<double> data036[] = { + { 3003.0000000000000, 10, 5, + 0.0000000000000000 }, + { 11.641975308642024, 10, 5, + 10.000000000000000 }, + { -1137.5643738977069, 10, 5, + 20.000000000000000 }, + { -9254.1428571428605, 10, 5, + 30.000000000000000 }, + { 2121878.8377425023, 10, 5, + 40.000000000000000 }, + { 352060171.43033499, 10, 5, + 50.000000000000000 }, + { 6212028560.1428576, 10, 5, + 60.000000000000000 }, + { 53782171674.604919, 10, 5, + 70.000000000000000 }, + { 309720255837.56775, 10, 5, + 80.000000000000000 }, + { 1359043035731.5713, 10, 5, + 90.000000000000000 }, + { 4900625954398.9434, 10, 5, + 100.00000000000000 }, +}; + +// Test function for n=10, m=5. +template <typename Tp> +void test036() +{ + 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(data036) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data036[i].n), Tp(data036[i].m), + Tp(data036[i].x)); + const Tp f0 = data036[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)); +} + +// Test data for n=10, m=10. +testcase_assoc_laguerre<double> data037[] = { + { 184756.00000000000, 10, 10, + 0.0000000000000000 }, + { -210.84303350970018, 10, 10, + 10.000000000000000 }, + { 508.38095238095184, 10, 10, + 20.000000000000000 }, + { 2098.8571428571431, 10, 10, + 30.000000000000000 }, + { -536338.88536155189, 10, 10, + 40.000000000000000 }, + { 24865988.804232784, 10, 10, + 50.000000000000000 }, + { 1343756013.1428571, 10, 10, + 60.000000000000000 }, + { 17298791247.358025, 10, 10, + 70.000000000000000 }, + { 124528450897.79892, 10, 10, + 80.000000000000000 }, + { 632674413641.71423, 10, 10, + 90.000000000000000 }, + { 2533008935405.0298, 10, 10, + 100.00000000000000 }, +}; + +// Test function for n=10, m=10. +template <typename Tp> +void test037() +{ + 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(data037) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data037[i].n), Tp(data037[i].m), + Tp(data037[i].x)); + const Tp f0 = data037[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)); +} + +// Test data for n=10, m=20. +testcase_assoc_laguerre<double> data038[] = { + { 30045014.999999993, 10, 20, + 0.0000000000000000 }, + { -23087.733686067022, 10, 20, + 10.000000000000000 }, + { 207.23985890652347, 10, 20, + 20.000000000000000 }, + { 1407.8571428571497, 10, 20, + 30.000000000000000 }, + { -44618.156966490329, 10, 20, + 40.000000000000000 }, + { 158690.04409171085, 10, 20, + 50.000000000000000 }, + { -6870413.5714285728, 10, 20, + 60.000000000000000 }, + { 793841351.41975331, 10, 20, + 70.000000000000000 }, + { 13358288958.562618, 10, 20, + 80.000000000000000 }, + { 106073722407.85715, 10, 20, + 90.000000000000000 }, + { 566337213392.42493, 10, 20, + 100.00000000000000 }, +}; + +// Test function for n=10, m=20. +template <typename Tp> +void test038() +{ + 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(data038) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data038[i].n), Tp(data038[i].m), + Tp(data038[i].x)); + const Tp f0 = data038[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(1.0000000000000008e-12)); +} + +// Test data for n=10, m=50. +testcase_assoc_laguerre<double> data039[] = { + { 75394027566.000000, 10, 50, + 0.0000000000000000 }, + { 8048106183.3721361, 10, 50, + 10.000000000000000 }, + { 328045023.84832466, 10, 50, + 20.000000000000000 }, + { -2568769.7142857141, 10, 50, + 30.000000000000000 }, + { 6971.9964726631733, 10, 50, + 40.000000000000000 }, + { 136111.41446208110, 10, 50, + 50.000000000000000 }, + { -62462.571428570242, 10, 50, + 60.000000000000000 }, + { -248167.95061728527, 10, 50, + 70.000000000000000 }, + { 1941270.4091710777, 10, 50, + 80.000000000000000 }, + { -8643512.5714285783, 10, 50, + 90.000000000000000 }, + { -140863522.18342155, 10, 50, + 100.00000000000000 }, +}; + +// Test function for n=10, m=50. +template <typename Tp> +void test039() +{ + 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(data039) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data039[i].n), Tp(data039[i].m), + Tp(data039[i].x)); + const Tp f0 = data039[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(1.0000000000000008e-12)); +} + +// Test data for n=10, m=100. +testcase_assoc_laguerre<double> data040[] = { + { 46897636623981.000, 10, 100, + 0.0000000000000000 }, + { 16444031323272.084, 10, 100, + 10.000000000000000 }, + { 5020343986463.5391, 10, 100, + 20.000000000000000 }, + { 1270977490645.2859, 10, 100, + 30.000000000000000 }, + { 244835756822.62262, 10, 100, + 40.000000000000000 }, + { 29786827693.962963, 10, 100, + 50.000000000000000 }, + { 1127612095.2857144, 10, 100, + 60.000000000000000 }, + { -66370555.419753075, 10, 100, + 70.000000000000000 }, + { 10420852.957671957, 10, 100, + 80.000000000000000 }, + { -3373097.5714285718, 10, 100, + 90.000000000000000 }, + { 2065423.6807760142, 10, 100, + 100.00000000000000 }, +}; + +// Test function for n=10, m=100. +template <typename Tp> +void test040() +{ + 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(data040) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data040[i].n), Tp(data040[i].m), + Tp(data040[i].x)); + const Tp f0 = data040[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)); +} + +// Test data for n=20, m=0. +testcase_assoc_laguerre<double> data041[] = { + { 1.0000000000000000, 20, 0, + 0.0000000000000000 }, + { -11.961333867812119, 20, 0, + 10.000000000000000 }, + { 2829.4728613531738, 20, 0, + 20.000000000000000 }, + { -18439.424502520938, 20, 0, + 30.000000000000000 }, + { 24799805.877530701, 20, 0, + 40.000000000000000 }, + { 7551960453.7672529, 20, 0, + 50.000000000000000 }, + { -1379223608444.9155, 20, 0, + 60.000000000000000 }, + { 165423821874449.94, 20, 0, + 70.000000000000000 }, + { 29500368536981676., 20, 0, + 80.000000000000000 }, + { 1.1292309514432899e+18, 20, 0, + 90.000000000000000 }, + { 2.2061882785931735e+19, 20, 0, + 100.00000000000000 }, +}; + +// Test function for n=20, m=0. +template <typename Tp> +void test041() +{ + 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(data041) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data041[i].n), Tp(data041[i].m), + Tp(data041[i].x)); + const Tp f0 = data041[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)); +} + +// Test data for n=20, m=1. +testcase_assoc_laguerre<double> data042[] = { + { 21.000000000000000, 20, 1, + 0.0000000000000000 }, + { 19.900488129734079, 20, 1, + 10.000000000000000 }, + { 2208.0318569557589, 20, 1, + 20.000000000000000 }, + { 263690.96303121914, 20, 1, + 30.000000000000000 }, + { 40667285.630564235, 20, 1, + 40.000000000000000 }, + { 1737442572.8115418, 20, 1, + 50.000000000000000 }, + { -588280953643.28125, 20, 1, + 60.000000000000000 }, + { 45617733778241.359, 20, 1, + 70.000000000000000 }, + { 17293487114876860., 20, 1, + 80.000000000000000 }, + { 7.6219135858585024e+17, 20, 1, + 90.000000000000000 }, + { 1.6037288204336759e+19, 20, 1, + 100.00000000000000 }, +}; + +// Test function for n=20, m=1. +template <typename Tp> +void test042() +{ + 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(data042) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data042[i].n), Tp(data042[i].m), + Tp(data042[i].x)); + const Tp f0 = data042[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)); +} + +// Test data for n=20, m=2. +testcase_assoc_laguerre<double> data043[] = { + { 231.00000000000003, 20, 2, + 0.0000000000000000 }, + { 47.009338065112935, 20, 2, + 10.000000000000000 }, + { -652.51305461728566, 20, 2, + 20.000000000000000 }, + { 285388.25895069109, 20, 2, + 30.000000000000000 }, + { 28664069.685624726, 20, 2, + 40.000000000000000 }, + { -1399631966.3144732, 20, 2, + 50.000000000000000 }, + { -115357373248.28198, 20, 2, + 60.000000000000000 }, + { -3357730872975.8545, 20, 2, + 70.000000000000000 }, + { 9765808962855122.0, 20, 2, + 80.000000000000000 }, + { 5.0717292945559181e+17, 20, 2, + 90.000000000000000 }, + { 1.1564665701334458e+19, 20, 2, + 100.00000000000000 }, +}; + +// Test function for n=20, m=2. +template <typename Tp> +void test043() +{ + 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(data043) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data043[i].n), Tp(data043[i].m), + Tp(data043[i].x)); + const Tp f0 = data043[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)); +} + +// Test data for n=20, m=5. +testcase_assoc_laguerre<double> data044[] = { + { 53130.000000000000, 20, 5, + 0.0000000000000000 }, + { -158.69554500944145, 20, 5, + 10.000000000000000 }, + { 334.08012288038969, 20, 5, + 20.000000000000000 }, + { -198372.47662554169, 20, 5, + 30.000000000000000 }, + { -13627144.088579427, 20, 5, + 40.000000000000000 }, + { -780579985.44731593, 20, 5, + 50.000000000000000 }, + { 116648634237.73526, 20, 5, + 60.000000000000000 }, + { -12347348707739.742, 20, 5, + 70.000000000000000 }, + { 1199516248034090.8, 20, 5, + 80.000000000000000 }, + { 1.3451503195078531e+17, 20, 5, + 90.000000000000000 }, + { 4.1058904276111483e+18, 20, 5, + 100.00000000000000 }, +}; + +// Test function for n=20, m=5. +template <typename Tp> +void test044() +{ + 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(data044) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data044[i].n), Tp(data044[i].m), + Tp(data044[i].x)); + const Tp f0 = data044[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)); +} + +// Test data for n=20, m=10. +testcase_assoc_laguerre<double> data045[] = { + { 30045015.000000000, 20, 10, + 0.0000000000000000 }, + { -1755.6226861258590, 20, 10, + 10.000000000000000 }, + { -9081.6726644737901, 20, 10, + 20.000000000000000 }, + { 95771.650912113109, 20, 10, + 30.000000000000000 }, + { 5089151.9272779226, 20, 10, + 40.000000000000000 }, + { 97400399.450206712, 20, 10, + 50.000000000000000 }, + { -16009352450.477026, 20, 10, + 60.000000000000000 }, + { 842271286905.01038, 20, 10, + 70.000000000000000 }, + { -79901725466796.938, 20, 10, + 80.000000000000000 }, + { 7944103675858638.0, 20, 10, + 90.000000000000000 }, + { 5.7429821893388288e+17, 20, 10, + 100.00000000000000 }, +}; + +// Test function for n=20, m=10. +template <typename Tp> +void test045() +{ + 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(data045) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data045[i].n), Tp(data045[i].m), + Tp(data045[i].x)); + const Tp f0 = data045[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)); +} + +// Test data for n=20, m=20. +testcase_assoc_laguerre<double> data046[] = { + { 137846528819.99994, 20, 20, + 0.0000000000000000 }, + { -136976.49571333214, 20, 20, + 10.000000000000000 }, + { 113878.49908041637, 20, 20, + 20.000000000000000 }, + { -342529.21778796182, 20, 20, + 30.000000000000000 }, + { -350112.66981443466, 20, 20, + 40.000000000000000 }, + { -10791735.172977794, 20, 20, + 50.000000000000000 }, + { -1038073940.0811402, 20, 20, + 60.000000000000000 }, + { 667312550.63616371, 20, 20, + 70.000000000000000 }, + { 741537869902.29028, 20, 20, + 80.000000000000000 }, + { -32378376755737.418, 20, 20, + 90.000000000000000 }, + { -601760332167934.75, 20, 20, + 100.00000000000000 }, +}; + +// Test function for n=20, m=20. +template <typename Tp> +void test046() +{ + 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(data046) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data046[i].n), Tp(data046[i].m), + Tp(data046[i].x)); + const Tp f0 = data046[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(1.0000000000000008e-12)); +} + +// Test data for n=20, m=50. +testcase_assoc_laguerre<double> data047[] = { + { 1.6188460366265789e+17, 20, 50, + 0.0000000000000000 }, + { 1599011936804291.5, 20, 50, + 10.000000000000000 }, + { -131273880831.42412, 20, 50, + 20.000000000000000 }, + { -3133213093.6903501, 20, 50, + 30.000000000000000 }, + { -213935628.04985175, 20, 50, + 40.000000000000000 }, + { -47375578.495921209, 20, 50, + 50.000000000000000 }, + { -115731015.14034875, 20, 50, + 60.000000000000000 }, + { -737415147.29420292, 20, 50, + 70.000000000000000 }, + { -2123455626.8621781, 20, 50, + 80.000000000000000 }, + { 29801266858.608925, 20, 50, + 90.000000000000000 }, + { -132886631026.82561, 20, 50, + 100.00000000000000 }, +}; + +// Test function for n=20, m=50. +template <typename Tp> +void test047() +{ + 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(data047) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data047[i].n), Tp(data047[i].m), + Tp(data047[i].x)); + const Tp f0 = data047[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(1.0000000000000008e-12)); +} + +// Test data for n=20, m=100. +testcase_assoc_laguerre<double> data048[] = { + { 2.9462227291176643e+22, 20, 100, + 0.0000000000000000 }, + { 3.5777890748701244e+21, 20, 100, + 10.000000000000000 }, + { 3.1584925521456765e+20, 20, 100, + 20.000000000000000 }, + { 1.7389599388424860e+19, 20, 100, + 30.000000000000000 }, + { 4.1401342745980646e+17, 20, 100, + 40.000000000000000 }, + { -79359706102062.672, 20, 100, + 50.000000000000000 }, + { 22736203650743.145, 20, 100, + 60.000000000000000 }, + { 65679006380.095215, 20, 100, + 70.000000000000000 }, + { -236263257610.77969, 20, 100, + 80.000000000000000 }, + { -38072644585.303085, 20, 100, + 90.000000000000000 }, + { 68236474365.173950, 20, 100, + 100.00000000000000 }, +}; + +// Test function for n=20, m=100. +template <typename Tp> +void test048() +{ + 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(data048) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data048[i].n), Tp(data048[i].m), + Tp(data048[i].x)); + const Tp f0 = data048[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.5000000000000015e-12)); +} + +// Test data for n=50, m=0. +testcase_assoc_laguerre<double> data049[] = { + { 1.0000000000000000, 50, 0, + 0.0000000000000000 }, + { 17.534183446338233, 50, 0, + 10.000000000000000 }, + { 980.26961889790766, 50, 0, + 20.000000000000000 }, + { 293000.50735962350, 50, 0, + 30.000000000000000 }, + { -14896937.968694847, 50, 0, + 40.000000000000000 }, + { 2513677852.6916885, 50, 0, + 50.000000000000000 }, + { -883876565337.99207, 50, 0, + 60.000000000000000 }, + { -80967880733583.219, 50, 0, + 70.000000000000000 }, + { -8217471769564850.0, 50, 0, + 80.000000000000000 }, + { -2.1140031308048906e+18, 50, 0, + 90.000000000000000 }, + { -3.9710103487094673e+20, 50, 0, + 100.00000000000000 }, +}; + +// Test function for n=50, m=0. +template <typename Tp> +void test049() +{ + 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(data049) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data049[i].n), Tp(data049[i].m), + Tp(data049[i].x)); + const Tp f0 = data049[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)); +} + +// Test data for n=50, m=1. +testcase_assoc_laguerre<double> data050[] = { + { 51.000000000000021, 50, 1, + 0.0000000000000000 }, + { 1.4214573271640045, 50, 1, + 10.000000000000000 }, + { -2574.8072295127863, 50, 1, + 20.000000000000000 }, + { 35846.479728359256, 50, 1, + 30.000000000000000 }, + { -48263698.768318526, 50, 1, + 40.000000000000000 }, + { 6161525870.2738571, 50, 1, + 50.000000000000000 }, + { -382655486658.47101, 50, 1, + 60.000000000000000 }, + { -109635579833241.69, 50, 1, + 70.000000000000000 }, + { -14623805817283476., 50, 1, + 80.000000000000000 }, + { -2.0666847190878118e+18, 50, 1, + 90.000000000000000 }, + { -1.4385187953997626e+20, 50, 1, + 100.00000000000000 }, +}; + +// Test function for n=50, m=1. +template <typename Tp> +void test050() +{ + 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(data050) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data050[i].n), Tp(data050[i].m), + Tp(data050[i].x)); + const Tp f0 = data050[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.0000000000000029e-12)); +} + +// Test data for n=50, m=2. +testcase_assoc_laguerre<double> data051[] = { + { 1326.0000000000000, 50, 2, + 0.0000000000000000 }, + { -87.860732516444671, 50, 2, + 10.000000000000000 }, + { -5203.2351191780890, 50, 2, + 20.000000000000000 }, + { -461059.50012538873, 50, 2, + 30.000000000000000 }, + { -30476695.327440601, 50, 2, + 40.000000000000000 }, + { 3720804977.9338136, 50, 2, + 50.000000000000000 }, + { 362262002434.51440, 50, 2, + 60.000000000000000 }, + { -52210917867820.273, 50, 2, + 70.000000000000000 }, + { -9567965136901918.0, 50, 2, + 80.000000000000000 }, + { -8.9171277517712806e+17, 50, 2, + 90.000000000000000 }, + { 5.7231129448807039e+19, 50, 2, + 100.00000000000000 }, +}; + +// Test function for n=50, m=2. +template <typename Tp> +void test051() +{ + 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(data051) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data051[i].n), Tp(data051[i].m), + Tp(data051[i].x)); + const Tp f0 = data051[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)); +} + +// Test data for n=50, m=5. +testcase_assoc_laguerre<double> data052[] = { + { 3478761.0000000000, 50, 5, + 0.0000000000000000 }, + { 1055.8381917651493, 50, 5, + 10.000000000000000 }, + { 15264.646660345048, 50, 5, + 20.000000000000000 }, + { 1229651.8966600855, 50, 5, + 30.000000000000000 }, + { 39270451.823656857, 50, 5, + 40.000000000000000 }, + { -4424062601.1152067, 50, 5, + 50.000000000000000 }, + { -186017434284.19220, 50, 5, + 60.000000000000000 }, + { 50972853949302.602, 50, 5, + 70.000000000000000 }, + { 6530702754012518.0, 50, 5, + 80.000000000000000 }, + { 6.8387592714678016e+17, 50, 5, + 90.000000000000000 }, + { 3.9198742504338366e+19, 50, 5, + 100.00000000000000 }, +}; + +// Test function for n=50, m=5. +template <typename Tp> +void test052() +{ + 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(data052) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data052[i].n), Tp(data052[i].m), + Tp(data052[i].x)); + const Tp f0 = data052[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)); +} + +// Test data for n=50, m=10. +testcase_assoc_laguerre<double> data053[] = { + { 75394027565.999985, 50, 10, + 0.0000000000000000 }, + { 91833.924098770134, 50, 10, + 10.000000000000000 }, + { 330501.87929778261, 50, 10, + 20.000000000000000 }, + { 3625088.1635972545, 50, 10, + 30.000000000000000 }, + { 213954727.28632003, 50, 10, + 40.000000000000000 }, + { -9381006937.7517643, 50, 10, + 50.000000000000000 }, + { 535333683777.48627, 50, 10, + 60.000000000000000 }, + { 18824406573722.156, 50, 10, + 70.000000000000000 }, + { -533858276780012.81, 50, 10, + 80.000000000000000 }, + { -52995774666704024., 50, 10, + 90.000000000000000 }, + { 6.0504182862448855e+18, 50, 10, + 100.00000000000000 }, +}; + +// Test function for n=50, m=10. +template <typename Tp> +void test053() +{ + 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(data053) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data053[i].n), Tp(data053[i].m), + Tp(data053[i].x)); + const Tp f0 = data053[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)); +} + +// Test data for n=50, m=20. +testcase_assoc_laguerre<double> data054[] = { + { 1.6188460366265779e+17, 50, 20, + 0.0000000000000000 }, + { -307637087.25169420, 50, 20, + 10.000000000000000 }, + { 12524651.102974579, 50, 20, + 20.000000000000000 }, + { -315460483.86210549, 50, 20, + 30.000000000000000 }, + { -1889683587.3459976, 50, 20, + 40.000000000000000 }, + { 37457044404.200340, 50, 20, + 50.000000000000000 }, + { -843831858224.71826, 50, 20, + 60.000000000000000 }, + { -92231643172.313248, 50, 20, + 70.000000000000000 }, + { 904211757769501.25, 50, 20, + 80.000000000000000 }, + { 46508193600283288., 50, 20, + 90.000000000000000 }, + { 2.3216887928162714e+18, 50, 20, + 100.00000000000000 }, +}; + +// Test function for n=50, m=20. +template <typename Tp> +void test054() +{ + 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(data054) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data054[i].n), Tp(data054[i].m), + Tp(data054[i].x)); + const Tp f0 = data054[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.5000000000000015e-12)); +} + +// Test data for n=50, m=50. +testcase_assoc_laguerre<double> data055[] = { + { 1.0089134454556417e+29, 50, 50, + 0.0000000000000000 }, + { 1.3822795753070569e+23, 50, 50, + 10.000000000000000 }, + { 95817260381628416., 50, 50, + 20.000000000000000 }, + { -910798580856013.88, 50, 50, + 30.000000000000000 }, + { 50513254049166.719, 50, 50, + 40.000000000000000 }, + { 84159703903349.859, 50, 50, + 50.000000000000000 }, + { -138805244691822.69, 50, 50, + 60.000000000000000 }, + { 181046391269246.25, 50, 50, + 70.000000000000000 }, + { 2086884905317107.2, 50, 50, + 80.000000000000000 }, + { -2765620139862432.5, 50, 50, + 90.000000000000000 }, + { -1.3706751678146291e+17, 50, 50, + 100.00000000000000 }, +}; + +// Test function for n=50, m=50. +template <typename Tp> +void test055() +{ + 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(data055) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data055[i].n), Tp(data055[i].m), + Tp(data055[i].x)); + const Tp f0 = data055[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)); +} + +// Test data for n=50, m=100. +testcase_assoc_laguerre<double> data056[] = { + { 2.0128660909731929e+40, 50, 100, + 0.0000000000000000 }, + { 9.3675094807695474e+37, 50, 100, + 10.000000000000000 }, + { 1.3009321481877196e+35, 50, 100, + 20.000000000000000 }, + { 7.3720026893233823e+30, 50, 100, + 30.000000000000000 }, + { -6.0824679079634607e+25, 50, 100, + 40.000000000000000 }, + { -6.0053188793543624e+23, 50, 100, + 50.000000000000000 }, + { 1.4178129287264701e+22, 50, 100, + 60.000000000000000 }, + { -5.4652099341566765e+20, 50, 100, + 70.000000000000000 }, + { -1.0817271759263398e+20, 50, 100, + 80.000000000000000 }, + { 3.8058734007924187e+19, 50, 100, + 90.000000000000000 }, + { 4.7439240848028353e+19, 50, 100, + 100.00000000000000 }, +}; + +// Test function for n=50, m=100. +template <typename Tp> +void test056() +{ + 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(data056) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data056[i].n), Tp(data056[i].m), + Tp(data056[i].x)); + const Tp f0 = data056[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.5000000000000015e-12)); +} + +// Test data for n=100, m=0. +testcase_assoc_laguerre<double> data057[] = { + { 1.0000000000000000, 100, 0, + 0.0000000000000000 }, + { 13.277662844303402, 100, 0, + 10.000000000000000 }, + { 1854.0367283243393, 100, 0, + 20.000000000000000 }, + { 170141.86987046539, 100, 0, + 30.000000000000000 }, + { -7272442.3156007063, 100, 0, + 40.000000000000000 }, + { 4847420871.2690468, 100, 0, + 50.000000000000000 }, + { 693492765740.29736, 100, 0, + 60.000000000000000 }, + { 17125518672239.707, 100, 0, + 70.000000000000000 }, + { -13763178176383754., 100, 0, + 80.000000000000000 }, + { 2.1307220490380198e+18, 100, 0, + 90.000000000000000 }, + { -2.6292260693068920e+20, 100, 0, + 100.00000000000000 }, +}; + +// Test function for n=100, m=0. +template <typename Tp> +void test057() +{ + 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(data057) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data057[i].n), Tp(data057[i].m), + Tp(data057[i].x)); + const Tp f0 = data057[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)); +} + +// Test data for n=100, m=1. +testcase_assoc_laguerre<double> data058[] = { + { 101.00000000000003, 100, 1, + 0.0000000000000000 }, + { -14.650661983680466, 100, 1, + 10.000000000000000 }, + { 1626.5010939361609, 100, 1, + 20.000000000000000 }, + { 417884.77658268705, 100, 1, + 30.000000000000000 }, + { -55617646.951649830, 100, 1, + 40.000000000000000 }, + { 884829874.26626098, 100, 1, + 50.000000000000000 }, + { 154466082750.32114, 100, 1, + 60.000000000000000 }, + { -101423973484646.05, 100, 1, + 70.000000000000000 }, + { -1388352348671755.5, 100, 1, + 80.000000000000000 }, + { 7.8048705513268326e+17, 100, 1, + 90.000000000000000 }, + { 1.6948925059042787e+19, 100, 1, + 100.00000000000000 }, +}; + +// Test function for n=100, m=1. +template <typename Tp> +void test058() +{ + 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(data058) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data058[i].n), Tp(data058[i].m), + Tp(data058[i].x)); + const Tp f0 = data058[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(1.0000000000000008e-12)); +} + +// Test data for n=100, m=2. +testcase_assoc_laguerre<double> data059[] = { + { 5151.0000000000055, 100, 2, + 0.0000000000000000 }, + { -150.22012290951341, 100, 2, + 10.000000000000000 }, + { -7655.0593294049440, 100, 2, + 20.000000000000000 }, + { -140996.69276179170, 100, 2, + 30.000000000000000 }, + { -38645171.278549291, 100, 2, + 40.000000000000000 }, + { -8889263688.2118778, 100, 2, + 50.000000000000000 }, + { -1010338971533.3397, 100, 2, + 60.000000000000000 }, + { -127582564332943.91, 100, 2, + 70.000000000000000 }, + { 15970305694654336., 100, 2, + 80.000000000000000 }, + { -1.6019844992862840e+18, 100, 2, + 90.000000000000000 }, + { 2.8267024730962919e+20, 100, 2, + 100.00000000000000 }, +}; + +// Test function for n=100, m=2. +template <typename Tp> +void test059() +{ + 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(data059) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data059[i].n), Tp(data059[i].m), + Tp(data059[i].x)); + const Tp f0 = data059[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)); +} + +// Test data for n=100, m=5. +testcase_assoc_laguerre<double> data060[] = { + { 96560646.000000030, 100, 5, + 0.0000000000000000 }, + { 2430.6732236677576, 100, 5, + 10.000000000000000 }, + { 111162.32026994640, 100, 5, + 20.000000000000000 }, + { 4036708.2599413753, 100, 5, + 30.000000000000000 }, + { -34055982.664405435, 100, 5, + 40.000000000000000 }, + { 30110688343.562344, 100, 5, + 50.000000000000000 }, + { 2651429940558.2920, 100, 5, + 60.000000000000000 }, + { 192108556058942.84, 100, 5, + 70.000000000000000 }, + { -25410533973455528., 100, 5, + 80.000000000000000 }, + { 2.1072955633564431e+18, 100, 5, + 90.000000000000000 }, + { -2.9434005355877260e+20, 100, 5, + 100.00000000000000 }, +}; + +// Test function for n=100, m=5. +template <typename Tp> +void test060() +{ + 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(data060) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data060[i].n), Tp(data060[i].m), + Tp(data060[i].x)); + const Tp f0 = data060[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)); +} + +// Test data for n=100, m=10. +testcase_assoc_laguerre<double> data061[] = { + { 46897636623981.039, 100, 10, + 0.0000000000000000 }, + { 529208.11550990446, 100, 10, + 10.000000000000000 }, + { 7402892.1748803742, 100, 10, + 20.000000000000000 }, + { 88369632.083243459, 100, 10, + 30.000000000000000 }, + { 822187797.59096730, 100, 10, + 40.000000000000000 }, + { 180231446033.06866, 100, 10, + 50.000000000000000 }, + { 7922942703798.1309, 100, 10, + 60.000000000000000 }, + { 784424250559043.38, 100, 10, + 70.000000000000000 }, + { -16325634720239362., 100, 10, + 80.000000000000000 }, + { -1.0879588307443181e+18, 100, 10, + 90.000000000000000 }, + { 3.0114394463610495e+19, 100, 10, + 100.00000000000000 }, +}; + +// Test function for n=100, m=10. +template <typename Tp> +void test061() +{ + 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(data061) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data061[i].n), Tp(data061[i].m), + Tp(data061[i].x)); + const Tp f0 = data061[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(1.0000000000000008e-12)); +} + +// Test data for n=100, m=20. +testcase_assoc_laguerre<double> data062[] = { + { 2.9462227291176614e+22, 100, 20, + 0.0000000000000000 }, + { 313694958939.90436, 100, 20, + 10.000000000000000 }, + { 45396489338.096252, 100, 20, + 20.000000000000000 }, + { -7215826758.0078783, 100, 20, + 30.000000000000000 }, + { 825949194005.88831, 100, 20, + 40.000000000000000 }, + { -2764742119971.0747, 100, 20, + 50.000000000000000 }, + { -219802198273516.03, 100, 20, + 60.000000000000000 }, + { -1699053306145266.0, 100, 20, + 70.000000000000000 }, + { 3.5495709345023853e+17, 100, 20, + 80.000000000000000 }, + { -9.6128675110292439e+18, 100, 20, + 90.000000000000000 }, + { 4.3619868422072153e+20, 100, 20, + 100.00000000000000 }, +}; + +// Test function for n=100, m=20. +template <typename Tp> +void test062() +{ + 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(data062) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data062[i].n), Tp(data062[i].m), + Tp(data062[i].x)); + const Tp f0 = data062[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)); +} + +// Test data for n=100, m=50. +testcase_assoc_laguerre<double> data063[] = { + { 2.0128660909731931e+40, 100, 50, + 0.0000000000000000 }, + { -4.0151443913473681e+28, 100, 50, + 10.000000000000000 }, + { 3.2199632594552201e+22, 100, 50, + 20.000000000000000 }, + { -2.7568702092659717e+20, 100, 50, + 30.000000000000000 }, + { 7.5553066015421530e+19, 100, 50, + 40.000000000000000 }, + { -2.7651625252388041e+19, 100, 50, + 50.000000000000000 }, + { -5.8963680147283821e+19, 100, 50, + 60.000000000000000 }, + { -1.8082798163033126e+20, 100, 50, + 70.000000000000000 }, + { -3.9044276986817249e+20, 100, 50, + 80.000000000000000 }, + { 6.9926310700401904e+21, 100, 50, + 90.000000000000000 }, + { -5.5727272809923697e+22, 100, 50, + 100.00000000000000 }, +}; + +// Test function for n=100, m=50. +template <typename Tp> +void test063() +{ + 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(data063) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data063[i].n), Tp(data063[i].m), + Tp(data063[i].x)); + const Tp f0 = data063[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(1.0000000000000008e-12)); +} + +// Test data for n=100, m=100. +testcase_assoc_laguerre<double> data064[] = { + { 9.0548514656103225e+58, 100, 100, + 0.0000000000000000 }, + { 1.3334078033060576e+54, 100, 100, + 10.000000000000000 }, + { 2.1002639254211231e+46, 100, 100, + 20.000000000000000 }, + { -1.1073158068796240e+39, 100, 100, + 30.000000000000000 }, + { -8.3640937363981405e+35, 100, 100, + 40.000000000000000 }, + { -6.5879339429312671e+32, 100, 100, + 50.000000000000000 }, + { -2.4190645077698453e+30, 100, 100, + 60.000000000000000 }, + { -7.9224960465662002e+29, 100, 100, + 70.000000000000000 }, + { -2.8605772478408853e+29, 100, 100, + 80.000000000000000 }, + { 2.4149589189610125e+28, 100, 100, + 90.000000000000000 }, + { 5.1146476014859003e+28, 100, 100, + 100.00000000000000 }, +}; + +// Test function for n=100, m=100. +template <typename Tp> +void test064() +{ + 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(data064) + / sizeof(testcase_assoc_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_laguerre(Tp(data064[i].n), Tp(data064[i].m), + Tp(data064[i].x)); + const Tp f0 = data064[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.5000000000000015e-12)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + test037<double>(); + test038<double>(); + test039<double>(); + test040<double>(); + test041<double>(); + test042<double>(); + test043<double>(); + test044<double>(); + test045<double>(); + test046<double>(); + test047<double>(); + test048<double>(); + test049<double>(); + test050<double>(); + test051<double>(); + test052<double>(); + test053<double>(); + test054<double>(); + test055<double>(); + test056<double>(); + test057<double>(); + test058<double>(); + test059<double>(); + test060<double>(); + test061<double>(); + test062<double>(); + test063<double>(); + test064<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile.cc new file mode 100644 index 00000000000..3beffc10ee3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile.cc @@ -0,0 +1,44 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile_2.cc new file mode 100644 index 00000000000..59cf17a332f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/01_assoc_laguerre/compile_2.cc @@ -0,0 +1,44 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_nan.cc new file mode 100644 index 00000000000..174a43c791c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_nan.cc @@ -0,0 +1,59 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_value.cc new file mode 100644 index 00000000000..8265137be22 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/check_value.cc @@ -0,0 +1,2746 @@ +// 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. + +// assoc_legendre + + +// 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 for l=0, m=0. +testcase_assoc_legendre<double> data001[] = { + { 1.0000000000000000, 0, 0, + -1.0000000000000000 }, + { 1.0000000000000000, 0, 0, + -0.90000000000000002 }, + { 1.0000000000000000, 0, 0, + -0.80000000000000004 }, + { 1.0000000000000000, 0, 0, + -0.69999999999999996 }, + { 1.0000000000000000, 0, 0, + -0.59999999999999998 }, + { 1.0000000000000000, 0, 0, + -0.50000000000000000 }, + { 1.0000000000000000, 0, 0, + -0.40000000000000002 }, + { 1.0000000000000000, 0, 0, + -0.30000000000000004 }, + { 1.0000000000000000, 0, 0, + -0.19999999999999996 }, + { 1.0000000000000000, 0, 0, + -0.099999999999999978 }, + { 1.0000000000000000, 0, 0, + 0.0000000000000000 }, + { 1.0000000000000000, 0, 0, + 0.10000000000000009 }, + { 1.0000000000000000, 0, 0, + 0.19999999999999996 }, + { 1.0000000000000000, 0, 0, + 0.30000000000000004 }, + { 1.0000000000000000, 0, 0, + 0.39999999999999991 }, + { 1.0000000000000000, 0, 0, + 0.50000000000000000 }, + { 1.0000000000000000, 0, 0, + 0.60000000000000009 }, + { 1.0000000000000000, 0, 0, + 0.69999999999999996 }, + { 1.0000000000000000, 0, 0, + 0.80000000000000004 }, + { 1.0000000000000000, 0, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 0, 0, + 1.0000000000000000 }, +}; + +// Test function for l=0, m=0. +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_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data001[i].l), Tp(data001[i].m), + 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)); +} + +// Test data for l=1, m=0. +testcase_assoc_legendre<double> data002[] = { + { -1.0000000000000000, 1, 0, + -1.0000000000000000 }, + { -0.90000000000000002, 1, 0, + -0.90000000000000002 }, + { -0.80000000000000004, 1, 0, + -0.80000000000000004 }, + { -0.69999999999999996, 1, 0, + -0.69999999999999996 }, + { -0.59999999999999998, 1, 0, + -0.59999999999999998 }, + { -0.50000000000000000, 1, 0, + -0.50000000000000000 }, + { -0.40000000000000002, 1, 0, + -0.40000000000000002 }, + { -0.30000000000000004, 1, 0, + -0.30000000000000004 }, + { -0.19999999999999996, 1, 0, + -0.19999999999999996 }, + { -0.099999999999999978, 1, 0, + -0.099999999999999978 }, + { 0.0000000000000000, 1, 0, + 0.0000000000000000 }, + { 0.10000000000000009, 1, 0, + 0.10000000000000009 }, + { 0.19999999999999996, 1, 0, + 0.19999999999999996 }, + { 0.30000000000000004, 1, 0, + 0.30000000000000004 }, + { 0.39999999999999991, 1, 0, + 0.39999999999999991 }, + { 0.50000000000000000, 1, 0, + 0.50000000000000000 }, + { 0.60000000000000009, 1, 0, + 0.60000000000000009 }, + { 0.69999999999999996, 1, 0, + 0.69999999999999996 }, + { 0.80000000000000004, 1, 0, + 0.80000000000000004 }, + { 0.89999999999999991, 1, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 1, 0, + 1.0000000000000000 }, +}; + +// Test function for l=1, m=0. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data002[i].l), Tp(data002[i].m), + Tp(data002[i].x)); + const Tp f0 = data002[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)); +} + +// Test data for l=1, m=1. +testcase_assoc_legendre<double> data003[] = { + { -0.0000000000000000, 1, 1, + -1.0000000000000000 }, + { -0.43588989435406728, 1, 1, + -0.90000000000000002 }, + { -0.59999999999999987, 1, 1, + -0.80000000000000004 }, + { -0.71414284285428509, 1, 1, + -0.69999999999999996 }, + { -0.80000000000000004, 1, 1, + -0.59999999999999998 }, + { -0.86602540378443860, 1, 1, + -0.50000000000000000 }, + { -0.91651513899116799, 1, 1, + -0.40000000000000002 }, + { -0.95393920141694577, 1, 1, + -0.30000000000000004 }, + { -0.97979589711327120, 1, 1, + -0.19999999999999996 }, + { -0.99498743710661997, 1, 1, + -0.099999999999999978 }, + { -1.0000000000000000, 1, 1, + 0.0000000000000000 }, + { -0.99498743710661997, 1, 1, + 0.10000000000000009 }, + { -0.97979589711327120, 1, 1, + 0.19999999999999996 }, + { -0.95393920141694577, 1, 1, + 0.30000000000000004 }, + { -0.91651513899116799, 1, 1, + 0.39999999999999991 }, + { -0.86602540378443860, 1, 1, + 0.50000000000000000 }, + { -0.79999999999999993, 1, 1, + 0.60000000000000009 }, + { -0.71414284285428509, 1, 1, + 0.69999999999999996 }, + { -0.59999999999999987, 1, 1, + 0.80000000000000004 }, + { -0.43588989435406750, 1, 1, + 0.89999999999999991 }, + { -0.0000000000000000, 1, 1, + 1.0000000000000000 }, +}; + +// Test function for l=1, m=1. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data003[i].l), Tp(data003[i].m), + Tp(data003[i].x)); + const Tp f0 = data003[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)); +} + +// Test data for l=2, m=0. +testcase_assoc_legendre<double> data004[] = { + { 1.0000000000000000, 2, 0, + -1.0000000000000000 }, + { 0.71500000000000008, 2, 0, + -0.90000000000000002 }, + { 0.46000000000000019, 2, 0, + -0.80000000000000004 }, + { 0.23499999999999982, 2, 0, + -0.69999999999999996 }, + { 0.039999999999999925, 2, 0, + -0.59999999999999998 }, + { -0.12500000000000000, 2, 0, + -0.50000000000000000 }, + { -0.25999999999999995, 2, 0, + -0.40000000000000002 }, + { -0.36499999999999994, 2, 0, + -0.30000000000000004 }, + { -0.44000000000000000, 2, 0, + -0.19999999999999996 }, + { -0.48499999999999999, 2, 0, + -0.099999999999999978 }, + { -0.50000000000000000, 2, 0, + 0.0000000000000000 }, + { -0.48499999999999999, 2, 0, + 0.10000000000000009 }, + { -0.44000000000000000, 2, 0, + 0.19999999999999996 }, + { -0.36499999999999994, 2, 0, + 0.30000000000000004 }, + { -0.26000000000000012, 2, 0, + 0.39999999999999991 }, + { -0.12500000000000000, 2, 0, + 0.50000000000000000 }, + { 0.040000000000000160, 2, 0, + 0.60000000000000009 }, + { 0.23499999999999982, 2, 0, + 0.69999999999999996 }, + { 0.46000000000000019, 2, 0, + 0.80000000000000004 }, + { 0.71499999999999975, 2, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 2, 0, + 1.0000000000000000 }, +}; + +// Test function for l=2, m=0. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data004[i].l), Tp(data004[i].m), + Tp(data004[i].x)); + const Tp f0 = data004[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)); +} + +// Test data for l=2, m=1. +testcase_assoc_legendre<double> data005[] = { + { 0.0000000000000000, 2, 1, + -1.0000000000000000 }, + { 1.1769027147559816, 2, 1, + -0.90000000000000002 }, + { 1.4399999999999999, 2, 1, + -0.80000000000000004 }, + { 1.4996999699939983, 2, 1, + -0.69999999999999996 }, + { 1.4399999999999999, 2, 1, + -0.59999999999999998 }, + { 1.2990381056766580, 2, 1, + -0.50000000000000000 }, + { 1.0998181667894018, 2, 1, + -0.40000000000000002 }, + { 0.85854528127525132, 2, 1, + -0.30000000000000004 }, + { 0.58787753826796263, 2, 1, + -0.19999999999999996 }, + { 0.29849623113198592, 2, 1, + -0.099999999999999978 }, + { -0.0000000000000000, 2, 1, + 0.0000000000000000 }, + { -0.29849623113198626, 2, 1, + 0.10000000000000009 }, + { -0.58787753826796263, 2, 1, + 0.19999999999999996 }, + { -0.85854528127525132, 2, 1, + 0.30000000000000004 }, + { -1.0998181667894014, 2, 1, + 0.39999999999999991 }, + { -1.2990381056766580, 2, 1, + 0.50000000000000000 }, + { -1.4400000000000002, 2, 1, + 0.60000000000000009 }, + { -1.4996999699939983, 2, 1, + 0.69999999999999996 }, + { -1.4399999999999999, 2, 1, + 0.80000000000000004 }, + { -1.1769027147559821, 2, 1, + 0.89999999999999991 }, + { -0.0000000000000000, 2, 1, + 1.0000000000000000 }, +}; + +// Test function for l=2, m=1. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data005[i].l), Tp(data005[i].m), + Tp(data005[i].x)); + const Tp f0 = data005[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)); +} + +// Test data for l=2, m=2. +testcase_assoc_legendre<double> data006[] = { + { 0.0000000000000000, 2, 2, + -1.0000000000000000 }, + { 0.56999999999999984, 2, 2, + -0.90000000000000002 }, + { 1.0799999999999996, 2, 2, + -0.80000000000000004 }, + { 1.5300000000000005, 2, 2, + -0.69999999999999996 }, + { 1.9200000000000004, 2, 2, + -0.59999999999999998 }, + { 2.2500000000000000, 2, 2, + -0.50000000000000000 }, + { 2.5200000000000000, 2, 2, + -0.40000000000000002 }, + { 2.7300000000000004, 2, 2, + -0.30000000000000004 }, + { 2.8799999999999999, 2, 2, + -0.19999999999999996 }, + { 2.9700000000000002, 2, 2, + -0.099999999999999978 }, + { 3.0000000000000000, 2, 2, + 0.0000000000000000 }, + { 2.9700000000000002, 2, 2, + 0.10000000000000009 }, + { 2.8799999999999999, 2, 2, + 0.19999999999999996 }, + { 2.7300000000000004, 2, 2, + 0.30000000000000004 }, + { 2.5200000000000000, 2, 2, + 0.39999999999999991 }, + { 2.2500000000000000, 2, 2, + 0.50000000000000000 }, + { 1.9199999999999997, 2, 2, + 0.60000000000000009 }, + { 1.5300000000000005, 2, 2, + 0.69999999999999996 }, + { 1.0799999999999996, 2, 2, + 0.80000000000000004 }, + { 0.57000000000000040, 2, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 2, 2, + 1.0000000000000000 }, +}; + +// Test function for l=2, m=2. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data006[i].l), Tp(data006[i].m), + Tp(data006[i].x)); + const Tp f0 = data006[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)); +} + +// Test data for l=5, m=0. +testcase_assoc_legendre<double> data007[] = { + { -1.0000000000000000, 5, 0, + -1.0000000000000000 }, + { 0.041141249999999997, 5, 0, + -0.90000000000000002 }, + { 0.39951999999999993, 5, 0, + -0.80000000000000004 }, + { 0.36519874999999991, 5, 0, + -0.69999999999999996 }, + { 0.15263999999999994, 5, 0, + -0.59999999999999998 }, + { -0.089843750000000000, 5, 0, + -0.50000000000000000 }, + { -0.27063999999999988, 5, 0, + -0.40000000000000002 }, + { -0.34538624999999995, 5, 0, + -0.30000000000000004 }, + { -0.30751999999999996, 5, 0, + -0.19999999999999996 }, + { -0.17882874999999995, 5, 0, + -0.099999999999999978 }, + { 0.0000000000000000, 5, 0, + 0.0000000000000000 }, + { 0.17882875000000015, 5, 0, + 0.10000000000000009 }, + { 0.30751999999999996, 5, 0, + 0.19999999999999996 }, + { 0.34538624999999995, 5, 0, + 0.30000000000000004 }, + { 0.27064000000000010, 5, 0, + 0.39999999999999991 }, + { 0.089843750000000000, 5, 0, + 0.50000000000000000 }, + { -0.15264000000000022, 5, 0, + 0.60000000000000009 }, + { -0.36519874999999991, 5, 0, + 0.69999999999999996 }, + { -0.39951999999999993, 5, 0, + 0.80000000000000004 }, + { -0.041141250000000407, 5, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 5, 0, + 1.0000000000000000 }, +}; + +// Test function for l=5, m=0. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data007[i].l), Tp(data007[i].m), + Tp(data007[i].x)); + const Tp f0 = data007[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)); +} + +// Test data for l=5, m=1. +testcase_assoc_legendre<double> data008[] = { + { 0.0000000000000000, 5, 1, + -1.0000000000000000 }, + { -2.8099369608350973, 5, 1, + -0.90000000000000002 }, + { -0.72180000000000089, 5, 1, + -0.80000000000000004 }, + { 1.0951826834447254, 5, 1, + -0.69999999999999996 }, + { 1.9775999999999998, 5, 1, + -0.59999999999999998 }, + { 1.9282596881137892, 5, 1, + -0.50000000000000000 }, + { 1.2070504380513685, 5, 1, + -0.40000000000000002 }, + { 0.16079837663884430, 5, 1, + -0.30000000000000004 }, + { -0.87005875663658538, 5, 1, + -0.19999999999999996 }, + { -1.6083350053680323, 5, 1, + -0.099999999999999978 }, + { -1.8750000000000000, 5, 1, + 0.0000000000000000 }, + { -1.6083350053680314, 5, 1, + 0.10000000000000009 }, + { -0.87005875663658538, 5, 1, + 0.19999999999999996 }, + { 0.16079837663884430, 5, 1, + 0.30000000000000004 }, + { 1.2070504380513674, 5, 1, + 0.39999999999999991 }, + { 1.9282596881137892, 5, 1, + 0.50000000000000000 }, + { 1.9775999999999996, 5, 1, + 0.60000000000000009 }, + { 1.0951826834447254, 5, 1, + 0.69999999999999996 }, + { -0.72180000000000089, 5, 1, + 0.80000000000000004 }, + { -2.8099369608350959, 5, 1, + 0.89999999999999991 }, + { 0.0000000000000000, 5, 1, + 1.0000000000000000 }, +}; + +// Test function for l=5, m=1. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data008[i].l), Tp(data008[i].m), + Tp(data008[i].x)); + const Tp f0 = data008[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)); +} + +// Test data for l=5, m=2. +testcase_assoc_legendre<double> data009[] = { + { 0.0000000000000000, 5, 2, + -1.0000000000000000 }, + { -12.837824999999995, 5, 2, + -0.90000000000000002 }, + { -13.910399999999997, 5, 2, + -0.80000000000000004 }, + { -8.8089749999999984, 5, 2, + -0.69999999999999996 }, + { -1.6128000000000009, 5, 2, + -0.59999999999999998 }, + { 4.9218750000000000, 5, 2, + -0.50000000000000000 }, + { 9.1728000000000005, 5, 2, + -0.40000000000000002 }, + { 10.462725000000001, 5, 2, + -0.30000000000000004 }, + { 8.8703999999999983, 5, 2, + -0.19999999999999996 }, + { 5.0415749999999999, 5, 2, + -0.099999999999999978 }, + { -0.0000000000000000, 5, 2, + 0.0000000000000000 }, + { -5.0415750000000044, 5, 2, + 0.10000000000000009 }, + { -8.8703999999999983, 5, 2, + 0.19999999999999996 }, + { -10.462725000000001, 5, 2, + 0.30000000000000004 }, + { -9.1728000000000005, 5, 2, + 0.39999999999999991 }, + { -4.9218750000000000, 5, 2, + 0.50000000000000000 }, + { 1.6128000000000071, 5, 2, + 0.60000000000000009 }, + { 8.8089749999999984, 5, 2, + 0.69999999999999996 }, + { 13.910399999999997, 5, 2, + 0.80000000000000004 }, + { 12.837825000000004, 5, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 5, 2, + 1.0000000000000000 }, +}; + +// Test function for l=5, m=2. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data009[i].l), Tp(data009[i].m), + Tp(data009[i].x)); + const Tp f0 = data009[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)); +} + +// Test data for l=5, m=5. +testcase_assoc_legendre<double> data010[] = { + { -0.0000000000000000, 5, 5, + -1.0000000000000000 }, + { -14.870165800941818, 5, 5, + -0.90000000000000002 }, + { -73.483199999999925, 5, 5, + -0.80000000000000004 }, + { -175.53238298794764, 5, 5, + -0.69999999999999996 }, + { -309.65760000000006, 5, 5, + -0.59999999999999998 }, + { -460.34662869916559, 5, 5, + -0.50000000000000000 }, + { -611.12496255819883, 5, 5, + -0.40000000000000002 }, + { -746.50941479523760, 5, 5, + -0.30000000000000004 }, + { -853.31600434671316, 5, 5, + -0.19999999999999996 }, + { -921.55189181724734, 5, 5, + -0.099999999999999978 }, + { -945.00000000000000, 5, 5, + 0.0000000000000000 }, + { -921.55189181724734, 5, 5, + 0.10000000000000009 }, + { -853.31600434671316, 5, 5, + 0.19999999999999996 }, + { -746.50941479523760, 5, 5, + 0.30000000000000004 }, + { -611.12496255819883, 5, 5, + 0.39999999999999991 }, + { -460.34662869916559, 5, 5, + 0.50000000000000000 }, + { -309.65759999999989, 5, 5, + 0.60000000000000009 }, + { -175.53238298794764, 5, 5, + 0.69999999999999996 }, + { -73.483199999999925, 5, 5, + 0.80000000000000004 }, + { -14.870165800941855, 5, 5, + 0.89999999999999991 }, + { -0.0000000000000000, 5, 5, + 1.0000000000000000 }, +}; + +// Test function for l=5, m=5. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data010[i].l), Tp(data010[i].m), + Tp(data010[i].x)); + const Tp f0 = data010[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)); +} + +// Test data for l=10, m=0. +testcase_assoc_legendre<double> data011[] = { + { 1.0000000000000000, 10, 0, + -1.0000000000000000 }, + { -0.26314561785585977, 10, 0, + -0.90000000000000002 }, + { 0.30052979559999998, 10, 0, + -0.80000000000000004 }, + { 0.085805795531640333, 10, 0, + -0.69999999999999996 }, + { -0.24366274560000006, 10, 0, + -0.59999999999999998 }, + { -0.18822860717773438, 10, 0, + -0.50000000000000000 }, + { 0.096839064399999869, 10, 0, + -0.40000000000000002 }, + { 0.25147634951601561, 10, 0, + -0.30000000000000004 }, + { 0.12907202559999989, 10, 0, + -0.19999999999999996 }, + { -0.12212499738710947, 10, 0, + -0.099999999999999978 }, + { -0.24609375000000000, 10, 0, + 0.0000000000000000 }, + { -0.12212499738710922, 10, 0, + 0.10000000000000009 }, + { 0.12907202559999989, 10, 0, + 0.19999999999999996 }, + { 0.25147634951601561, 10, 0, + 0.30000000000000004 }, + { 0.096839064400000258, 10, 0, + 0.39999999999999991 }, + { -0.18822860717773438, 10, 0, + 0.50000000000000000 }, + { -0.24366274559999987, 10, 0, + 0.60000000000000009 }, + { 0.085805795531640333, 10, 0, + 0.69999999999999996 }, + { 0.30052979559999998, 10, 0, + 0.80000000000000004 }, + { -0.26314561785585888, 10, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 10, 0, + 1.0000000000000000 }, +}; + +// Test function for l=10, m=0. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data011[i].l), Tp(data011[i].m), + Tp(data011[i].x)); + const Tp f0 = data011[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)); +} + +// Test data for l=10, m=1. +testcase_assoc_legendre<double> data012[] = { + { -0.0000000000000000, 10, 1, + -1.0000000000000000 }, + { -3.0438748781479061, 10, 1, + -0.90000000000000002 }, + { -0.87614260800000199, 10, 1, + -0.80000000000000004 }, + { 2.9685359952934522, 10, 1, + -0.69999999999999996 }, + { 1.2511825919999990, 10, 1, + -0.59999999999999998 }, + { -2.0066877394361260, 10, 1, + -0.50000000000000000 }, + { -2.4822196173476661, 10, 1, + -0.40000000000000002 }, + { -0.12309508907433941, 10, 1, + -0.30000000000000004 }, + { 2.2468221751958408, 10, 1, + -0.19999999999999996 }, + { 2.2472659777983512, 10, 1, + -0.099999999999999978 }, + { -0.0000000000000000, 10, 1, + 0.0000000000000000 }, + { -2.2472659777983530, 10, 1, + 0.10000000000000009 }, + { -2.2468221751958408, 10, 1, + 0.19999999999999996 }, + { 0.12309508907433941, 10, 1, + 0.30000000000000004 }, + { 2.4822196173476643, 10, 1, + 0.39999999999999991 }, + { 2.0066877394361260, 10, 1, + 0.50000000000000000 }, + { -1.2511825920000037, 10, 1, + 0.60000000000000009 }, + { -2.9685359952934522, 10, 1, + 0.69999999999999996 }, + { 0.87614260800000199, 10, 1, + 0.80000000000000004 }, + { 3.0438748781479110, 10, 1, + 0.89999999999999991 }, + { 0.0000000000000000, 10, 1, + 1.0000000000000000 }, +}; + +// Test function for l=10, m=1. +template <typename Tp> +void test012() +{ + 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(data012) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data012[i].l), Tp(data012[i].m), + Tp(data012[i].x)); + const Tp f0 = data012[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)); +} + +// Test data for l=10, m=2. +testcase_assoc_legendre<double> data013[] = { + { 0.0000000000000000, 10, 2, + -1.0000000000000000 }, + { 16.376387762496122, 10, 2, + -0.90000000000000002 }, + { -35.394657803999991, 10, 2, + -0.80000000000000004 }, + { -3.6191429423788892, 10, 2, + -0.69999999999999996 }, + { 28.679675904000010, 10, 2, + -0.59999999999999998 }, + { 18.388023376464844, 10, 2, + -0.50000000000000000 }, + { -12.818955995999996, 10, 2, + -0.40000000000000002 }, + { -27.739821675972660, 10, 2, + -0.30000000000000004 }, + { -13.280661503999987, 10, 2, + -0.19999999999999996 }, + { 13.885467170308596, 10, 2, + -0.099999999999999978 }, + { 27.070312500000000, 10, 2, + 0.0000000000000000 }, + { 13.885467170308573, 10, 2, + 0.10000000000000009 }, + { -13.280661503999987, 10, 2, + 0.19999999999999996 }, + { -27.739821675972660, 10, 2, + 0.30000000000000004 }, + { -12.818955996000019, 10, 2, + 0.39999999999999991 }, + { 18.388023376464844, 10, 2, + 0.50000000000000000 }, + { 28.679675903999982, 10, 2, + 0.60000000000000009 }, + { -3.6191429423788892, 10, 2, + 0.69999999999999996 }, + { -35.394657803999991, 10, 2, + 0.80000000000000004 }, + { 16.376387762495984, 10, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 10, 2, + 1.0000000000000000 }, +}; + +// Test function for l=10, m=2. +template <typename Tp> +void test013() +{ + 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(data013) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data013[i].l), Tp(data013[i].m), + Tp(data013[i].x)); + const Tp f0 = data013[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)); +} + +// Test data for l=10, m=5. +testcase_assoc_legendre<double> data014[] = { + { 0.0000000000000000, 10, 5, + -1.0000000000000000 }, + { 21343.618518164669, 10, 5, + -0.90000000000000002 }, + { 40457.016407807983, 10, 5, + -0.80000000000000004 }, + { 20321.279317331318, 10, 5, + -0.69999999999999996 }, + { -14410.820616192013, 10, 5, + -0.59999999999999998 }, + { -30086.169706116176, 10, 5, + -0.50000000000000000 }, + { -17177.549337582859, 10, 5, + -0.40000000000000002 }, + { 9272.5119495412346, 10, 5, + -0.30000000000000004 }, + { 26591.511184414714, 10, 5, + -0.19999999999999996 }, + { 21961.951238504211, 10, 5, + -0.099999999999999978 }, + { -0.0000000000000000, 10, 5, + 0.0000000000000000 }, + { -21961.951238504229, 10, 5, + 0.10000000000000009 }, + { -26591.511184414714, 10, 5, + 0.19999999999999996 }, + { -9272.5119495412346, 10, 5, + 0.30000000000000004 }, + { 17177.549337582830, 10, 5, + 0.39999999999999991 }, + { 30086.169706116176, 10, 5, + 0.50000000000000000 }, + { 14410.820616191975, 10, 5, + 0.60000000000000009 }, + { -20321.279317331318, 10, 5, + 0.69999999999999996 }, + { -40457.016407807983, 10, 5, + 0.80000000000000004 }, + { -21343.618518164698, 10, 5, + 0.89999999999999991 }, + { 0.0000000000000000, 10, 5, + 1.0000000000000000 }, +}; + +// Test function for l=10, m=5. +template <typename Tp> +void test014() +{ + 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(data014) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data014[i].l), Tp(data014[i].m), + Tp(data014[i].x)); + const Tp f0 = data014[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)); +} + +// Test data for l=10, m=10. +testcase_assoc_legendre<double> data015[] = { + { 0.0000000000000000, 10, 10, + -1.0000000000000000 }, + { 162117.40078784220, 10, 10, + -0.90000000000000002 }, + { 3958896.3481267113, 10, 10, + -0.80000000000000004 }, + { 22589806.343887307, 10, 10, + -0.69999999999999996 }, + { 70300999.121633321, 10, 10, + -0.59999999999999998 }, + { 155370278.54003900, 10, 10, + -0.50000000000000000 }, + { 273815518.20150518, 10, 10, + -0.40000000000000002 }, + { 408571989.13158917, 10, 10, + -0.30000000000000004 }, + { 533848212.07990247, 10, 10, + -0.19999999999999996 }, + { 622640835.70523083, 10, 10, + -0.099999999999999978 }, + { 654729075.00000000, 10, 10, + 0.0000000000000000 }, + { 622640835.70523083, 10, 10, + 0.10000000000000009 }, + { 533848212.07990247, 10, 10, + 0.19999999999999996 }, + { 408571989.13158917, 10, 10, + 0.30000000000000004 }, + { 273815518.20150518, 10, 10, + 0.39999999999999991 }, + { 155370278.54003900, 10, 10, + 0.50000000000000000 }, + { 70300999.121633217, 10, 10, + 0.60000000000000009 }, + { 22589806.343887307, 10, 10, + 0.69999999999999996 }, + { 3958896.3481267113, 10, 10, + 0.80000000000000004 }, + { 162117.40078784304, 10, 10, + 0.89999999999999991 }, + { 0.0000000000000000, 10, 10, + 1.0000000000000000 }, +}; + +// Test function for l=10, m=10. +template <typename Tp> +void test015() +{ + 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(data015) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data015[i].l), Tp(data015[i].m), + Tp(data015[i].x)); + const Tp f0 = data015[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)); +} + +// Test data for l=20, m=0. +testcase_assoc_legendre<double> data016[] = { + { 1.0000000000000000, 20, 0, + -1.0000000000000000 }, + { -0.14930823530984821, 20, 0, + -0.90000000000000002 }, + { 0.22420460541741344, 20, 0, + -0.80000000000000004 }, + { -0.20457394463834172, 20, 0, + -0.69999999999999996 }, + { 0.15916752910098114, 20, 0, + -0.59999999999999998 }, + { -0.048358381067373557, 20, 0, + -0.50000000000000000 }, + { -0.10159261558628156, 20, 0, + -0.40000000000000002 }, + { 0.18028715947998047, 20, 0, + -0.30000000000000004 }, + { -0.098042194344594741, 20, 0, + -0.19999999999999996 }, + { -0.082077130944527649, 20, 0, + -0.099999999999999978 }, + { 0.17619705200195312, 20, 0, + 0.0000000000000000 }, + { -0.082077130944528037, 20, 0, + 0.10000000000000009 }, + { -0.098042194344594741, 20, 0, + 0.19999999999999996 }, + { 0.18028715947998047, 20, 0, + 0.30000000000000004 }, + { -0.10159261558628112, 20, 0, + 0.39999999999999991 }, + { -0.048358381067373557, 20, 0, + 0.50000000000000000 }, + { 0.15916752910098084, 20, 0, + 0.60000000000000009 }, + { -0.20457394463834172, 20, 0, + 0.69999999999999996 }, + { 0.22420460541741344, 20, 0, + 0.80000000000000004 }, + { -0.14930823530984949, 20, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 20, 0, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=0. +template <typename Tp> +void test016() +{ + 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(data016) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data016[i].l), Tp(data016[i].m), + Tp(data016[i].x)); + const Tp f0 = data016[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)); +} + +// Test data for l=20, m=1. +testcase_assoc_legendre<double> data017[] = { + { 0.0000000000000000, 20, 1, + -1.0000000000000000 }, + { 4.3838334818220490, 20, 1, + -0.90000000000000002 }, + { -0.63138296146340556, 20, 1, + -0.80000000000000004 }, + { 0.72274871413391228, 20, 1, + -0.69999999999999996 }, + { -2.3203528743824893, 20, 1, + -0.59999999999999998 }, + { 3.7399919228791405, 20, 1, + -0.50000000000000000 }, + { -3.1692202279270028, 20, 1, + -0.40000000000000002 }, + { 0.15804468835344049, 20, 1, + -0.30000000000000004 }, + { 3.0366182393271162, 20, 1, + -0.19999999999999996 }, + { -3.2115523815580209, 20, 1, + -0.099999999999999978 }, + { 0.0000000000000000, 20, 1, + 0.0000000000000000 }, + { 3.2115523815580160, 20, 1, + 0.10000000000000009 }, + { -3.0366182393271162, 20, 1, + 0.19999999999999996 }, + { -0.15804468835344049, 20, 1, + 0.30000000000000004 }, + { 3.1692202279270076, 20, 1, + 0.39999999999999991 }, + { -3.7399919228791405, 20, 1, + 0.50000000000000000 }, + { 2.3203528743825008, 20, 1, + 0.60000000000000009 }, + { -0.72274871413391228, 20, 1, + 0.69999999999999996 }, + { 0.63138296146340556, 20, 1, + 0.80000000000000004 }, + { -4.3838334818220304, 20, 1, + 0.89999999999999991 }, + { 0.0000000000000000, 20, 1, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=1. +template <typename Tp> +void test017() +{ + 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(data017) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data017[i].l), Tp(data017[i].m), + Tp(data017[i].x)); + const Tp f0 = data017[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)); +} + +// Test data for l=20, m=2. +testcase_assoc_legendre<double> data018[] = { + { 0.0000000000000000, 20, 2, + -1.0000000000000000 }, + { 80.812425587310116, 20, 2, + -0.90000000000000002 }, + { -95.849622172549317, 20, 2, + -0.80000000000000004 }, + { 87.337927630325510, 20, 2, + -0.69999999999999996 }, + { -70.330891533985834, 20, 2, + -0.59999999999999998 }, + { 24.629090735179489, 20, 2, + -0.50000000000000000 }, + { 39.902576338912418, 20, 2, + -0.40000000000000002 }, + { -75.621201471396589, 20, 2, + -0.30000000000000004 }, + { 42.417415829726487, 20, 2, + -0.19999999999999996 }, + { 33.826848678871301, 20, 2, + -0.099999999999999978 }, + { -74.002761840820312, 20, 2, + 0.0000000000000000 }, + { 33.826848678871457, 20, 2, + 0.10000000000000009 }, + { 42.417415829726487, 20, 2, + 0.19999999999999996 }, + { -75.621201471396589, 20, 2, + 0.30000000000000004 }, + { 39.902576338912240, 20, 2, + 0.39999999999999991 }, + { 24.629090735179489, 20, 2, + 0.50000000000000000 }, + { -70.330891533985664, 20, 2, + 0.60000000000000009 }, + { 87.337927630325510, 20, 2, + 0.69999999999999996 }, + { -95.849622172549317, 20, 2, + 0.80000000000000004 }, + { 80.812425587310585, 20, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 20, 2, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=2. +template <typename Tp> +void test018() +{ + 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(data018) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data018[i].l), Tp(data018[i].m), + Tp(data018[i].x)); + const Tp f0 = data018[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)); +} + +// Test data for l=20, m=5. +testcase_assoc_legendre<double> data019[] = { + { -0.0000000000000000, 20, 5, + -1.0000000000000000 }, + { -315702.32715134107, 20, 5, + -0.90000000000000002 }, + { 503060.91484852595, 20, 5, + -0.80000000000000004 }, + { -298127.28360361949, 20, 5, + -0.69999999999999996 }, + { -114444.61447464002, 20, 5, + -0.59999999999999998 }, + { 543428.40914592857, 20, 5, + -0.50000000000000000 }, + { -613842.07728185481, 20, 5, + -0.40000000000000002 }, + { 143765.42411270953, 20, 5, + -0.30000000000000004 }, + { 472600.45321372297, 20, 5, + -0.19999999999999996 }, + { -563861.76771496492, 20, 5, + -0.099999999999999978 }, + { 0.0000000000000000, 20, 5, + 0.0000000000000000 }, + { 563861.76771496458, 20, 5, + 0.10000000000000009 }, + { -472600.45321372297, 20, 5, + 0.19999999999999996 }, + { -143765.42411270953, 20, 5, + 0.30000000000000004 }, + { 613842.07728185505, 20, 5, + 0.39999999999999991 }, + { -543428.40914592857, 20, 5, + 0.50000000000000000 }, + { 114444.61447464184, 20, 5, + 0.60000000000000009 }, + { 298127.28360361949, 20, 5, + 0.69999999999999996 }, + { -503060.91484852595, 20, 5, + 0.80000000000000004 }, + { 315702.32715134590, 20, 5, + 0.89999999999999991 }, + { 0.0000000000000000, 20, 5, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=5. +template <typename Tp> +void test019() +{ + 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(data019) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data019[i].l), Tp(data019[i].m), + Tp(data019[i].x)); + const Tp f0 = data019[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)); +} + +// Test data for l=20, m=10. +testcase_assoc_legendre<double> data020[] = { + { -0.0000000000000000, 20, 10, + -1.0000000000000000 }, + { 990017476694.99084, 20, 10, + -0.90000000000000002 }, + { 2392757933281.0503, 20, 10, + -0.80000000000000004 }, + { -1548364524949.5808, 20, 10, + -0.69999999999999996 }, + { -424471915195.05609, 20, 10, + -0.59999999999999998 }, + { 1744502295946.2065, 20, 10, + -0.50000000000000000 }, + { -899973487310.55212, 20, 10, + -0.40000000000000002 }, + { -1092420454297.7164, 20, 10, + -0.30000000000000004 }, + { 1466609267659.8816, 20, 10, + -0.19999999999999996 }, + { 356041756390.71661, 20, 10, + -0.099999999999999978 }, + { -1612052956674.3164, 20, 10, + 0.0000000000000000 }, + { 356041756390.71985, 20, 10, + 0.10000000000000009 }, + { 1466609267659.8816, 20, 10, + 0.19999999999999996 }, + { -1092420454297.7164, 20, 10, + 0.30000000000000004 }, + { -899973487310.55469, 20, 10, + 0.39999999999999991 }, + { 1744502295946.2065, 20, 10, + 0.50000000000000000 }, + { -424471915195.05914, 20, 10, + 0.60000000000000009 }, + { -1548364524949.5808, 20, 10, + 0.69999999999999996 }, + { 2392757933281.0503, 20, 10, + 0.80000000000000004 }, + { 990017476694.99353, 20, 10, + 0.89999999999999991 }, + { 0.0000000000000000, 20, 10, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=10. +template <typename Tp> +void test020() +{ + 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(data020) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data020[i].l), Tp(data020[i].m), + Tp(data020[i].x)); + const Tp f0 = data020[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)); +} + +// Test data for l=20, m=20. +testcase_assoc_legendre<double> data021[] = { + { 0.0000000000000000, 20, 20, + -1.0000000000000000 }, + { 19609049712023808., 20, 20, + -0.90000000000000002 }, + { 1.1693527616833221e+19, 20, 20, + -0.80000000000000004 }, + { 3.8073455880620691e+20, 20, 20, + -0.69999999999999996 }, + { 3.6874002249007927e+21, 20, 20, + -0.59999999999999998 }, + { 1.8010806978179592e+22, 20, 20, + -0.50000000000000000 }, + { 5.5938832584012466e+22, 20, 20, + -0.40000000000000002 }, + { 1.2454734132297811e+23, 20, 20, + -0.30000000000000004 }, + { 2.1263407800797497e+23, 20, 20, + -0.19999999999999996 }, + { 2.8924941146976873e+23, 20, 20, + -0.099999999999999978 }, + { 3.1983098677287775e+23, 20, 20, + 0.0000000000000000 }, + { 2.8924941146976873e+23, 20, 20, + 0.10000000000000009 }, + { 2.1263407800797497e+23, 20, 20, + 0.19999999999999996 }, + { 1.2454734132297811e+23, 20, 20, + 0.30000000000000004 }, + { 5.5938832584012466e+22, 20, 20, + 0.39999999999999991 }, + { 1.8010806978179592e+22, 20, 20, + 0.50000000000000000 }, + { 3.6874002249007807e+21, 20, 20, + 0.60000000000000009 }, + { 3.8073455880620691e+20, 20, 20, + 0.69999999999999996 }, + { 1.1693527616833221e+19, 20, 20, + 0.80000000000000004 }, + { 19609049712024020., 20, 20, + 0.89999999999999991 }, + { 0.0000000000000000, 20, 20, + 1.0000000000000000 }, +}; + +// Test function for l=20, m=20. +template <typename Tp> +void test021() +{ + 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(data021) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data021[i].l), Tp(data021[i].m), + Tp(data021[i].x)); + const Tp f0 = data021[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)); +} + +// Test data for l=50, m=0. +testcase_assoc_legendre<double> data022[] = { + { 1.0000000000000000, 50, 0, + -1.0000000000000000 }, + { -0.17003765994383685, 50, 0, + -0.90000000000000002 }, + { 0.13879737345093118, 50, 0, + -0.80000000000000004 }, + { -0.014572731645892805, 50, 0, + -0.69999999999999996 }, + { -0.058860798844002173, 50, 0, + -0.59999999999999998 }, + { -0.031059099239609828, 50, 0, + -0.50000000000000000 }, + { 0.041569033381825368, 50, 0, + -0.40000000000000002 }, + { 0.10911051574714808, 50, 0, + -0.30000000000000004 }, + { 0.083432272204197466, 50, 0, + -0.19999999999999996 }, + { -0.038205812661313579, 50, 0, + -0.099999999999999978 }, + { -0.11227517265921705, 50, 0, + 0.0000000000000000 }, + { -0.038205812661314169, 50, 0, + 0.10000000000000009 }, + { 0.083432272204197466, 50, 0, + 0.19999999999999996 }, + { 0.10911051574714808, 50, 0, + 0.30000000000000004 }, + { 0.041569033381824647, 50, 0, + 0.39999999999999991 }, + { -0.031059099239609828, 50, 0, + 0.50000000000000000 }, + { -0.058860798844001430, 50, 0, + 0.60000000000000009 }, + { -0.014572731645892805, 50, 0, + 0.69999999999999996 }, + { 0.13879737345093118, 50, 0, + 0.80000000000000004 }, + { -0.17003765994383663, 50, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 50, 0, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=0. +template <typename Tp> +void test022() +{ + 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(data022) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data022[i].l), Tp(data022[i].m), + Tp(data022[i].x)); + const Tp f0 = data022[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)); +} + +// Test data for l=50, m=1. +testcase_assoc_legendre<double> data023[] = { + { 0.0000000000000000, 50, 1, + -1.0000000000000000 }, + { -0.13424149984450387, 50, 1, + -0.90000000000000002 }, + { 2.2011219672413085, 50, 1, + -0.80000000000000004 }, + { 6.6622414993232013, 50, 1, + -0.69999999999999996 }, + { 5.5772846936919231, 50, 1, + -0.59999999999999998 }, + { 5.8787148815607617, 50, 1, + -0.50000000000000000 }, + { 5.5473459458634000, 50, 1, + -0.40000000000000002 }, + { 1.8444956647619912, 50, 1, + -0.30000000000000004 }, + { -3.8722014306642150, 50, 1, + -0.19999999999999996 }, + { -5.3488751322285593, 50, 1, + -0.099999999999999978 }, + { -0.0000000000000000, 50, 1, + 0.0000000000000000 }, + { 5.3488751322285459, 50, 1, + 0.10000000000000009 }, + { 3.8722014306642150, 50, 1, + 0.19999999999999996 }, + { -1.8444956647619912, 50, 1, + 0.30000000000000004 }, + { -5.5473459458634098, 50, 1, + 0.39999999999999991 }, + { -5.8787148815607617, 50, 1, + 0.50000000000000000 }, + { -5.5772846936919489, 50, 1, + 0.60000000000000009 }, + { -6.6622414993232013, 50, 1, + 0.69999999999999996 }, + { -2.2011219672413085, 50, 1, + 0.80000000000000004 }, + { 0.13424149984460862, 50, 1, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 1, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=1. +template <typename Tp> +void test023() +{ + 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(data023) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data023[i].l), Tp(data023[i].m), + Tp(data023[i].x)); + const Tp f0 = data023[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.0000000000000029e-12)); +} + +// Test data for l=50, m=2. +testcase_assoc_legendre<double> data024[] = { + { 0.0000000000000000, 50, 2, + -1.0000000000000000 }, + { 433.04168483713448, 50, 2, + -0.90000000000000002 }, + { -348.06364372056390, 50, 2, + -0.80000000000000004 }, + { 50.221071418108465, 50, 2, + -0.69999999999999996 }, + { 158.46096409274341, 50, 2, + -0.59999999999999998 }, + { 85.988858299721414, 50, 2, + -0.50000000000000000 }, + { -101.15891460879277, 50, 2, + -0.40000000000000002 }, + { -277.07168105316612, 50, 2, + -0.30000000000000004 }, + { -214.33311373510401, 50, 2, + -0.19999999999999996 }, + { 96.349657930951722, 50, 2, + -0.099999999999999978 }, + { 286.30169028100346, 50, 2, + 0.0000000000000000 }, + { 96.349657930953285, 50, 2, + 0.10000000000000009 }, + { -214.33311373510401, 50, 2, + 0.19999999999999996 }, + { -277.07168105316612, 50, 2, + 0.30000000000000004 }, + { -101.15891460879106, 50, 2, + 0.39999999999999991 }, + { 85.988858299721414, 50, 2, + 0.50000000000000000 }, + { 158.46096409274131, 50, 2, + 0.60000000000000009 }, + { 50.221071418108465, 50, 2, + 0.69999999999999996 }, + { -348.06364372056390, 50, 2, + 0.80000000000000004 }, + { 433.04168483713414, 50, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 2, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=2. +template <typename Tp> +void test024() +{ + 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(data024) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data024[i].l), Tp(data024[i].m), + Tp(data024[i].x)); + const Tp f0 = data024[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)); +} + +// Test data for l=50, m=5. +testcase_assoc_legendre<double> data025[] = { + { -0.0000000000000000, 50, 5, + -1.0000000000000000 }, + { -27340473.952132788, 50, 5, + -0.90000000000000002 }, + { 27753716.768532373, 50, 5, + -0.80000000000000004 }, + { 40808153.913493626, 50, 5, + -0.69999999999999996 }, + { 32071189.035790101, 50, 5, + -0.59999999999999998 }, + { 36265736.218529105, 50, 5, + -0.50000000000000000 }, + { 37089596.700204894, 50, 5, + -0.40000000000000002 }, + { 14562029.629244510, 50, 5, + -0.30000000000000004 }, + { -23686895.217517227, 50, 5, + -0.19999999999999996 }, + { -34878992.965676002, 50, 5, + -0.099999999999999978 }, + { -0.0000000000000000, 50, 5, + 0.0000000000000000 }, + { 34878992.965675950, 50, 5, + 0.10000000000000009 }, + { 23686895.217517227, 50, 5, + 0.19999999999999996 }, + { -14562029.629244510, 50, 5, + 0.30000000000000004 }, + { -37089596.700204931, 50, 5, + 0.39999999999999991 }, + { -36265736.218529105, 50, 5, + 0.50000000000000000 }, + { -32071189.035790265, 50, 5, + 0.60000000000000009 }, + { -40808153.913493626, 50, 5, + 0.69999999999999996 }, + { -27753716.768532373, 50, 5, + 0.80000000000000004 }, + { 27340473.952133406, 50, 5, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 5, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=5. +template <typename Tp> +void test025() +{ + 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(data025) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data025[i].l), Tp(data025[i].m), + Tp(data025[i].x)); + const Tp f0 = data025[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)); +} + +// Test data for l=50, m=10. +testcase_assoc_legendre<double> data026[] = { + { -0.0000000000000000, 50, 10, + -1.0000000000000000 }, + { -8994661710093158.0, 50, 10, + -0.90000000000000002 }, + { 932311375306557.00, 50, 10, + -0.80000000000000004 }, + { 12153535011507012., 50, 10, + -0.69999999999999996 }, + { 12176690755542244., 50, 10, + -0.59999999999999998 }, + { 9180035388465752.0, 50, 10, + -0.50000000000000000 }, + { 889201701866911.12, 50, 10, + -0.40000000000000002 }, + { -9451384032851600.0, 50, 10, + -0.30000000000000004 }, + { -9926439446673564.0, 50, 10, + -0.19999999999999996 }, + { 2794368162749970.5, 50, 10, + -0.099999999999999978 }, + { 11452238249246346., 50, 10, + 0.0000000000000000 }, + { 2794368162750031.0, 50, 10, + 0.10000000000000009 }, + { -9926439446673564.0, 50, 10, + 0.19999999999999996 }, + { -9451384032851600.0, 50, 10, + 0.30000000000000004 }, + { 889201701866976.25, 50, 10, + 0.39999999999999991 }, + { 9180035388465752.0, 50, 10, + 0.50000000000000000 }, + { 12176690755542216., 50, 10, + 0.60000000000000009 }, + { 12153535011507012., 50, 10, + 0.69999999999999996 }, + { 932311375306557.00, 50, 10, + 0.80000000000000004 }, + { -8994661710093322.0, 50, 10, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 10, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=10. +template <typename Tp> +void test026() +{ + 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(data026) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data026[i].l), Tp(data026[i].m), + Tp(data026[i].x)); + const Tp f0 = data026[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(1.0000000000000008e-12)); +} + +// Test data for l=50, m=20. +testcase_assoc_legendre<double> data027[] = { + { 0.0000000000000000, 50, 20, + -1.0000000000000000 }, + { 1.6630925158645460e+33, 50, 20, + -0.90000000000000002 }, + { 1.0622676657892043e+33, 50, 20, + -0.80000000000000004 }, + { 8.6022521164717170e+32, 50, 20, + -0.69999999999999996 }, + { 4.0860128756808430e+32, 50, 20, + -0.59999999999999998 }, + { -4.0169860814274409e+32, 50, 20, + -0.50000000000000000 }, + { -8.2324325279774008e+32, 50, 20, + -0.40000000000000002 }, + { -4.0054067236243299e+31, 50, 20, + -0.30000000000000004 }, + { 7.9309266056434309e+32, 50, 20, + -0.19999999999999996 }, + { 5.4151358290899148e+31, 50, 20, + -0.099999999999999978 }, + { -7.8735935697332210e+32, 50, 20, + 0.0000000000000000 }, + { 5.4151358290895032e+31, 50, 20, + 0.10000000000000009 }, + { 7.9309266056434309e+32, 50, 20, + 0.19999999999999996 }, + { -4.0054067236243299e+31, 50, 20, + 0.30000000000000004 }, + { -8.2324325279773965e+32, 50, 20, + 0.39999999999999991 }, + { -4.0169860814274409e+32, 50, 20, + 0.50000000000000000 }, + { 4.0860128756807882e+32, 50, 20, + 0.60000000000000009 }, + { 8.6022521164717170e+32, 50, 20, + 0.69999999999999996 }, + { 1.0622676657892043e+33, 50, 20, + 0.80000000000000004 }, + { 1.6630925158645483e+33, 50, 20, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 20, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=20. +template <typename Tp> +void test027() +{ + 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(data027) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data027[i].l), Tp(data027[i].m), + Tp(data027[i].x)); + const Tp f0 = data027[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(1.0000000000000008e-12)); +} + +// Test data for l=50, m=50. +testcase_assoc_legendre<double> data028[] = { + { 0.0000000000000000, 50, 50, + -1.0000000000000000 }, + { 2.5366994974431341e+60, 50, 50, + -0.90000000000000002 }, + { 2.2028834403101213e+67, 50, 50, + -0.80000000000000004 }, + { 1.3325496559566651e+71, 50, 50, + -0.69999999999999996 }, + { 3.8898096431781969e+73, 50, 50, + -0.59999999999999998 }, + { 2.0509760257037188e+75, 50, 50, + -0.50000000000000000 }, + { 3.4866724533443283e+76, 50, 50, + -0.40000000000000002 }, + { 2.5790740224150207e+77, 50, 50, + -0.30000000000000004 }, + { 9.8222237931680989e+77, 50, 50, + -0.19999999999999996 }, + { 2.1198682190366617e+78, 50, 50, + -0.099999999999999978 }, + { 2.7253921397507295e+78, 50, 50, + 0.0000000000000000 }, + { 2.1198682190366617e+78, 50, 50, + 0.10000000000000009 }, + { 9.8222237931680989e+77, 50, 50, + 0.19999999999999996 }, + { 2.5790740224150207e+77, 50, 50, + 0.30000000000000004 }, + { 3.4866724533443283e+76, 50, 50, + 0.39999999999999991 }, + { 2.0509760257037188e+75, 50, 50, + 0.50000000000000000 }, + { 3.8898096431781724e+73, 50, 50, + 0.60000000000000009 }, + { 1.3325496559566651e+71, 50, 50, + 0.69999999999999996 }, + { 2.2028834403101213e+67, 50, 50, + 0.80000000000000004 }, + { 2.5366994974431990e+60, 50, 50, + 0.89999999999999991 }, + { 0.0000000000000000, 50, 50, + 1.0000000000000000 }, +}; + +// Test function for l=50, m=50. +template <typename Tp> +void test028() +{ + 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(data028) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data028[i].l), Tp(data028[i].m), + Tp(data028[i].x)); + const Tp f0 = data028[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)); +} + +// Test data for l=100, m=0. +testcase_assoc_legendre<double> data029[] = { + { 1.0000000000000000, 100, 0, + -1.0000000000000000 }, + { 0.10226582055871908, 100, 0, + -0.90000000000000002 }, + { 0.050861167913584124, 100, 0, + -0.80000000000000004 }, + { -0.077132507199778780, 100, 0, + -0.69999999999999996 }, + { -0.023747023905133110, 100, 0, + -0.59999999999999998 }, + { -0.060518025961861198, 100, 0, + -0.50000000000000000 }, + { -0.072258202125684429, 100, 0, + -0.40000000000000002 }, + { 0.057127392202801719, 100, 0, + -0.30000000000000004 }, + { 0.014681835355659636, 100, 0, + -0.19999999999999996 }, + { -0.063895098434750303, 100, 0, + -0.099999999999999978 }, + { 0.079589237387178727, 100, 0, + 0.0000000000000000 }, + { -0.063895098434749775, 100, 0, + 0.10000000000000009 }, + { 0.014681835355659636, 100, 0, + 0.19999999999999996 }, + { 0.057127392202801719, 100, 0, + 0.30000000000000004 }, + { -0.072258202125685012, 100, 0, + 0.39999999999999991 }, + { -0.060518025961861198, 100, 0, + 0.50000000000000000 }, + { -0.023747023905134217, 100, 0, + 0.60000000000000009 }, + { -0.077132507199778780, 100, 0, + 0.69999999999999996 }, + { 0.050861167913584124, 100, 0, + 0.80000000000000004 }, + { 0.10226582055871723, 100, 0, + 0.89999999999999991 }, + { 1.0000000000000000, 100, 0, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=0. +template <typename Tp> +void test029() +{ + 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(data029) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data029[i].l), Tp(data029[i].m), + Tp(data029[i].x)); + const Tp f0 = data029[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)); +} + +// Test data for l=100, m=1. +testcase_assoc_legendre<double> data030[] = { + { -0.0000000000000000, 100, 1, + -1.0000000000000000 }, + { 6.5200167187780309, 100, 1, + -0.90000000000000002 }, + { 9.0065170007027540, 100, 1, + -0.80000000000000004 }, + { -5.4690908541181056, 100, 1, + -0.69999999999999996 }, + { -8.6275439170430861, 100, 1, + -0.59999999999999998 }, + { -6.0909031663448499, 100, 1, + -0.50000000000000000 }, + { 4.1160338699561265, 100, 1, + -0.40000000000000002 }, + { 5.8491043010758004, 100, 1, + -0.30000000000000004 }, + { -7.9435138723089826, 100, 1, + -0.19999999999999996 }, + { 4.7996285823989346, 100, 1, + -0.099999999999999978 }, + { 0.0000000000000000, 100, 1, + 0.0000000000000000 }, + { -4.7996285823990057, 100, 1, + 0.10000000000000009 }, + { 7.9435138723089826, 100, 1, + 0.19999999999999996 }, + { -5.8491043010758004, 100, 1, + 0.30000000000000004 }, + { -4.1160338699560359, 100, 1, + 0.39999999999999991 }, + { 6.0909031663448499, 100, 1, + 0.50000000000000000 }, + { 8.6275439170430559, 100, 1, + 0.60000000000000009 }, + { 5.4690908541181056, 100, 1, + 0.69999999999999996 }, + { -9.0065170007027540, 100, 1, + 0.80000000000000004 }, + { -6.5200167187783133, 100, 1, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 1, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=1. +template <typename Tp> +void test030() +{ + 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(data030) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data030[i].l), Tp(data030[i].m), + Tp(data030[i].x)); + const Tp f0 = data030[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)); +} + +// Test data for l=100, m=2. +testcase_assoc_legendre<double> data031[] = { + { 0.0000000000000000, 100, 2, + -1.0000000000000000 }, + { -1005.9604880761007, 100, 2, + -0.90000000000000002 }, + { -489.68041725865896, 100, 2, + -0.80000000000000004 }, + { 768.31676011669970, 100, 2, + -0.69999999999999996 }, + { 226.90362556628003, 100, 2, + -0.59999999999999998 }, + { 604.19889304940330, 100, 2, + -0.50000000000000000 }, + { 733.40061037838029, 100, 2, + -0.40000000000000002 }, + { -573.30774483996402, 100, 2, + -0.30000000000000004 }, + { -151.52946305080897, 100, 2, + -0.19999999999999996 }, + { 646.30525583588019, 100, 2, + -0.099999999999999978 }, + { -803.85129761050518, 100, 2, + 0.0000000000000000 }, + { 646.30525583587439, 100, 2, + 0.10000000000000009 }, + { -151.52946305080897, 100, 2, + 0.19999999999999996 }, + { -573.30774483996402, 100, 2, + 0.30000000000000004 }, + { 733.40061037838507, 100, 2, + 0.39999999999999991 }, + { 604.19889304940330, 100, 2, + 0.50000000000000000 }, + { 226.90362556629168, 100, 2, + 0.60000000000000009 }, + { 768.31676011669970, 100, 2, + 0.69999999999999996 }, + { -489.68041725865896, 100, 2, + 0.80000000000000004 }, + { -1005.9604880760811, 100, 2, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 2, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=2. +template <typename Tp> +void test031() +{ + 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(data031) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data031[i].l), Tp(data031[i].m), + Tp(data031[i].x)); + const Tp f0 = data031[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)); +} + +// Test data for l=100, m=5. +testcase_assoc_legendre<double> data032[] = { + { 0.0000000000000000, 100, 5, + -1.0000000000000000 }, + { 900551126.09653592, 100, 5, + -0.90000000000000002 }, + { 988567431.55756044, 100, 5, + -0.80000000000000004 }, + { -645646451.90344620, 100, 5, + -0.69999999999999996 }, + { -897114585.29920745, 100, 5, + -0.59999999999999998 }, + { -661710744.42483830, 100, 5, + -0.50000000000000000 }, + { 380163158.51425594, 100, 5, + -0.40000000000000002 }, + { 617391071.36632609, 100, 5, + -0.30000000000000004 }, + { -805288801.85509181, 100, 5, + -0.19999999999999996 }, + { 481041740.16728652, 100, 5, + -0.099999999999999978 }, + { 0.0000000000000000, 100, 5, + 0.0000000000000000 }, + { -481041740.16729414, 100, 5, + 0.10000000000000009 }, + { 805288801.85509181, 100, 5, + 0.19999999999999996 }, + { -617391071.36632609, 100, 5, + 0.30000000000000004 }, + { -380163158.51424748, 100, 5, + 0.39999999999999991 }, + { 661710744.42483830, 100, 5, + 0.50000000000000000 }, + { 897114585.29920506, 100, 5, + 0.60000000000000009 }, + { 645646451.90344620, 100, 5, + 0.69999999999999996 }, + { -988567431.55756044, 100, 5, + 0.80000000000000004 }, + { -900551126.09655809, 100, 5, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 5, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=5. +template <typename Tp> +void test032() +{ + 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(data032) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data032[i].l), Tp(data032[i].m), + Tp(data032[i].x)); + const Tp f0 = data032[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)); +} + +// Test data for l=100, m=10. +testcase_assoc_legendre<double> data033[] = { + { 0.0000000000000000, 100, 10, + -1.0000000000000000 }, + { 2.5643395957658915e+17, 100, 10, + -0.90000000000000002 }, + { 1.5778673545673316e+18, 100, 10, + -0.80000000000000004 }, + { 4.4355048487496776e+18, 100, 10, + -0.69999999999999996 }, + { -9.5936111659124493e+17, 100, 10, + -0.59999999999999998 }, + { 4.2387123021963372e+18, 100, 10, + -0.50000000000000000 }, + { 8.2370834618426563e+18, 100, 10, + -0.40000000000000002 }, + { -4.9089358388052890e+18, 100, 10, + -0.30000000000000004 }, + { -2.3468810358091279e+18, 100, 10, + -0.19999999999999996 }, + { 6.8627855225034568e+18, 100, 10, + -0.099999999999999978 }, + { -8.2494597181670380e+18, 100, 10, + 0.0000000000000000 }, + { 6.8627855225034056e+18, 100, 10, + 0.10000000000000009 }, + { -2.3468810358091279e+18, 100, 10, + 0.19999999999999996 }, + { -4.9089358388052890e+18, 100, 10, + 0.30000000000000004 }, + { 8.2370834618426747e+18, 100, 10, + 0.39999999999999991 }, + { 4.2387123021963372e+18, 100, 10, + 0.50000000000000000 }, + { -9.5936111659112115e+17, 100, 10, + 0.60000000000000009 }, + { 4.4355048487496776e+18, 100, 10, + 0.69999999999999996 }, + { 1.5778673545673316e+18, 100, 10, + 0.80000000000000004 }, + { 2.5643395957690282e+17, 100, 10, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 10, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=10. +template <typename Tp> +void test033() +{ + 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(data033) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data033[i].l), Tp(data033[i].m), + Tp(data033[i].x)); + const Tp f0 = data033[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.5000000000000014e-11)); +} + +// Test data for l=100, m=20. +testcase_assoc_legendre<double> data034[] = { + { 0.0000000000000000, 100, 20, + -1.0000000000000000 }, + { 7.1604344878778576e+37, 100, 20, + -0.90000000000000002 }, + { -8.3963895116962035e+38, 100, 20, + -0.80000000000000004 }, + { 7.9022236853110024e+38, 100, 20, + -0.69999999999999996 }, + { 8.2680005574120908e+38, 100, 20, + -0.59999999999999998 }, + { 3.0750497039999469e+38, 100, 20, + -0.50000000000000000 }, + { -7.6120586043843874e+38, 100, 20, + -0.40000000000000002 }, + { 1.1474496891901873e+38, 100, 20, + -0.30000000000000004 }, + { 4.3966251307444218e+38, 100, 20, + -0.19999999999999996 }, + { -7.0503266451702621e+38, 100, 20, + -0.099999999999999978 }, + { 7.7727439836159581e+38, 100, 20, + 0.0000000000000000 }, + { -7.0503266451702213e+38, 100, 20, + 0.10000000000000009 }, + { 4.3966251307444218e+38, 100, 20, + 0.19999999999999996 }, + { 1.1474496891901873e+38, 100, 20, + 0.30000000000000004 }, + { -7.6120586043843511e+38, 100, 20, + 0.39999999999999991 }, + { 3.0750497039999469e+38, 100, 20, + 0.50000000000000000 }, + { 8.2680005574120424e+38, 100, 20, + 0.60000000000000009 }, + { 7.9022236853110024e+38, 100, 20, + 0.69999999999999996 }, + { -8.3963895116962035e+38, 100, 20, + 0.80000000000000004 }, + { 7.1604344878809460e+37, 100, 20, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 20, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=20. +template <typename Tp> +void test034() +{ + 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(data034) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data034[i].l), Tp(data034[i].m), + Tp(data034[i].x)); + const Tp f0 = data034[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.5000000000000015e-12)); +} + +// Test data for l=100, m=50. +testcase_assoc_legendre<double> data035[] = { + { 0.0000000000000000, 100, 50, + -1.0000000000000000 }, + { 9.3231278516893773e+96, 100, 50, + -0.90000000000000002 }, + { -1.1029797977454331e+98, 100, 50, + -0.80000000000000004 }, + { 1.8089333903465883e+97, 100, 50, + -0.69999999999999996 }, + { 5.9364045925669389e+97, 100, 50, + -0.59999999999999998 }, + { -8.2252620339727163e+97, 100, 50, + -0.50000000000000000 }, + { 7.1431385093739848e+97, 100, 50, + -0.40000000000000002 }, + { -3.3520602067479374e+97, 100, 50, + -0.30000000000000004 }, + { -2.7791149588121386e+97, 100, 50, + -0.19999999999999996 }, + { 9.0119338550180433e+97, 100, 50, + -0.099999999999999978 }, + { -1.1712145031578381e+98, 100, 50, + 0.0000000000000000 }, + { 9.0119338550181176e+97, 100, 50, + 0.10000000000000009 }, + { -2.7791149588121386e+97, 100, 50, + 0.19999999999999996 }, + { -3.3520602067479374e+97, 100, 50, + 0.30000000000000004 }, + { 7.1431385093740728e+97, 100, 50, + 0.39999999999999991 }, + { -8.2252620339727163e+97, 100, 50, + 0.50000000000000000 }, + { 5.9364045925668061e+97, 100, 50, + 0.60000000000000009 }, + { 1.8089333903465883e+97, 100, 50, + 0.69999999999999996 }, + { -1.1029797977454331e+98, 100, 50, + 0.80000000000000004 }, + { 9.3231278516894892e+96, 100, 50, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 50, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=50. +template <typename Tp> +void test035() +{ + 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(data035) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data035[i].l), Tp(data035[i].m), + Tp(data035[i].x)); + const Tp f0 = data035[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(1.0000000000000008e-12)); +} + +// Test data for l=100, m=100. +testcase_assoc_legendre<double> data036[] = { + { 0.0000000000000000, 100, 100, + -1.0000000000000000 }, + { 5.7751792255758316e+150, 100, 100, + -0.90000000000000002 }, + { 4.3552236041585515e+164, 100, 100, + -0.80000000000000004 }, + { 1.5936546850595123e+172, 100, 100, + -0.69999999999999996 }, + { 1.3579510590289176e+177, 100, 100, + -0.59999999999999998 }, + { 3.7752749682889513e+180, 100, 100, + -0.50000000000000000 }, + { 1.0910627330458913e+183, 100, 100, + -0.40000000000000002 }, + { 5.9697347526822483e+184, 100, 100, + -0.30000000000000004 }, + { 8.6585879147526714e+185, 100, 100, + -0.19999999999999996 }, + { 4.0331571908057011e+186, 100, 100, + -0.099999999999999978 }, + { 6.6663086700729543e+186, 100, 100, + 0.0000000000000000 }, + { 4.0331571908057011e+186, 100, 100, + 0.10000000000000009 }, + { 8.6585879147526714e+185, 100, 100, + 0.19999999999999996 }, + { 5.9697347526822483e+184, 100, 100, + 0.30000000000000004 }, + { 1.0910627330458913e+183, 100, 100, + 0.39999999999999991 }, + { 3.7752749682889513e+180, 100, 100, + 0.50000000000000000 }, + { 1.3579510590289000e+177, 100, 100, + 0.60000000000000009 }, + { 1.5936546850595123e+172, 100, 100, + 0.69999999999999996 }, + { 4.3552236041585515e+164, 100, 100, + 0.80000000000000004 }, + { 5.7751792255761289e+150, 100, 100, + 0.89999999999999991 }, + { 0.0000000000000000, 100, 100, + 1.0000000000000000 }, +}; + +// Test function for l=100, m=100. +template <typename Tp> +void test036() +{ + 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(data036) + / sizeof(testcase_assoc_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::assoc_legendre(Tp(data036[i].l), Tp(data036[i].m), + Tp(data036[i].x)); + const Tp f0 = data036[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>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile.cc new file mode 100644 index 00000000000..a18b05f74a7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile.cc @@ -0,0 +1,44 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile_2.cc new file mode 100644 index 00000000000..2fe173022d7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/02_assoc_legendre/compile_2.cc @@ -0,0 +1,44 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_nan.cc new file mode 100644 index 00000000000..ca8246c4e72 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_nan.cc @@ -0,0 +1,87 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_value.cc new file mode 100644 index 00000000000..8f8a4a74a78 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/check_value.cc @@ -0,0 +1,466 @@ +// 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. + +// beta + + +// 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 for x=10.000000000000000. +testcase_beta<double> data001[] = { + { 1.0825088224469029e-06, 10.000000000000000, 10.000000000000000 }, + { 4.9925087406346778e-09, 10.000000000000000, 20.000000000000000 }, + { 1.5729567312509485e-10, 10.000000000000000, 30.000000000000000 }, + { 1.2168673582561288e-11, 10.000000000000000, 40.000000000000000 }, + { 1.5916380099863291e-12, 10.000000000000000, 50.000000000000000 }, + { 2.9408957938463963e-13, 10.000000000000000, 60.000000000000000 }, + { 6.9411637980691676e-14, 10.000000000000000, 70.000000000000000 }, + { 1.9665612972502651e-14, 10.000000000000000, 80.000000000000000 }, + { 6.4187824828154399e-15, 10.000000000000000, 90.000000000000000 }, + { 2.3455339739604842e-15, 10.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=10.000000000000000. +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_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data001[i].x), Tp(data001[i].y)); + 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.0000000000000029e-12)); +} + +// Test data for x=20.000000000000000. +testcase_beta<double> data002[] = { + { 4.9925087406346778e-09, 20.000000000000000, 10.000000000000000 }, + { 7.2544445519248436e-13, 20.000000000000000, 20.000000000000000 }, + { 1.7681885473062028e-15, 20.000000000000000, 30.000000000000000 }, + { 1.7891885039182335e-17, 20.000000000000000, 40.000000000000000 }, + { 4.3240677875623635e-19, 20.000000000000000, 50.000000000000000 }, + { 1.8857342309689050e-20, 20.000000000000000, 60.000000000000000 }, + { 1.2609804003539998e-21, 20.000000000000000, 70.000000000000000 }, + { 1.1660809542079041e-22, 20.000000000000000, 80.000000000000000 }, + { 1.3907944279729071e-23, 20.000000000000000, 90.000000000000000 }, + { 2.0365059099917614e-24, 20.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=20.000000000000000. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data002[i].x), Tp(data002[i].y)); + const Tp f0 = data002[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)); +} + +// Test data for x=30.000000000000000. +testcase_beta<double> data003[] = { + { 1.5729567312509485e-10, 30.000000000000000, 10.000000000000000 }, + { 1.7681885473062028e-15, 30.000000000000000, 20.000000000000000 }, + { 5.6370779640482451e-19, 30.000000000000000, 30.000000000000000 }, + { 1.0539424603796547e-21, 30.000000000000000, 40.000000000000000 }, + { 6.0118197777273836e-24, 30.000000000000000, 50.000000000000000 }, + { 7.4279528553260165e-26, 30.000000000000000, 60.000000000000000 }, + { 1.6212207780604767e-27, 30.000000000000000, 70.000000000000000 }, + { 5.4783729715317616e-29, 30.000000000000000, 80.000000000000000 }, + { 2.6183005659681346e-30, 30.000000000000000, 90.000000000000000 }, + { 1.6587948222122229e-31, 30.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=30.000000000000000. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data003[i].x), Tp(data003[i].y)); + const Tp f0 = data003[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)); +} + +// Test data for x=40.000000000000000. +testcase_beta<double> data004[] = { + { 1.2168673582561288e-11, 40.000000000000000, 10.000000000000000 }, + { 1.7891885039182335e-17, 40.000000000000000, 20.000000000000000 }, + { 1.0539424603796547e-21, 40.000000000000000, 30.000000000000000 }, + { 4.6508509140090659e-25, 40.000000000000000, 40.000000000000000 }, + { 7.5161712118557719e-28, 40.000000000000000, 50.000000000000000 }, + { 3.0311331979886071e-30, 40.000000000000000, 60.000000000000000 }, + { 2.4175035070466313e-32, 40.000000000000000, 70.000000000000000 }, + { 3.2734839142758369e-34, 40.000000000000000, 80.000000000000000 }, + { 6.7690629601315579e-36, 40.000000000000000, 90.000000000000000 }, + { 1.9797337118812366e-37, 40.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=40.000000000000000. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data004[i].x), Tp(data004[i].y)); + const Tp f0 = data004[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.5000000000000015e-12)); +} + +// Test data for x=50.000000000000000. +testcase_beta<double> data005[] = { + { 1.5916380099863291e-12, 50.000000000000000, 10.000000000000000 }, + { 4.3240677875623635e-19, 50.000000000000000, 20.000000000000000 }, + { 6.0118197777273836e-24, 50.000000000000000, 30.000000000000000 }, + { 7.5161712118557719e-28, 50.000000000000000, 40.000000000000000 }, + { 3.9646612085674138e-31, 50.000000000000000, 50.000000000000000 }, + { 5.8425643906418403e-34, 50.000000000000000, 60.000000000000000 }, + { 1.8672362180783552e-36, 50.000000000000000, 70.000000000000000 }, + { 1.0939382296458962e-38, 50.000000000000000, 80.000000000000000 }, + { 1.0442781609881063e-40, 50.000000000000000, 90.000000000000000 }, + { 1.4904121110954370e-42, 50.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=50.000000000000000. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data005[i].x), Tp(data005[i].y)); + const Tp f0 = data005[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)); +} + +// Test data for x=60.000000000000000. +testcase_beta<double> data006[] = { + { 2.9408957938463963e-13, 60.000000000000000, 10.000000000000000 }, + { 1.8857342309689050e-20, 60.000000000000000, 20.000000000000000 }, + { 7.4279528553260165e-26, 60.000000000000000, 30.000000000000000 }, + { 3.0311331979886071e-30, 60.000000000000000, 40.000000000000000 }, + { 5.8425643906418403e-34, 60.000000000000000, 50.000000000000000 }, + { 3.4501231469782229e-37, 60.000000000000000, 60.000000000000000 }, + { 4.7706855386086599e-40, 60.000000000000000, 70.000000000000000 }, + { 1.2902663809722593e-42, 60.000000000000000, 80.000000000000000 }, + { 6.0105571058570508e-45, 60.000000000000000, 90.000000000000000 }, + { 4.3922898898347209e-47, 60.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=60.000000000000000. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data006[i].x), Tp(data006[i].y)); + const Tp f0 = data006[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(1.0000000000000008e-12)); +} + +// Test data for x=70.000000000000000. +testcase_beta<double> data007[] = { + { 6.9411637980691676e-14, 70.000000000000000, 10.000000000000000 }, + { 1.2609804003539998e-21, 70.000000000000000, 20.000000000000000 }, + { 1.6212207780604767e-27, 70.000000000000000, 30.000000000000000 }, + { 2.4175035070466313e-32, 70.000000000000000, 40.000000000000000 }, + { 1.8672362180783552e-36, 70.000000000000000, 50.000000000000000 }, + { 4.7706855386086599e-40, 70.000000000000000, 60.000000000000000 }, + { 3.0453137143486369e-43, 70.000000000000000, 70.000000000000000 }, + { 4.0192274082013779e-46, 70.000000000000000, 80.000000000000000 }, + { 9.5865870063501807e-49, 70.000000000000000, 90.000000000000000 }, + { 3.7409127305819802e-51, 70.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=70.000000000000000. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data007[i].x), Tp(data007[i].y)); + const Tp f0 = data007[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(1.0000000000000008e-12)); +} + +// Test data for x=80.000000000000000. +testcase_beta<double> data008[] = { + { 1.9665612972502651e-14, 80.000000000000000, 10.000000000000000 }, + { 1.1660809542079041e-22, 80.000000000000000, 20.000000000000000 }, + { 5.4783729715317616e-29, 80.000000000000000, 30.000000000000000 }, + { 3.2734839142758369e-34, 80.000000000000000, 40.000000000000000 }, + { 1.0939382296458962e-38, 80.000000000000000, 50.000000000000000 }, + { 1.2902663809722593e-42, 80.000000000000000, 60.000000000000000 }, + { 4.0192274082013779e-46, 80.000000000000000, 70.000000000000000 }, + { 2.7160590828669411e-49, 80.000000000000000, 80.000000000000000 }, + { 3.4593773902125368e-52, 80.000000000000000, 90.000000000000000 }, + { 7.4807039968503468e-55, 80.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=80.000000000000000. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data008[i].x), Tp(data008[i].y)); + const Tp f0 = data008[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.0000000000000029e-12)); +} + +// Test data for x=90.000000000000000. +testcase_beta<double> data009[] = { + { 6.4187824828154399e-15, 90.000000000000000, 10.000000000000000 }, + { 1.3907944279729071e-23, 90.000000000000000, 20.000000000000000 }, + { 2.6183005659681346e-30, 90.000000000000000, 30.000000000000000 }, + { 6.7690629601315579e-36, 90.000000000000000, 40.000000000000000 }, + { 1.0442781609881063e-40, 90.000000000000000, 50.000000000000000 }, + { 6.0105571058570508e-45, 90.000000000000000, 60.000000000000000 }, + { 9.5865870063501807e-49, 90.000000000000000, 70.000000000000000 }, + { 3.4593773902125368e-52, 90.000000000000000, 80.000000000000000 }, + { 2.4416737907558032e-55, 90.000000000000000, 90.000000000000000 }, + { 3.0238531916564246e-58, 90.000000000000000, 100.00000000000000 }, +}; + +// Test function for x=90.000000000000000. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data009[i].x), Tp(data009[i].y)); + const Tp f0 = data009[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(1.0000000000000008e-12)); +} + +// Test data for x=100.00000000000000. +testcase_beta<double> data010[] = { + { 2.3455339739604842e-15, 100.00000000000000, 10.000000000000000 }, + { 2.0365059099917614e-24, 100.00000000000000, 20.000000000000000 }, + { 1.6587948222122229e-31, 100.00000000000000, 30.000000000000000 }, + { 1.9797337118812366e-37, 100.00000000000000, 40.000000000000000 }, + { 1.4904121110954370e-42, 100.00000000000000, 50.000000000000000 }, + { 4.3922898898347209e-47, 100.00000000000000, 60.000000000000000 }, + { 3.7409127305819802e-51, 100.00000000000000, 70.000000000000000 }, + { 7.4807039968503468e-55, 100.00000000000000, 80.000000000000000 }, + { 3.0238531916564246e-58, 100.00000000000000, 90.000000000000000 }, + { 2.2087606931991853e-61, 100.00000000000000, 100.00000000000000 }, +}; + +// Test function for x=100.00000000000000. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_beta<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::beta(Tp(data010[i].x), Tp(data010[i].y)); + const Tp f0 = data010[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.0000000000000029e-12)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile.cc new file mode 100644 index 00000000000..a689c95a4aa --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile_2.cc new file mode 100644 index 00000000000..68d5b20cfb3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/03_beta/compile_2.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_nan.cc new file mode 100644 index 00000000000..f5a0e9b74ca --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_nan.cc @@ -0,0 +1,57 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_value.cc new file mode 100644 index 00000000000..7fda191f00d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/check_value.cc @@ -0,0 +1,97 @@ +// 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; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile.cc new file mode 100644 index 00000000000..b72f5b64f83 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile_2.cc new file mode 100644 index 00000000000..ec52fcb019e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/04_comp_ellint_1/compile_2.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_nan.cc new file mode 100644 index 00000000000..b30c77a7555 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_nan.cc @@ -0,0 +1,57 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_value.cc new file mode 100644 index 00000000000..9fd6a06b665 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/check_value.cc @@ -0,0 +1,97 @@ +// 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; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile.cc new file mode 100644 index 00000000000..5ac3d2bf3c9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile_2.cc new file mode 100644 index 00000000000..7f2c0b8d03e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/05_comp_ellint_2/compile_2.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_nan.cc new file mode 100644 index 00000000000..b928eab7642 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_nan.cc @@ -0,0 +1,87 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_value.cc new file mode 100644 index 00000000000..4d4e78be662 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/check_value.cc @@ -0,0 +1,844 @@ +// 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_3 + + +// 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 for k=-0.90000000000000002. +testcase_comp_ellint_3<double> data001[] = { + { 2.2805491384227703, -0.90000000000000002, 0.0000000000000000 }, + { 2.1537868513875287, -0.90000000000000002, 0.10000000000000001 }, + { 2.0443194576468890, -0.90000000000000002, 0.20000000000000001 }, + { 1.9486280260314426, -0.90000000000000002, 0.29999999999999999 }, + { 1.8641114227238349, -0.90000000000000002, 0.40000000000000002 }, + { 1.7888013241937861, -0.90000000000000002, 0.50000000000000000 }, + { 1.7211781128919523, -0.90000000000000002, 0.59999999999999998 }, + { 1.6600480747670938, -0.90000000000000002, 0.69999999999999996 }, + { 1.6044591960982204, -0.90000000000000002, 0.80000000000000004 }, + { 1.5536420236310946, -0.90000000000000002, 0.90000000000000002 }, +}; + +// Test function for k=-0.90000000000000002. +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_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data001[i].k), Tp(data001[i].nu)); + 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)); +} + +// Test data for k=-0.80000000000000004. +testcase_comp_ellint_3<double> data002[] = { + { 1.9953027776647296, -0.80000000000000004, 0.0000000000000000 }, + { 1.8910755418379521, -0.80000000000000004, 0.10000000000000001 }, + { 1.8007226661734588, -0.80000000000000004, 0.20000000000000001 }, + { 1.7214611048717301, -0.80000000000000004, 0.29999999999999999 }, + { 1.6512267838651289, -0.80000000000000004, 0.40000000000000002 }, + { 1.5884528947755532, -0.80000000000000004, 0.50000000000000000 }, + { 1.5319262547427865, -0.80000000000000004, 0.59999999999999998 }, + { 1.4806912324625332, -0.80000000000000004, 0.69999999999999996 }, + { 1.4339837018309474, -0.80000000000000004, 0.80000000000000004 }, + { 1.3911845406776222, -0.80000000000000004, 0.90000000000000002 }, +}; + +// Test function for k=-0.80000000000000004. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data002[i].k), Tp(data002[i].nu)); + const Tp f0 = data002[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)); +} + +// Test data for k=-0.69999999999999996. +testcase_comp_ellint_3<double> data003[] = { + { 1.8456939983747236, -0.69999999999999996, 0.0000000000000000 }, + { 1.7528050171757608, -0.69999999999999996, 0.10000000000000001 }, + { 1.6721098780092147, -0.69999999999999996, 0.20000000000000001 }, + { 1.6011813647733213, -0.69999999999999996, 0.29999999999999999 }, + { 1.5382162002954762, -0.69999999999999996, 0.40000000000000002 }, + { 1.4818433192178544, -0.69999999999999996, 0.50000000000000000 }, + { 1.4309994736080540, -0.69999999999999996, 0.59999999999999998 }, + { 1.3848459188329196, -0.69999999999999996, 0.69999999999999996 }, + { 1.3427110650397533, -0.69999999999999996, 0.80000000000000004 }, + { 1.3040500499695911, -0.69999999999999996, 0.90000000000000002 }, +}; + +// Test function for k=-0.69999999999999996. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data003[i].k), Tp(data003[i].nu)); + const Tp f0 = data003[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)); +} + +// Test data for k=-0.59999999999999998. +testcase_comp_ellint_3<double> data004[] = { + { 1.7507538029157526, -0.59999999999999998, 0.0000000000000000 }, + { 1.6648615773343014, -0.59999999999999998, 0.10000000000000001 }, + { 1.5901418016279374, -0.59999999999999998, 0.20000000000000001 }, + { 1.5243814243493585, -0.59999999999999998, 0.29999999999999999 }, + { 1.4659345278069984, -0.59999999999999998, 0.40000000000000002 }, + { 1.4135484285693078, -0.59999999999999998, 0.50000000000000000 }, + { 1.3662507535812816, -0.59999999999999998, 0.59999999999999998 }, + { 1.3232737468822811, -0.59999999999999998, 0.69999999999999996 }, + { 1.2840021261752192, -0.59999999999999998, 0.80000000000000004 }, + { 1.2479362973851875, -0.59999999999999998, 0.90000000000000002 }, +}; + +// Test function for k=-0.59999999999999998. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data004[i].k), Tp(data004[i].nu)); + const Tp f0 = data004[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)); +} + +// Test data for k=-0.50000000000000000. +testcase_comp_ellint_3<double> data005[] = { + { 1.6857503548125963, -0.50000000000000000, 0.0000000000000000 }, + { 1.6045524936084892, -0.50000000000000000, 0.10000000000000001 }, + { 1.5338490483665983, -0.50000000000000000, 0.20000000000000001 }, + { 1.4715681939859637, -0.50000000000000000, 0.29999999999999999 }, + { 1.4161679518465340, -0.50000000000000000, 0.40000000000000002 }, + { 1.3664739530045971, -0.50000000000000000, 0.50000000000000000 }, + { 1.3215740290190876, -0.50000000000000000, 0.59999999999999998 }, + { 1.2807475181182502, -0.50000000000000000, 0.69999999999999996 }, + { 1.2434165408189539, -0.50000000000000000, 0.80000000000000004 }, + { 1.2091116095504744, -0.50000000000000000, 0.90000000000000002 }, +}; + +// Test function for k=-0.50000000000000000. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data005[i].k), Tp(data005[i].nu)); + const Tp f0 = data005[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)); +} + +// Test data for k=-0.40000000000000002. +testcase_comp_ellint_3<double> data006[] = { + { 1.6399998658645112, -0.40000000000000002, 0.0000000000000000 }, + { 1.5620566886683604, -0.40000000000000002, 0.10000000000000001 }, + { 1.4941414344266770, -0.40000000000000002, 0.20000000000000001 }, + { 1.4342789859950078, -0.40000000000000002, 0.29999999999999999 }, + { 1.3809986210732901, -0.40000000000000002, 0.40000000000000002 }, + { 1.3331797176377398, -0.40000000000000002, 0.50000000000000000 }, + { 1.2899514672527024, -0.40000000000000002, 0.59999999999999998 }, + { 1.2506255923253344, -0.40000000000000002, 0.69999999999999996 }, + { 1.2146499565727209, -0.40000000000000002, 0.80000000000000004 }, + { 1.1815758115929846, -0.40000000000000002, 0.90000000000000002 }, +}; + +// Test function for k=-0.40000000000000002. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data006[i].k), Tp(data006[i].nu)); + const Tp f0 = data006[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)); +} + +// Test data for k=-0.30000000000000004. +testcase_comp_ellint_3<double> data007[] = { + { 1.6080486199305126, -0.30000000000000004, 0.0000000000000000 }, + { 1.5323534693557526, -0.30000000000000004, 0.10000000000000001 }, + { 1.4663658145259875, -0.30000000000000004, 0.20000000000000001 }, + { 1.4081767433479089, -0.30000000000000004, 0.29999999999999999 }, + { 1.3563643538969761, -0.30000000000000004, 0.40000000000000002 }, + { 1.3098448759814960, -0.30000000000000004, 0.50000000000000000 }, + { 1.2677758800420666, -0.30000000000000004, 0.59999999999999998 }, + { 1.2294913236274980, -0.30000000000000004, 0.69999999999999996 }, + { 1.1944567571590046, -0.30000000000000004, 0.80000000000000004 }, + { 1.1622376896064912, -0.30000000000000004, 0.90000000000000002 }, +}; + +// Test function for k=-0.30000000000000004. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data007[i].k), Tp(data007[i].nu)); + const Tp f0 = data007[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)); +} + +// Test data for k=-0.19999999999999996. +testcase_comp_ellint_3<double> data008[] = { + { 1.5868678474541664, -0.19999999999999996, 0.0000000000000000 }, + { 1.5126513474261092, -0.19999999999999996, 0.10000000000000001 }, + { 1.4479323932249568, -0.19999999999999996, 0.20000000000000001 }, + { 1.3908453514752481, -0.19999999999999996, 0.29999999999999999 }, + { 1.3400002519661010, -0.19999999999999996, 0.40000000000000002 }, + { 1.2943374404397376, -0.19999999999999996, 0.50000000000000000 }, + { 1.2530330675914561, -0.19999999999999996, 0.59999999999999998 }, + { 1.2154356555075867, -0.19999999999999996, 0.69999999999999996 }, + { 1.1810223448909913, -0.19999999999999996, 0.80000000000000004 }, + { 1.1493679916141863, -0.19999999999999996, 0.90000000000000002 }, +}; + +// Test function for k=-0.19999999999999996. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data008[i].k), Tp(data008[i].nu)); + const Tp f0 = data008[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)); +} + +// Test data for k=-0.099999999999999978. +testcase_comp_ellint_3<double> data009[] = { + { 1.5747455615173562, -0.099999999999999978, 0.0000000000000000 }, + { 1.5013711111199950, -0.099999999999999978, 0.10000000000000001 }, + { 1.4373749386463430, -0.099999999999999978, 0.20000000000000001 }, + { 1.3809159606704959, -0.099999999999999978, 0.29999999999999999 }, + { 1.3306223265207477, -0.099999999999999978, 0.40000000000000002 }, + { 1.2854480708580160, -0.099999999999999978, 0.50000000000000000 }, + { 1.2445798942989255, -0.099999999999999978, 0.59999999999999998 }, + { 1.2073745911083187, -0.099999999999999978, 0.69999999999999996 }, + { 1.1733158866987732, -0.099999999999999978, 0.80000000000000004 }, + { 1.1419839485283374, -0.099999999999999978, 0.90000000000000002 }, +}; + +// Test function for k=-0.099999999999999978. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data009[i].k), Tp(data009[i].nu)); + const Tp f0 = data009[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)); +} + +// Test data for k=0.0000000000000000. +testcase_comp_ellint_3<double> data010[] = { + { 1.5707963267948966, 0.0000000000000000, 0.0000000000000000 }, + { 1.4976955329233277, 0.0000000000000000, 0.10000000000000001 }, + { 1.4339343023863691, 0.0000000000000000, 0.20000000000000001 }, + { 1.3776795151134889, 0.0000000000000000, 0.29999999999999999 }, + { 1.3275651989026322, 0.0000000000000000, 0.40000000000000002 }, + { 1.2825498301618641, 0.0000000000000000, 0.50000000000000000 }, + { 1.2418235332245127, 0.0000000000000000, 0.59999999999999998 }, + { 1.2047457872617382, 0.0000000000000000, 0.69999999999999996 }, + { 1.1708024551734544, 0.0000000000000000, 0.80000000000000004 }, + { 1.1395754288497419, 0.0000000000000000, 0.90000000000000002 }, +}; + +// Test function for k=0.0000000000000000. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data010[i].k), Tp(data010[i].nu)); + const Tp f0 = data010[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)); +} + +// Test data for k=0.10000000000000009. +testcase_comp_ellint_3<double> data011[] = { + { 1.5747455615173562, 0.10000000000000009, 0.0000000000000000 }, + { 1.5013711111199950, 0.10000000000000009, 0.10000000000000001 }, + { 1.4373749386463430, 0.10000000000000009, 0.20000000000000001 }, + { 1.3809159606704959, 0.10000000000000009, 0.29999999999999999 }, + { 1.3306223265207477, 0.10000000000000009, 0.40000000000000002 }, + { 1.2854480708580160, 0.10000000000000009, 0.50000000000000000 }, + { 1.2445798942989255, 0.10000000000000009, 0.59999999999999998 }, + { 1.2073745911083187, 0.10000000000000009, 0.69999999999999996 }, + { 1.1733158866987732, 0.10000000000000009, 0.80000000000000004 }, + { 1.1419839485283374, 0.10000000000000009, 0.90000000000000002 }, +}; + +// Test function for k=0.10000000000000009. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data011[i].k), Tp(data011[i].nu)); + const Tp f0 = data011[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)); +} + +// Test data for k=0.19999999999999996. +testcase_comp_ellint_3<double> data012[] = { + { 1.5868678474541664, 0.19999999999999996, 0.0000000000000000 }, + { 1.5126513474261092, 0.19999999999999996, 0.10000000000000001 }, + { 1.4479323932249568, 0.19999999999999996, 0.20000000000000001 }, + { 1.3908453514752481, 0.19999999999999996, 0.29999999999999999 }, + { 1.3400002519661010, 0.19999999999999996, 0.40000000000000002 }, + { 1.2943374404397376, 0.19999999999999996, 0.50000000000000000 }, + { 1.2530330675914561, 0.19999999999999996, 0.59999999999999998 }, + { 1.2154356555075867, 0.19999999999999996, 0.69999999999999996 }, + { 1.1810223448909913, 0.19999999999999996, 0.80000000000000004 }, + { 1.1493679916141863, 0.19999999999999996, 0.90000000000000002 }, +}; + +// Test function for k=0.19999999999999996. +template <typename Tp> +void test012() +{ + 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(data012) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data012[i].k), Tp(data012[i].nu)); + const Tp f0 = data012[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)); +} + +// Test data for k=0.30000000000000004. +testcase_comp_ellint_3<double> data013[] = { + { 1.6080486199305126, 0.30000000000000004, 0.0000000000000000 }, + { 1.5323534693557526, 0.30000000000000004, 0.10000000000000001 }, + { 1.4663658145259875, 0.30000000000000004, 0.20000000000000001 }, + { 1.4081767433479089, 0.30000000000000004, 0.29999999999999999 }, + { 1.3563643538969761, 0.30000000000000004, 0.40000000000000002 }, + { 1.3098448759814960, 0.30000000000000004, 0.50000000000000000 }, + { 1.2677758800420666, 0.30000000000000004, 0.59999999999999998 }, + { 1.2294913236274980, 0.30000000000000004, 0.69999999999999996 }, + { 1.1944567571590046, 0.30000000000000004, 0.80000000000000004 }, + { 1.1622376896064912, 0.30000000000000004, 0.90000000000000002 }, +}; + +// Test function for k=0.30000000000000004. +template <typename Tp> +void test013() +{ + 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(data013) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data013[i].k), Tp(data013[i].nu)); + const Tp f0 = data013[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)); +} + +// Test data for k=0.39999999999999991. +testcase_comp_ellint_3<double> data014[] = { + { 1.6399998658645112, 0.39999999999999991, 0.0000000000000000 }, + { 1.5620566886683604, 0.39999999999999991, 0.10000000000000001 }, + { 1.4941414344266770, 0.39999999999999991, 0.20000000000000001 }, + { 1.4342789859950078, 0.39999999999999991, 0.29999999999999999 }, + { 1.3809986210732901, 0.39999999999999991, 0.40000000000000002 }, + { 1.3331797176377398, 0.39999999999999991, 0.50000000000000000 }, + { 1.2899514672527024, 0.39999999999999991, 0.59999999999999998 }, + { 1.2506255923253344, 0.39999999999999991, 0.69999999999999996 }, + { 1.2146499565727209, 0.39999999999999991, 0.80000000000000004 }, + { 1.1815758115929846, 0.39999999999999991, 0.90000000000000002 }, +}; + +// Test function for k=0.39999999999999991. +template <typename Tp> +void test014() +{ + 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(data014) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data014[i].k), Tp(data014[i].nu)); + const Tp f0 = data014[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)); +} + +// Test data for k=0.50000000000000000. +testcase_comp_ellint_3<double> data015[] = { + { 1.6857503548125963, 0.50000000000000000, 0.0000000000000000 }, + { 1.6045524936084892, 0.50000000000000000, 0.10000000000000001 }, + { 1.5338490483665983, 0.50000000000000000, 0.20000000000000001 }, + { 1.4715681939859637, 0.50000000000000000, 0.29999999999999999 }, + { 1.4161679518465340, 0.50000000000000000, 0.40000000000000002 }, + { 1.3664739530045971, 0.50000000000000000, 0.50000000000000000 }, + { 1.3215740290190876, 0.50000000000000000, 0.59999999999999998 }, + { 1.2807475181182502, 0.50000000000000000, 0.69999999999999996 }, + { 1.2434165408189539, 0.50000000000000000, 0.80000000000000004 }, + { 1.2091116095504744, 0.50000000000000000, 0.90000000000000002 }, +}; + +// Test function for k=0.50000000000000000. +template <typename Tp> +void test015() +{ + 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(data015) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data015[i].k), Tp(data015[i].nu)); + const Tp f0 = data015[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)); +} + +// Test data for k=0.60000000000000009. +testcase_comp_ellint_3<double> data016[] = { + { 1.7507538029157526, 0.60000000000000009, 0.0000000000000000 }, + { 1.6648615773343014, 0.60000000000000009, 0.10000000000000001 }, + { 1.5901418016279374, 0.60000000000000009, 0.20000000000000001 }, + { 1.5243814243493585, 0.60000000000000009, 0.29999999999999999 }, + { 1.4659345278069984, 0.60000000000000009, 0.40000000000000002 }, + { 1.4135484285693078, 0.60000000000000009, 0.50000000000000000 }, + { 1.3662507535812816, 0.60000000000000009, 0.59999999999999998 }, + { 1.3232737468822811, 0.60000000000000009, 0.69999999999999996 }, + { 1.2840021261752192, 0.60000000000000009, 0.80000000000000004 }, + { 1.2479362973851875, 0.60000000000000009, 0.90000000000000002 }, +}; + +// Test function for k=0.60000000000000009. +template <typename Tp> +void test016() +{ + 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(data016) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data016[i].k), Tp(data016[i].nu)); + const Tp f0 = data016[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)); +} + +// Test data for k=0.69999999999999996. +testcase_comp_ellint_3<double> data017[] = { + { 1.8456939983747236, 0.69999999999999996, 0.0000000000000000 }, + { 1.7528050171757608, 0.69999999999999996, 0.10000000000000001 }, + { 1.6721098780092147, 0.69999999999999996, 0.20000000000000001 }, + { 1.6011813647733213, 0.69999999999999996, 0.29999999999999999 }, + { 1.5382162002954762, 0.69999999999999996, 0.40000000000000002 }, + { 1.4818433192178544, 0.69999999999999996, 0.50000000000000000 }, + { 1.4309994736080540, 0.69999999999999996, 0.59999999999999998 }, + { 1.3848459188329196, 0.69999999999999996, 0.69999999999999996 }, + { 1.3427110650397533, 0.69999999999999996, 0.80000000000000004 }, + { 1.3040500499695911, 0.69999999999999996, 0.90000000000000002 }, +}; + +// Test function for k=0.69999999999999996. +template <typename Tp> +void test017() +{ + 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(data017) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data017[i].k), Tp(data017[i].nu)); + const Tp f0 = data017[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)); +} + +// Test data for k=0.80000000000000004. +testcase_comp_ellint_3<double> data018[] = { + { 1.9953027776647296, 0.80000000000000004, 0.0000000000000000 }, + { 1.8910755418379521, 0.80000000000000004, 0.10000000000000001 }, + { 1.8007226661734588, 0.80000000000000004, 0.20000000000000001 }, + { 1.7214611048717301, 0.80000000000000004, 0.29999999999999999 }, + { 1.6512267838651289, 0.80000000000000004, 0.40000000000000002 }, + { 1.5884528947755532, 0.80000000000000004, 0.50000000000000000 }, + { 1.5319262547427865, 0.80000000000000004, 0.59999999999999998 }, + { 1.4806912324625332, 0.80000000000000004, 0.69999999999999996 }, + { 1.4339837018309474, 0.80000000000000004, 0.80000000000000004 }, + { 1.3911845406776222, 0.80000000000000004, 0.90000000000000002 }, +}; + +// Test function for k=0.80000000000000004. +template <typename Tp> +void test018() +{ + 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(data018) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data018[i].k), Tp(data018[i].nu)); + const Tp f0 = data018[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)); +} + +// Test data for k=0.89999999999999991. +testcase_comp_ellint_3<double> data019[] = { + { 2.2805491384227699, 0.89999999999999991, 0.0000000000000000 }, + { 2.1537868513875282, 0.89999999999999991, 0.10000000000000001 }, + { 2.0443194576468890, 0.89999999999999991, 0.20000000000000001 }, + { 1.9486280260314424, 0.89999999999999991, 0.29999999999999999 }, + { 1.8641114227238347, 0.89999999999999991, 0.40000000000000002 }, + { 1.7888013241937859, 0.89999999999999991, 0.50000000000000000 }, + { 1.7211781128919521, 0.89999999999999991, 0.59999999999999998 }, + { 1.6600480747670936, 0.89999999999999991, 0.69999999999999996 }, + { 1.6044591960982200, 0.89999999999999991, 0.80000000000000004 }, + { 1.5536420236310944, 0.89999999999999991, 0.90000000000000002 }, +}; + +// Test function for k=0.89999999999999991. +template <typename Tp> +void test019() +{ + 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(data019) + / sizeof(testcase_comp_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::comp_ellint_3(Tp(data019[i].k), Tp(data019[i].nu)); + const Tp f0 = data019[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>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile.cc new file mode 100644 index 00000000000..a4bbcb88b76 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile_2.cc new file mode 100644 index 00000000000..56319e537c3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/06_comp_ellint_3/compile_2.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_nan.cc new file mode 100644 index 00000000000..1f2bb40bd0c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_nan.cc @@ -0,0 +1,126 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_value.cc new file mode 100644 index 00000000000..a751448459c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/check_value.cc @@ -0,0 +1,5294 @@ +// 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. + +// conf_hyperg + + +// 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 for a=0.0000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data001[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=1.0000000000000000. +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_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data001[i].a), Tp(data001[i].c), + 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)); +} + +// Test data for a=0.0000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data002[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data002[i].a), Tp(data002[i].c), + Tp(data002[i].x)); + const Tp f0 = data002[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)); +} + +// Test data for a=0.0000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data003[] = { + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=3.0000000000000000. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data003[i].a), Tp(data003[i].c), + Tp(data003[i].x)); + const Tp f0 = data003[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)); +} + +// Test data for a=0.0000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data004[] = { + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data004[i].a), Tp(data004[i].c), + Tp(data004[i].x)); + const Tp f0 = data004[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)); +} + +// Test data for a=0.0000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data005[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=5.0000000000000000. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data005[i].a), Tp(data005[i].c), + Tp(data005[i].x)); + const Tp f0 = data005[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)); +} + +// Test data for a=0.0000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data006[] = { + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data006[i].a), Tp(data006[i].c), + Tp(data006[i].x)); + const Tp f0 = data006[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)); +} + +// Test data for a=0.0000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data007[] = { + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=7.0000000000000000. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data007[i].a), Tp(data007[i].c), + Tp(data007[i].x)); + const Tp f0 = data007[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)); +} + +// Test data for a=0.0000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data008[] = { + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data008[i].a), Tp(data008[i].c), + Tp(data008[i].x)); + const Tp f0 = data008[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)); +} + +// Test data for a=0.0000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data009[] = { + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=9.0000000000000000. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data009[i].a), Tp(data009[i].c), + Tp(data009[i].x)); + const Tp f0 = data009[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)); +} + +// Test data for a=0.0000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data010[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data010[i].a), Tp(data010[i].c), + Tp(data010[i].x)); + const Tp f0 = data010[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)); +} + +// Test data for a=0.50000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data011[] = { + { 0.18354081260932853, 0.50000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { 0.19419827762834704, 0.50000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { 0.20700192122398287, 0.50000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { 0.22280243801078498, 0.50000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { 0.24300035416182644, 0.50000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { 0.27004644161220326, 0.50000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { 0.30850832255367100, 0.50000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { 0.36743360905415834, 0.50000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 0.46575960759364043, 0.50000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { 0.64503527044915010, 0.50000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 1.7533876543770910, 0.50000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 3.4415238691253336, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 7.3801013214774045, 0.50000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 16.843983681258987, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 40.078445504076413, 0.50000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 98.033339697812551, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 244.33254130132133, 0.50000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 617.06403040562418, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 1573.6049422133683, 0.50000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 4042.7554308904046, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=1.0000000000000000. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data011[i].a), Tp(data011[i].c), + Tp(data011[i].x)); + const Tp f0 = data011[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(1.0000000000000006e-11)); +} + +// Test data for a=0.50000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data012[] = { + { 0.34751307955387079, 0.50000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { 0.36515709992587503, 0.50000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { 0.38575276072642301, 0.50000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 0.41020241461382889, 0.50000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.43982706745912625, 0.50000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { 0.47663109114346930, 0.50000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { 0.52377761180260862, 0.50000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { 0.58647299647508400, 0.50000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { 0.67367002294334866, 0.50000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { 0.80145607363402172, 0.50000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 1.3281918274866849, 0.50000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 1.9052621465543667, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 2.9805776178019903, 0.50000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 5.0906787293171654, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 9.4185650450425964, 0.50000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 18.627776225141986, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 38.823513069699615, 0.50000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 84.215287700426927, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 188.31125697734240, 0.50000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 431.02590173952245, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test012() +{ + 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(data012) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data012[i].a), Tp(data012[i].c), + Tp(data012[i].x)); + const Tp f0 = data012[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)); +} + +// Test data for a=0.50000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data013[] = { + { 0.44148780381255515, 0.50000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 0.46154890030153722, 0.50000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 0.48454520771815751, 0.50000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 0.51124131917976301, 0.50000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { 0.54269682032387934, 0.50000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { 0.58041888164962119, 0.50000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 0.62661371932049892, 0.50000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { 0.68461315644636744, 0.50000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { 0.75961975369132639, 0.50000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 0.86004702726553350, 0.50000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 1.2039946674617061, 0.50000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 1.5161750470251780, 0.50000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 2.0187596221024697, 0.50000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 2.8698033217756134, 0.50000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 4.3821186043144440, 0.50000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 7.1913541951514128, 0.50000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 12.620107286909638, 0.50000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 23.478926483036350, 0.50000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 45.852981860749004, 0.50000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 93.137265099245667, 0.50000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=3.0000000000000000. +template <typename Tp> +void test013() +{ + 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(data013) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data013[i].a), Tp(data013[i].c), + Tp(data013[i].x)); + const Tp f0 = data013[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)); +} + +// Test data for a=0.50000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data014[] = { + { 0.50723143075298227, 0.50000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { 0.52815420026166782, 0.50000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { 0.55181651516426766, 0.50000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { 0.57884767287882366, 0.50000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { 0.61008828324275399, 0.50000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 0.64668451853659259, 0.50000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.69023479867386495, 0.50000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { 0.74302365975861406, 0.50000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 0.80840402753201868, 0.50000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 0.89143814400301236, 0.50000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 1.1467204168940972, 0.50000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 1.3525055369951857, 0.50000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 1.6530571499633475, 0.50000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 2.1112387416058045, 0.50000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 2.8410480336278194, 0.50000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 4.0550562221854669, 0.50000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 6.1601039044778592, 0.50000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 9.9538034144264458, 0.50000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 17.034704868473899, 0.50000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 30.671445325428369, 0.50000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test014() +{ + 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(data014) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data014[i].a), Tp(data014[i].c), + Tp(data014[i].x)); + const Tp f0 = data014[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)); +} + +// Test data for a=0.50000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data015[] = { + { 0.55715239162383312, 0.50000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 0.57823135269518977, 0.50000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { 0.60181688556797253, 0.50000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 0.62842688147829928, 0.50000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 0.65873434489521876, 0.50000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 0.69362872731932568, 0.50000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { 0.73430741618153195, 0.50000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 0.78241503593870543, 0.50000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 0.84026013345254857, 0.50000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 0.91115976433208690, 0.50000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 1.1141687602185972, 0.50000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 1.2651443108002267, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 1.4712624889419719, 0.50000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 1.7626460645467978, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 2.1901779328181084, 0.50000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 2.8421796979457072, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 3.8760354586203549, 0.50000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 5.5792940156545505, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 8.4898429002463196, 0.50000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 13.636227878037923, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=5.0000000000000000. +template <typename Tp> +void test015() +{ + 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(data015) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data015[i].a), Tp(data015[i].c), + Tp(data015[i].x)); + const Tp f0 = data015[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)); +} + +// Test data for a=0.50000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data016[] = { + { 0.59687111919499192, 0.50000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 0.61774982278057033, 0.50000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 0.64090744485124451, 0.50000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 0.66677322792860194, 0.50000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 0.69589293014100995, 0.50000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { 0.72897040032571048, 0.50000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { 0.76692755408207181, 0.50000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 0.81099244559101891, 0.50000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 0.86283102401276535, 0.50000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.92474809223976406, 0.50000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 1.0932912594628821, 0.50000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 1.2115798426781204, 0.50000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 1.3654106750890422, 0.50000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 1.5711704305419896, 0.50000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 1.8549798357448213, 0.50000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 2.2595503871694818, 0.50000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 2.8565038772876936, 0.50000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 3.7689325736317811, 0.50000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 5.2134738554699460, 0.50000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 7.5801565545352725, 0.50000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test016() +{ + 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(data016) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data016[i].a), Tp(data016[i].c), + Tp(data016[i].x)); + const Tp f0 = data016[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)); +} + +// Test data for a=0.50000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data017[] = { + { 0.62946736953754090, 0.50000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 0.64995830964827050, 0.50000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 0.67251910396276349, 0.50000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 0.69750870596083636, 0.50000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { 0.72537539174856436, 0.50000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { 0.75668588434835504, 0.50000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 0.79216623458879654, 0.50000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 0.83276010491326891, 0.50000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 0.87971323375878940, 0.50000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.93469794840150233, 0.50000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 1.0788040971101556, 0.50000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 1.1756385516794761, 0.50000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 1.2970810749099917, 0.50000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 1.4529009687665237, 0.50000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 1.6579437149144023, 0.50000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 1.9353010489337750, 0.50000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 2.3217458547039813, 0.50000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 2.8772254607646004, 0.50000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 3.7017478151936545, 0.50000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 4.9659500648552148, 0.50000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=7.0000000000000000. +template <typename Tp> +void test017() +{ + 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(data017) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data017[i].a), Tp(data017[i].c), + Tp(data017[i].x)); + const Tp f0 = data017[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)); +} + +// Test data for a=0.50000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data018[] = { + { 0.65682574389601245, 0.50000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 0.67683106084440448, 0.50000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 0.69871884883136481, 0.50000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { 0.72279201131268422, 0.50000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { 0.74942315553647221, 0.50000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 0.77907555763819503, 0.50000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 0.81233192258476394, 0.50000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 0.84993438521252052, 0.50000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 0.89284095871461888, 0.50000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.94230641231038748, 0.50000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 1.0681796709163929, 0.50000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 1.1499542693515108, 0.50000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 1.2496850956712680, 0.50000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 1.3736119127266571, 0.50000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 1.5308465522192733, 0.50000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 1.7349787653671500, 0.50000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 2.0067188996039378, 0.50000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 2.3783255204306930, 0.50000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 2.9011558746255721, 0.50000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 3.6587666457431167, 0.50000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test018() +{ + 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(data018) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data018[i].a), Tp(data018[i].c), + Tp(data018[i].x)); + const Tp f0 = data018[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)); +} + +// Test data for a=0.50000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data019[] = { + { 0.68018654063475448, 0.50000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 0.69965870094538662, 0.50000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 0.72084701020942776, 0.50000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 0.74400928635822572, 0.50000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 0.76945859319172982, 0.50000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 0.79757868270124699, 0.50000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 0.82884476649794248, 0.50000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 0.86385180214855140, 0.50000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.90335351612716308, 0.50000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.94831697594473685, 0.50000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 1.0600626000640645, 0.50000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 1.1307298999505393, 0.50000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 1.2150341092774180, 0.50000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 1.3171798023006840, 0.50000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 1.4431045594091672, 0.50000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 1.6013540635087158, 0.50000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 1.8044714074708206, 0.50000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 2.0712406108144252, 0.50000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 2.4303714711293125, 0.50000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 2.9266541358556246, 0.50000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=9.0000000000000000. +template <typename Tp> +void test019() +{ + 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(data019) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data019[i].a), Tp(data019[i].c), + Tp(data019[i].x)); + const Tp f0 = data019[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)); +} + +// Test data for a=0.50000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data020[] = { + { 0.70040954461104077, 0.50000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 0.71933025737654377, 0.50000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 0.73981995758615049, 0.50000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 0.76209985272755054, 0.50000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 0.78643553963087975, 0.50000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 0.81314860510626796, 0.50000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 0.84263196565226672, 0.50000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 0.87537037798496642, 0.50000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.91196818568151450, 0.50000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.95318731786229316, 0.50000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 1.0536628587304602, 0.50000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 1.1158225648376323, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 1.1886686247111011, 0.50000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 1.2751576744751334, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 1.3793478044961116, 0.50000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 1.5069047234443802, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 1.6658803233122232, 0.50000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 1.8679295659745196, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 2.1302432955522042, 0.50000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 2.4786679001777268, 0.50000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test020() +{ + 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(data020) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data020[i].a), Tp(data020[i].c), + Tp(data020[i].x)); + const Tp f0 = data020[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)); +} + +// Test data for a=1.0000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data021[] = { + { 4.5399929762484854e-05, 1.0000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { 0.00012340980408667956, 1.0000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { 0.00033546262790251185, 1.0000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { 0.00091188196555451624, 1.0000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 1.0000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { 0.0067379469990854670, 1.0000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { 0.018315638888734179, 1.0000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { 0.049787068367863944, 1.0000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 0.13533528323661270, 1.0000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { 0.36787944117144233, 1.0000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 2.7182818284590451, 1.0000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 7.3890560989306504, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 20.085536923187668, 1.0000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 54.598150033144236, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 148.41315910257660, 1.0000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 403.42879349273511, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 1096.6331584284585, 1.0000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 2980.9579870417283, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 8103.0839275753842, 1.0000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 22026.465794806718, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=1.0000000000000000. +template <typename Tp> +void test021() +{ + 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(data021) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data021[i].a), Tp(data021[i].c), + Tp(data021[i].x)); + const Tp f0 = data021[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)); +} + +// Test data for a=1.0000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data022[] = { + { 0.099995460007023751, 1.0000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { 0.11109739891065704, 1.0000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { 0.12495806717151219, 1.0000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 0.14272687400492079, 1.0000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.16625354130388895, 1.0000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { 0.19865241060018290, 1.0000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { 0.24542109027781644, 1.0000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { 0.31673764387737868, 1.0000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { 0.43233235838169365, 1.0000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { 0.63212055882855767, 1.0000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 1.7182818284590451, 1.0000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 3.1945280494653252, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 6.3618456410625557, 1.0000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 13.399537508286059, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 29.482631820515319, 1.0000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 67.071465582122514, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 156.51902263263693, 1.0000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 372.49474838021604, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 900.23154750837602, 1.0000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 2202.5465794806719, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test022() +{ + 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(data022) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data022[i].a), Tp(data022[i].c), + Tp(data022[i].x)); + const Tp f0 = data022[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)); +} + +// Test data for a=1.0000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data023[] = { + { 0.18000090799859525, 1.0000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 0.19753391135318732, 1.0000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 0.21876048320712196, 1.0000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 0.24493517885573690, 1.0000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { 0.27791548623203705, 1.0000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { 0.32053903575992687, 1.0000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 0.37728945486109178, 1.0000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { 0.45550823741508090, 1.0000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { 0.56766764161830641, 1.0000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 0.73575888234288467, 1.0000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 1.4365636569180902, 1.0000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 2.1945280494653252, 1.0000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 3.5745637607083705, 1.0000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 6.1997687541430295, 1.0000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 11.393052728206127, 1.0000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 22.023821860707507, 1.0000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 44.434006466467693, 1.0000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 92.873687095054009, 1.0000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 199.82923277963911, 1.0000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 440.30931589613436, 1.0000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=3.0000000000000000. +template <typename Tp> +void test023() +{ + 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(data023) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data023[i].a), Tp(data023[i].c), + Tp(data023[i].x)); + const Tp f0 = data023[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)); +} + +// Test data for a=1.0000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data024[] = { + { 0.24599972760042146, 1.0000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { 0.26748869621560417, 1.0000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { 0.29296481879732927, 1.0000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { 0.32359920906182704, 1.0000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { 0.36104225688398150, 1.0000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 0.40767657854404399, 1.0000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.46703290885418114, 1.0000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { 0.54449176258491927, 1.0000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 0.64849853757254050, 1.0000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 0.79272335297134611, 1.0000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 1.3096909707542714, 1.0000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 1.7917920741979876, 1.0000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 2.5745637607083709, 1.0000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 3.8998265656072717, 1.0000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 6.2358316369236775, 1.0000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 10.511910930353745, 1.0000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 18.614574199914728, 1.0000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 34.452632660645271, 1.0000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 66.276410926546333, 1.0000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 131.79279476884014, 1.0000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test024() +{ + 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(data024) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data024[i].a), Tp(data024[i].c), + Tp(data024[i].x)); + const Tp f0 = data024[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)); +} + +// Test data for a=1.0000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data025[] = { + { 0.30160010895983153, 1.0000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 0.32556057945973144, 1.0000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { 0.35351759060133547, 1.0000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 0.38651473767895589, 1.0000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 0.42597182874401224, 1.0000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 0.47385873716476495, 1.0000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { 0.53296709114581886, 1.0000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 0.60734431655344123, 1.0000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 0.70300292485491900, 1.0000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 0.82910658811461568, 1.0000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 1.2387638830170857, 1.0000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 1.5835841483959754, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 2.0994183476111612, 1.0000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 2.8998265656072721, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 4.1886653095389432, 1.0000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 6.3412739535691678, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 10.065470971379844, 1.0000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 16.726316330322632, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 29.011738189576135, 1.0000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 52.317117907536058, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=5.0000000000000000. +template <typename Tp> +void test025() +{ + 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(data025) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data025[i].a), Tp(data025[i].c), + Tp(data025[i].x)); + const Tp f0 = data025[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)); +} + +// Test data for a=1.0000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data026[] = { + { 0.34919994552008432, 1.0000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 0.37468856696681579, 1.0000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 0.40405150587416544, 1.0000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 0.43820375880074558, 1.0000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 0.47835680937998976, 1.0000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { 0.52614126283523510, 1.0000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { 0.58379113606772637, 1.0000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 0.65442613907759817, 1.0000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 0.74249268786270239, 1.0000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.85446705942692136, 1.0000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 1.1938194150854282, 1.0000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 1.4589603709899384, 1.0000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 1.8323639126852680, 1.0000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 2.3747832070090902, 1.0000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 3.1886653095389415, 1.0000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 4.4510616279743056, 1.0000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 6.4753364081284595, 1.0000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 9.8289477064516344, 1.0000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 15.562076771986721, 1.0000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 25.658558953767979, 1.0000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test026() +{ + 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(data026) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data026[i].a), Tp(data026[i].c), + Tp(data026[i].x)); + const Tp f0 = data026[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)); +} + +// Test data for a=1.0000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data027[] = { + { 0.39048003268794951, 1.0000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 0.41687428868878945, 1.0000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 0.44696137059437596, 1.0000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 0.48153963531364646, 1.0000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { 0.52164319062001030, 1.0000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { 0.56863048459771781, 1.0000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 0.62431329589841034, 1.0000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 0.69114772184480400, 1.0000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 0.77252193641189282, 1.0000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.87319764343847150, 1.0000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 1.1629164905125695, 1.0000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 1.3768811129698151, 1.0000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 1.6647278253705360, 1.0000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 2.0621748105136359, 1.0000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 2.6263983714467298, 1.0000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 3.4510616279743078, 1.0000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 4.6931454926815448, 1.0000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 6.6217107798387476, 1.0000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 9.7080511813245050, 1.0000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 14.795135372260793, 1.0000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=7.0000000000000000. +template <typename Tp> +void test027() +{ + 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(data027) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data027[i].a), Tp(data027[i].c), + Tp(data027[i].x)); + const Tp f0 = data027[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)); +} + +// Test data for a=1.0000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data028[] = { + { 0.42666397711843540, 1.0000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 0.45354221990871918, 1.0000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 0.48390880072992104, 1.0000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { 0.51846036468635348, 1.0000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { 0.55808294427665472, 1.0000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 0.60391732156319489, 1.0000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 0.65745173217778197, 1.0000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 0.72065531569545760, 1.0000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 0.79617322255837530, 1.0000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.88761649593069913, 1.0000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 1.1404154335879861, 1.0000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 1.3190838953943527, 1.0000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 1.5510315925312508, 1.0000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 1.8588059183988628, 1.0000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 2.2769577200254218, 1.0000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 2.8595718993033583, 1.0000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 3.6931454926815368, 1.0000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 4.9189969323589020, 1.0000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 6.7729286965857218, 1.0000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 9.6565947605825802, 1.0000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test028() +{ + 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(data028) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data028[i].a), Tp(data028[i].c), + Tp(data028[i].x)); + const Tp f0 = data028[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)); +} + +// Test data for a=1.0000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data029[] = { + { 0.45866881830525175, 1.0000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 0.48574024897002721, 1.0000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 0.51609119927007907, 1.0000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 0.55033101178702437, 1.0000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 0.58922274096446048, 1.0000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 0.63373228549888783, 1.0000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 0.68509653564443607, 1.0000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 0.74491915814544640, 1.0000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.81530710976649901, 1.0000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.89906803255440670, 1.0000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 1.1233234687038898, 1.0000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 1.2763355815774109, 1.0000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 1.4694175800833353, 1.0000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 1.7176118367977251, 1.0000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 2.0431323520406752, 1.0000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 2.4794291990711450, 1.0000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 3.0778805630646140, 1.0000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 3.9189969323588896, 1.0000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 5.1314921747428537, 1.0000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 6.9252758084660462, 1.0000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=9.0000000000000000. +template <typename Tp> +void test029() +{ + 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(data029) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data029[i].a), Tp(data029[i].c), + Tp(data029[i].x)); + const Tp f0 = data029[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)); +} + +// Test data for a=1.0000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data030[] = { + { 0.48719806352527339, 1.0000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 0.51425975102997279, 1.0000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 0.54439740082116117, 1.0000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 0.57814584198811125, 1.0000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 0.61616588855330923, 1.0000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 0.65928188610200156, 1.0000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 0.70853279480001885, 1.0000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 0.76524252556366068, 1.0000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.83111800605075459, 1.0000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.90838770701033944, 1.0000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 1.1099112183350075, 1.0000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 1.2435101170983485, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 1.4082527402500060, 1.0000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 1.6146266327948817, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 1.8776382336732149, 1.0000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 2.2191437986067171, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 2.6715607239402184, 1.0000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 3.2838715489037504, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 4.1314921747428679, 1.0000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 5.3327482276194447, 1.0000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test030() +{ + 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(data030) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data030[i].a), Tp(data030[i].c), + Tp(data030[i].x)); + const Tp f0 = data030[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)); +} + +// Test data for a=2.0000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data031[] = { + { -0.00040859936786236367, 2.0000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { -0.00098727843269343649, 2.0000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { -0.0023482383953175828, 2.0000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { -0.0054712917933270972, 2.0000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { -0.012393760883331793, 2.0000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { -0.026951787996341868, 2.0000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { -0.054946916666202536, 2.0000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { -0.099574136735727889, 2.0000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { -0.13533528323661270, 2.0000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 5.4365636569180902, 2.0000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 22.167168296791949, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 80.342147692750672, 2.0000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 272.99075016572118, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 890.47895461545954, 2.0000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 2824.0015544491457, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 8773.0652674276680, 2.0000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 26828.621883375556, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 81030.839275753839, 2.0000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 242291.12374287390, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=1.0000000000000000. +template <typename Tp> +void test031() +{ + 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(data031) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data031[i].a), Tp(data031[i].c), + Tp(data031[i].x)); + const Tp f0 = data031[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(1.0000000000000008e-12)); +} + +// Test data for a=2.0000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data032[] = { + { 4.5399929762484854e-05, 2.0000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { 0.00012340980408667956, 2.0000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { 0.00033546262790251185, 2.0000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 0.00091188196555451624, 2.0000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 2.0000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { 0.0067379469990854670, 2.0000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { 0.018315638888734179, 2.0000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { 0.049787068367863944, 2.0000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { 0.13533528323661270, 2.0000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { 0.36787944117144233, 2.0000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 2.7182818284590451, 2.0000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 7.3890560989306504, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 20.085536923187668, 2.0000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 54.598150033144236, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 148.41315910257660, 2.0000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 403.42879349273511, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 1096.6331584284585, 2.0000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 2980.9579870417283, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 8103.0839275753842, 2.0000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 22026.465794806718, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test032() +{ + 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(data032) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data032[i].a), Tp(data032[i].c), + Tp(data032[i].x)); + const Tp f0 = data032[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)); +} + +// Test data for a=2.0000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data033[] = { + { 0.019990012015452256, 2.0000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 0.024660886468126749, 2.0000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 0.031155651135902421, 2.0000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 0.040518569154104643, 2.0000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { 0.054591596375740861, 2.0000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { 0.076765785440438966, 2.0000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 0.11355272569454113, 2.0000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { 0.17796705033967650, 2.0000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { 0.29699707514508100, 2.0000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 0.52848223531423066, 2.0000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 2.0000000000000000, 2.0000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 4.1945280494653261, 2.0000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 9.1491275214167409, 2.0000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 20.599306262429089, 2.0000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 47.572210912824517, 2.0000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 112.11910930353754, 2.0000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 268.60403879880613, 2.0000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 652.11580966537815, 2.0000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 1600.6338622371129, 2.0000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 3964.7838430652091, 2.0000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=3.0000000000000000. +template <typename Tp> +void test033() +{ + 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(data033) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data033[i].a), Tp(data033[i].c), + Tp(data033[i].x)); + const Tp f0 = data033[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)); +} + +// Test data for a=2.0000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data034[] = { + { 0.048003268794942940, 2.0000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { 0.057624341628353531, 2.0000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { 0.070351812026707330, 2.0000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { 0.087607118443556703, 2.0000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { 0.11166194492814813, 2.0000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 0.14626395019169278, 2.0000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.19780254687491294, 2.0000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { 0.27754118707540443, 2.0000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 0.40600584970983811, 2.0000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 0.62182994108596168, 2.0000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 1.6903090292457283, 2.0000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 3.0000000000000000, 2.0000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 5.5745637607083705, 2.0000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 10.799653131214550, 2.0000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 21.707494910771043, 2.0000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 45.047643721415056, 2.0000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 96.072870999573695, 2.0000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 209.71579596387159, 2.0000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 466.93487648582493, 2.0000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 1057.3423581507243, 2.0000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test034() +{ + 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(data034) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data034[i].a), Tp(data034[i].c), + Tp(data034[i].x)); + const Tp f0 = data034[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)); +} + +// Test data for a=2.0000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data035[] = { + { 0.079198583522191404, 2.0000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 0.093273046483222530, 2.0000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { 0.11130650338531098, 2.0000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 0.13485262321044020, 2.0000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 0.16625354130388895, 2.0000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 0.20913010268188095, 2.0000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { 0.26923036197926808, 2.0000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 0.35593410067935288, 2.0000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 0.48498537572540468, 2.0000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 0.68357364754153715, 2.0000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 1.5224722339658285, 2.0000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 2.4164158516040235, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 4.0000000000000009, 2.0000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 6.8998265656072721, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 12.377330619077886, 2.0000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 23.023821860707503, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 44.261883885519374, 2.0000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 87.631581651613160, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 178.07042913745681, 2.0000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 370.21982535275242, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=5.0000000000000000. +template <typename Tp> +void test035() +{ + 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(data035) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data035[i].a), Tp(data035[i].c), + Tp(data035[i].x)); + const Tp f0 = data035[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)); +} + +// Test data for a=2.0000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data036[] = { + { 0.11120076271882003, 2.0000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 0.12904862943139384, 2.0000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 0.15138192951001525, 2.0000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 0.17975865319179699, 2.0000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 0.21643190620010283, 2.0000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { 0.26472863448288397, 2.0000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { 0.32967091145818839, 2.0000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 0.41901702645681349, 2.0000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 0.54504387282378575, 2.0000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.72766470286539298, 2.0000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 1.4185417547437151, 2.0000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 2.0820792580201224, 2.0000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 3.1676360873147318, 2.0000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 4.9999999999999982, 2.0000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 8.1886653095389406, 2.0000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 13.902123255948611, 2.0000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 24.426009224385378, 2.0000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 44.315790825806538, 2.0000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 82.810383859933609, 2.0000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 158.95135372260788, 2.0000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test036() +{ + 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(data036) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data036[i].a), Tp(data036[i].c), + Tp(data036[i].x)); + const Tp f0 = data036[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)); +} + +// Test data for a=2.0000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data037[] = { + { 0.14279950968075858, 2.0000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 0.16375995835694801, 2.0000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 0.18950218227311263, 2.0000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 0.22152437623624174, 2.0000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { 0.26192490317988687, 2.0000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { 0.31369515402282139, 2.0000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 0.38118033691430731, 2.0000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 0.47081822524156886, 2.0000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 0.59234644511675072, 2.0000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.76081413936917086, 2.0000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 1.3483340379497220, 2.0000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 1.8693566610905543, 2.0000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 2.6705443492589280, 2.0000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 3.9378251894863650, 2.0000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 6.0000000000000018, 2.0000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 9.4510616279743118, 2.0000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 15.386290985363090, 2.0000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 25.865132339516244, 2.0000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 44.832204725298020, 2.0000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 79.975676861303967, 2.0000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=7.0000000000000000. +template <typename Tp> +void test037() +{ + 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(data037) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data037[i].a), Tp(data037[i].c), + Tp(data037[i].x)); + const Tp f0 = data037[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)); +} + +// Test data for a=2.0000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data038[] = { + { 0.17337636610503362, 2.0000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 0.19686670136921000, 2.0000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 0.22527678978110538, 2.0000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { 0.26001525907740475, 2.0000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { 0.30300466868014397, 2.0000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 0.35690946280485503, 2.0000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 0.42548267822218039, 2.0000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 0.51410215874088183, 2.0000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 0.63061421953299790, 2.0000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.78668452848510595, 2.0000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 1.2979228320600693, 2.0000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 1.7236644184225898, 2.0000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 2.3469052224062485, 2.0000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 3.2823881632022749, 2.0000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 4.7230422799745782, 2.0000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 7.0000000000000009, 2.0000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 10.693145492681536, 2.0000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 16.837993864717802, 2.0000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 27.318786089757165, 2.0000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 45.626379042330321, 2.0000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test038() +{ + 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(data038) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data038[i].a), Tp(data038[i].c), + Tp(data038[i].x)); + const Tp f0 = data038[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)); +} + +// Test data for a=2.0000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data039[] = { + { 0.20263008881072142, 2.0000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 0.22815601647956382, 2.0000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 0.25863201094881560, 2.0000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 0.29536583498165569, 2.0000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 0.34010436746201422, 2.0000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 0.39521257401334392, 2.0000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 0.46393810791120338, 2.0000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 0.55080841854553553, 2.0000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.66223601210150940, 2.0000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.80745573956474603, 2.0000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 1.2600591877766618, 2.0000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 1.6183220921129462, 2.0000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 2.1223296796666578, 2.0000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 2.8471644896068233, 2.0000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 3.9137352959186495, 2.0000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 5.5205708009288541, 2.0000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 7.9999999999999982, 2.0000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 11.918996932358892, 2.0000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 18.262984349485706, 2.0000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 28.775827425398138, 2.0000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=9.0000000000000000. +template <typename Tp> +void test039() +{ + 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(data039) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data039[i].a), Tp(data039[i].c), + Tp(data039[i].x)); + const Tp f0 = data039[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)); +} + +// Test data for a=2.0000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data040[] = { + { 0.23043485654507717, 2.0000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 0.25758423249046342, 2.0000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 0.28964158686142122, 2.0000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 0.32781237017833142, 2.0000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 0.37367756025366927, 2.0000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 0.42933548067397925, 2.0000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 0.49760646239977369, 2.0000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 0.58233221879973318, 2.0000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.68881993949245379, 2.0000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.82451063690694526, 2.0000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 1.2306214716549471, 2.0000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 1.5389392974099088, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 1.9587362987499699, 2.0000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 2.5414934688204727, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 3.3670852989803555, 2.0000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 4.5617124027865650, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 6.3284392760597825, 2.0000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 9.0000000000000036, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 13.131492174742865, 2.0000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 19.665496455238888, 2.0000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test040() +{ + 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(data040) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data040[i].a), Tp(data040[i].c), + Tp(data040[i].x)); + const Tp f0 = data040[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)); +} + +// Test data for a=5.0000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data041[] = { + { 0.00049939922738733355, 5.0000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { -0.00057077034390089253, 5.0000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { -0.0032428054030576147, 5.0000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { -0.0078649819529077025, 5.0000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { -0.012393760883331793, 5.0000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { -0.0087031815404853934, 5.0000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { 0.018315638888832021, 5.0000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { 0.068457219005814696, 5.0000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 0.045111761078875295, 5.0000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { -0.22992465073215118, 5.0000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 23.671704256164183, 5.0000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 199.50451467112745, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 1232.7498286606428, 5.0000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 6460.7810872554019, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 30480.352550691667, 5.0000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 133534.93064609534, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 553479.89366849652, 5.0000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 2196966.0364497532, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 8422142.8572236635, 5.0000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 31373029.447069697, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=1.0000000000000000. +template <typename Tp> +void test041() +{ + 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(data041) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data041[i].a), Tp(data041[i].c), + Tp(data041[i].x)); + const Tp f0 = data041[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.0000000000000034e-10)); +} + +// Test data for a=5.0000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data042[] = { + { -0.00025726626865408083, 5.0000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { -0.00029309828470586396, 5.0000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { -0.00011182087596750395, 5.0000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 0.00064591639226778245, 5.0000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 5.0000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { 0.0053342080409426616, 5.0000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { 0.0061052129629022966, 5.0000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { -0.0062233835459823200, 5.0000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { -0.045111761078871798, 5.0000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { -0.015328310048810216, 5.0000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 8.2681072282295975, 5.0000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 46.797355293227440, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 223.45159827046285, 5.0000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 964.56731725221459, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 3889.6615448133625, 5.0000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 14926.865359231202, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 55151.509259297891, 5.0000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 197736.87980710136, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 691800.79031674843, 5.0000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 2371516.1505741901, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test042() +{ + 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(data042) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data042[i].a), Tp(data042[i].c), + Tp(data042[i].x)); + const Tp f0 = data042[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(1.0000000000000006e-10)); +} + +// Test data for a=5.0000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data043[] = { + { 0.00012106647936662629, 5.0000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 0.00021596715715168925, 5.0000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 0.00033546262790251185, 5.0000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 0.00037995081898104839, 5.0000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { 0.0000000000000000, 5.0000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { -0.0016844867497713672, 5.0000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { -0.0061052129629113917, 5.0000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { -0.012446767091965986, 5.0000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { 7.5126173746727200e-18, 5.0000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 0.15328310048810098, 5.0000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 4.7569931998033290, 5.0000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 19.704149597148401, 5.0000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 75.320763461953760, 5.0000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 272.99075016572118, 5.0000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 952.31777090819992, 5.0000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 3227.4303479418809, 5.0000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 10692.173294677470, 5.0000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 34777.843182153498, 5.0000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 111417.40400416154, 5.0000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 352423.45271690749, 5.0000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=3.0000000000000000. +template <typename Tp> +void test043() +{ + 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(data043) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data043[i].a), Tp(data043[i].c), + Tp(data043[i].x)); + const Tp f0 = data043[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.0000000000000028e-11)); +} + +// Test data for a=5.0000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data044[] = { + { -6.8099894643727278e-05, 5.0000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { -0.00015426225510834944, 5.0000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { -0.00033546262790251185, 5.0000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { -0.00068391147416588716, 5.0000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { -0.0012393760883331792, 5.0000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { -0.0016844867497713668, 5.0000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.0000000000000000, 5.0000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { 0.012446767091965986, 5.0000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 0.067667641618306351, 5.0000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 0.27590958087858175, 5.0000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 3.3978522855738063, 5.0000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 11.083584148395975, 5.0000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 35.149689615578417, 5.0000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 109.19630006628847, 5.0000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 333.92960798079736, 5.0000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 1008.5719837318378, 5.0000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 3015.7411856782610, 5.0000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 8942.8739611251840, 5.0000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 26335.022764620000, 5.0000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 77092.630281823513, 5.0000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test044() +{ + 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(data044) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data044[i].a), Tp(data044[i].c), + Tp(data044[i].x)); + const Tp f0 = data044[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.5000000000000014e-11)); +} + +// Test data for a=5.0000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data045[] = { + { 4.5399929762484854e-05, 5.0000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 0.00012340980408667956, 5.0000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { 0.00033546262790251185, 5.0000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 0.00091188196555451624, 5.0000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 5.0000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 0.0067379469990854670, 5.0000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { 0.018315638888734179, 5.0000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 0.049787068367863944, 5.0000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 0.13533528323661270, 5.0000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 0.36787944117144233, 5.0000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 2.7182818284590451, 5.0000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 7.3890560989306504, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 20.085536923187668, 5.0000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 54.598150033144236, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 148.41315910257660, 5.0000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 403.42879349273511, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 1096.6331584284585, 5.0000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 2980.9579870417283, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 8103.0839275753842, 5.0000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 22026.465794806718, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=5.0000000000000000. +template <typename Tp> +void test045() +{ + 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(data045) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data045[i].a), Tp(data045[i].c), + Tp(data045[i].x)); + const Tp f0 = data045[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)); +} + +// Test data for a=5.0000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data046[] = { + { 0.0011648967743076431, 5.0000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 0.0019205128456127479, 5.0000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 0.0032972446271226320, 5.0000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 0.0059047424914709006, 5.0000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 0.011033078698817415, 5.0000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { 0.021485057853495842, 5.0000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { 0.043495671658608563, 5.0000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 0.091228027395668113, 5.0000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 0.19744881503891684, 5.0000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.43918161928124549, 5.0000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 2.3226822806570353, 5.0000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 5.4863201236633126, 5.0000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 13.144500379942246, 5.0000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 31.873916035045447, 5.0000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 78.086286951596321, 5.0000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 192.98291046720354, 5.0000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 480.54877204888402, 5.0000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 1204.4605636118313, 5.0000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 3036.1329048350581, 5.0000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 7691.6406555465064, 5.0000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test046() +{ + 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(data046) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data046[i].a), Tp(data046[i].c), + Tp(data046[i].x)); + const Tp f0 = data046[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(1.0000000000000006e-11)); +} + +// Test data for a=5.0000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data047[] = { + { 0.0036308901122103932, 5.0000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 0.0055327336019229401, 5.0000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 0.0086767852656603455, 5.0000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 0.014030481266326614, 5.0000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { 0.023426839582149212, 5.0000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { 0.040427681994512799, 5.0000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 0.072123784177593755, 5.0000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 0.13295857409596740, 5.0000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 0.25298991319893882, 5.0000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.49602437239337821, 5.0000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 2.0681072498819240, 5.0000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 4.3768811129698140, 5.0000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 9.4566368471992224, 5.0000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 20.811741224531826, 5.0000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 46.556488803696276, 5.0000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 105.66804767556316, 5.0000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 242.93097638084427, 5.0000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 564.89804380887358, 5.0000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 1326.9606865425994, 5.0000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 3145.3685154983909, 5.0000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=7.0000000000000000. +template <typename Tp> +void test047() +{ + 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(data047) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data047[i].a), Tp(data047[i].c), + Tp(data047[i].x)); + const Tp f0 = data047[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.0000000000000029e-12)); +} + +// Test data for a=5.0000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data048[] = { + { 0.0075295293831406122, 5.0000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 0.010936052508673187, 5.0000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 0.016247454253649721, 5.0000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { 0.024729468107576008, 5.0000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { 0.038615775445860964, 5.0000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 0.061937865588523586, 5.0000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 0.10213565389690644, 5.0000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 0.17324118243379236, 5.0000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 0.30228316551605494, 5.0000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.54238748802203829, 5.0000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 1.8922997283093959, 5.0000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 3.6699742831126270, 5.0000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 7.2831842359960941, 5.0000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 14.764676530664770, 5.0000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 30.522558591756702, 5.0000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 64.236147093730224, 5.0000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 137.40503032883328, 5.0000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 298.29153884828759, 5.0000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 656.29389355002741, 5.0000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 1461.6183101433730, 5.0000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test048() +{ + 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(data048) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data048[i].a), Tp(data048[i].c), + Tp(data048[i].x)); + const Tp f0 = data048[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.5000000000000015e-12)); +} + +// Test data for a=5.0000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data049[] = { + { 0.012801285049305222, 5.0000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 0.017955923031350202, 5.0000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 0.025661650371090718, 5.0000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 0.037414616710204310, 5.0000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 0.055720934057414885, 5.0000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 0.084862956151755986, 5.0000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 0.13230635170162319, 5.0000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 0.21132914572142125, 5.0000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.34601808641639625, 5.0000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.58092180965710882, 5.0000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 1.7643922061378634, 5.0000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 3.1888010096332451, 5.0000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 5.8981194929479273, 5.0000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 11.152835510393174, 5.0000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 21.533483453443495, 5.0000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 42.397145995355721, 5.0000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 85.010891404859976, 5.0000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 173.36225868739959, 5.0000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 359.10444177844266, 5.0000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 754.64844371961385, 5.0000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=9.0000000000000000. +template <typename Tp> +void test049() +{ + 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(data049) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data049[i].a), Tp(data049[i].c), + Tp(data049[i].x)); + const Tp f0 = data049[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(1.0000000000000008e-12)); +} + +// Test data for a=5.0000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data050[] = { + { 0.019313731161840469, 5.0000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 0.026361085775183927, 5.0000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 0.036556772070711910, 5.0000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 0.051563934048344140, 5.0000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 0.074056625794521824, 5.0000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 0.10841132531381445, 5.0000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 0.16192115120742598, 5.0000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 0.24696279814742436, 5.0000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.38492640633381947, 5.0000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.61345628229723270, 5.0000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 1.6675470647226096, 5.0000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 2.8442428103603667, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 4.9603804008438397, 5.0000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 8.8405953071624790, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 16.089667272320334, 5.0000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 29.876575194426895, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 56.546719856432318, 5.0000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 108.97420168465270, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 213.60609045832913, 5.0000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 425.41323880637168, 5.0000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test050() +{ + 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(data050) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data050[i].a), Tp(data050[i].c), + Tp(data050[i].x)); + const Tp f0 = data050[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)); +} + +// Test data for a=10.000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data051[] = { + { 0.00067155063653961283, 10.000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { -0.00071555648905258641, 10.000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { -0.0035372078786207375, 10.000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { -0.0047884005574714370, 10.000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 10.000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { 0.018136827242522878, 10.000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { 0.0099686175680129968, 10.000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { -0.052832081031434205, 10.000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 0.0010979582061524211, 10.000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { 0.11394854824644544, 10.000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 131.63017574352625, 10.000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 2431.2913698755492, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 27127.328899791049, 10.000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 232066.49977835573, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 1674401.3794931532, 10.000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 10707495.820386337, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 62515499.242815509, 10.000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 339773485.00937450, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 1742442474.2135217, 10.000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 8514625476.5462780, 10.000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=1.0000000000000000. +template <typename Tp> +void test051() +{ + 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(data051) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data051[i].a), Tp(data051[i].c), + Tp(data051[i].x)); + const Tp f0 = data051[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.0000000000000029e-12)); +} + +// Test data for a=10.000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data052[] = { + { -0.00014116415550486912, 10.000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { -0.00016988130843806985, 10.000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { 6.6619209703391391e-05, 10.000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 0.00072582919646365740, 10.000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.0012039653429522313, 10.000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { -0.00061450715370021350, 10.000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { -0.0053557899960354968, 10.000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { -0.00078903612815141419, 10.000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { 0.023725444715554326, 10.000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { -0.057297669024384767, 10.000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 34.432116659636534, 10.000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 432.53475371634494, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 3789.1768909683515, 10.000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 27089.676185774806, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 169243.72183073507, 10.000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 959019.40135397331, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 5043073.3458297960, 10.000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 24989309.819281481, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 117948708.50540228, 10.000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 534524325.69810420, 10.000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test052() +{ + 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(data052) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data052[i].a), Tp(data052[i].c), + Tp(data052[i].x)); + const Tp f0 = data052[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.5000000000000017e-10)); +} + +// Test data for a=10.000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data053[] = { + { 1.4973169075105230e-05, 10.000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { 5.7627971015476259e-05, 10.000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 9.5964794084281178e-05, 10.000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 1.5479477810339013e-05, 10.000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { -0.00035410745380947978, 10.000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { -0.00078393993138610115, 10.000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 0.00038117202625584341, 10.000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { 0.0045341794406447526, 10.000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { -0.0031029253652133434, 10.000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { -0.028487137061611361, 10.000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 15.691485606063281, 10.000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 141.71088859081422, 10.000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 997.55177799313742, 10.000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 6038.6324280926056, 10.000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 32946.952425437157, 10.000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 166431.66712118863, 10.000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 791818.30272061308, 10.000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 3589678.0198700386, 10.000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 15637649.698874988, 10.000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 65871447.346678361, 10.000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=3.0000000000000000. +template <typename Tp> +void test053() +{ + 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(data053) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data053[i].a), Tp(data053[i].c), + Tp(data053[i].x)); + const Tp f0 = data053[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.5000000000000013e-09)); +} + +// Test data for a=10.000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data054[] = { + { 6.9661267889527031e-06, 10.000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { -3.0301514396282926e-06, 10.000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { -3.7983599138168025e-05, 10.000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { -9.3615660121163871e-05, 10.000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { -7.0821490761895943e-05, 10.000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 0.00030692863727646260, 10.000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.0010659895649527829, 10.000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { -0.00042230102633456065, 10.000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { -0.010168047735237568, 10.000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { 0.036903514708782073, 10.000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 9.3384756433214022, 10.000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 63.905561372021388, 10.000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 370.08498456728779, 10.000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 1922.9526217493540, 10.000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 9245.0380014351485, 10.000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 41898.961838459785, 10.000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 181211.14084739226, 10.000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 754384.25570692297, 10.000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 3042060.4915799876, 10.000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 11939626.424402930, 10.000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test054() +{ + 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(data054) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data054[i].a), Tp(data054[i].c), + Tp(data054[i].x)); + const Tp f0 = data054[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.0000000000000026e-09)); +} + +// Test data for a=10.000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data055[] = { + { -6.2454929831989742e-06, 10.000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { -1.1459481808048817e-05, 10.000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { -8.1646988801669512e-06, 10.000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { 3.1240400671775088e-05, 10.000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 0.00014164298152379191, 10.000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 0.00023172833594738379, 10.000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { -0.00036825094062005220, 10.000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { -0.0030227862937631683, 10.000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { -0.00028642387986584615, 10.000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { 0.10617896040159881, 10.000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 6.4803694966028260, 10.000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 35.201619637445276, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 171.58787257237464, 10.000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 775.87148867205678, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 3317.4071019773678, 10.000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 13578.260535269774, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 53651.761875039716, 10.000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 205900.60390283042, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 770979.49612334219, 10.000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 2826613.2348531331, 10.000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=5.0000000000000000. +template <typename Tp> +void test055() +{ + 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(data055) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data055[i].a), Tp(data055[i].c), + Tp(data055[i].x)); + const Tp f0 = data055[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.5000000000000013e-09)); +} + +// Test data for a=10.000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data056[] = { + { 9.6084507433830306e-07, 10.000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { 7.7131127554174726e-06, 10.000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { 2.3074149009167486e-05, 10.000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 4.0105919781332888e-05, 10.000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { -7.7443012320393170e-21, 10.000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { -0.00029188857701064686, 10.000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { -0.0010659895649527829, 10.000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { -0.00044452739614164190, 10.000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { 0.020049671590609292, 10.000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.17092282236966813, 10.000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 4.9520550902714540, 10.000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 22.206263831706924, 10.000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 93.074943420842843, 10.000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 371.20964440523989, 10.000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 1424.6976175888544, 10.000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 5302.2070001902330, 10.000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 19239.311823447424, 10.000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 68341.221999215923, 10.000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 238389.83519072225, 10.000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 818592.04096678516, 10.000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test056() +{ + 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(data056) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data056[i].a), Tp(data056[i].c), + Tp(data056[i].x)); + const Tp f0 = data056[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.5000000000000012e-08)); +} + +// Test data for a=10.000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data057[] = { + { 3.9634859316455036e-06, 10.000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { 4.4074930030956985e-06, 10.000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { -5.3248036175001926e-06, 10.000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { -5.0660109197473119e-05, 10.000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { -0.00017705372690473989, 10.000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { -0.00034759250392107569, 10.000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 0.00029072442680530428, 10.000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 0.0071124383382662791, 10.000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { 0.046185850628367831, 10.000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.22919473120601763, 10.000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 4.0342754120781059, 10.000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 15.423188523958421, 10.000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 56.669907747565212, 10.000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 201.92649139242229, 10.000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 702.01780019948944, 10.000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 2391.7564185640722, 10.000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 8011.5144629634615, 10.000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 26450.087535814702, 10.000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 86239.964657766584, 10.000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 278127.83396458323, 10.000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=7.0000000000000000. +template <typename Tp> +void test057() +{ + 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(data057) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data057[i].a), Tp(data057[i].c), + Tp(data057[i].x)); + const Tp f0 = data057[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(1.0000000000000004e-06)); +} + +// Test data for a=10.000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data058[] = { + { -5.0444366402760924e-06, 10.000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { -1.5426225510834945e-05, 10.000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { -3.7273625322501334e-05, 10.000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { -6.3325136496841480e-05, 10.000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { -2.7519677388747149e-19, 10.000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 0.00065507818046664273, 10.000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 0.0040701419752742617, 10.000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { 0.018670150637948978, 10.000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { 0.075186268464784836, 10.000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.28101901756151842, 10.000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 3.4356061998579595, 10.000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 11.494087265003234, 10.000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 37.660381730976880, 10.000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 121.32922229587608, 10.000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 385.46195489141422, 10.000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 1210.2863804782053, 10.000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 3762.0609740531836, 10.000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 11592.614394051165, 10.000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 35450.992183142305, 10.000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 107684.94388572175, 10.000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test058() +{ + 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(data058) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data058[i].a), Tp(data058[i].c), + Tp(data058[i].x)); + const Tp f0 = data058[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.5000000000000013e-09)); +} + +// Test data for a=10.000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data059[] = { + { -5.0444366402760974e-06, 10.000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { 0.0000000000000000, 10.000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { 3.7273625322501334e-05, 10.000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { 0.00020264043678989247, 10.000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 0.00082625072555545290, 10.000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 0.0029946431107046520, 10.000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { 0.010175354938185655, 10.000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { 0.033191378911909299, 10.000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.10526077585069878, 10.000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.32700394770794872, 10.000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 3.0203131427322725, 10.000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 9.0310685653596838, 10.000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 26.780715897583555, 10.000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 78.863994492319449, 10.000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 230.86491415956360, 10.000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 672.38132248789179, 10.000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 1949.5700594283705, 10.000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 5630.6984199677090, 10.000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 16206.167855150768, 10.000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 46500.316677925293, 10.000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=9.0000000000000000. +template <typename Tp> +void test059() +{ + 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(data059) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data059[i].a), Tp(data059[i].c), + Tp(data059[i].x)); + const Tp f0 = data059[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.5000000000000013e-09)); +} + +// Test data for a=10.000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data060[] = { + { 4.5399929762484854e-05, 10.000000000000000, 10.000000000000000, + -10.000000000000000 }, + { 0.00012340980408667956, 10.000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { 0.00033546262790251185, 10.000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 0.00091188196555451624, 10.000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 0.0024787521766663585, 10.000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { 0.0067379469990854670, 10.000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { 0.018315638888734179, 10.000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 0.049787068367863944, 10.000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.13533528323661270, 10.000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.36787944117144233, 10.000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 2.7182818284590451, 10.000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 7.3890560989306504, 10.000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 20.085536923187668, 10.000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 54.598150033144236, 10.000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 148.41315910257660, 10.000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 403.42879349273511, 10.000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 1096.6331584284585, 10.000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 2980.9579870417283, 10.000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 8103.0839275753842, 10.000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 22026.465794806718, 10.000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test060() +{ + 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(data060) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data060[i].a), Tp(data060[i].c), + Tp(data060[i].x)); + const Tp f0 = data060[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)); +} + +// Test data for a=20.000000000000000, c=1.0000000000000000. +testcase_conf_hyperg<double> data061[] = { + { 0.00018021852293239465, 20.000000000000000, 1.0000000000000000, + -10.000000000000000 }, + { 0.0017726368057851861, 20.000000000000000, 1.0000000000000000, + -9.0000000000000000 }, + { 0.00058280040382329248, 20.000000000000000, 1.0000000000000000, + -8.0000000000000000 }, + { -0.0049657717020590141, 20.000000000000000, 1.0000000000000000, + -7.0000000000000000 }, + { -0.0012360336087128597, 20.000000000000000, 1.0000000000000000, + -6.0000000000000000 }, + { 0.014898894139255305, 20.000000000000000, 1.0000000000000000, + -5.0000000000000000 }, + { -0.013800784612552089, 20.000000000000000, 1.0000000000000000, + -4.0000000000000000 }, + { -0.012192213426039619, 20.000000000000000, 1.0000000000000000, + -3.0000000000000000 }, + { 0.050311246773136239, 20.000000000000000, 1.0000000000000000, + -2.0000000000000000 }, + { -0.025985814502838461, 20.000000000000000, 1.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 0.0000000000000000 }, + { 1563.6577385252015, 20.000000000000000, 1.0000000000000000, + 1.0000000000000000 }, + { 86377.091910766278, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000 }, + { 2216718.8789979252, 20.000000000000000, 1.0000000000000000, + 3.0000000000000000 }, + { 38045018.520647161, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000 }, + { 504376263.68346798, 20.000000000000000, 1.0000000000000000, + 5.0000000000000000 }, + { 5565635666.7972031, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000 }, + { 53451562646.544518, 20.000000000000000, 1.0000000000000000, + 7.0000000000000000 }, + { 460009135340.33868, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000 }, + { 3620401937301.4907, 20.000000000000000, 1.0000000000000000, + 9.0000000000000000 }, + { 26446266822604.152, 20.000000000000000, 1.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=1.0000000000000000. +template <typename Tp> +void test061() +{ + 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(data061) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data061[i].a), Tp(data061[i].c), + Tp(data061[i].x)); + const Tp f0 = data061[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.5000000000000015e-12)); +} + +// Test data for a=20.000000000000000, c=2.0000000000000000. +testcase_conf_hyperg<double> data062[] = { + { 6.6647681992684102e-05, 20.000000000000000, 2.0000000000000000, + -10.000000000000000 }, + { -3.7248253270227178e-05, 20.000000000000000, 2.0000000000000000, + -9.0000000000000000 }, + { -0.00024392611307344028, 20.000000000000000, 2.0000000000000000, + -8.0000000000000000 }, + { 2.4034559592246216e-05, 20.000000000000000, 2.0000000000000000, + -7.0000000000000000 }, + { 0.00081645960584843073, 20.000000000000000, 2.0000000000000000, + -6.0000000000000000 }, + { -0.00051326387116462115, 20.000000000000000, 2.0000000000000000, + -5.0000000000000000 }, + { -0.0021786279856333920, 20.000000000000000, 2.0000000000000000, + -4.0000000000000000 }, + { 0.0061029380625179973, 20.000000000000000, 2.0000000000000000, + -3.0000000000000000 }, + { -0.011834301617155171, 20.000000000000000, 2.0000000000000000, + -2.0000000000000000 }, + { 0.037622016973681095, 20.000000000000000, 2.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 0.0000000000000000 }, + { 303.10954080179744, 20.000000000000000, 2.0000000000000000, + 1.0000000000000000 }, + { 11508.923130556599, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000 }, + { 234541.86023461280, 20.000000000000000, 2.0000000000000000, + 3.0000000000000000 }, + { 3398931.2897027107, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000 }, + { 39382712.287920594, 20.000000000000000, 2.0000000000000000, + 5.0000000000000000 }, + { 388350500.37087941, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000 }, + { 3385284070.5527201, 20.000000000000000, 2.0000000000000000, + 7.0000000000000000 }, + { 26751585258.405773, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000 }, + { 195061928138.27673, 20.000000000000000, 2.0000000000000000, + 9.0000000000000000 }, + { 1329571695324.3132, 20.000000000000000, 2.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test062() +{ + 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(data062) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data062[i].a), Tp(data062[i].c), + Tp(data062[i].x)); + const Tp f0 = data062[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.5000000000000017e-10)); +} + +// Test data for a=20.000000000000000, c=3.0000000000000000. +testcase_conf_hyperg<double> data063[] = { + { -8.6671962318505729e-06, 20.000000000000000, 3.0000000000000000, + -10.000000000000000 }, + { -1.8205565180535418e-05, 20.000000000000000, 3.0000000000000000, + -9.0000000000000000 }, + { 1.5620588717927631e-05, 20.000000000000000, 3.0000000000000000, + -8.0000000000000000 }, + { 7.6532767373103759e-05, 20.000000000000000, 3.0000000000000000, + -7.0000000000000000 }, + { -5.2708600380172109e-05, 20.000000000000000, 3.0000000000000000, + -6.0000000000000000 }, + { -0.00028546308121326264, 20.000000000000000, 3.0000000000000000, + -5.0000000000000000 }, + { 0.00056490746026256289, 20.000000000000000, 3.0000000000000000, + -4.0000000000000000 }, + { -5.0602588875468348e-07, 20.000000000000000, 3.0000000000000000, + -3.0000000000000000 }, + { -0.0021376080642211705, 20.000000000000000, 3.0000000000000000, + -2.0000000000000000 }, + { 0.0028873127225376070, 20.000000000000000, 3.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 3.0000000000000000, + 0.0000000000000000 }, + { 106.38207299128953, 20.000000000000000, 3.0000000000000000, + 1.0000000000000000 }, + { 2880.5734732831320, 20.000000000000000, 3.0000000000000000, + 2.0000000000000000 }, + { 47353.756965165747, 20.000000000000000, 3.0000000000000000, + 3.0000000000000000 }, + { 584732.27978148917, 20.000000000000000, 3.0000000000000000, + 4.0000000000000000 }, + { 5957333.1101321029, 20.000000000000000, 3.0000000000000000, + 5.0000000000000000 }, + { 52725595.633352734, 20.000000000000000, 3.0000000000000000, + 6.0000000000000000 }, + { 418560160.03369552, 20.000000000000000, 3.0000000000000000, + 7.0000000000000000 }, + { 3045067611.3150902, 20.000000000000000, 3.0000000000000000, + 8.0000000000000000 }, + { 20614600690.354652, 20.000000000000000, 3.0000000000000000, + 9.0000000000000000 }, + { 131344201933.74118, 20.000000000000000, 3.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=3.0000000000000000. +template <typename Tp> +void test063() +{ + 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(data063) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data063[i].a), Tp(data063[i].c), + Tp(data063[i].x)); + const Tp f0 = data063[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(1.0000000000000007e-09)); +} + +// Test data for a=20.000000000000000, c=4.0000000000000000. +testcase_conf_hyperg<double> data064[] = { + { -1.1286669552452404e-06, 20.000000000000000, 4.0000000000000000, + -10.000000000000000 }, + { 3.9595188785137704e-06, 20.000000000000000, 4.0000000000000000, + -9.0000000000000000 }, + { 8.6940153052790034e-06, 20.000000000000000, 4.0000000000000000, + -8.0000000000000000 }, + { -1.0858814018067509e-05, 20.000000000000000, 4.0000000000000000, + -7.0000000000000000 }, + { -4.1826023828710966e-05, 20.000000000000000, 4.0000000000000000, + -6.0000000000000000 }, + { 6.6455893622436357e-05, 20.000000000000000, 4.0000000000000000, + -5.0000000000000000 }, + { 0.00014238710517977903, 20.000000000000000, 4.0000000000000000, + -4.0000000000000000 }, + { -0.00071796294700866132, 20.000000000000000, 4.0000000000000000, + -3.0000000000000000 }, + { 0.0020884061677332653, 20.000000000000000, 4.0000000000000000, + -2.0000000000000000 }, + { -0.012768833157321986, 20.000000000000000, 4.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 4.0000000000000000, + 0.0000000000000000 }, + { 50.659916934657751, 20.000000000000000, 4.0000000000000000, + 1.0000000000000000 }, + { 1014.3134442335910, 20.000000000000000, 4.0000000000000000, + 2.0000000000000000 }, + { 13665.584449611581, 20.000000000000000, 4.0000000000000000, + 3.0000000000000000 }, + { 145123.62797278629, 20.000000000000000, 4.0000000000000000, + 4.0000000000000000 }, + { 1308144.4519382305, 20.000000000000000, 4.0000000000000000, + 5.0000000000000000 }, + { 10438124.578674613, 20.000000000000000, 4.0000000000000000, + 6.0000000000000000 }, + { 75719160.524424642, 20.000000000000000, 4.0000000000000000, + 7.0000000000000000 }, + { 508510905.96310234, 20.000000000000000, 4.0000000000000000, + 8.0000000000000000 }, + { 3203200954.5618095, 20.000000000000000, 4.0000000000000000, + 9.0000000000000000 }, + { 19111993543.124691, 20.000000000000000, 4.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test064() +{ + 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(data064) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data064[i].a), Tp(data064[i].c), + Tp(data064[i].x)); + const Tp f0 = data064[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(1.0000000000000007e-09)); +} + +// Test data for a=20.000000000000000, c=5.0000000000000000. +testcase_conf_hyperg<double> data065[] = { + { 8.4755643455670995e-07, 20.000000000000000, 5.0000000000000000, + -10.000000000000000 }, + { 8.5721061862565634e-07, 20.000000000000000, 5.0000000000000000, + -9.0000000000000000 }, + { -2.8228700837555599e-06, 20.000000000000000, 5.0000000000000000, + -8.0000000000000000 }, + { -6.6486802159657585e-06, 20.000000000000000, 5.0000000000000000, + -7.0000000000000000 }, + { 1.1816828026110384e-05, 20.000000000000000, 5.0000000000000000, + -6.0000000000000000 }, + { 3.6173872819745767e-05, 20.000000000000000, 5.0000000000000000, + -5.0000000000000000 }, + { -0.00011481934287296673, 20.000000000000000, 5.0000000000000000, + -4.0000000000000000 }, + { 1.2650647218867087e-07, 20.000000000000000, 5.0000000000000000, + -3.0000000000000000 }, + { 0.0010626537950495971, 20.000000000000000, 5.0000000000000000, + -2.0000000000000000 }, + { -0.0085499011205641979, 20.000000000000000, 5.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 0.0000000000000000 }, + { 29.126637808809363, 20.000000000000000, 5.0000000000000000, + 1.0000000000000000 }, + { 446.26914983518060, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000 }, + { 5005.6470164856382, 20.000000000000000, 5.0000000000000000, + 3.0000000000000000 }, + { 46145.715220935213, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000 }, + { 370342.18574452243, 20.000000000000000, 5.0000000000000000, + 5.0000000000000000 }, + { 2676402.7371661114, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000 }, + { 17803174.102029990, 20.000000000000000, 5.0000000000000000, + 7.0000000000000000 }, + { 110674464.63597310, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000 }, + { 650149739.34228516, 20.000000000000000, 5.0000000000000000, + 9.0000000000000000 }, + { 3639417243.5150661, 20.000000000000000, 5.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=5.0000000000000000. +template <typename Tp> +void test065() +{ + 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(data065) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data065[i].a), Tp(data065[i].c), + Tp(data065[i].x)); + const Tp f0 = data065[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(1.0000000000000005e-07)); +} + +// Test data for a=20.000000000000000, c=6.0000000000000000. +testcase_conf_hyperg<double> data066[] = { + { -1.9022359545309947e-08, 20.000000000000000, 6.0000000000000000, + -10.000000000000000 }, + { -7.4533809656234677e-07, 20.000000000000000, 6.0000000000000000, + -9.0000000000000000 }, + { -9.7852420358724059e-07, 20.000000000000000, 6.0000000000000000, + -8.0000000000000000 }, + { 3.0181569866746340e-06, 20.000000000000000, 6.0000000000000000, + -7.0000000000000000 }, + { 7.9816910701457280e-06, 20.000000000000000, 6.0000000000000000, + -6.0000000000000000 }, + { -2.0133163153966078e-05, 20.000000000000000, 6.0000000000000000, + -5.0000000000000000 }, + { -4.7462368393259678e-05, 20.000000000000000, 6.0000000000000000, + -4.0000000000000000 }, + { 0.00031910869938964821, 20.000000000000000, 6.0000000000000000, + -3.0000000000000000 }, + { -0.0010380528468056445, 20.000000000000000, 6.0000000000000000, + -2.0000000000000000 }, + { 0.0084752097558651162, 20.000000000000000, 6.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 6.0000000000000000, + 0.0000000000000000 }, + { 19.002159564861387, 20.000000000000000, 6.0000000000000000, + 1.0000000000000000 }, + { 229.93981298721295, 20.000000000000000, 6.0000000000000000, + 2.0000000000000000 }, + { 2180.3120758940981, 20.000000000000000, 6.0000000000000000, + 3.0000000000000000 }, + { 17610.732510305290, 20.000000000000000, 6.0000000000000000, + 4.0000000000000000 }, + { 126633.20907014773, 20.000000000000000, 6.0000000000000000, + 5.0000000000000000 }, + { 832692.83016874129, 20.000000000000000, 6.0000000000000000, + 6.0000000000000000 }, + { 5097225.0940651651, 20.000000000000000, 6.0000000000000000, + 7.0000000000000000 }, + { 29414585.342530537, 20.000000000000000, 6.0000000000000000, + 8.0000000000000000 }, + { 161513229.88138971, 20.000000000000000, 6.0000000000000000, + 9.0000000000000000 }, + { 849871092.10959554, 20.000000000000000, 6.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test066() +{ + 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(data066) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data066[i].a), Tp(data066[i].c), + Tp(data066[i].x)); + const Tp f0 = data066[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.0000000000000019e-07)); +} + +// Test data for a=20.000000000000000, c=7.0000000000000000. +testcase_conf_hyperg<double> data067[] = { + { -1.7754301607387143e-07, 20.000000000000000, 7.0000000000000000, + -10.000000000000000 }, + { -6.2128605089471174e-08, 20.000000000000000, 7.0000000000000000, + -9.0000000000000000 }, + { 9.1338873372533148e-07, 20.000000000000000, 7.0000000000000000, + -8.0000000000000000 }, + { 1.6657400269273180e-06, 20.000000000000000, 7.0000000000000000, + -7.0000000000000000 }, + { -4.7904165143355465e-06, 20.000000000000000, 7.0000000000000000, + -6.0000000000000000 }, + { -1.5503088351319615e-05, 20.000000000000000, 7.0000000000000000, + -5.0000000000000000 }, + { 5.6425108496954350e-05, 20.000000000000000, 7.0000000000000000, + -4.0000000000000000 }, + { 9.1083552345479015e-05, 20.000000000000000, 7.0000000000000000, + -3.0000000000000000 }, + { -0.0018058773247853399, 20.000000000000000, 7.0000000000000000, + -2.0000000000000000 }, + { 0.032850147696977763, 20.000000000000000, 7.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 7.0000000000000000, + 0.0000000000000000 }, + { 13.551527852090816, 20.000000000000000, 7.0000000000000000, + 1.0000000000000000 }, + { 133.23579819973102, 20.000000000000000, 7.0000000000000000, + 2.0000000000000000 }, + { 1083.6769250393436, 20.000000000000000, 7.0000000000000000, + 3.0000000000000000 }, + { 7739.1410905637622, 20.000000000000000, 7.0000000000000000, + 4.0000000000000000 }, + { 50175.328973240226, 20.000000000000000, 7.0000000000000000, + 5.0000000000000000 }, + { 301599.46814102860, 20.000000000000000, 7.0000000000000000, + 6.0000000000000000 }, + { 1705051.1866143674, 20.000000000000000, 7.0000000000000000, + 7.0000000000000000 }, + { 9159788.2353733126, 20.000000000000000, 7.0000000000000000, + 8.0000000000000000 }, + { 47122070.398665302, 20.000000000000000, 7.0000000000000000, + 9.0000000000000000 }, + { 233529421.53991729, 20.000000000000000, 7.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=7.0000000000000000. +template <typename Tp> +void test067() +{ + 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(data067) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data067[i].a), Tp(data067[i].c), + Tp(data067[i].x)); + const Tp f0 = data067[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.5000000000000009e-07)); +} + +// Test data for a=20.000000000000000, c=8.0000000000000000. +testcase_conf_hyperg<double> data068[] = { + { 4.4385719622857060e-08, 20.000000000000000, 8.0000000000000000, + -10.000000000000000 }, + { 2.7870855352561929e-07, 20.000000000000000, 8.0000000000000000, + -9.0000000000000000 }, + { 2.7221706037028333e-07, 20.000000000000000, 8.0000000000000000, + -8.0000000000000000 }, + { -1.5211293805365477e-06, 20.000000000000000, 8.0000000000000000, + -7.0000000000000000 }, + { -4.2978336531553922e-06, 20.000000000000000, 8.0000000000000000, + -6.0000000000000000 }, + { 1.1339557446266738e-05, 20.000000000000000, 8.0000000000000000, + -5.0000000000000000 }, + { 5.3526365220658982e-05, 20.000000000000000, 8.0000000000000000, + -4.0000000000000000 }, + { -0.00029461053269513242, 20.000000000000000, 8.0000000000000000, + -3.0000000000000000 }, + { -0.00026793636646740187, 20.000000000000000, 8.0000000000000000, + -2.0000000000000000 }, + { 0.061061258434452835, 20.000000000000000, 8.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 8.0000000000000000, + 0.0000000000000000 }, + { 10.312756690132913, 20.000000000000000, 8.0000000000000000, + 1.0000000000000000 }, + { 84.471824856846425, 20.000000000000000, 8.0000000000000000, + 2.0000000000000000 }, + { 597.47335666854985, 20.000000000000000, 8.0000000000000000, + 3.0000000000000000 }, + { 3805.9786364107408, 20.000000000000000, 8.0000000000000000, + 4.0000000000000000 }, + { 22386.068461641658, 20.000000000000000, 8.0000000000000000, + 5.0000000000000000 }, + { 123573.63516975302, 20.000000000000000, 8.0000000000000000, + 6.0000000000000000 }, + { 647514.24141570868, 20.000000000000000, 8.0000000000000000, + 7.0000000000000000 }, + { 3247628.2434586394, 20.000000000000000, 8.0000000000000000, + 8.0000000000000000 }, + { 15690070.625286423, 20.000000000000000, 8.0000000000000000, + 9.0000000000000000 }, + { 73379158.893325061, 20.000000000000000, 8.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test068() +{ + 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(data068) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data068[i].a), Tp(data068[i].c), + Tp(data068[i].x)); + const Tp f0 = data068[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(1.0000000000000005e-07)); +} + +// Test data for a=20.000000000000000, c=9.0000000000000000. +testcase_conf_hyperg<double> data069[] = { + { 7.3976263576568592e-08, 20.000000000000000, 9.0000000000000000, + -10.000000000000000 }, + { -9.0753238092548416e-09, 20.000000000000000, 9.0000000000000000, + -9.0000000000000000 }, + { -5.5549484970396693e-07, 20.000000000000000, 9.0000000000000000, + -8.0000000000000000 }, + { -1.1104933512848787e-06, 20.000000000000000, 9.0000000000000000, + -7.0000000000000000 }, + { 3.2483424385770483e-06, 20.000000000000000, 9.0000000000000000, + -6.0000000000000000 }, + { 1.7493431113569438e-05, 20.000000000000000, 9.0000000000000000, + -5.0000000000000000 }, + { -3.9066110636117253e-05, 20.000000000000000, 9.0000000000000000, + -4.0000000000000000 }, + { -0.00040356155493308509, 20.000000000000000, 9.0000000000000000, + -3.0000000000000000 }, + { 0.0037671531470534567, 20.000000000000000, 9.0000000000000000, + -2.0000000000000000 }, + { 0.090944344485248449, 20.000000000000000, 9.0000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 9.0000000000000000, + 0.0000000000000000 }, + { 8.2390942957149722, 20.000000000000000, 9.0000000000000000, + 1.0000000000000000 }, + { 57.468054562166706, 20.000000000000000, 9.0000000000000000, + 2.0000000000000000 }, + { 358.00109079775746, 20.000000000000000, 9.0000000000000000, + 3.0000000000000000 }, + { 2051.3704389046998, 20.000000000000000, 9.0000000000000000, + 4.0000000000000000 }, + { 11012.597503064211, 20.000000000000000, 9.0000000000000000, + 5.0000000000000000 }, + { 56082.113308934473, 20.000000000000000, 9.0000000000000000, + 6.0000000000000000 }, + { 273348.46918863337, 20.000000000000000, 9.0000000000000000, + 7.0000000000000000 }, + { 1283674.4996444662, 20.000000000000000, 9.0000000000000000, + 8.0000000000000000 }, + { 5838026.8730425332, 20.000000000000000, 9.0000000000000000, + 9.0000000000000000 }, + { 25817349.972859707, 20.000000000000000, 9.0000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=9.0000000000000000. +template <typename Tp> +void test069() +{ + 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(data069) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data069[i].a), Tp(data069[i].c), + Tp(data069[i].x)); + const Tp f0 = data069[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(1.0000000000000004e-06)); +} + +// Test data for a=20.000000000000000, c=10.000000000000000. +testcase_conf_hyperg<double> data070[] = { + { -4.1157677792944940e-08, 20.000000000000000, 10.000000000000000, + -10.000000000000000 }, + { -2.0187210039960906e-07, 20.000000000000000, 10.000000000000000, + -9.0000000000000000 }, + { -2.2272304939386817e-07, 20.000000000000000, 10.000000000000000, + -8.0000000000000000 }, + { 1.2925568212606171e-06, 20.000000000000000, 10.000000000000000, + -7.0000000000000000 }, + { 5.5744573775996227e-06, 20.000000000000000, 10.000000000000000, + -6.0000000000000000 }, + { -6.2568272011787340e-06, 20.000000000000000, 10.000000000000000, + -5.0000000000000000 }, + { -0.00011955177906335608, 20.000000000000000, 10.000000000000000, + -4.0000000000000000 }, + { 9.2475405516991078e-05, 20.000000000000000, 10.000000000000000, + -3.0000000000000000 }, + { 0.010123531287569982, 20.000000000000000, 10.000000000000000, + -2.0000000000000000 }, + { 0.12118937229909535, 20.000000000000000, 10.000000000000000, + -1.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 0.0000000000000000 }, + { 6.8319857942415494, 20.000000000000000, 10.000000000000000, + 1.0000000000000000 }, + { 41.356658140815220, 20.000000000000000, 10.000000000000000, + 2.0000000000000000 }, + { 229.57496033810907, 20.000000000000000, 10.000000000000000, + 3.0000000000000000 }, + { 1192.7830549969506, 20.000000000000000, 10.000000000000000, + 4.0000000000000000 }, + { 5878.6003887215920, 20.000000000000000, 10.000000000000000, + 5.0000000000000000 }, + { 27741.749322673899, 20.000000000000000, 10.000000000000000, + 6.0000000000000000 }, + { 126220.54599305884, 20.000000000000000, 10.000000000000000, + 7.0000000000000000 }, + { 556592.10886612453, 20.000000000000000, 10.000000000000000, + 8.0000000000000000 }, + { 2388555.2873243922, 20.000000000000000, 10.000000000000000, + 9.0000000000000000 }, + { 10008079.497419352, 20.000000000000000, 10.000000000000000, + 10.000000000000000 }, +}; + +// Test function for a=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test070() +{ + 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(data070) + / sizeof(testcase_conf_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::conf_hyperg(Tp(data070[i].a), Tp(data070[i].c), + Tp(data070[i].x)); + const Tp f0 = data070[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.5000000000000009e-07)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + test037<double>(); + test038<double>(); + test039<double>(); + test040<double>(); + test041<double>(); + test042<double>(); + test043<double>(); + test044<double>(); + test045<double>(); + test046<double>(); + test047<double>(); + test048<double>(); + test049<double>(); + test050<double>(); + test051<double>(); + test052<double>(); + test053<double>(); + test054<double>(); + test055<double>(); + test056<double>(); + test057<double>(); + test058<double>(); + test059<double>(); + test060<double>(); + test061<double>(); + test062<double>(); + test063<double>(); + test064<double>(); + test065<double>(); + test066<double>(); + test067<double>(); + test068<double>(); + test069<double>(); + test070<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile.cc new file mode 100644 index 00000000000..1085952d7da --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile_2.cc new file mode 100644 index 00000000000..654bdf90316 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/07_conf_hyperg/compile_2.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_nan.cc new file mode 100644 index 00000000000..4220f0236d5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_nan.cc @@ -0,0 +1,87 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_value.cc new file mode 100644 index 00000000000..32f8af1c26a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/check_value.cc @@ -0,0 +1,629 @@ +// 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. + +// cyl_bessel_i + + +// 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 for nu=0.0000000000000000. +testcase_cyl_bessel_i<double> data001[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000 }, + { 27.239871823604439, 0.0000000000000000, 5.0000000000000000 }, + { 2815.7166284662558, 0.0000000000000000, 10.000000000000000 }, + { 339649.37329791381, 0.0000000000000000, 15.000000000000000 }, + { 43558282.559553474, 0.0000000000000000, 20.000000000000000 }, + { 5774560606.4663124, 0.0000000000000000, 25.000000000000000 }, + { 781672297823.97925, 0.0000000000000000, 30.000000000000000 }, + { 107338818494514.42, 0.0000000000000000, 35.000000000000000 }, + { 14894774793419918., 0.0000000000000000, 40.000000000000000 }, + { 2.0834140751773158e+18, 0.0000000000000000, 45.000000000000000 }, + { 2.9325537838493463e+20, 0.0000000000000000, 50.000000000000000 }, + { 4.1487895607332160e+22, 0.0000000000000000, 55.000000000000000 }, + { 5.8940770556098216e+24, 0.0000000000000000, 60.000000000000000 }, + { 8.4030398456255610e+26, 0.0000000000000000, 65.000000000000000 }, + { 1.2015889579125422e+29, 0.0000000000000000, 70.000000000000000 }, + { 1.7226390780357971e+31, 0.0000000000000000, 75.000000000000000 }, + { 2.4751784043341670e+33, 0.0000000000000000, 80.000000000000000 }, + { 3.5634776304081418e+35, 0.0000000000000000, 85.000000000000000 }, + { 5.1392383455086475e+37, 0.0000000000000000, 90.000000000000000 }, + { 7.4233258618752096e+39, 0.0000000000000000, 95.000000000000000 }, + { 1.0737517071310986e+42, 0.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.0000000000000000. +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_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data001[i].nu), 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.5000000000000015e-12)); +} + +// Test data for nu=0.33333333333333331. +testcase_cyl_bessel_i<double> data002[] = { + { 0.0000000000000000, 0.33333333333333331, 0.0000000000000000 }, + { 26.897553069268362, 0.33333333333333331, 5.0000000000000000 }, + { 2799.2396097056790, 0.33333333333333331, 10.000000000000000 }, + { 338348.63146593655, 0.33333333333333331, 15.000000000000000 }, + { 43434263.927938439, 0.33333333333333331, 20.000000000000000 }, + { 5761474759.6213636, 0.33333333333333331, 25.000000000000000 }, + { 780201111830.30225, 0.33333333333333331, 30.000000000000000 }, + { 107166066959051.92, 0.33333333333333331, 35.000000000000000 }, + { 14873836574083760., 0.33333333333333331, 40.000000000000000 }, + { 2.0808143020217085e+18, 0.33333333333333331, 45.000000000000000 }, + { 2.9292639365644229e+20, 0.33333333333333331, 50.000000000000000 }, + { 4.1445621624120489e+22, 0.33333333333333331, 55.000000000000000 }, + { 5.8885758374365916e+24, 0.33333333333333331, 60.000000000000000 }, + { 8.3958047021083955e+26, 0.33333333333333331, 65.000000000000000 }, + { 1.2006287819446431e+29, 0.33333333333333331, 70.000000000000000 }, + { 1.7213548977150022e+31, 0.33333333333333331, 75.000000000000000 }, + { 2.4734492458444449e+33, 0.33333333333333331, 80.000000000000000 }, + { 3.5611354547857122e+35, 0.33333333333333331, 85.000000000000000 }, + { 5.1360491295551829e+37, 0.33333333333333331, 90.000000000000000 }, + { 7.4189629097600431e+39, 0.33333333333333331, 95.000000000000000 }, + { 1.0731523308358370e+42, 0.33333333333333331, 100.00000000000000 }, +}; + +// Test function for nu=0.33333333333333331. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data002[i].nu), Tp(data002[i].x)); + const Tp f0 = data002[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(1.0000000000000008e-12)); +} + +// Test data for nu=0.50000000000000000. +testcase_cyl_bessel_i<double> data003[] = { + { 0.0000000000000000, 0.50000000000000000, 0.0000000000000000 }, + { 26.477547497559065, 0.50000000000000000, 5.0000000000000000 }, + { 2778.7846038745711, 0.50000000000000000, 10.000000000000000 }, + { 336729.88718706399, 0.50000000000000000, 15.000000000000000 }, + { 43279746.272428922, 0.50000000000000000, 20.000000000000000 }, + { 5745159748.3464680, 0.50000000000000000, 25.000000000000000 }, + { 778366068840.44580, 0.50000000000000000, 30.000000000000000 }, + { 106950522408567.66, 0.50000000000000000, 35.000000000000000 }, + { 14847705549021962., 0.50000000000000000, 40.000000000000000 }, + { 2.0775691824625661e+18, 0.50000000000000000, 45.000000000000000 }, + { 2.9251568529912988e+20, 0.50000000000000000, 50.000000000000000 }, + { 4.1392840094781220e+22, 0.50000000000000000, 55.000000000000000 }, + { 5.8817065760751945e+24, 0.50000000000000000, 60.000000000000000 }, + { 8.3867695787277231e+26, 0.50000000000000000, 65.000000000000000 }, + { 1.1994296461653203e+29, 0.50000000000000000, 70.000000000000000 }, + { 1.7197510246063332e+31, 0.50000000000000000, 75.000000000000000 }, + { 2.4712895036230794e+33, 0.50000000000000000, 80.000000000000000 }, + { 3.5582099086757769e+35, 0.50000000000000000, 85.000000000000000 }, + { 5.1320654031231090e+37, 0.50000000000000000, 90.000000000000000 }, + { 7.4135128383495227e+39, 0.50000000000000000, 95.000000000000000 }, + { 1.0724035825423179e+42, 0.50000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.50000000000000000. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data003[i].nu), Tp(data003[i].x)); + const Tp f0 = data003[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(1.0000000000000008e-12)); +} + +// Test data for nu=0.66666666666666663. +testcase_cyl_bessel_i<double> data004[] = { + { 0.0000000000000000, 0.66666666666666663, 0.0000000000000000 }, + { 25.902310583215122, 0.66666666666666663, 5.0000000000000000 }, + { 2750.4090423459315, 0.66666666666666663, 10.000000000000000 }, + { 334476.98138574383, 0.66666666666666663, 15.000000000000000 }, + { 43064361.686912313, 0.66666666666666663, 20.000000000000000 }, + { 5722397441.9603882, 0.66666666666666663, 25.000000000000000 }, + { 775804343498.02661, 0.66666666666666663, 30.000000000000000 }, + { 106649495512800.89, 0.66666666666666663, 35.000000000000000 }, + { 14811199896983756., 0.66666666666666663, 40.000000000000000 }, + { 2.0730345814356961e+18, 0.66666666666666663, 45.000000000000000 }, + { 2.9194166755257467e+20, 0.66666666666666663, 50.000000000000000 }, + { 4.1319059569935366e+22, 0.66666666666666663, 55.000000000000000 }, + { 5.8721031476386222e+24, 0.66666666666666663, 60.000000000000000 }, + { 8.3741368248217830e+26, 0.66666666666666663, 65.000000000000000 }, + { 1.1977528777008688e+29, 0.66666666666666663, 70.000000000000000 }, + { 1.7175081240014333e+31, 0.66666666666666663, 75.000000000000000 }, + { 2.4682690458513916e+33, 0.66666666666666663, 80.000000000000000 }, + { 3.5541181975850724e+35, 0.66666666666666663, 85.000000000000000 }, + { 5.1264933963228864e+37, 0.66666666666666663, 90.000000000000000 }, + { 7.4058894880134064e+39, 0.66666666666666663, 95.000000000000000 }, + { 1.0713562154788124e+42, 0.66666666666666663, 100.00000000000000 }, +}; + +// Test function for nu=0.66666666666666663. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data004[i].nu), Tp(data004[i].x)); + const Tp f0 = data004[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)); +} + +// Test data for nu=1.0000000000000000. +testcase_cyl_bessel_i<double> data005[] = { + { 0.0000000000000000, 1.0000000000000000, 0.0000000000000000 }, + { 24.335642142450524, 1.0000000000000000, 5.0000000000000000 }, + { 2670.9883037012560, 1.0000000000000000, 10.000000000000000 }, + { 328124.92197020649, 1.0000000000000000, 15.000000000000000 }, + { 42454973.385127775, 1.0000000000000000, 20.000000000000000 }, + { 5657865129.8787022, 1.0000000000000000, 25.000000000000000 }, + { 768532038938.95667, 1.0000000000000000, 30.000000000000000 }, + { 105794126051896.17, 1.0000000000000000, 35.000000000000000 }, + { 14707396163259354., 1.0000000000000000, 40.000000000000000 }, + { 2.0601334620815775e+18, 1.0000000000000000, 45.000000000000000 }, + { 2.9030785901035635e+20, 1.0000000000000000, 50.000000000000000 }, + { 4.1108986452992812e+22, 1.0000000000000000, 55.000000000000000 }, + { 5.8447515883904527e+24, 1.0000000000000000, 60.000000000000000 }, + { 8.3381485471501302e+26, 1.0000000000000000, 65.000000000000000 }, + { 1.1929750788892366e+29, 1.0000000000000000, 70.000000000000000 }, + { 1.7111160152965384e+31, 1.0000000000000000, 75.000000000000000 }, + { 2.4596595795675343e+33, 1.0000000000000000, 80.000000000000000 }, + { 3.5424536064404024e+35, 1.0000000000000000, 85.000000000000000 }, + { 5.1106068152566129e+37, 1.0000000000000000, 90.000000000000000 }, + { 7.3841518091360157e+39, 1.0000000000000000, 95.000000000000000 }, + { 1.0683693903381569e+42, 1.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=1.0000000000000000. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data005[i].nu), Tp(data005[i].x)); + const Tp f0 = data005[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)); +} + +// Test data for nu=2.0000000000000000. +testcase_cyl_bessel_i<double> data006[] = { + { 0.0000000000000000, 2.0000000000000000, 0.0000000000000000 }, + { 17.505614966624233, 2.0000000000000000, 5.0000000000000000 }, + { 2281.5189677260046, 2.0000000000000000, 10.000000000000000 }, + { 295899.38370188634, 2.0000000000000000, 15.000000000000000 }, + { 39312785.221040756, 2.0000000000000000, 20.000000000000000 }, + { 5321931396.0760136, 2.0000000000000000, 25.000000000000000 }, + { 730436828561.38013, 2.0000000000000000, 30.000000000000000 }, + { 101293439862977.19, 2.0000000000000000, 35.000000000000000 }, + { 14159404985256920., 2.0000000000000000, 40.000000000000000 }, + { 1.9918525879736883e+18, 2.0000000000000000, 45.000000000000000 }, + { 2.8164306402451938e+20, 2.0000000000000000, 50.000000000000000 }, + { 3.9993023372677515e+22, 2.0000000000000000, 55.000000000000000 }, + { 5.6992520026634433e+24, 2.0000000000000000, 60.000000000000000 }, + { 8.1464814287900378e+26, 2.0000000000000000, 65.000000000000000 }, + { 1.1675039556585663e+29, 2.0000000000000000, 70.000000000000000 }, + { 1.6770093176278926e+31, 2.0000000000000000, 75.000000000000000 }, + { 2.4136869148449879e+33, 2.0000000000000000, 80.000000000000000 }, + { 3.4801257808448186e+35, 2.0000000000000000, 85.000000000000000 }, + { 5.0256693051696307e+37, 2.0000000000000000, 90.000000000000000 }, + { 7.2678700343145842e+39, 2.0000000000000000, 95.000000000000000 }, + { 1.0523843193243042e+42, 2.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=2.0000000000000000. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data006[i].nu), Tp(data006[i].x)); + const Tp f0 = data006[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)); +} + +// Test data for nu=5.0000000000000000. +testcase_cyl_bessel_i<double> data007[] = { + { 0.0000000000000000, 5.0000000000000000, 0.0000000000000000 }, + { 2.1579745473225476, 5.0000000000000000, 5.0000000000000000 }, + { 777.18828640326012, 5.0000000000000000, 10.000000000000000 }, + { 144572.01120063406, 5.0000000000000000, 15.000000000000000 }, + { 23018392.213413671, 5.0000000000000000, 20.000000000000000 }, + { 3472466208.7419176, 5.0000000000000000, 25.000000000000000 }, + { 512151465476.93494, 5.0000000000000000, 30.000000000000000 }, + { 74756743552251.531, 5.0000000000000000, 35.000000000000000 }, + { 10858318337624276., 5.0000000000000000, 40.000000000000000 }, + { 1.5736087399245906e+18, 5.0000000000000000, 45.000000000000000 }, + { 2.2785483079112829e+20, 5.0000000000000000, 50.000000000000000 }, + { 3.2989391052963687e+22, 5.0000000000000000, 55.000000000000000 }, + { 4.7777652072561742e+24, 5.0000000000000000, 60.000000000000000 }, + { 6.9232165147172671e+26, 5.0000000000000000, 65.000000000000000 }, + { 1.0038643002095153e+29, 5.0000000000000000, 70.000000000000000 }, + { 1.4566328222327068e+31, 5.0000000000000000, 75.000000000000000 }, + { 2.1151488565944838e+33, 5.0000000000000000, 80.000000000000000 }, + { 3.0735883450768236e+35, 5.0000000000000000, 85.000000000000000 }, + { 4.4694790189230327e+37, 5.0000000000000000, 90.000000000000000 }, + { 6.5037505570430971e+39, 5.0000000000000000, 95.000000000000000 }, + { 9.4700938730355882e+41, 5.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=5.0000000000000000. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data007[i].nu), Tp(data007[i].x)); + const Tp f0 = data007[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)); +} + +// Test data for nu=10.000000000000000. +testcase_cyl_bessel_i<double> data008[] = { + { 0.0000000000000000, 10.000000000000000, 0.0000000000000000 }, + { 0.0045800444191760525, 10.000000000000000, 5.0000000000000000 }, + { 21.891706163723381, 10.000000000000000, 10.000000000000000 }, + { 12267.475049806462, 10.000000000000000, 15.000000000000000 }, + { 3540200.2090195213, 10.000000000000000, 20.000000000000000 }, + { 771298871.17072666, 10.000000000000000, 25.000000000000000 }, + { 145831809975.96713, 10.000000000000000, 30.000000000000000 }, + { 25449470018534.785, 10.000000000000000, 35.000000000000000 }, + { 4228469210516757.5, 10.000000000000000, 40.000000000000000 }, + { 6.8049404557505152e+17, 10.000000000000000, 45.000000000000000 }, + { 1.0715971594776370e+20, 10.000000000000000, 50.000000000000000 }, + { 1.6618215752886714e+22, 10.000000000000000, 55.000000000000000 }, + { 2.5486246072566784e+24, 10.000000000000000, 60.000000000000000 }, + { 3.8764628702155481e+26, 10.000000000000000, 65.000000000000000 }, + { 5.8592538145409686e+28, 10.000000000000000, 70.000000000000000 }, + { 8.8135370711317444e+30, 10.000000000000000, 75.000000000000000 }, + { 1.3207418268325279e+33, 10.000000000000000, 80.000000000000000 }, + { 1.9732791360862186e+35, 10.000000000000000, 85.000000000000000 }, + { 2.9411893748384672e+37, 10.000000000000000, 90.000000000000000 }, + { 4.3754494922439990e+39, 10.000000000000000, 95.000000000000000 }, + { 6.4989755247201446e+41, 10.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=10.000000000000000. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data008[i].nu), Tp(data008[i].x)); + const Tp f0 = data008[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)); +} + +// Test data for nu=20.000000000000000. +testcase_cyl_bessel_i<double> data009[] = { + { 0.0000000000000000, 20.000000000000000, 0.0000000000000000 }, + { 5.0242393579718066e-11, 20.000000000000000, 5.0000000000000000 }, + { 0.00012507997356449481, 20.000000000000000, 10.000000000000000 }, + { 1.6470152535015834, 20.000000000000000, 15.000000000000000 }, + { 3188.7503288536154, 20.000000000000000, 20.000000000000000 }, + { 2449840.5422952301, 20.000000000000000, 25.000000000000000 }, + { 1126985104.4483771, 20.000000000000000, 30.000000000000000 }, + { 379617876611.88586, 20.000000000000000, 35.000000000000000 }, + { 104459633129479.89, 20.000000000000000, 40.000000000000000 }, + { 25039579987216504., 20.000000000000000, 45.000000000000000 }, + { 5.4420084027529964e+18, 20.000000000000000, 50.000000000000000 }, + { 1.1007498584335492e+21, 20.000000000000000, 55.000000000000000 }, + { 2.1091734863057236e+23, 20.000000000000000, 60.000000000000000 }, + { 3.8763618091286899e+25, 20.000000000000000, 65.000000000000000 }, + { 6.8946130527930859e+27, 20.000000000000000, 70.000000000000000 }, + { 1.1946319948836447e+30, 20.000000000000000, 75.000000000000000 }, + { 2.0265314377577580e+32, 20.000000000000000, 80.000000000000000 }, + { 3.3784665214179971e+34, 20.000000000000000, 85.000000000000000 }, + { 5.5516089411796670e+36, 20.000000000000000, 90.000000000000000 }, + { 9.0129310795305151e+38, 20.000000000000000, 95.000000000000000 }, + { 1.4483461256427176e+41, 20.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=20.000000000000000. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data009[i].nu), Tp(data009[i].x)); + const Tp f0 = data009[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)); +} + +// Test data for nu=50.000000000000000. +testcase_cyl_bessel_i<double> data010[] = { + { 0.0000000000000000, 50.000000000000000, 0.0000000000000000 }, + { 2.9314696468108517e-45, 50.000000000000000, 5.0000000000000000 }, + { 4.7568945607268442e-30, 50.000000000000000, 10.000000000000000 }, + { 5.5468372730667069e-21, 50.000000000000000, 15.000000000000000 }, + { 2.2551205757604056e-14, 50.000000000000000, 20.000000000000000 }, + { 4.5344251866130282e-09, 50.000000000000000, 25.000000000000000 }, + { 0.00014590106916468937, 50.000000000000000, 30.000000000000000 }, + { 1.3965549457254878, 50.000000000000000, 35.000000000000000 }, + { 5726.8656631289878, 50.000000000000000, 40.000000000000000 }, + { 12672593.113027776, 50.000000000000000, 45.000000000000000 }, + { 17650802430.016705, 50.000000000000000, 50.000000000000000 }, + { 17220231607789.926, 50.000000000000000, 55.000000000000000 }, + { 12704607933652172., 50.000000000000000, 60.000000000000000 }, + { 7.4989491942193766e+18, 50.000000000000000, 65.000000000000000 }, + { 3.6944034898904901e+21, 50.000000000000000, 70.000000000000000 }, + { 1.5691634774370194e+24, 50.000000000000000, 75.000000000000000 }, + { 5.8927749458163587e+26, 50.000000000000000, 80.000000000000000 }, + { 1.9958849054749339e+29, 50.000000000000000, 85.000000000000000 }, + { 6.1946050361781518e+31, 50.000000000000000, 90.000000000000000 }, + { 1.7845429728697110e+34, 50.000000000000000, 95.000000000000000 }, + { 4.8219580855940813e+36, 50.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=50.000000000000000. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data010[i].nu), Tp(data010[i].x)); + const Tp f0 = data010[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.0000000000000029e-12)); +} + +// Test data for nu=100.00000000000000. +testcase_cyl_bessel_i<double> data011[] = { + { 0.0000000000000000, 100.00000000000000, 0.0000000000000000 }, + { 7.0935514885313123e-119, 100.00000000000000, 5.0000000000000000 }, + { 1.0823442017492018e-88, 100.00000000000000, 10.000000000000000 }, + { 5.9887888536468904e-71, 100.00000000000000, 15.000000000000000 }, + { 2.8703193216428771e-58, 100.00000000000000, 20.000000000000000 }, + { 2.4426896913122370e-48, 100.00000000000000, 25.000000000000000 }, + { 3.9476420053334271e-40, 100.00000000000000, 30.000000000000000 }, + { 4.2836596180818801e-33, 100.00000000000000, 35.000000000000000 }, + { 6.6249380222596129e-27, 100.00000000000000, 40.000000000000000 }, + { 2.3702587262788881e-21, 100.00000000000000, 45.000000000000000 }, + { 2.7278879470966907e-16, 100.00000000000000, 50.000000000000000 }, + { 1.2763258878228088e-11, 100.00000000000000, 55.000000000000000 }, + { 2.8832770906491951e-07, 100.00000000000000, 60.000000000000000 }, + { 0.0035805902717061240, 100.00000000000000, 65.000000000000000 }, + { 27.017219102595398, 100.00000000000000, 70.000000000000000 }, + { 134001.44891209516, 100.00000000000000, 75.000000000000000 }, + { 465194832.85061038, 100.00000000000000, 80.000000000000000 }, + { 1189280653119.4819, 100.00000000000000, 85.000000000000000 }, + { 2334119331258731.0, 100.00000000000000, 90.000000000000000 }, + { 3.6399223078502380e+18, 100.00000000000000, 95.000000000000000 }, + { 4.6415349416161989e+21, 100.00000000000000, 100.00000000000000 }, +}; + +// Test function for nu=100.00000000000000. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_cyl_bessel_i<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_i(Tp(data011[i].nu), Tp(data011[i].x)); + const Tp f0 = data011[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.5000000000000014e-11)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile.cc new file mode 100644 index 00000000000..31d77980cd0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile_2.cc new file mode 100644 index 00000000000..374d7ac41fb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/08_cyl_bessel_i/compile_2.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_nan.cc new file mode 100644 index 00000000000..606697a00b4 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_nan.cc @@ -0,0 +1,87 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_value.cc new file mode 100644 index 00000000000..5fa6e0cb4d0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/check_value.cc @@ -0,0 +1,629 @@ +// 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. + +// cyl_bessel_j + + +// 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 for nu=0.0000000000000000. +testcase_cyl_bessel_j<double> data001[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000 }, + { -0.17759677131433835, 0.0000000000000000, 5.0000000000000000 }, + { -0.24593576445134832, 0.0000000000000000, 10.000000000000000 }, + { -0.014224472826780788, 0.0000000000000000, 15.000000000000000 }, + { 0.16702466434058319, 0.0000000000000000, 20.000000000000000 }, + { 0.096266783275958140, 0.0000000000000000, 25.000000000000000 }, + { -0.086367983581040184, 0.0000000000000000, 30.000000000000000 }, + { -0.12684568275631256, 0.0000000000000000, 35.000000000000000 }, + { 0.0073668905842372914, 0.0000000000000000, 40.000000000000000 }, + { 0.11581867067325630, 0.0000000000000000, 45.000000000000000 }, + { 0.055812327669251746, 0.0000000000000000, 50.000000000000000 }, + { -0.074548302648236808, 0.0000000000000000, 55.000000000000000 }, + { -0.091471804089061873, 0.0000000000000000, 60.000000000000000 }, + { 0.018687343227677920, 0.0000000000000000, 65.000000000000000 }, + { 0.094908726483013517, 0.0000000000000000, 70.000000000000000 }, + { 0.034643913805097029, 0.0000000000000000, 75.000000000000000 }, + { -0.069742165512210061, 0.0000000000000000, 80.000000000000000 }, + { -0.070940394796273301, 0.0000000000000000, 85.000000000000000 }, + { 0.026630016699969568, 0.0000000000000000, 90.000000000000000 }, + { 0.081811967783384149, 0.0000000000000000, 95.000000000000000 }, + { 0.019985850304223264, 0.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.0000000000000000. +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_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data001[i].nu), 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.5000000000000014e-11)); +} + +// Test data for nu=0.33333333333333331. +testcase_cyl_bessel_j<double> data002[] = { + { 0.0000000000000000, 0.33333333333333331, 0.0000000000000000 }, + { -0.30642046380026405, 0.33333333333333331, 5.0000000000000000 }, + { -0.18614516704869569, 0.33333333333333331, 10.000000000000000 }, + { 0.089740004221152581, 0.33333333333333331, 15.000000000000000 }, + { 0.17606058001293898, 0.33333333333333331, 20.000000000000000 }, + { 0.020097162141383202, 0.33333333333333331, 25.000000000000000 }, + { -0.13334053387426156, 0.33333333333333331, 30.000000000000000 }, + { -0.087118009397765442, 0.33333333333333331, 35.000000000000000 }, + { 0.069202942818858165, 0.33333333333333331, 40.000000000000000 }, + { 0.11387616964518317, 0.33333333333333331, 45.000000000000000 }, + { -0.00057226680771807741, 0.33333333333333331, 50.000000000000000 }, + { -0.10331600929280821, 0.33333333333333331, 55.000000000000000 }, + { -0.055618147270528023, 0.33333333333333331, 60.000000000000000 }, + { 0.064711954014113920, 0.33333333333333331, 65.000000000000000 }, + { 0.086879926462481619, 0.33333333333333331, 70.000000000000000 }, + { -0.012614484229891070, 0.33333333333333331, 75.000000000000000 }, + { -0.088199784400034537, 0.33333333333333331, 80.000000000000000 }, + { -0.036703611076564557, 0.33333333333333331, 85.000000000000000 }, + { 0.062916286828779533, 0.33333333333333331, 90.000000000000000 }, + { 0.069465244416806071, 0.33333333333333331, 95.000000000000000 }, + { -0.021271244853702295, 0.33333333333333331, 100.00000000000000 }, +}; + +// Test function for nu=0.33333333333333331. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data002[i].nu), Tp(data002[i].x)); + const Tp f0 = data002[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.5000000000000017e-10)); +} + +// Test data for nu=0.50000000000000000. +testcase_cyl_bessel_j<double> data003[] = { + { 0.0000000000000000, 0.50000000000000000, 0.0000000000000000 }, + { -0.34216798479816180, 0.50000000000000000, 5.0000000000000000 }, + { -0.13726373575505049, 0.50000000000000000, 10.000000000000000 }, + { 0.13396768882243942, 0.50000000000000000, 15.000000000000000 }, + { 0.16288076385502981, 0.50000000000000000, 20.000000000000000 }, + { -0.021120283599650416, 0.50000000000000000, 25.000000000000000 }, + { -0.14392965337039987, 0.50000000000000000, 30.000000000000000 }, + { -0.057747757589458860, 0.50000000000000000, 35.000000000000000 }, + { 0.094000962389533579, 0.50000000000000000, 40.000000000000000 }, + { 0.10120783324271412, 0.50000000000000000, 45.000000000000000 }, + { -0.029605831888924662, 0.50000000000000000, 50.000000000000000 }, + { -0.10756039213265806, 0.50000000000000000, 55.000000000000000 }, + { -0.031397461182520445, 0.50000000000000000, 60.000000000000000 }, + { 0.081827430775628568, 0.50000000000000000, 65.000000000000000 }, + { 0.073802429539054637, 0.50000000000000000, 70.000000000000000 }, + { -0.035727009681702594, 0.50000000000000000, 75.000000000000000 }, + { -0.088661035811765446, 0.50000000000000000, 80.000000000000000 }, + { -0.015238065106312407, 0.50000000000000000, 85.000000000000000 }, + { 0.075189068550269425, 0.50000000000000000, 90.000000000000000 }, + { 0.055932643481494140, 0.50000000000000000, 95.000000000000000 }, + { -0.040402132716252113, 0.50000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.50000000000000000. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data003[i].nu), Tp(data003[i].x)); + const Tp f0 = data003[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.5000000000000014e-11)); +} + +// Test data for nu=0.66666666666666663. +testcase_cyl_bessel_j<double> data004[] = { + { 0.0000000000000000, 0.66666666666666663, 0.0000000000000000 }, + { -0.35712533549168879, 0.66666666666666663, 5.0000000000000000 }, + { -0.080149603304315822, 0.66666666666666663, 10.000000000000000 }, + { 0.16918875175798076, 0.66666666666666663, 15.000000000000000 }, + { 0.13904826122116526, 0.66666666666666663, 20.000000000000000 }, + { -0.060770629698497579, 0.66666666666666663, 25.000000000000000 }, + { -0.14489851974205059, 0.66666666666666663, 30.000000000000000 }, + { -0.024604880159644467, 0.66666666666666663, 35.000000000000000 }, + { 0.11243936464912015, 0.66666666666666663, 40.000000000000000 }, + { 0.081776275512525379, 0.66666666666666663, 45.000000000000000 }, + { -0.056589908749367770, 0.66666666666666663, 50.000000000000000 }, + { -0.10455814523765933, 0.66666666666666663, 55.000000000000000 }, + { -0.0051030148548608109, 0.66666666666666663, 60.000000000000000 }, + { 0.093398227061639250, 0.66666666666666663, 65.000000000000000 }, + { 0.055763883611864899, 0.66666666666666663, 70.000000000000000 }, + { -0.056395322915757343, 0.66666666666666663, 75.000000000000000 }, + { -0.083131347805783087, 0.66666666666666663, 80.000000000000000 }, + { 0.0072315397874096309, 0.66666666666666663, 85.000000000000000 }, + { 0.082362798520905264, 0.66666666666666663, 90.000000000000000 }, + { 0.038630504403446168, 0.66666666666666663, 95.000000000000000 }, + { -0.056778819380529706, 0.66666666666666663, 100.00000000000000 }, +}; + +// Test function for nu=0.66666666666666663. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data004[i].nu), Tp(data004[i].x)); + const Tp f0 = data004[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(1.0000000000000006e-10)); +} + +// Test data for nu=1.0000000000000000. +testcase_cyl_bessel_j<double> data005[] = { + { 0.0000000000000000, 1.0000000000000000, 0.0000000000000000 }, + { -0.32757913759146523, 1.0000000000000000, 5.0000000000000000 }, + { 0.043472746168861369, 1.0000000000000000, 10.000000000000000 }, + { 0.20510403861352278, 1.0000000000000000, 15.000000000000000 }, + { 0.066833124175850092, 1.0000000000000000, 20.000000000000000 }, + { -0.12535024958028987, 1.0000000000000000, 25.000000000000000 }, + { -0.11875106261662292, 1.0000000000000000, 30.000000000000000 }, + { 0.043990942179625556, 1.0000000000000000, 35.000000000000000 }, + { 0.12603831803758497, 1.0000000000000000, 40.000000000000000 }, + { 0.028348854376424548, 1.0000000000000000, 45.000000000000000 }, + { -0.097511828125175157, 1.0000000000000000, 50.000000000000000 }, + { -0.078250038308684655, 1.0000000000000000, 55.000000000000000 }, + { 0.046598383758166398, 1.0000000000000000, 60.000000000000000 }, + { 0.097330172226126929, 1.0000000000000000, 65.000000000000000 }, + { 0.0099877887848384625, 1.0000000000000000, 70.000000000000000 }, + { -0.085139995044829109, 1.0000000000000000, 75.000000000000000 }, + { -0.056057296675712610, 1.0000000000000000, 80.000000000000000 }, + { 0.049151460334891116, 1.0000000000000000, 85.000000000000000 }, + { 0.079925646708868064, 1.0000000000000000, 90.000000000000000 }, + { -0.0023925612997268684, 1.0000000000000000, 95.000000000000000 }, + { -0.077145352014112142, 1.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=1.0000000000000000. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data005[i].nu), Tp(data005[i].x)); + const Tp f0 = data005[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(1.0000000000000006e-10)); +} + +// Test data for nu=2.0000000000000000. +testcase_cyl_bessel_j<double> data006[] = { + { 0.0000000000000000, 2.0000000000000000, 0.0000000000000000 }, + { 0.046565116277751971, 2.0000000000000000, 5.0000000000000000 }, + { 0.25463031368512062, 2.0000000000000000, 10.000000000000000 }, + { 0.041571677975250479, 2.0000000000000000, 15.000000000000000 }, + { -0.16034135192299817, 2.0000000000000000, 20.000000000000000 }, + { -0.10629480324238134, 2.0000000000000000, 25.000000000000000 }, + { 0.078451246073265340, 2.0000000000000000, 30.000000000000000 }, + { 0.12935945088086262, 2.0000000000000000, 35.000000000000000 }, + { -0.0010649746823580893, 2.0000000000000000, 40.000000000000000 }, + { -0.11455872158985966, 2.0000000000000000, 45.000000000000000 }, + { -0.059712800794258801, 2.0000000000000000, 50.000000000000000 }, + { 0.071702846709739212, 2.0000000000000000, 55.000000000000000 }, + { 0.093025083547667448, 2.0000000000000000, 60.000000000000000 }, + { -0.015692568697643280, 2.0000000000000000, 65.000000000000000 }, + { -0.094623361089160987, 2.0000000000000000, 70.000000000000000 }, + { -0.036914313672959186, 2.0000000000000000, 75.000000000000000 }, + { 0.068340733095317227, 2.0000000000000000, 80.000000000000000 }, + { 0.072096899745329499, 2.0000000000000000, 85.000000000000000 }, + { -0.024853891217550262, 2.0000000000000000, 90.000000000000000 }, + { -0.081862337494957346, 2.0000000000000000, 95.000000000000000 }, + { -0.021528757344505392, 2.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=2.0000000000000000. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data006[i].nu), Tp(data006[i].x)); + const Tp f0 = data006[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(1.0000000000000006e-10)); +} + +// Test data for nu=5.0000000000000000. +testcase_cyl_bessel_j<double> data007[] = { + { 0.0000000000000000, 5.0000000000000000, 0.0000000000000000 }, + { 0.26114054612017007, 5.0000000000000000, 5.0000000000000000 }, + { -0.23406152818679365, 5.0000000000000000, 10.000000000000000 }, + { 0.13045613456502966, 5.0000000000000000, 15.000000000000000 }, + { 0.15116976798239504, 5.0000000000000000, 20.000000000000000 }, + { -0.066007995398423044, 5.0000000000000000, 25.000000000000000 }, + { -0.14324029551207709, 5.0000000000000000, 30.000000000000000 }, + { -0.0015053072953907080, 5.0000000000000000, 35.000000000000000 }, + { 0.12257346597711774, 5.0000000000000000, 40.000000000000000 }, + { 0.057984499200954144, 5.0000000000000000, 45.000000000000000 }, + { -0.081400247696569658, 5.0000000000000000, 50.000000000000000 }, + { -0.092569895786432710, 5.0000000000000000, 55.000000000000000 }, + { 0.027454744228344184, 5.0000000000000000, 60.000000000000000 }, + { 0.099110527701539039, 5.0000000000000000, 65.000000000000000 }, + { 0.026058129823895274, 5.0000000000000000, 70.000000000000000 }, + { -0.078523977013751398, 5.0000000000000000, 75.000000000000000 }, + { -0.065862349140031654, 5.0000000000000000, 80.000000000000000 }, + { 0.038669072284680923, 5.0000000000000000, 85.000000000000000 }, + { 0.082759319528415129, 5.0000000000000000, 90.000000000000000 }, + { 0.0079423372702472905, 5.0000000000000000, 95.000000000000000 }, + { -0.074195736964513911, 5.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=5.0000000000000000. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data007[i].nu), Tp(data007[i].x)); + const Tp f0 = data007[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.0000000000000028e-11)); +} + +// Test data for nu=10.000000000000000. +testcase_cyl_bessel_j<double> data008[] = { + { 0.0000000000000000, 10.000000000000000, 0.0000000000000000 }, + { 0.0014678026473104744, 10.000000000000000, 5.0000000000000000 }, + { 0.20748610663335865, 10.000000000000000, 10.000000000000000 }, + { -0.090071811047659045, 10.000000000000000, 15.000000000000000 }, + { 0.18648255802394512, 10.000000000000000, 20.000000000000000 }, + { -0.075179843948523270, 10.000000000000000, 25.000000000000000 }, + { -0.12987689399858882, 10.000000000000000, 30.000000000000000 }, + { 0.063546391343962852, 10.000000000000000, 35.000000000000000 }, + { 0.11938336278226093, 10.000000000000000, 40.000000000000000 }, + { -0.026971402475010734, 10.000000000000000, 45.000000000000000 }, + { -0.11384784914946940, 10.000000000000000, 50.000000000000000 }, + { -0.015773790303746010, 10.000000000000000, 55.000000000000000 }, + { 0.097177143328071106, 10.000000000000000, 60.000000000000000 }, + { 0.054617389951112157, 10.000000000000000, 65.000000000000000 }, + { -0.065870338561951874, 10.000000000000000, 70.000000000000000 }, + { -0.080417867891894437, 10.000000000000000, 75.000000000000000 }, + { 0.024043850978184754, 10.000000000000000, 80.000000000000000 }, + { 0.086824832700067869, 10.000000000000000, 85.000000000000000 }, + { 0.019554748856312278, 10.000000000000000, 90.000000000000000 }, + { -0.072341598669443757, 10.000000000000000, 95.000000000000000 }, + { -0.054732176935472103, 10.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=10.000000000000000. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data008[i].nu), Tp(data008[i].x)); + const Tp f0 = data008[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.5000000000000014e-11)); +} + +// Test data for nu=20.000000000000000. +testcase_cyl_bessel_j<double> data009[] = { + { 0.0000000000000000, 20.000000000000000, 0.0000000000000000 }, + { 2.7703300521289426e-11, 20.000000000000000, 5.0000000000000000 }, + { 1.1513369247813403e-05, 20.000000000000000, 10.000000000000000 }, + { 0.0073602340792234882, 20.000000000000000, 15.000000000000000 }, + { 0.16474777377532657, 20.000000000000000, 20.000000000000000 }, + { 0.051994049228303287, 20.000000000000000, 25.000000000000000 }, + { 0.0048310199934041105, 20.000000000000000, 30.000000000000000 }, + { -0.10927417397178038, 20.000000000000000, 35.000000000000000 }, + { 0.12779393355084886, 20.000000000000000, 40.000000000000000 }, + { 0.0047633437900312841, 20.000000000000000, 45.000000000000000 }, + { -0.11670435275957974, 20.000000000000000, 50.000000000000000 }, + { 0.025389204574566695, 20.000000000000000, 55.000000000000000 }, + { 0.10266020557876331, 20.000000000000000, 60.000000000000000 }, + { -0.023138582263434168, 20.000000000000000, 65.000000000000000 }, + { -0.096058573489952323, 20.000000000000000, 70.000000000000000 }, + { 0.0068961047221522270, 20.000000000000000, 75.000000000000000 }, + { 0.090565405489918357, 20.000000000000000, 80.000000000000000 }, + { 0.015985497599497155, 20.000000000000000, 85.000000000000000 }, + { -0.080345344044422506, 20.000000000000000, 90.000000000000000 }, + { -0.040253075701614051, 20.000000000000000, 95.000000000000000 }, + { 0.062217458498338679, 20.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=20.000000000000000. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data009[i].nu), Tp(data009[i].x)); + const Tp f0 = data009[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(1.0000000000000006e-10)); +} + +// Test data for nu=50.000000000000000. +testcase_cyl_bessel_j<double> data010[] = { + { 0.0000000000000000, 50.000000000000000, 0.0000000000000000 }, + { 2.2942476159525415e-45, 50.000000000000000, 5.0000000000000000 }, + { 1.7845136078715964e-30, 50.000000000000000, 10.000000000000000 }, + { 6.1060519495338733e-22, 50.000000000000000, 15.000000000000000 }, + { 4.4510392847006872e-16, 50.000000000000000, 20.000000000000000 }, + { 9.7561594280229727e-12, 50.000000000000000, 25.000000000000000 }, + { 2.0581656631564181e-08, 50.000000000000000, 30.000000000000000 }, + { 7.6069951699272926e-06, 50.000000000000000, 35.000000000000000 }, + { 0.00068185243531768255, 50.000000000000000, 40.000000000000000 }, + { 0.017284343240791228, 50.000000000000000, 45.000000000000000 }, + { 0.12140902189761522, 50.000000000000000, 50.000000000000000 }, + { 0.13594720957176004, 50.000000000000000, 55.000000000000000 }, + { -0.13798273148535209, 50.000000000000000, 60.000000000000000 }, + { 0.12116217746619408, 50.000000000000000, 65.000000000000000 }, + { -0.11394866738787141, 50.000000000000000, 70.000000000000000 }, + { 0.094076799581573417, 50.000000000000000, 75.000000000000000 }, + { -0.039457764590251236, 50.000000000000000, 80.000000000000000 }, + { -0.040412060734136369, 50.000000000000000, 85.000000000000000 }, + { 0.090802099838032252, 50.000000000000000, 90.000000000000000 }, + { -0.055979156267280269, 50.000000000000000, 95.000000000000000 }, + { -0.038698339728525460, 50.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=50.000000000000000. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data010[i].nu), Tp(data010[i].x)); + const Tp f0 = data010[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(1.0000000000000006e-11)); +} + +// Test data for nu=100.00000000000000. +testcase_cyl_bessel_j<double> data011[] = { + { 0.0000000000000000, 100.00000000000000, 0.0000000000000000 }, + { 6.2677893955418763e-119, 100.00000000000000, 5.0000000000000000 }, + { 6.5973160641553816e-89, 100.00000000000000, 10.000000000000000 }, + { 1.9660095611249536e-71, 100.00000000000000, 15.000000000000000 }, + { 3.9617550943362524e-59, 100.00000000000000, 20.000000000000000 }, + { 1.1064482655301687e-49, 100.00000000000000, 25.000000000000000 }, + { 4.5788015281752354e-42, 100.00000000000000, 30.000000000000000 }, + { 9.9210206714732606e-36, 100.00000000000000, 35.000000000000000 }, + { 2.3866062996027414e-30, 100.00000000000000, 40.000000000000000 }, + { 1.0329791804565538e-25, 100.00000000000000, 45.000000000000000 }, + { 1.1159273690838340e-21, 100.00000000000000, 50.000000000000000 }, + { 3.7899753451900682e-18, 100.00000000000000, 55.000000000000000 }, + { 4.7832744078781205e-15, 100.00000000000000, 60.000000000000000 }, + { 2.5375564579490517e-12, 100.00000000000000, 65.000000000000000 }, + { 6.1982452141641260e-10, 100.00000000000000, 70.000000000000000 }, + { 7.4479005905904457e-08, 100.00000000000000, 75.000000000000000 }, + { 4.6065530648234948e-06, 100.00000000000000, 80.000000000000000 }, + { 0.00015043869999501605, 100.00000000000000, 85.000000000000000 }, + { 0.0026021305819963472, 100.00000000000000, 90.000000000000000 }, + { 0.023150768009428162, 100.00000000000000, 95.000000000000000 }, + { 0.096366673295861571, 100.00000000000000, 100.00000000000000 }, +}; + +// Test function for nu=100.00000000000000. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_cyl_bessel_j<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_j(Tp(data011[i].nu), Tp(data011[i].x)); + const Tp f0 = data011[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(1.0000000000000006e-11)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile.cc new file mode 100644 index 00000000000..c4054ebbe54 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile_2.cc new file mode 100644 index 00000000000..21589cf0225 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/09_cyl_bessel_j/compile_2.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_nan.cc new file mode 100644 index 00000000000..72754a7dacd --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_nan.cc @@ -0,0 +1,87 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_value.cc new file mode 100644 index 00000000000..19405d0be4d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/check_value.cc @@ -0,0 +1,618 @@ +// 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. + +// cyl_bessel_k + + +// 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 for nu=0.0000000000000000. +testcase_cyl_bessel_k<double> data001[] = { + { 0.0036910983340425947, 0.0000000000000000, 5.0000000000000000 }, + { 1.7780062316167650e-05, 0.0000000000000000, 10.000000000000000 }, + { 9.8195364823964333e-08, 0.0000000000000000, 15.000000000000000 }, + { 5.7412378153365238e-10, 0.0000000000000000, 20.000000000000000 }, + { 3.4641615622131151e-12, 0.0000000000000000, 25.000000000000000 }, + { 2.1324774964630566e-14, 0.0000000000000000, 30.000000000000000 }, + { 1.3310351491429464e-16, 0.0000000000000000, 35.000000000000000 }, + { 8.3928611000995700e-19, 0.0000000000000000, 40.000000000000000 }, + { 5.3334561226187255e-21, 0.0000000000000000, 45.000000000000000 }, + { 3.4101677497894956e-23, 0.0000000000000000, 50.000000000000000 }, + { 2.1913102183534147e-25, 0.0000000000000000, 55.000000000000000 }, + { 1.4138978405591074e-27, 0.0000000000000000, 60.000000000000000 }, + { 9.1544673210030045e-30, 0.0000000000000000, 65.000000000000000 }, + { 5.9446613372925013e-32, 0.0000000000000000, 70.000000000000000 }, + { 3.8701170455869113e-34, 0.0000000000000000, 75.000000000000000 }, + { 2.5251198425054723e-36, 0.0000000000000000, 80.000000000000000 }, + { 1.6507623579783908e-38, 0.0000000000000000, 85.000000000000000 }, + { 1.0810242556984256e-40, 0.0000000000000000, 90.000000000000000 }, + { 7.0901249699001278e-43, 0.0000000000000000, 95.000000000000000 }, + { 4.6566282291759032e-45, 0.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.0000000000000000. +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_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data001[i].nu), 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)); +} + +// Test data for nu=0.33333333333333331. +testcase_cyl_bessel_k<double> data002[] = { + { 0.0037288750960535887, 0.33333333333333331, 5.0000000000000000 }, + { 1.7874608271055339e-05, 0.33333333333333331, 10.000000000000000 }, + { 9.8548341568798317e-08, 0.33333333333333331, 15.000000000000000 }, + { 5.7568278247790865e-10, 0.33333333333333331, 20.000000000000000 }, + { 3.4717201424907059e-12, 0.33333333333333331, 25.000000000000000 }, + { 2.1363664736611189e-14, 0.33333333333333331, 30.000000000000000 }, + { 1.3331202314165813e-16, 0.33333333333333331, 35.000000000000000 }, + { 8.4043837769480934e-19, 0.33333333333333331, 40.000000000000000 }, + { 5.3399731261024948e-21, 0.33333333333333331, 45.000000000000000 }, + { 3.4139217813583632e-23, 0.33333333333333331, 50.000000000000000 }, + { 2.1935050179185627e-25, 0.33333333333333331, 55.000000000000000 }, + { 1.4151968805623662e-27, 0.33333333333333331, 60.000000000000000 }, + { 9.1622357217019043e-30, 0.33333333333333331, 65.000000000000000 }, + { 5.9493479703461315e-32, 0.33333333333333331, 70.000000000000000 }, + { 3.8729660011055947e-34, 0.33333333333333331, 75.000000000000000 }, + { 2.5268631828013877e-36, 0.33333333333333331, 80.000000000000000 }, + { 1.6518353676138867e-38, 0.33333333333333331, 85.000000000000000 }, + { 1.0816880942511496e-40, 0.33333333333333331, 90.000000000000000 }, + { 7.0942508599231512e-43, 0.33333333333333331, 95.000000000000000 }, + { 4.6592031570213454e-45, 0.33333333333333331, 100.00000000000000 }, +}; + +// Test function for nu=0.33333333333333331. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data002[i].nu), Tp(data002[i].x)); + const Tp f0 = data002[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)); +} + +// Test data for nu=0.50000000000000000. +testcase_cyl_bessel_k<double> data003[] = { + { 0.0037766133746428825, 0.50000000000000000, 5.0000000000000000 }, + { 1.7993478093705181e-05, 0.50000000000000000, 10.000000000000000 }, + { 9.8991312032877236e-08, 0.50000000000000000, 15.000000000000000 }, + { 5.7763739747074450e-10, 0.50000000000000000, 20.000000000000000 }, + { 3.4811912768406949e-12, 0.50000000000000000, 25.000000000000000 }, + { 2.1412375659560111e-14, 0.50000000000000000, 30.000000000000000 }, + { 1.3357311366035824e-16, 0.50000000000000000, 35.000000000000000 }, + { 8.4188091949489049e-19, 0.50000000000000000, 40.000000000000000 }, + { 5.3481305002517408e-21, 0.50000000000000000, 45.000000000000000 }, + { 3.4186200954570754e-23, 0.50000000000000000, 50.000000000000000 }, + { 2.1962515908772453e-25, 0.50000000000000000, 55.000000000000000 }, + { 1.4168223500353693e-27, 0.50000000000000000, 60.000000000000000 }, + { 9.1719554473256892e-30, 0.50000000000000000, 65.000000000000000 }, + { 5.9552114337788932e-32, 0.50000000000000000, 70.000000000000000 }, + { 3.8765301321409432e-34, 0.50000000000000000, 75.000000000000000 }, + { 2.5290440439442910e-36, 0.50000000000000000, 80.000000000000000 }, + { 1.6531776067605980e-38, 0.50000000000000000, 85.000000000000000 }, + { 1.0825184636529955e-40, 0.50000000000000000, 90.000000000000000 }, + { 7.0994115873258822e-43, 0.50000000000000000, 95.000000000000000 }, + { 4.6624238126346715e-45, 0.50000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.50000000000000000. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data003[i].nu), Tp(data003[i].x)); + const Tp f0 = data003[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)); +} + +// Test data for nu=0.66666666666666663. +testcase_cyl_bessel_k<double> data004[] = { + { 0.0038444246344968226, 0.66666666666666663, 5.0000000000000000 }, + { 1.8161187569530204e-05, 0.66666666666666663, 10.000000000000000 }, + { 9.9614751542305571e-08, 0.66666666666666663, 15.000000000000000 }, + { 5.8038484271925811e-10, 0.66666666666666663, 20.000000000000000 }, + { 3.4944937498488603e-12, 0.66666666666666663, 25.000000000000000 }, + { 2.1480755645577720e-14, 0.66666666666666663, 30.000000000000000 }, + { 1.3393949190152161e-16, 0.66666666666666663, 35.000000000000000 }, + { 8.4390460553642992e-19, 0.66666666666666663, 40.000000000000000 }, + { 5.3595716143622089e-21, 0.66666666666666663, 45.000000000000000 }, + { 3.4252085301433749e-23, 0.66666666666666663, 50.000000000000000 }, + { 2.2001025377982308e-25, 0.66666666666666663, 55.000000000000000 }, + { 1.4191011274172078e-27, 0.66666666666666663, 60.000000000000000 }, + { 9.1855803020269763e-30, 0.66666666666666663, 65.000000000000000 }, + { 5.9634299472578764e-32, 0.66666666666666663, 70.000000000000000 }, + { 3.8815254026478500e-34, 0.66666666666666663, 75.000000000000000 }, + { 2.5321003991943851e-36, 0.66666666666666663, 80.000000000000000 }, + { 1.6550585670593067e-38, 0.66666666666666663, 85.000000000000000 }, + { 1.0836820479428609e-40, 0.66666666666666663, 90.000000000000000 }, + { 7.1066428916285356e-43, 0.66666666666666663, 95.000000000000000 }, + { 4.6669364587280465e-45, 0.66666666666666663, 100.00000000000000 }, +}; + +// Test function for nu=0.66666666666666663. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data004[i].nu), Tp(data004[i].x)); + const Tp f0 = data004[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)); +} + +// Test data for nu=1.0000000000000000. +testcase_cyl_bessel_k<double> data005[] = { + { 0.0040446134454521655, 1.0000000000000000, 5.0000000000000000 }, + { 1.8648773453825582e-05, 1.0000000000000000, 10.000000000000000 }, + { 1.0141729369762091e-07, 1.0000000000000000, 15.000000000000000 }, + { 5.8830579695570384e-10, 1.0000000000000000, 20.000000000000000 }, + { 3.5327780731999345e-12, 1.0000000000000000, 25.000000000000000 }, + { 2.1677320018915498e-14, 1.0000000000000000, 30.000000000000000 }, + { 1.3499178340011053e-16, 1.0000000000000000, 35.000000000000000 }, + { 8.4971319548610435e-19, 1.0000000000000000, 40.000000000000000 }, + { 5.3923945937225050e-21, 1.0000000000000000, 45.000000000000000 }, + { 3.4441022267175555e-23, 1.0000000000000000, 50.000000000000000 }, + { 2.2111422716117463e-25, 1.0000000000000000, 55.000000000000000 }, + { 1.4256320265171041e-27, 1.0000000000000000, 60.000000000000000 }, + { 9.2246195278906156e-30, 1.0000000000000000, 65.000000000000000 }, + { 5.9869736739138550e-32, 1.0000000000000000, 70.000000000000000 }, + { 3.8958329467421912e-34, 1.0000000000000000, 75.000000000000000 }, + { 2.5408531275211708e-36, 1.0000000000000000, 80.000000000000000 }, + { 1.6604444948567571e-38, 1.0000000000000000, 85.000000000000000 }, + { 1.0870134457498335e-40, 1.0000000000000000, 90.000000000000000 }, + { 7.1273442329907240e-43, 1.0000000000000000, 95.000000000000000 }, + { 4.6798537356369101e-45, 1.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=1.0000000000000000. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data005[i].nu), Tp(data005[i].x)); + const Tp f0 = data005[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)); +} + +// Test data for nu=2.0000000000000000. +testcase_cyl_bessel_k<double> data006[] = { + { 0.0053089437122234608, 2.0000000000000000, 5.0000000000000000 }, + { 2.1509817006932767e-05, 2.0000000000000000, 10.000000000000000 }, + { 1.1171767065031378e-07, 2.0000000000000000, 15.000000000000000 }, + { 6.3295436122922281e-10, 2.0000000000000000, 20.000000000000000 }, + { 3.7467838080691102e-12, 2.0000000000000000, 25.000000000000000 }, + { 2.2769929632558265e-14, 2.0000000000000000, 30.000000000000000 }, + { 1.4081733110858665e-16, 2.0000000000000000, 35.000000000000000 }, + { 8.8177176978426223e-19, 2.0000000000000000, 40.000000000000000 }, + { 5.5731181045619477e-21, 2.0000000000000000, 45.000000000000000 }, + { 3.5479318388581979e-23, 2.0000000000000000, 50.000000000000000 }, + { 2.2717153918665688e-25, 2.0000000000000000, 55.000000000000000 }, + { 1.4614189081096777e-27, 2.0000000000000000, 60.000000000000000 }, + { 9.4383017680150234e-30, 2.0000000000000000, 65.000000000000000 }, + { 6.1157177279757537e-32, 2.0000000000000000, 70.000000000000000 }, + { 3.9740059241667034e-34, 2.0000000000000000, 75.000000000000000 }, + { 2.5886411706935015e-36, 2.0000000000000000, 80.000000000000000 }, + { 1.6898316402103145e-38, 2.0000000000000000, 85.000000000000000 }, + { 1.1051801100484218e-40, 2.0000000000000000, 90.000000000000000 }, + { 7.2401743221736176e-43, 2.0000000000000000, 95.000000000000000 }, + { 4.7502253038886413e-45, 2.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=2.0000000000000000. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data006[i].nu), Tp(data006[i].x)); + const Tp f0 = data006[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)); +} + +// Test data for nu=5.0000000000000000. +testcase_cyl_bessel_k<double> data007[] = { + { 0.032706273712031865, 5.0000000000000000, 5.0000000000000000 }, + { 5.7541849985312275e-05, 5.0000000000000000, 10.000000000000000 }, + { 2.1878261369258224e-07, 5.0000000000000000, 15.000000000000000 }, + { 1.0538660139974233e-09, 5.0000000000000000, 20.000000000000000 }, + { 5.6485921365284157e-12, 5.0000000000000000, 25.000000000000000 }, + { 3.2103335105890266e-14, 5.0000000000000000, 30.000000000000000 }, + { 1.8919208406439644e-16, 5.0000000000000000, 35.000000000000000 }, + { 1.1423814375953188e-18, 5.0000000000000000, 40.000000000000000 }, + { 7.0181216822204116e-21, 5.0000000000000000, 45.000000000000000 }, + { 4.3671822541009859e-23, 5.0000000000000000, 50.000000000000000 }, + { 2.7444967640357869e-25, 5.0000000000000000, 55.000000000000000 }, + { 1.7382232741886986e-27, 5.0000000000000000, 60.000000000000000 }, + { 1.1078474298959669e-29, 5.0000000000000000, 65.000000000000000 }, + { 7.0974537081794416e-32, 5.0000000000000000, 70.000000000000000 }, + { 4.5667269500061064e-34, 5.0000000000000000, 75.000000000000000 }, + { 2.9491764420206150e-36, 5.0000000000000000, 80.000000000000000 }, + { 1.9105685973117463e-38, 5.0000000000000000, 85.000000000000000 }, + { 1.2411034311592645e-40, 5.0000000000000000, 90.000000000000000 }, + { 8.0814211331379146e-43, 5.0000000000000000, 95.000000000000000 }, + { 5.2732561132929509e-45, 5.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=5.0000000000000000. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data007[i].nu), Tp(data007[i].x)); + const Tp f0 = data007[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)); +} + +// Test data for nu=10.000000000000000. +testcase_cyl_bessel_k<double> data008[] = { + { 9.7585628291778121, 10.000000000000000, 5.0000000000000000 }, + { 0.0016142553003906700, 10.000000000000000, 10.000000000000000 }, + { 2.2605303776606440e-06, 10.000000000000000, 15.000000000000000 }, + { 6.3162145283215787e-09, 10.000000000000000, 20.000000000000000 }, + { 2.4076769602801230e-11, 10.000000000000000, 25.000000000000000 }, + { 1.0842816942222975e-13, 10.000000000000000, 30.000000000000000 }, + { 5.3976770429777191e-16, 10.000000000000000, 35.000000000000000 }, + { 2.8680293113671932e-18, 10.000000000000000, 40.000000000000000 }, + { 1.5939871900169603e-20, 10.000000000000000, 45.000000000000000 }, + { 9.1509882099879962e-23, 10.000000000000000, 50.000000000000000 }, + { 5.3823846249592858e-25, 10.000000000000000, 55.000000000000000 }, + { 3.2253408700563144e-27, 10.000000000000000, 60.000000000000000 }, + { 1.9613367530075138e-29, 10.000000000000000, 65.000000000000000 }, + { 1.2068471495933484e-31, 10.000000000000000, 70.000000000000000 }, + { 7.4979152649449644e-34, 10.000000000000000, 75.000000000000000 }, + { 4.6957285830490538e-36, 10.000000000000000, 80.000000000000000 }, + { 2.9606323347034084e-38, 10.000000000000000, 85.000000000000000 }, + { 1.8773542561131613e-40, 10.000000000000000, 90.000000000000000 }, + { 1.1962899527846350e-42, 10.000000000000000, 95.000000000000000 }, + { 7.6554279773881018e-45, 10.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=10.000000000000000. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data008[i].nu), Tp(data008[i].x)); + const Tp f0 = data008[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)); +} + +// Test data for nu=20.000000000000000. +testcase_cyl_bessel_k<double> data009[] = { + { 482700052.06214869, 20.000000000000000, 5.0000000000000000 }, + { 178.74427820770549, 20.000000000000000, 10.000000000000000 }, + { 0.012141257729731146, 20.000000000000000, 15.000000000000000 }, + { 5.5431116361258155e-06, 20.000000000000000, 20.000000000000000 }, + { 6.3744029330352105e-09, 20.000000000000000, 25.000000000000000 }, + { 1.2304516475442478e-11, 20.000000000000000, 30.000000000000000 }, + { 3.2673136479809012e-14, 20.000000000000000, 35.000000000000000 }, + { 1.0703023799997383e-16, 20.000000000000000, 40.000000000000000 }, + { 4.0549953175660486e-19, 20.000000000000000, 45.000000000000000 }, + { 1.7061483797220352e-21, 20.000000000000000, 50.000000000000000 }, + { 7.7617008115659413e-24, 20.000000000000000, 55.000000000000000 }, + { 3.7482954006874725e-26, 20.000000000000000, 60.000000000000000 }, + { 1.8966880763956578e-28, 20.000000000000000, 65.000000000000000 }, + { 9.9615763479998882e-31, 20.000000000000000, 70.000000000000000 }, + { 5.3921623063091066e-33, 20.000000000000000, 75.000000000000000 }, + { 2.9920407657642272e-35, 20.000000000000000, 80.000000000000000 }, + { 1.6948662723618263e-37, 20.000000000000000, 85.000000000000000 }, + { 9.7689149642963025e-40, 20.000000000000000, 90.000000000000000 }, + { 5.7143603019220823e-42, 20.000000000000000, 95.000000000000000 }, + { 3.3852054148901700e-44, 20.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=20.000000000000000. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data009[i].nu), Tp(data009[i].x)); + const Tp f0 = data009[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)); +} + +// Test data for nu=50.000000000000000. +testcase_cyl_bessel_k<double> data010[] = { + { 3.3943222434301628e+42, 50.000000000000000, 5.0000000000000000 }, + { 2.0613737753892579e+27, 50.000000000000000, 10.000000000000000 }, + { 1.7267736974519191e+18, 50.000000000000000, 15.000000000000000 }, + { 411711209122.01794, 50.000000000000000, 20.000000000000000 }, + { 1972478.7419813862, 50.000000000000000, 25.000000000000000 }, + { 58.770686258007267, 50.000000000000000, 30.000000000000000 }, + { 0.0058659391182535195, 50.000000000000000, 35.000000000000000 }, + { 1.3634854128794103e-06, 50.000000000000000, 40.000000000000000 }, + { 5.8652396362160840e-10, 50.000000000000000, 45.000000000000000 }, + { 4.0060134766400903e-13, 50.000000000000000, 50.000000000000000 }, + { 3.9062324485711016e-16, 50.000000000000000, 55.000000000000000 }, + { 5.0389298085176520e-19, 50.000000000000000, 60.000000000000000 }, + { 8.1305344250110396e-22, 50.000000000000000, 65.000000000000000 }, + { 1.5732816234949002e-24, 50.000000000000000, 70.000000000000000 }, + { 3.5349854993874397e-27, 50.000000000000000, 75.000000000000000 }, + { 8.9940101003189485e-30, 50.000000000000000, 80.000000000000000 }, + { 2.5403205503080723e-32, 50.000000000000000, 85.000000000000000 }, + { 7.8397596486715711e-35, 50.000000000000000, 90.000000000000000 }, + { 2.6098900651329550e-37, 50.000000000000000, 95.000000000000000 }, + { 9.2745226536133274e-40, 50.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=50.000000000000000. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data010[i].nu), Tp(data010[i].x)); + const Tp f0 = data010[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)); +} + +// Test data for nu=100.00000000000000. +testcase_cyl_bessel_k<double> data011[] = { + { 7.0398601930616797e+115, 100.00000000000000, 5.0000000000000000 }, + { 4.5966740842695286e+85, 100.00000000000000, 10.000000000000000 }, + { 8.2565552242653898e+67, 100.00000000000000, 15.000000000000000 }, + { 1.7081356456876038e+55, 100.00000000000000, 20.000000000000000 }, + { 1.9858028128780595e+45, 100.00000000000000, 25.000000000000000 }, + { 1.2131584253026677e+37, 100.00000000000000, 30.000000000000000 }, + { 1.1016916354696684e+30, 100.00000000000000, 35.000000000000000 }, + { 7.0074023297775712e+23, 100.00000000000000, 40.000000000000000 }, + { 1.9236643958470909e+18, 100.00000000000000, 45.000000000000000 }, + { 16394035276269.254, 100.00000000000000, 50.000000000000000 }, + { 343254952.89495456, 100.00000000000000, 55.000000000000000 }, + { 14870.012754946305, 100.00000000000000, 60.000000000000000 }, + { 1.1708099078572209, 100.00000000000000, 65.000000000000000 }, + { 0.00015161193930722305, 100.00000000000000, 70.000000000000000 }, + { 2.9850234381623436e-08, 100.00000000000000, 75.000000000000000 }, + { 8.3928710724649065e-12, 100.00000000000000, 80.000000000000000 }, + { 3.2033435630927728e-15, 100.00000000000000, 85.000000000000000 }, + { 1.5922281431788077e-18, 100.00000000000000, 90.000000000000000 }, + { 9.9589454577674300e-22, 100.00000000000000, 95.000000000000000 }, + { 7.6171296304940858e-25, 100.00000000000000, 100.00000000000000 }, +}; + +// Test function for nu=100.00000000000000. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_cyl_bessel_k<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_bessel_k(Tp(data011[i].nu), Tp(data011[i].x)); + const Tp f0 = data011[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>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile.cc new file mode 100644 index 00000000000..03d6a0c5140 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile_2.cc new file mode 100644 index 00000000000..5be103f0fe2 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/10_cyl_bessel_k/compile_2.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_nan.cc new file mode 100644 index 00000000000..6d631086928 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_nan.cc @@ -0,0 +1,87 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_value.cc new file mode 100644 index 00000000000..494f9893096 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/check_value.cc @@ -0,0 +1,618 @@ +// 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. + +// cyl_neumann + + +// 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 for nu=0.0000000000000000. +testcase_cyl_neumann<double> data001[] = { + { -0.30851762524903376, 0.0000000000000000, 5.0000000000000000 }, + { 0.055671167283599395, 0.0000000000000000, 10.000000000000000 }, + { 0.20546429603891825, 0.0000000000000000, 15.000000000000000 }, + { 0.062640596809383955, 0.0000000000000000, 20.000000000000000 }, + { -0.12724943226800620, 0.0000000000000000, 25.000000000000000 }, + { -0.11729573168666411, 0.0000000000000000, 30.000000000000000 }, + { 0.045797987195155640, 0.0000000000000000, 35.000000000000000 }, + { 0.12593641705826095, 0.0000000000000000, 40.000000000000000 }, + { 0.027060469763313322, 0.0000000000000000, 45.000000000000000 }, + { -0.098064995470077104, 0.0000000000000000, 50.000000000000000 }, + { -0.077569178730412622, 0.0000000000000000, 55.000000000000000 }, + { 0.047358952209449412, 0.0000000000000000, 60.000000000000000 }, + { 0.097183557740181933, 0.0000000000000000, 65.000000000000000 }, + { 0.0093096664589410131, 0.0000000000000000, 70.000000000000000 }, + { -0.085369047647775642, 0.0000000000000000, 75.000000000000000 }, + { -0.055620339089769981, 0.0000000000000000, 80.000000000000000 }, + { 0.049567884951494258, 0.0000000000000000, 85.000000000000000 }, + { 0.079776475854877765, 0.0000000000000000, 90.000000000000000 }, + { -0.0028230995861232323, 0.0000000000000000, 95.000000000000000 }, + { -0.077244313365083112, 0.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.0000000000000000. +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_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data001[i].nu), 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(1.0000000000000006e-10)); +} + +// Test data for nu=0.33333333333333331. +testcase_cyl_neumann<double> data002[] = { + { -0.18192321129343830, 0.33333333333333331, 5.0000000000000000 }, + { 0.17020111788268769, 0.33333333333333331, 10.000000000000000 }, + { 0.18540507541540799, 0.33333333333333331, 15.000000000000000 }, + { -0.028777707635715091, 0.33333333333333331, 20.000000000000000 }, + { -0.15829741864944166, 0.33333333333333331, 25.000000000000000 }, + { -0.058645772316705216, 0.33333333333333331, 30.000000000000000 }, + { 0.10294930308870620, 0.33333333333333331, 35.000000000000000 }, + { 0.10547870367098920, 0.33333333333333331, 40.000000000000000 }, + { -0.034334228816010864, 0.33333333333333331, 45.000000000000000 }, + { -0.11283489933031278, 0.33333333333333331, 50.000000000000000 }, + { -0.030007358986895123, 0.33333333333333331, 55.000000000000000 }, + { 0.086699173295718093, 0.33333333333333331, 60.000000000000000 }, + { 0.074875579668878672, 0.33333333333333331, 65.000000000000000 }, + { -0.039323246374552645, 0.33333333333333331, 70.000000000000000 }, + { -0.091263539574475222, 0.33333333333333331, 75.000000000000000 }, + { -0.013358849535984282, 0.33333333333333331, 80.000000000000000 }, + { 0.078373575537830184, 0.33333333333333331, 85.000000000000000 }, + { 0.055812482883955974, 0.33333333333333331, 90.000000000000000 }, + { -0.043310380106990579, 0.33333333333333331, 95.000000000000000 }, + { -0.076900504962136587, 0.33333333333333331, 100.00000000000000 }, +}; + +// Test function for nu=0.33333333333333331. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data002[i].nu), Tp(data002[i].x)); + const Tp f0 = data002[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.5000000000000014e-11)); +} + +// Test data for nu=0.50000000000000000. +testcase_cyl_neumann<double> data003[] = { + { -0.10121770918510843, 0.50000000000000000, 5.0000000000000000 }, + { 0.21170886633139813, 0.50000000000000000, 10.000000000000000 }, + { 0.15650551590730860, 0.50000000000000000, 15.000000000000000 }, + { -0.072806904785061841, 0.50000000000000000, 20.000000000000000 }, + { -0.15817308404205055, 0.50000000000000000, 25.000000000000000 }, + { -0.022470290598831121, 0.50000000000000000, 30.000000000000000 }, + { 0.12187835265849536, 0.50000000000000000, 35.000000000000000 }, + { 0.084138655676395432, 0.50000000000000000, 40.000000000000000 }, + { -0.062482641933003132, 0.50000000000000000, 45.000000000000000 }, + { -0.10888475635053953, 0.50000000000000000, 50.000000000000000 }, + { -0.0023805454010948804, 0.50000000000000000, 55.000000000000000 }, + { 0.098104683735037904, 0.50000000000000000, 60.000000000000000 }, + { 0.055663470218594434, 0.50000000000000000, 65.000000000000000 }, + { -0.060396767883824809, 0.50000000000000000, 70.000000000000000 }, + { -0.084922578922046868, 0.50000000000000000, 75.000000000000000 }, + { 0.0098472271924441215, 0.50000000000000000, 80.000000000000000 }, + { 0.085190643574343639, 0.50000000000000000, 85.000000000000000 }, + { 0.037684970437156261, 0.50000000000000000, 90.000000000000000 }, + { -0.059772904856097479, 0.50000000000000000, 95.000000000000000 }, + { -0.068803091468728053, 0.50000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=0.50000000000000000. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data003[i].nu), Tp(data003[i].x)); + const Tp f0 = data003[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.0000000000000028e-11)); +} + +// Test data for nu=0.66666666666666663. +testcase_cyl_neumann<double> data004[] = { + { -0.016050662643389616, 0.66666666666666663, 5.0000000000000000 }, + { 0.23937232657540730, 0.66666666666666663, 10.000000000000000 }, + { 0.11762106604241242, 0.66666666666666663, 15.000000000000000 }, + { -0.11182254014899563, 0.66666666666666663, 20.000000000000000 }, + { -0.14756582982938804, 0.66666666666666663, 25.000000000000000 }, + { 0.015078692908077665, 0.66666666666666663, 30.000000000000000 }, + { 0.13260911815705798, 0.66666666666666663, 35.000000000000000 }, + { 0.057217565989652795, 0.66666666666666663, 40.000000000000000 }, + { -0.086373755152382048, 0.66666666666666663, 45.000000000000000 }, + { -0.097624139208051630, 0.66666666666666663, 50.000000000000000 }, + { 0.025354902147023434, 0.66666666666666663, 55.000000000000000 }, + { 0.10288136476351209, 0.66666666666666663, 60.000000000000000 }, + { 0.032728379560128203, 0.66666666666666663, 65.000000000000000 }, + { -0.077363672735747777, 0.66666666666666663, 70.000000000000000 }, + { -0.072855870458293975, 0.66666666666666663, 75.000000000000000 }, + { 0.032358106046953494, 0.66666666666666663, 80.000000000000000 }, + { 0.086240651537394228, 0.66666666666666663, 85.000000000000000 }, + { 0.017029601697285159, 0.66666666666666663, 90.000000000000000 }, + { -0.072173520560584709, 0.66666666666666663, 95.000000000000000 }, + { -0.056057339204073985, 0.66666666666666663, 100.00000000000000 }, +}; + +// Test function for nu=0.66666666666666663. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data004[i].nu), Tp(data004[i].x)); + const Tp f0 = data004[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.5000000000000014e-11)); +} + +// Test data for nu=1.0000000000000000. +testcase_cyl_neumann<double> data005[] = { + { 0.14786314339122689, 1.0000000000000000, 5.0000000000000000 }, + { 0.24901542420695388, 1.0000000000000000, 10.000000000000000 }, + { 0.021073628036873546, 1.0000000000000000, 15.000000000000000 }, + { -0.16551161436252118, 1.0000000000000000, 20.000000000000000 }, + { -0.098829964783237384, 1.0000000000000000, 25.000000000000000 }, + { 0.084425570661747149, 1.0000000000000000, 30.000000000000000 }, + { 0.12751273354559012, 1.0000000000000000, 35.000000000000000 }, + { -0.0057935058215496330, 1.0000000000000000, 40.000000000000000 }, + { -0.11552517964639945, 1.0000000000000000, 45.000000000000000 }, + { -0.056795668562014713, 1.0000000000000000, 50.000000000000000 }, + { 0.073846265432577940, 1.0000000000000000, 55.000000000000000 }, + { 0.091869609369866906, 1.0000000000000000, 60.000000000000000 }, + { -0.017940374275377303, 1.0000000000000000, 65.000000000000000 }, + { -0.094844652625716244, 1.0000000000000000, 70.000000000000000 }, + { -0.035213785160580456, 1.0000000000000000, 75.000000000000000 }, + { 0.069395913784588051, 1.0000000000000000, 80.000000000000000 }, + { 0.071233187582749782, 1.0000000000000000, 85.000000000000000 }, + { -0.026187238607768282, 1.0000000000000000, 90.000000000000000 }, + { -0.081827958724501229, 1.0000000000000000, 95.000000000000000 }, + { -0.020372312002759942, 1.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=1.0000000000000000. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data005[i].nu), Tp(data005[i].x)); + const Tp f0 = data005[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.5000000000000014e-11)); +} + +// Test data for nu=2.0000000000000000. +testcase_cyl_neumann<double> data006[] = { + { 0.36766288260552449, 2.0000000000000000, 5.0000000000000000 }, + { -0.0058680824422086154, 2.0000000000000000, 10.000000000000000 }, + { -0.20265447896733510, 2.0000000000000000, 15.000000000000000 }, + { -0.079191758245636068, 2.0000000000000000, 20.000000000000000 }, + { 0.11934303508534720, 2.0000000000000000, 25.000000000000000 }, + { 0.12292410306411393, 2.0000000000000000, 30.000000000000000 }, + { -0.038511545278264774, 2.0000000000000000, 35.000000000000000 }, + { -0.12622609234933843, 2.0000000000000000, 40.000000000000000 }, + { -0.032194922192042189, 2.0000000000000000, 45.000000000000000 }, + { 0.095793168727596509, 2.0000000000000000, 50.000000000000000 }, + { 0.080254497473415454, 2.0000000000000000, 55.000000000000000 }, + { -0.044296631897120513, 2.0000000000000000, 60.000000000000000 }, + { -0.097735569256347382, 2.0000000000000000, 65.000000000000000 }, + { -0.012019513676818619, 2.0000000000000000, 70.000000000000000 }, + { 0.084430013376826832, 2.0000000000000000, 75.000000000000000 }, + { 0.057355236934384685, 2.0000000000000000, 80.000000000000000 }, + { -0.047891809949547205, 2.0000000000000000, 85.000000000000000 }, + { -0.080358414490605948, 2.0000000000000000, 90.000000000000000 }, + { 0.0011004057182389959, 2.0000000000000000, 95.000000000000000 }, + { 0.076836867125027908, 2.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=2.0000000000000000. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data006[i].nu), Tp(data006[i].x)); + const Tp f0 = data006[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.5000000000000017e-10)); +} + +// Test data for nu=5.0000000000000000. +testcase_cyl_neumann<double> data007[] = { + { -0.45369482249110188, 5.0000000000000000, 5.0000000000000000 }, + { 0.13540304768936232, 5.0000000000000000, 10.000000000000000 }, + { 0.16717271575940021, 5.0000000000000000, 15.000000000000000 }, + { -0.10003576788953225, 5.0000000000000000, 20.000000000000000 }, + { -0.14705799311372267, 5.0000000000000000, 25.000000000000000 }, + { 0.031627359289264322, 5.0000000000000000, 30.000000000000000 }, + { 0.13554781474770031, 5.0000000000000000, 35.000000000000000 }, + { 0.031869448780850372, 5.0000000000000000, 40.000000000000000 }, + { -0.10426932700176872, 5.0000000000000000, 45.000000000000000 }, + { -0.078548413913081608, 5.0000000000000000, 50.000000000000000 }, + { 0.055257033062858382, 5.0000000000000000, 55.000000000000000 }, + { 0.099464632840450901, 5.0000000000000000, 60.000000000000000 }, + { 0.00023860469499600970, 5.0000000000000000, 65.000000000000000 }, + { -0.091861802216406066, 5.0000000000000000, 70.000000000000000 }, + { -0.048383671296970077, 5.0000000000000000, 75.000000000000000 }, + { 0.060293667104896330, 5.0000000000000000, 80.000000000000000 }, + { 0.077506166682734010, 5.0000000000000000, 85.000000000000000 }, + { -0.015338764062239803, 5.0000000000000000, 90.000000000000000 }, + { -0.081531504045514375, 5.0000000000000000, 95.000000000000000 }, + { -0.029480196281662041, 5.0000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=5.0000000000000000. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data007[i].nu), Tp(data007[i].x)); + const Tp f0 = data007[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.5000000000000013e-09)); +} + +// Test data for nu=10.000000000000000. +testcase_cyl_neumann<double> data008[] = { + { -25.129110095610098, 10.000000000000000, 5.0000000000000000 }, + { -0.35981415218340279, 10.000000000000000, 10.000000000000000 }, + { 0.21997141360195582, 10.000000000000000, 15.000000000000000 }, + { -0.043894653515658202, 10.000000000000000, 20.000000000000000 }, + { -0.14871839049980651, 10.000000000000000, 25.000000000000000 }, + { 0.075056702122397012, 10.000000000000000, 30.000000000000000 }, + { 0.12222473135000553, 10.000000000000000, 35.000000000000000 }, + { -0.046723877232677867, 10.000000000000000, 40.000000000000000 }, + { -0.11739339009322178, 10.000000000000000, 45.000000000000000 }, + { 0.0057238971820535740, 10.000000000000000, 50.000000000000000 }, + { 0.10733910125831635, 10.000000000000000, 55.000000000000000 }, + { 0.036290350559545506, 10.000000000000000, 60.000000000000000 }, + { -0.083239127691715639, 10.000000000000000, 65.000000000000000 }, + { -0.069639384138314872, 10.000000000000000, 70.000000000000000 }, + { 0.045798335061325038, 10.000000000000000, 75.000000000000000 }, + { 0.086269195064844428, 10.000000000000000, 80.000000000000000 }, + { -0.0018234674126248629, 10.000000000000000, 85.000000000000000 }, + { -0.082067762371231298, 10.000000000000000, 90.000000000000000 }, + { -0.038798074754578075, 10.000000000000000, 95.000000000000000 }, + { 0.058331574236414815, 10.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=10.000000000000000. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data008[i].nu), Tp(data008[i].x)); + const Tp f0 = data008[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.5000000000000017e-10)); +} + +// Test data for nu=20.000000000000000. +testcase_cyl_neumann<double> data009[] = { + { -593396529.69143212, 20.000000000000000, 5.0000000000000000 }, + { -1597.4838482696264, 20.000000000000000, 10.000000000000000 }, + { -3.3087330924737630, 20.000000000000000, 15.000000000000000 }, + { -0.28548945860020319, 20.000000000000000, 20.000000000000000 }, + { 0.19804074776289243, 20.000000000000000, 25.000000000000000 }, + { -0.16848153948742675, 20.000000000000000, 30.000000000000000 }, + { 0.10102784152594022, 20.000000000000000, 35.000000000000000 }, + { 0.045161820565805928, 20.000000000000000, 40.000000000000000 }, + { -0.12556489308015448, 20.000000000000000, 45.000000000000000 }, + { 0.016442633948115841, 20.000000000000000, 50.000000000000000 }, + { 0.10853448778255187, 20.000000000000000, 55.000000000000000 }, + { -0.026721408520664677, 20.000000000000000, 60.000000000000000 }, + { -0.098780425256324203, 20.000000000000000, 65.000000000000000 }, + { 0.016201957786018205, 20.000000000000000, 70.000000000000000 }, + { 0.093591198265063735, 20.000000000000000, 75.000000000000000 }, + { 0.0040484400737295740, 20.000000000000000, 80.000000000000000 }, + { -0.086314929459920503, 20.000000000000000, 85.000000000000000 }, + { -0.028274110097231495, 20.000000000000000, 90.000000000000000 }, + { 0.072349520791638755, 20.000000000000000, 95.000000000000000 }, + { 0.051247973076188565, 20.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=20.000000000000000. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data009[i].nu), Tp(data009[i].x)); + const Tp f0 = data009[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(1.0000000000000006e-10)); +} + +// Test data for nu=50.000000000000000. +testcase_cyl_neumann<double> data010[] = { + { -2.7888370175838943e+42, 50.000000000000000, 5.0000000000000000 }, + { -3.6410665018007421e+27, 50.000000000000000, 10.000000000000000 }, + { -1.0929732912175405e+19, 50.000000000000000, 15.000000000000000 }, + { -15606426801663.732, 50.000000000000000, 20.000000000000000 }, + { -753573251.44662631, 50.000000000000000, 25.000000000000000 }, + { -386759.32602734747, 50.000000000000000, 30.000000000000000 }, + { -1172.8690492895341, 50.000000000000000, 35.000000000000000 }, + { -15.615608873419953, 50.000000000000000, 40.000000000000000 }, + { -0.87058346204176951, 50.000000000000000, 45.000000000000000 }, + { -0.21031655464397736, 50.000000000000000, 50.000000000000000 }, + { 0.093048240412999375, 50.000000000000000, 55.000000000000000 }, + { 0.0086417699626745066, 50.000000000000000, 60.000000000000000 }, + { -0.025019788459221974, 50.000000000000000, 65.000000000000000 }, + { -0.0014815155191908913, 50.000000000000000, 70.000000000000000 }, + { 0.050335774732164155, 50.000000000000000, 75.000000000000000 }, + { -0.092924250967987204, 50.000000000000000, 80.000000000000000 }, + { 0.087332463030205670, 50.000000000000000, 85.000000000000000 }, + { -0.016164237701651891, 50.000000000000000, 90.000000000000000 }, + { -0.068897613820457920, 50.000000000000000, 95.000000000000000 }, + { 0.076505263944802962, 50.000000000000000, 100.00000000000000 }, +}; + +// Test function for nu=50.000000000000000. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data010[i].nu), Tp(data010[i].x)); + const Tp f0 = data010[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.5000000000000017e-10)); +} + +// Test data for nu=100.00000000000000. +testcase_cyl_neumann<double> data011[] = { + { -5.0848639160196196e+115, 100.00000000000000, 5.0000000000000000 }, + { -4.8491482711800245e+85, 100.00000000000000, 10.000000000000000 }, + { -1.6375955323195320e+68, 100.00000000000000, 15.000000000000000 }, + { -8.2002648144679137e+55, 100.00000000000000, 20.000000000000000 }, + { -2.9712216432562373e+46, 100.00000000000000, 25.000000000000000 }, + { -7.2875284708240766e+38, 100.00000000000000, 30.000000000000000 }, + { -3.4251079902108953e+32, 100.00000000000000, 35.000000000000000 }, + { -1.4552439438101799e+27, 100.00000000000000, 40.000000000000000 }, + { -3.4506612476220073e+22, 100.00000000000000, 45.000000000000000 }, + { -3.2938001882025948e+18, 100.00000000000000, 50.000000000000000 }, + { -1005686182055527.4, 100.00000000000000, 55.000000000000000 }, + { -831892881402.11377, 100.00000000000000, 60.000000000000000 }, + { -1650863778.0598330, 100.00000000000000, 65.000000000000000 }, + { -7192614.1976097804, 100.00000000000000, 70.000000000000000 }, + { -64639.072261231602, 100.00000000000000, 75.000000000000000 }, + { -1152.5905185698464, 100.00000000000000, 80.000000000000000 }, + { -40.250761402102000, 100.00000000000000, 85.000000000000000 }, + { -2.8307771387185459, 100.00000000000000, 90.000000000000000 }, + { -0.45762200495904559, 100.00000000000000, 95.000000000000000 }, + { -0.16692141141757649, 100.00000000000000, 100.00000000000000 }, +}; + +// Test function for nu=100.00000000000000. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_cyl_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::cyl_neumann(Tp(data011[i].nu), Tp(data011[i].x)); + const Tp f0 = data011[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(1.0000000000000006e-11)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile.cc new file mode 100644 index 00000000000..0d948655513 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile_2.cc new file mode 100644 index 00000000000..39e0cac7ea5 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/11_cyl_neumann/compile_2.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_nan.cc new file mode 100644 index 00000000000..d86c5b40f54 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_nan.cc @@ -0,0 +1,87 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_value.cc new file mode 100644 index 00000000000..8df6df02f30 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/check_value.cc @@ -0,0 +1,844 @@ +// 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. + +// 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 for k=-0.90000000000000002. +testcase_ellint_1<double> data001[] = { + { -0.0000000000000000, -0.90000000000000002, 0.0000000000000000 }, + { 0.17525427376115027, -0.90000000000000002, 0.17453292519943295 }, + { 0.35492464591297446, -0.90000000000000002, 0.34906585039886590 }, + { 0.54388221416157134, -0.90000000000000002, 0.52359877559829882 }, + { 0.74797400423532523, -0.90000000000000002, 0.69813170079773179 }, + { 0.97463898451966458, -0.90000000000000002, 0.87266462599716477 }, + { 1.2334463254523440, -0.90000000000000002, 1.0471975511965976 }, + { 1.5355247765594910, -0.90000000000000002, 1.2217304763960306 }, + { 1.8882928567775124, -0.90000000000000002, 1.3962634015954636 }, + { 2.2805491384227703, -0.90000000000000002, 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002. +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_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data001[i].k), Tp(data001[i].phi)); + 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)); +} + +// Test data for k=-0.80000000000000004. +testcase_ellint_1<double> data002[] = { + { -0.0000000000000000, -0.80000000000000004, 0.0000000000000000 }, + { 0.17510154241338902, -0.80000000000000004, 0.17453292519943295 }, + { 0.35365068839779390, -0.80000000000000004, 0.34906585039886590 }, + { 0.53926804409084561, -0.80000000000000004, 0.52359877559829882 }, + { 0.73587926028070383, -0.80000000000000004, 0.69813170079773179 }, + { 0.94770942970071170, -0.80000000000000004, 0.87266462599716477 }, + { 1.1789022995388239, -0.80000000000000004, 1.0471975511965976 }, + { 1.4323027881876009, -0.80000000000000004, 1.2217304763960306 }, + { 1.7069629739121674, -0.80000000000000004, 1.3962634015954636 }, + { 1.9953027776647296, -0.80000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data002[i].k), Tp(data002[i].phi)); + const Tp f0 = data002[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)); +} + +// Test data for k=-0.69999999999999996. +testcase_ellint_1<double> data003[] = { + { -0.0000000000000000, -0.69999999999999996, 0.0000000000000000 }, + { 0.17496737466916720, -0.69999999999999996, 0.17453292519943295 }, + { 0.35254687535677925, -0.69999999999999996, 0.34906585039886590 }, + { 0.53536740275997130, -0.69999999999999996, 0.52359877559829882 }, + { 0.72603797651684465, -0.69999999999999996, 0.69813170079773179 }, + { 0.92698296348313458, -0.69999999999999996, 0.87266462599716477 }, + { 1.1400447527693316, -0.69999999999999996, 1.0471975511965976 }, + { 1.3657668117194071, -0.69999999999999996, 1.2217304763960306 }, + { 1.6024686895959159, -0.69999999999999996, 1.3962634015954636 }, + { 1.8456939983747236, -0.69999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data003[i].k), Tp(data003[i].phi)); + const Tp f0 = data003[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)); +} + +// Test data for k=-0.59999999999999998. +testcase_ellint_1<double> data004[] = { + { -0.0000000000000000, -0.59999999999999998, 0.0000000000000000 }, + { 0.17485154362988362, -0.59999999999999998, 0.17453292519943295 }, + { 0.35160509865544326, -0.59999999999999998, 0.34906585039886590 }, + { 0.53210652578446160, -0.59999999999999998, 0.52359877559829882 }, + { 0.71805304664485670, -0.59999999999999998, 0.69813170079773179 }, + { 0.91082759030195970, -0.59999999999999998, 0.87266462599716477 }, + { 1.1112333229323361, -0.59999999999999998, 1.0471975511965976 }, + { 1.3191461190365270, -0.59999999999999998, 1.2217304763960306 }, + { 1.5332022105084773, -0.59999999999999998, 1.3962634015954636 }, + { 1.7507538029157526, -0.59999999999999998, 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data004[i].k), Tp(data004[i].phi)); + const Tp f0 = data004[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)); +} + +// Test data for k=-0.50000000000000000. +testcase_ellint_1<double> data005[] = { + { -0.0000000000000000, -0.50000000000000000, 0.0000000000000000 }, + { 0.17475385514035785, -0.50000000000000000, 0.17453292519943295 }, + { 0.35081868470101585, -0.50000000000000000, 0.34906585039886590 }, + { 0.52942862705190585, -0.50000000000000000, 0.52359877559829882 }, + { 0.71164727562630326, -0.50000000000000000, 0.69813170079773179 }, + { 0.89824523594227768, -0.50000000000000000, 0.87266462599716477 }, + { 1.0895506700518851, -0.50000000000000000, 1.0471975511965976 }, + { 1.2853005857432933, -0.50000000000000000, 1.2217304763960306 }, + { 1.4845545520549484, -0.50000000000000000, 1.3962634015954636 }, + { 1.6857503548125963, -0.50000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data005[i].k), Tp(data005[i].phi)); + const Tp f0 = data005[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)); +} + +// Test data for k=-0.40000000000000002. +testcase_ellint_1<double> data006[] = { + { -0.0000000000000000, -0.40000000000000002, 0.0000000000000000 }, + { 0.17467414669441531, -0.40000000000000002, 0.17453292519943295 }, + { 0.35018222772483443, -0.40000000000000002, 0.34906585039886590 }, + { 0.52729015917508748, -0.40000000000000002, 0.52359877559829882 }, + { 0.70662374407341255, -0.40000000000000002, 0.69813170079773179 }, + { 0.88859210497602170, -0.40000000000000002, 0.87266462599716477 }, + { 1.0733136290471379, -0.40000000000000002, 1.0471975511965976 }, + { 1.2605612170157061, -0.40000000000000002, 1.2217304763960306 }, + { 1.4497513956433437, -0.40000000000000002, 1.3962634015954636 }, + { 1.6399998658645112, -0.40000000000000002, 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data006[i].k), Tp(data006[i].phi)); + const Tp f0 = data006[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)); +} + +// Test data for k=-0.30000000000000004. +testcase_ellint_1<double> data007[] = { + { -0.0000000000000000, -0.30000000000000004, 0.0000000000000000 }, + { 0.17461228653000102, -0.30000000000000004, 0.17453292519943295 }, + { 0.34969146102798415, -0.30000000000000004, 0.34906585039886590 }, + { 0.52565822873726320, -0.30000000000000004, 0.52359877559829882 }, + { 0.70284226512408532, -0.30000000000000004, 0.69813170079773179 }, + { 0.88144139195111182, -0.30000000000000004, 0.87266462599716477 }, + { 1.0614897067260523, -0.30000000000000004, 1.0471975511965976 }, + { 1.2428416824174218, -0.30000000000000004, 1.2217304763960306 }, + { 1.4251795877015925, -0.30000000000000004, 1.3962634015954636 }, + { 1.6080486199305126, -0.30000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data007[i].k), Tp(data007[i].phi)); + const Tp f0 = data007[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)); +} + +// Test data for k=-0.19999999999999996. +testcase_ellint_1<double> data008[] = { + { -0.0000000000000000, -0.19999999999999996, 0.0000000000000000 }, + { 0.17456817290292811, -0.19999999999999996, 0.17453292519943295 }, + { 0.34934315932086801, -0.19999999999999996, 0.34906585039886590 }, + { 0.52450880529443988, -0.19999999999999996, 0.52359877559829882 }, + { 0.70020491009844910, -0.19999999999999996, 0.69813170079773179 }, + { 0.87651006649967955, -0.19999999999999996, 0.87266462599716477 }, + { 1.0534305870298994, -0.19999999999999996, 1.0471975511965976 }, + { 1.2308975521670784, -0.19999999999999996, 1.2217304763960306 }, + { 1.4087733584990738, -0.19999999999999996, 1.3962634015954636 }, + { 1.5868678474541664, -0.19999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data008[i].k), Tp(data008[i].phi)); + const Tp f0 = data008[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)); +} + +// Test data for k=-0.099999999999999978. +testcase_ellint_1<double> data009[] = { + { -0.0000000000000000, -0.099999999999999978, 0.0000000000000000 }, + { 0.17454173353063665, -0.099999999999999978, 0.17453292519943295 }, + { 0.34913506721468085, -0.099999999999999978, 0.34906585039886590 }, + { 0.52382550016538953, -0.099999999999999978, 0.52359877559829882 }, + { 0.69864700854177031, -0.099999999999999978, 0.69813170079773179 }, + { 0.87361792586964870, -0.099999999999999978, 0.87266462599716477 }, + { 1.0487386319621685, -0.099999999999999978, 1.0471975511965976 }, + { 1.2239913752078757, -0.099999999999999978, 1.2217304763960306 }, + { 1.3993423113684049, -0.099999999999999978, 1.3962634015954636 }, + { 1.5747455615173562, -0.099999999999999978, 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data009[i].k), Tp(data009[i].phi)); + const Tp f0 = data009[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)); +} + +// Test data for k=0.0000000000000000. +testcase_ellint_1<double> data010[] = { + { -0.0000000000000000, 0.0000000000000000, 0.0000000000000000 }, + { 0.17453292519943295, 0.0000000000000000, 0.17453292519943295 }, + { 0.34906585039886584, 0.0000000000000000, 0.34906585039886590 }, + { 0.52359877559829882, 0.0000000000000000, 0.52359877559829882 }, + { 0.69813170079773179, 0.0000000000000000, 0.69813170079773179 }, + { 0.87266462599716477, 0.0000000000000000, 0.87266462599716477 }, + { 1.0471975511965976, 0.0000000000000000, 1.0471975511965976 }, + { 1.2217304763960304, 0.0000000000000000, 1.2217304763960306 }, + { 1.3962634015954631, 0.0000000000000000, 1.3962634015954636 }, + { 1.5707963267948966, 0.0000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data010[i].k), Tp(data010[i].phi)); + const Tp f0 = data010[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)); +} + +// Test data for k=0.10000000000000009. +testcase_ellint_1<double> data011[] = { + { -0.0000000000000000, 0.10000000000000009, 0.0000000000000000 }, + { 0.17454173353063665, 0.10000000000000009, 0.17453292519943295 }, + { 0.34913506721468085, 0.10000000000000009, 0.34906585039886590 }, + { 0.52382550016538953, 0.10000000000000009, 0.52359877559829882 }, + { 0.69864700854177031, 0.10000000000000009, 0.69813170079773179 }, + { 0.87361792586964870, 0.10000000000000009, 0.87266462599716477 }, + { 1.0487386319621685, 0.10000000000000009, 1.0471975511965976 }, + { 1.2239913752078757, 0.10000000000000009, 1.2217304763960306 }, + { 1.3993423113684049, 0.10000000000000009, 1.3962634015954636 }, + { 1.5747455615173562, 0.10000000000000009, 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data011[i].k), Tp(data011[i].phi)); + const Tp f0 = data011[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)); +} + +// Test data for k=0.19999999999999996. +testcase_ellint_1<double> data012[] = { + { -0.0000000000000000, 0.19999999999999996, 0.0000000000000000 }, + { 0.17456817290292811, 0.19999999999999996, 0.17453292519943295 }, + { 0.34934315932086801, 0.19999999999999996, 0.34906585039886590 }, + { 0.52450880529443988, 0.19999999999999996, 0.52359877559829882 }, + { 0.70020491009844910, 0.19999999999999996, 0.69813170079773179 }, + { 0.87651006649967955, 0.19999999999999996, 0.87266462599716477 }, + { 1.0534305870298994, 0.19999999999999996, 1.0471975511965976 }, + { 1.2308975521670784, 0.19999999999999996, 1.2217304763960306 }, + { 1.4087733584990738, 0.19999999999999996, 1.3962634015954636 }, + { 1.5868678474541664, 0.19999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996. +template <typename Tp> +void test012() +{ + 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(data012) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data012[i].k), Tp(data012[i].phi)); + const Tp f0 = data012[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)); +} + +// Test data for k=0.30000000000000004. +testcase_ellint_1<double> data013[] = { + { -0.0000000000000000, 0.30000000000000004, 0.0000000000000000 }, + { 0.17461228653000102, 0.30000000000000004, 0.17453292519943295 }, + { 0.34969146102798415, 0.30000000000000004, 0.34906585039886590 }, + { 0.52565822873726320, 0.30000000000000004, 0.52359877559829882 }, + { 0.70284226512408532, 0.30000000000000004, 0.69813170079773179 }, + { 0.88144139195111182, 0.30000000000000004, 0.87266462599716477 }, + { 1.0614897067260523, 0.30000000000000004, 1.0471975511965976 }, + { 1.2428416824174218, 0.30000000000000004, 1.2217304763960306 }, + { 1.4251795877015925, 0.30000000000000004, 1.3962634015954636 }, + { 1.6080486199305126, 0.30000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004. +template <typename Tp> +void test013() +{ + 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(data013) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data013[i].k), Tp(data013[i].phi)); + const Tp f0 = data013[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)); +} + +// Test data for k=0.39999999999999991. +testcase_ellint_1<double> data014[] = { + { -0.0000000000000000, 0.39999999999999991, 0.0000000000000000 }, + { 0.17467414669441531, 0.39999999999999991, 0.17453292519943295 }, + { 0.35018222772483443, 0.39999999999999991, 0.34906585039886590 }, + { 0.52729015917508748, 0.39999999999999991, 0.52359877559829882 }, + { 0.70662374407341255, 0.39999999999999991, 0.69813170079773179 }, + { 0.88859210497602170, 0.39999999999999991, 0.87266462599716477 }, + { 1.0733136290471379, 0.39999999999999991, 1.0471975511965976 }, + { 1.2605612170157061, 0.39999999999999991, 1.2217304763960306 }, + { 1.4497513956433437, 0.39999999999999991, 1.3962634015954636 }, + { 1.6399998658645112, 0.39999999999999991, 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991. +template <typename Tp> +void test014() +{ + 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(data014) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data014[i].k), Tp(data014[i].phi)); + const Tp f0 = data014[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)); +} + +// Test data for k=0.50000000000000000. +testcase_ellint_1<double> data015[] = { + { -0.0000000000000000, 0.50000000000000000, 0.0000000000000000 }, + { 0.17475385514035785, 0.50000000000000000, 0.17453292519943295 }, + { 0.35081868470101585, 0.50000000000000000, 0.34906585039886590 }, + { 0.52942862705190585, 0.50000000000000000, 0.52359877559829882 }, + { 0.71164727562630326, 0.50000000000000000, 0.69813170079773179 }, + { 0.89824523594227768, 0.50000000000000000, 0.87266462599716477 }, + { 1.0895506700518851, 0.50000000000000000, 1.0471975511965976 }, + { 1.2853005857432933, 0.50000000000000000, 1.2217304763960306 }, + { 1.4845545520549484, 0.50000000000000000, 1.3962634015954636 }, + { 1.6857503548125963, 0.50000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000. +template <typename Tp> +void test015() +{ + 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(data015) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data015[i].k), Tp(data015[i].phi)); + const Tp f0 = data015[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)); +} + +// Test data for k=0.60000000000000009. +testcase_ellint_1<double> data016[] = { + { -0.0000000000000000, 0.60000000000000009, 0.0000000000000000 }, + { 0.17485154362988362, 0.60000000000000009, 0.17453292519943295 }, + { 0.35160509865544326, 0.60000000000000009, 0.34906585039886590 }, + { 0.53210652578446160, 0.60000000000000009, 0.52359877559829882 }, + { 0.71805304664485670, 0.60000000000000009, 0.69813170079773179 }, + { 0.91082759030195970, 0.60000000000000009, 0.87266462599716477 }, + { 1.1112333229323366, 0.60000000000000009, 1.0471975511965976 }, + { 1.3191461190365270, 0.60000000000000009, 1.2217304763960306 }, + { 1.5332022105084775, 0.60000000000000009, 1.3962634015954636 }, + { 1.7507538029157526, 0.60000000000000009, 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009. +template <typename Tp> +void test016() +{ + 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(data016) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data016[i].k), Tp(data016[i].phi)); + const Tp f0 = data016[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)); +} + +// Test data for k=0.69999999999999996. +testcase_ellint_1<double> data017[] = { + { -0.0000000000000000, 0.69999999999999996, 0.0000000000000000 }, + { 0.17496737466916720, 0.69999999999999996, 0.17453292519943295 }, + { 0.35254687535677925, 0.69999999999999996, 0.34906585039886590 }, + { 0.53536740275997130, 0.69999999999999996, 0.52359877559829882 }, + { 0.72603797651684465, 0.69999999999999996, 0.69813170079773179 }, + { 0.92698296348313458, 0.69999999999999996, 0.87266462599716477 }, + { 1.1400447527693316, 0.69999999999999996, 1.0471975511965976 }, + { 1.3657668117194071, 0.69999999999999996, 1.2217304763960306 }, + { 1.6024686895959159, 0.69999999999999996, 1.3962634015954636 }, + { 1.8456939983747236, 0.69999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996. +template <typename Tp> +void test017() +{ + 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(data017) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data017[i].k), Tp(data017[i].phi)); + const Tp f0 = data017[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)); +} + +// Test data for k=0.80000000000000004. +testcase_ellint_1<double> data018[] = { + { -0.0000000000000000, 0.80000000000000004, 0.0000000000000000 }, + { 0.17510154241338902, 0.80000000000000004, 0.17453292519943295 }, + { 0.35365068839779390, 0.80000000000000004, 0.34906585039886590 }, + { 0.53926804409084561, 0.80000000000000004, 0.52359877559829882 }, + { 0.73587926028070383, 0.80000000000000004, 0.69813170079773179 }, + { 0.94770942970071170, 0.80000000000000004, 0.87266462599716477 }, + { 1.1789022995388239, 0.80000000000000004, 1.0471975511965976 }, + { 1.4323027881876009, 0.80000000000000004, 1.2217304763960306 }, + { 1.7069629739121674, 0.80000000000000004, 1.3962634015954636 }, + { 1.9953027776647296, 0.80000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004. +template <typename Tp> +void test018() +{ + 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(data018) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data018[i].k), Tp(data018[i].phi)); + const Tp f0 = data018[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)); +} + +// Test data for k=0.89999999999999991. +testcase_ellint_1<double> data019[] = { + { -0.0000000000000000, 0.89999999999999991, 0.0000000000000000 }, + { 0.17525427376115027, 0.89999999999999991, 0.17453292519943295 }, + { 0.35492464591297446, 0.89999999999999991, 0.34906585039886590 }, + { 0.54388221416157123, 0.89999999999999991, 0.52359877559829882 }, + { 0.74797400423532501, 0.89999999999999991, 0.69813170079773179 }, + { 0.97463898451966458, 0.89999999999999991, 0.87266462599716477 }, + { 1.2334463254523438, 0.89999999999999991, 1.0471975511965976 }, + { 1.5355247765594910, 0.89999999999999991, 1.2217304763960306 }, + { 1.8882928567775117, 0.89999999999999991, 1.3962634015954636 }, + { 2.2805491384227699, 0.89999999999999991, 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991. +template <typename Tp> +void test019() +{ + 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(data019) + / sizeof(testcase_ellint_1<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_1(Tp(data019[i].k), Tp(data019[i].phi)); + const Tp f0 = data019[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>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile.cc new file mode 100644 index 00000000000..d925f82da6d --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile_2.cc new file mode 100644 index 00000000000..38119b6f866 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/12_ellint_1/compile_2.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_nan.cc new file mode 100644 index 00000000000..9e1775e5749 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_nan.cc @@ -0,0 +1,87 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_value.cc new file mode 100644 index 00000000000..fa9e4d3a0a9 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/check_value.cc @@ -0,0 +1,844 @@ +// 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. + +// 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 for k=-0.90000000000000002. +testcase_ellint_2<double> data001[] = { + { -0.0000000000000000, -0.90000000000000002, 0.0000000000000000 }, + { 0.17381690606167963, -0.90000000000000002, 0.17453292519943295 }, + { 0.34337919186972055, -0.90000000000000002, 0.34906585039886590 }, + { 0.50464268659856337, -0.90000000000000002, 0.52359877559829882 }, + { 0.65400003842368593, -0.90000000000000002, 0.69813170079773179 }, + { 0.78854928419904657, -0.90000000000000002, 0.87266462599716477 }, + { 0.90645698626315407, -0.90000000000000002, 1.0471975511965976 }, + { 1.0075154899135925, -0.90000000000000002, 1.2217304763960306 }, + { 1.0940135583194071, -0.90000000000000002, 1.3962634015954636 }, + { 1.1716970527816140, -0.90000000000000002, 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002. +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_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data001[i].k), Tp(data001[i].phi)); + 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.0000000000000029e-12)); +} + +// Test data for k=-0.80000000000000004. +testcase_ellint_2<double> data002[] = { + { -0.0000000000000000, -0.80000000000000004, 0.0000000000000000 }, + { 0.17396762274534808, -0.80000000000000004, 0.17453292519943295 }, + { 0.34458685226969316, -0.80000000000000004, 0.34906585039886590 }, + { 0.50872923654502444, -0.80000000000000004, 0.52359877559829882 }, + { 0.66372016539176237, -0.80000000000000004, 0.69813170079773179 }, + { 0.80760344410167406, -0.80000000000000004, 0.87266462599716477 }, + { 0.93945480372495072, -0.80000000000000004, 1.0471975511965976 }, + { 1.0597473310395036, -0.80000000000000004, 1.2217304763960306 }, + { 1.1706981862452361, -0.80000000000000004, 1.3962634015954636 }, + { 1.2763499431699066, -0.80000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data002[i].k), Tp(data002[i].phi)); + const Tp f0 = data002[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(1.0000000000000008e-12)); +} + +// Test data for k=-0.69999999999999996. +testcase_ellint_2<double> data003[] = { + { -0.0000000000000000, -0.69999999999999996, 0.0000000000000000 }, + { 0.17410041242702540, -0.69999999999999996, 0.17453292519943295 }, + { 0.34564605085764760, -0.69999999999999996, 0.34906585039886590 }, + { 0.51228495693314657, -0.69999999999999996, 0.52359877559829882 }, + { 0.67207654098799530, -0.69999999999999996, 0.69813170079773179 }, + { 0.82370932631556515, -0.69999999999999996, 0.87266462599716477 }, + { 0.96672313309452795, -0.69999999999999996, 1.0471975511965976 }, + { 1.1017090644949503, -0.69999999999999996, 1.2217304763960306 }, + { 1.2304180097292916, -0.69999999999999996, 1.3962634015954636 }, + { 1.3556611355719557, -0.69999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data003[i].k), Tp(data003[i].phi)); + const Tp f0 = data003[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)); +} + +// Test data for k=-0.59999999999999998. +testcase_ellint_2<double> data004[] = { + { -0.0000000000000000, -0.59999999999999998, 0.0000000000000000 }, + { 0.17421534919599130, -0.59999999999999998, 0.17453292519943295 }, + { 0.34655927787174101, -0.59999999999999998, 0.34906585039886590 }, + { 0.51533034538432165, -0.59999999999999998, 0.52359877559829882 }, + { 0.67916550597453029, -0.59999999999999998, 0.69813170079773179 }, + { 0.83720218180349870, -0.59999999999999998, 0.87266462599716477 }, + { 0.98922159354937755, -0.59999999999999998, 1.0471975511965976 }, + { 1.1357478470419360, -0.59999999999999998, 1.2217304763960306 }, + { 1.2780617372844056, -0.59999999999999998, 1.3962634015954636 }, + { 1.4180833944487243, -0.59999999999999998, 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data004[i].k), Tp(data004[i].phi)); + const Tp f0 = data004[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)); +} + +// Test data for k=-0.50000000000000000. +testcase_ellint_2<double> data005[] = { + { -0.0000000000000000, -0.50000000000000000, 0.0000000000000000 }, + { 0.17431249677315910, -0.50000000000000000, 0.17453292519943295 }, + { 0.34732862537770803, -0.50000000000000000, 0.34906585039886590 }, + { 0.51788193485993805, -0.50000000000000000, 0.52359877559829882 }, + { 0.68506022954164536, -0.50000000000000000, 0.69813170079773179 }, + { 0.84831662803347196, -0.50000000000000000, 0.87266462599716477 }, + { 1.0075555551444717, -0.50000000000000000, 1.0471975511965976 }, + { 1.1631768599287302, -0.50000000000000000, 1.2217304763960306 }, + { 1.3160584048772543, -0.50000000000000000, 1.3962634015954636 }, + { 1.4674622093394274, -0.50000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data005[i].k), Tp(data005[i].phi)); + const Tp f0 = data005[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)); +} + +// Test data for k=-0.40000000000000002. +testcase_ellint_2<double> data006[] = { + { -0.0000000000000000, -0.40000000000000002, 0.0000000000000000 }, + { 0.17439190872481269, -0.40000000000000002, 0.17453292519943295 }, + { 0.34795581767099210, -0.40000000000000002, 0.34906585039886590 }, + { 0.51995290683804474, -0.40000000000000002, 0.52359877559829882 }, + { 0.68981638464431549, -0.40000000000000002, 0.69813170079773179 }, + { 0.85722088859936041, -0.40000000000000002, 0.87266462599716477 }, + { 1.0221301327876993, -0.40000000000000002, 1.0471975511965976 }, + { 1.1848138019818371, -0.40000000000000002, 1.2217304763960306 }, + { 1.3458259266501531, -0.40000000000000002, 1.3962634015954636 }, + { 1.5059416123600402, -0.40000000000000002, 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data006[i].k), Tp(data006[i].phi)); + const Tp f0 = data006[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)); +} + +// Test data for k=-0.30000000000000004. +testcase_ellint_2<double> data007[] = { + { -0.0000000000000000, -0.30000000000000004, 0.0000000000000000 }, + { 0.17445362864048916, -0.30000000000000004, 0.17453292519943295 }, + { 0.34844223535713464, -0.30000000000000004, 0.34906585039886590 }, + { 0.52155353877411770, -0.30000000000000004, 0.52359877559829882 }, + { 0.69347584418369879, -0.30000000000000004, 0.69813170079773179 }, + { 0.86403609928237668, -0.30000000000000004, 0.87266462599716477 }, + { 1.0332234514065410, -0.30000000000000004, 1.0471975511965976 }, + { 1.2011943182068923, -0.30000000000000004, 1.2217304763960306 }, + { 1.3682566113689620, -0.30000000000000004, 1.3962634015954636 }, + { 1.5348334649232489, -0.30000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data007[i].k), Tp(data007[i].phi)); + const Tp f0 = data007[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)); +} + +// Test data for k=-0.19999999999999996. +testcase_ellint_2<double> data008[] = { + { -0.0000000000000000, -0.19999999999999996, 0.0000000000000000 }, + { 0.17449769027652814, -0.19999999999999996, 0.17453292519943295 }, + { 0.34878893400762095, -0.19999999999999996, 0.34906585039886590 }, + { 0.52269152856057410, -0.19999999999999996, 0.52359877559829882 }, + { 0.69606913360157596, -0.19999999999999996, 0.69813170079773179 }, + { 0.86884782374863356, -0.19999999999999996, 0.87266462599716477 }, + { 1.0410255369689567, -0.19999999999999996, 1.0471975511965976 }, + { 1.2126730391631360, -0.19999999999999996, 1.2217304763960306 }, + { 1.3839259540325153, -0.19999999999999996, 1.3962634015954636 }, + { 1.5549685462425296, -0.19999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data008[i].k), Tp(data008[i].phi)); + const Tp f0 = data008[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)); +} + +// Test data for k=-0.099999999999999978. +testcase_ellint_2<double> data009[] = { + { -0.0000000000000000, -0.099999999999999978, 0.0000000000000000 }, + { 0.17452411766649945, -0.099999999999999978, 0.17453292519943295 }, + { 0.34899665805442398, -0.099999999999999978, 0.34906585039886590 }, + { 0.52337222400508787, -0.099999999999999978, 0.52359877559829882 }, + { 0.69761705217284875, -0.099999999999999978, 0.69813170079773179 }, + { 0.87171309273007491, -0.099999999999999978, 0.87266462599716477 }, + { 1.0456602197056328, -0.099999999999999978, 1.0471975511965976 }, + { 1.2194762899272025, -0.099999999999999978, 1.2217304763960306 }, + { 1.3931950229892744, -0.099999999999999978, 1.3962634015954636 }, + { 1.5668619420216685, -0.099999999999999978, 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data009[i].k), Tp(data009[i].phi)); + const Tp f0 = data009[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)); +} + +// Test data for k=0.0000000000000000. +testcase_ellint_2<double> data010[] = { + { -0.0000000000000000, 0.0000000000000000, 0.0000000000000000 }, + { 0.17453292519943295, 0.0000000000000000, 0.17453292519943295 }, + { 0.34906585039886584, 0.0000000000000000, 0.34906585039886590 }, + { 0.52359877559829882, 0.0000000000000000, 0.52359877559829882 }, + { 0.69813170079773179, 0.0000000000000000, 0.69813170079773179 }, + { 0.87266462599716477, 0.0000000000000000, 0.87266462599716477 }, + { 1.0471975511965976, 0.0000000000000000, 1.0471975511965976 }, + { 1.2217304763960304, 0.0000000000000000, 1.2217304763960306 }, + { 1.3962634015954631, 0.0000000000000000, 1.3962634015954636 }, + { 1.5707963267948966, 0.0000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data010[i].k), Tp(data010[i].phi)); + const Tp f0 = data010[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)); +} + +// Test data for k=0.10000000000000009. +testcase_ellint_2<double> data011[] = { + { -0.0000000000000000, 0.10000000000000009, 0.0000000000000000 }, + { 0.17452411766649945, 0.10000000000000009, 0.17453292519943295 }, + { 0.34899665805442398, 0.10000000000000009, 0.34906585039886590 }, + { 0.52337222400508787, 0.10000000000000009, 0.52359877559829882 }, + { 0.69761705217284875, 0.10000000000000009, 0.69813170079773179 }, + { 0.87171309273007491, 0.10000000000000009, 0.87266462599716477 }, + { 1.0456602197056328, 0.10000000000000009, 1.0471975511965976 }, + { 1.2194762899272025, 0.10000000000000009, 1.2217304763960306 }, + { 1.3931950229892744, 0.10000000000000009, 1.3962634015954636 }, + { 1.5668619420216685, 0.10000000000000009, 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data011[i].k), Tp(data011[i].phi)); + const Tp f0 = data011[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)); +} + +// Test data for k=0.19999999999999996. +testcase_ellint_2<double> data012[] = { + { -0.0000000000000000, 0.19999999999999996, 0.0000000000000000 }, + { 0.17449769027652814, 0.19999999999999996, 0.17453292519943295 }, + { 0.34878893400762095, 0.19999999999999996, 0.34906585039886590 }, + { 0.52269152856057410, 0.19999999999999996, 0.52359877559829882 }, + { 0.69606913360157596, 0.19999999999999996, 0.69813170079773179 }, + { 0.86884782374863356, 0.19999999999999996, 0.87266462599716477 }, + { 1.0410255369689567, 0.19999999999999996, 1.0471975511965976 }, + { 1.2126730391631360, 0.19999999999999996, 1.2217304763960306 }, + { 1.3839259540325153, 0.19999999999999996, 1.3962634015954636 }, + { 1.5549685462425296, 0.19999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996. +template <typename Tp> +void test012() +{ + 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(data012) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data012[i].k), Tp(data012[i].phi)); + const Tp f0 = data012[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)); +} + +// Test data for k=0.30000000000000004. +testcase_ellint_2<double> data013[] = { + { -0.0000000000000000, 0.30000000000000004, 0.0000000000000000 }, + { 0.17445362864048916, 0.30000000000000004, 0.17453292519943295 }, + { 0.34844223535713464, 0.30000000000000004, 0.34906585039886590 }, + { 0.52155353877411770, 0.30000000000000004, 0.52359877559829882 }, + { 0.69347584418369879, 0.30000000000000004, 0.69813170079773179 }, + { 0.86403609928237668, 0.30000000000000004, 0.87266462599716477 }, + { 1.0332234514065410, 0.30000000000000004, 1.0471975511965976 }, + { 1.2011943182068923, 0.30000000000000004, 1.2217304763960306 }, + { 1.3682566113689620, 0.30000000000000004, 1.3962634015954636 }, + { 1.5348334649232489, 0.30000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004. +template <typename Tp> +void test013() +{ + 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(data013) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data013[i].k), Tp(data013[i].phi)); + const Tp f0 = data013[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)); +} + +// Test data for k=0.39999999999999991. +testcase_ellint_2<double> data014[] = { + { -0.0000000000000000, 0.39999999999999991, 0.0000000000000000 }, + { 0.17439190872481269, 0.39999999999999991, 0.17453292519943295 }, + { 0.34795581767099210, 0.39999999999999991, 0.34906585039886590 }, + { 0.51995290683804474, 0.39999999999999991, 0.52359877559829882 }, + { 0.68981638464431549, 0.39999999999999991, 0.69813170079773179 }, + { 0.85722088859936041, 0.39999999999999991, 0.87266462599716477 }, + { 1.0221301327876993, 0.39999999999999991, 1.0471975511965976 }, + { 1.1848138019818373, 0.39999999999999991, 1.2217304763960306 }, + { 1.3458259266501531, 0.39999999999999991, 1.3962634015954636 }, + { 1.5059416123600404, 0.39999999999999991, 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991. +template <typename Tp> +void test014() +{ + 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(data014) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data014[i].k), Tp(data014[i].phi)); + const Tp f0 = data014[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)); +} + +// Test data for k=0.50000000000000000. +testcase_ellint_2<double> data015[] = { + { -0.0000000000000000, 0.50000000000000000, 0.0000000000000000 }, + { 0.17431249677315910, 0.50000000000000000, 0.17453292519943295 }, + { 0.34732862537770803, 0.50000000000000000, 0.34906585039886590 }, + { 0.51788193485993805, 0.50000000000000000, 0.52359877559829882 }, + { 0.68506022954164536, 0.50000000000000000, 0.69813170079773179 }, + { 0.84831662803347196, 0.50000000000000000, 0.87266462599716477 }, + { 1.0075555551444717, 0.50000000000000000, 1.0471975511965976 }, + { 1.1631768599287302, 0.50000000000000000, 1.2217304763960306 }, + { 1.3160584048772543, 0.50000000000000000, 1.3962634015954636 }, + { 1.4674622093394274, 0.50000000000000000, 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000. +template <typename Tp> +void test015() +{ + 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(data015) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data015[i].k), Tp(data015[i].phi)); + const Tp f0 = data015[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)); +} + +// Test data for k=0.60000000000000009. +testcase_ellint_2<double> data016[] = { + { -0.0000000000000000, 0.60000000000000009, 0.0000000000000000 }, + { 0.17421534919599130, 0.60000000000000009, 0.17453292519943295 }, + { 0.34655927787174101, 0.60000000000000009, 0.34906585039886590 }, + { 0.51533034538432165, 0.60000000000000009, 0.52359877559829882 }, + { 0.67916550597453029, 0.60000000000000009, 0.69813170079773179 }, + { 0.83720218180349870, 0.60000000000000009, 0.87266462599716477 }, + { 0.98922159354937789, 0.60000000000000009, 1.0471975511965976 }, + { 1.1357478470419360, 0.60000000000000009, 1.2217304763960306 }, + { 1.2780617372844056, 0.60000000000000009, 1.3962634015954636 }, + { 1.4180833944487241, 0.60000000000000009, 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009. +template <typename Tp> +void test016() +{ + 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(data016) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data016[i].k), Tp(data016[i].phi)); + const Tp f0 = data016[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)); +} + +// Test data for k=0.69999999999999996. +testcase_ellint_2<double> data017[] = { + { -0.0000000000000000, 0.69999999999999996, 0.0000000000000000 }, + { 0.17410041242702540, 0.69999999999999996, 0.17453292519943295 }, + { 0.34564605085764760, 0.69999999999999996, 0.34906585039886590 }, + { 0.51228495693314657, 0.69999999999999996, 0.52359877559829882 }, + { 0.67207654098799530, 0.69999999999999996, 0.69813170079773179 }, + { 0.82370932631556515, 0.69999999999999996, 0.87266462599716477 }, + { 0.96672313309452795, 0.69999999999999996, 1.0471975511965976 }, + { 1.1017090644949503, 0.69999999999999996, 1.2217304763960306 }, + { 1.2304180097292916, 0.69999999999999996, 1.3962634015954636 }, + { 1.3556611355719557, 0.69999999999999996, 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996. +template <typename Tp> +void test017() +{ + 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(data017) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data017[i].k), Tp(data017[i].phi)); + const Tp f0 = data017[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)); +} + +// Test data for k=0.80000000000000004. +testcase_ellint_2<double> data018[] = { + { -0.0000000000000000, 0.80000000000000004, 0.0000000000000000 }, + { 0.17396762274534808, 0.80000000000000004, 0.17453292519943295 }, + { 0.34458685226969316, 0.80000000000000004, 0.34906585039886590 }, + { 0.50872923654502444, 0.80000000000000004, 0.52359877559829882 }, + { 0.66372016539176237, 0.80000000000000004, 0.69813170079773179 }, + { 0.80760344410167406, 0.80000000000000004, 0.87266462599716477 }, + { 0.93945480372495072, 0.80000000000000004, 1.0471975511965976 }, + { 1.0597473310395036, 0.80000000000000004, 1.2217304763960306 }, + { 1.1706981862452361, 0.80000000000000004, 1.3962634015954636 }, + { 1.2763499431699066, 0.80000000000000004, 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004. +template <typename Tp> +void test018() +{ + 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(data018) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data018[i].k), Tp(data018[i].phi)); + const Tp f0 = data018[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(1.0000000000000008e-12)); +} + +// Test data for k=0.89999999999999991. +testcase_ellint_2<double> data019[] = { + { -0.0000000000000000, 0.89999999999999991, 0.0000000000000000 }, + { 0.17381690606167963, 0.89999999999999991, 0.17453292519943295 }, + { 0.34337919186972055, 0.89999999999999991, 0.34906585039886590 }, + { 0.50464268659856337, 0.89999999999999991, 0.52359877559829882 }, + { 0.65400003842368581, 0.89999999999999991, 0.69813170079773179 }, + { 0.78854928419904657, 0.89999999999999991, 0.87266462599716477 }, + { 0.90645698626315385, 0.89999999999999991, 1.0471975511965976 }, + { 1.0075154899135930, 0.89999999999999991, 1.2217304763960306 }, + { 1.0940135583194071, 0.89999999999999991, 1.3962634015954636 }, + { 1.1716970527816142, 0.89999999999999991, 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991. +template <typename Tp> +void test019() +{ + 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(data019) + / sizeof(testcase_ellint_2<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_2(Tp(data019[i].k), Tp(data019[i].phi)); + const Tp f0 = data019[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.0000000000000029e-12)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile.cc new file mode 100644 index 00000000000..0f4cf9793cb --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile_2.cc new file mode 100644 index 00000000000..27dd739bc00 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/13_ellint_2/compile_2.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_nan.cc new file mode 100644 index 00000000000..fcf2f680d94 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_nan.cc @@ -0,0 +1,126 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_value.cc new file mode 100644 index 00000000000..a86771b3173 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/check_value.cc @@ -0,0 +1,10116 @@ +// 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. + +// ellint_3 + + +// 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 for k=-0.90000000000000002, nu=0.0000000000000000. +testcase_ellint_3<double> data001[] = { + { -0.0000000000000000, -0.90000000000000002, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17525427376115027, -0.90000000000000002, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35492464591297446, -0.90000000000000002, 0.0000000000000000, + 0.34906585039886590 }, + { 0.54388221416157134, -0.90000000000000002, 0.0000000000000000, + 0.52359877559829882 }, + { 0.74797400423532523, -0.90000000000000002, 0.0000000000000000, + 0.69813170079773179 }, + { 0.97463898451966458, -0.90000000000000002, 0.0000000000000000, + 0.87266462599716477 }, + { 1.2334463254523440, -0.90000000000000002, 0.0000000000000000, + 1.0471975511965976 }, + { 1.5355247765594910, -0.90000000000000002, 0.0000000000000000, + 1.2217304763960306 }, + { 1.8882928567775124, -0.90000000000000002, 0.0000000000000000, + 1.3962634015954636 }, + { 2.2805491384227703, -0.90000000000000002, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.0000000000000000. +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_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data001[i].k), Tp(data001[i].nu), + Tp(data001[i].phi)); + 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)); +} + +// Test data for k=-0.90000000000000002, nu=0.10000000000000001. +testcase_ellint_3<double> data002[] = { + { -0.0000000000000000, -0.90000000000000002, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17507714233254659, -0.90000000000000002, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35350932904326521, -0.90000000000000002, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53911129989870998, -0.90000000000000002, 0.10000000000000001, + 0.52359877559829882 }, + { 0.73666644254508429, -0.90000000000000002, 0.10000000000000001, + 0.69813170079773179 }, + { 0.95250736612100184, -0.90000000000000002, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1950199550905594, -0.90000000000000002, 0.10000000000000001, + 1.0471975511965976 }, + { 1.4741687286340848, -0.90000000000000002, 0.10000000000000001, + 1.2217304763960306 }, + { 1.7968678183506059, -0.90000000000000002, 0.10000000000000001, + 1.3962634015954636 }, + { 2.1537868513875287, -0.90000000000000002, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.10000000000000001. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data002[i].k), Tp(data002[i].nu), + Tp(data002[i].phi)); + const Tp f0 = data002[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)); +} + +// Test data for k=-0.90000000000000002, nu=0.20000000000000001. +testcase_ellint_3<double> data003[] = { + { -0.0000000000000000, -0.90000000000000002, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17490065089140930, -0.90000000000000002, 0.20000000000000001, + 0.17453292519943295 }, + { 0.35211377590661436, -0.90000000000000002, 0.20000000000000001, + 0.34906585039886590 }, + { 0.53448220334204122, -0.90000000000000002, 0.20000000000000001, + 0.52359877559829882 }, + { 0.72591368943179613, -0.90000000000000002, 0.20000000000000001, + 0.69813170079773179 }, + { 0.93192539780038763, -0.90000000000000002, 0.20000000000000001, + 0.87266462599716477 }, + { 1.1600809679692683, -0.90000000000000002, 0.20000000000000001, + 1.0471975511965976 }, + { 1.4195407225882508, -0.90000000000000002, 0.20000000000000001, + 1.2217304763960306 }, + { 1.7168966476424528, -0.90000000000000002, 0.20000000000000001, + 1.3962634015954636 }, + { 2.0443194576468890, -0.90000000000000002, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.20000000000000001. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data003[i].k), Tp(data003[i].nu), + Tp(data003[i].phi)); + const Tp f0 = data003[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)); +} + +// Test data for k=-0.90000000000000002, nu=0.29999999999999999. +testcase_ellint_3<double> data004[] = { + { -0.0000000000000000, -0.90000000000000002, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17472479532647534, -0.90000000000000002, 0.29999999999999999, + 0.17453292519943295 }, + { 0.35073750187374114, -0.90000000000000002, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52998766129466979, -0.90000000000000002, 0.29999999999999999, + 0.52359877559829882 }, + { 0.71566993548699587, -0.90000000000000002, 0.29999999999999999, + 0.69813170079773179 }, + { 0.91271517762560195, -0.90000000000000002, 0.29999999999999999, + 0.87266462599716477 }, + { 1.1281241199843370, -0.90000000000000002, 0.29999999999999999, + 1.0471975511965976 }, + { 1.3704929576917448, -0.90000000000000002, 0.29999999999999999, + 1.2217304763960306 }, + { 1.6461981511487715, -0.90000000000000002, 0.29999999999999999, + 1.3962634015954636 }, + { 1.9486280260314426, -0.90000000000000002, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.29999999999999999. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data004[i].k), Tp(data004[i].nu), + Tp(data004[i].phi)); + const Tp f0 = data004[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)); +} + +// Test data for k=-0.90000000000000002, nu=0.40000000000000002. +testcase_ellint_3<double> data005[] = { + { -0.0000000000000000, -0.90000000000000002, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17454957156468839, -0.90000000000000002, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34938003933330430, -0.90000000000000002, 0.40000000000000002, + 0.34906585039886590 }, + { 0.52562093533067455, -0.90000000000000002, 0.40000000000000002, + 0.52359877559829882 }, + { 0.70589461324915703, -0.90000000000000002, 0.40000000000000002, + 0.69813170079773179 }, + { 0.89472658511942849, -0.90000000000000002, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0987419542323440, -0.90000000000000002, 0.40000000000000002, + 1.0471975511965976 }, + { 1.3261349565496301, -0.90000000000000002, 0.40000000000000002, + 1.2217304763960306 }, + { 1.5831293909853767, -0.90000000000000002, 0.40000000000000002, + 1.3962634015954636 }, + { 1.8641114227238349, -0.90000000000000002, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.40000000000000002. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data005[i].k), Tp(data005[i].nu), + Tp(data005[i].phi)); + const Tp f0 = data005[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)); +} + +// Test data for k=-0.90000000000000002, nu=0.50000000000000000. +testcase_ellint_3<double> data006[] = { + { -0.0000000000000000, -0.90000000000000002, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17437497557073336, -0.90000000000000002, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34804093691586013, -0.90000000000000002, 0.50000000000000000, + 0.34906585039886590 }, + { 0.52137576320372914, -0.90000000000000002, 0.50000000000000000, + 0.52359877559829882 }, + { 0.69655163996912284, -0.90000000000000002, 0.50000000000000000, + 0.69813170079773179 }, + { 0.87783188683054236, -0.90000000000000002, 0.50000000000000000, + 0.87266462599716477 }, + { 1.0716015959755185, -0.90000000000000002, 0.50000000000000000, + 1.0471975511965976 }, + { 1.2857636916026747, -0.90000000000000002, 0.50000000000000000, + 1.2217304763960306 }, + { 1.5264263913252365, -0.90000000000000002, 0.50000000000000000, + 1.3962634015954636 }, + { 1.7888013241937861, -0.90000000000000002, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.50000000000000000. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data006[i].k), Tp(data006[i].nu), + Tp(data006[i].phi)); + const Tp f0 = data006[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)); +} + +// Test data for k=-0.90000000000000002, nu=0.59999999999999998. +testcase_ellint_3<double> data007[] = { + { -0.0000000000000000, -0.90000000000000002, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17420100334657815, -0.90000000000000002, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34671975876122157, -0.90000000000000002, 0.59999999999999998, + 0.34906585039886590 }, + { 0.51724631570707968, -0.90000000000000002, 0.59999999999999998, + 0.52359877559829882 }, + { 0.68760879113743056, -0.90000000000000002, 0.59999999999999998, + 0.69813170079773179 }, + { 0.86192157779698364, -0.90000000000000002, 0.59999999999999998, + 0.87266462599716477 }, + { 1.0464279696166354, -0.90000000000000002, 0.59999999999999998, + 1.0471975511965976 }, + { 1.2488156247094004, -0.90000000000000002, 0.59999999999999998, + 1.2217304763960306 }, + { 1.4750988777188474, -0.90000000000000002, 0.59999999999999998, + 1.3962634015954636 }, + { 1.7211781128919523, -0.90000000000000002, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.59999999999999998. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data007[i].k), Tp(data007[i].nu), + Tp(data007[i].phi)); + const Tp f0 = data007[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)); +} + +// Test data for k=-0.90000000000000002, nu=0.69999999999999996. +testcase_ellint_3<double> data008[] = { + { -0.0000000000000000, -0.90000000000000002, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17402765093102210, -0.90000000000000002, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34541608382635131, -0.90000000000000002, 0.69999999999999996, + 0.34906585039886590 }, + { 0.51322715827061705, -0.90000000000000002, 0.69999999999999996, + 0.52359877559829882 }, + { 0.67903717872440306, -0.90000000000000002, 0.69999999999999996, + 0.69813170079773179 }, + { 0.84690113601682671, -0.90000000000000002, 0.69999999999999996, + 0.87266462599716477 }, + { 1.0229914311548418, -0.90000000000000002, 0.69999999999999996, + 1.0471975511965976 }, + { 1.2148329639709381, -0.90000000000000002, 0.69999999999999996, + 1.2217304763960306 }, + { 1.4283586501307806, -0.90000000000000002, 0.69999999999999996, + 1.3962634015954636 }, + { 1.6600480747670938, -0.90000000000000002, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.69999999999999996. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data008[i].k), Tp(data008[i].nu), + Tp(data008[i].phi)); + const Tp f0 = data008[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)); +} + +// Test data for k=-0.90000000000000002, nu=0.80000000000000004. +testcase_ellint_3<double> data009[] = { + { -0.0000000000000000, -0.90000000000000002, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17385491439925149, -0.90000000000000002, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34412950523113928, -0.90000000000000002, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50931321668729612, -0.90000000000000002, 0.80000000000000004, + 0.52359877559829882 }, + { 0.67081081392296349, -0.90000000000000002, 0.80000000000000004, + 0.69813170079773179 }, + { 0.83268846097293259, -0.90000000000000002, 0.80000000000000004, + 0.87266462599716477 }, + { 1.0010985015814027, -0.90000000000000002, 0.80000000000000004, + 1.0471975511965976 }, + { 1.1834394045489678, -0.90000000000000002, 0.80000000000000004, + 1.2217304763960306 }, + { 1.3855695891683188, -0.90000000000000002, 0.80000000000000004, + 1.3962634015954636 }, + { 1.6044591960982204, -0.90000000000000002, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.80000000000000004. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data009[i].k), Tp(data009[i].nu), + Tp(data009[i].phi)); + const Tp f0 = data009[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)); +} + +// Test data for k=-0.90000000000000002, nu=0.90000000000000002. +testcase_ellint_3<double> data010[] = { + { -0.0000000000000000, -0.90000000000000002, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17368278986240138, -0.90000000000000002, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34285962963961397, -0.90000000000000002, 0.90000000000000002, + 0.34906585039886590 }, + { 0.50549974644993323, -0.90000000000000002, 0.90000000000000002, + 0.52359877559829882 }, + { 0.66290623857720898, -0.90000000000000002, 0.90000000000000002, + 0.69813170079773179 }, + { 0.81921183128847164, -0.90000000000000002, 0.90000000000000002, + 0.87266462599716477 }, + { 0.98058481956066390, -0.90000000000000002, 0.90000000000000002, + 1.0471975511965976 }, + { 1.1543223520473567, -0.90000000000000002, 0.90000000000000002, + 1.2217304763960306 }, + { 1.3462119782292938, -0.90000000000000002, 0.90000000000000002, + 1.3962634015954636 }, + { 1.5536420236310946, -0.90000000000000002, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.90000000000000002, nu=0.90000000000000002. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data010[i].k), Tp(data010[i].nu), + Tp(data010[i].phi)); + const Tp f0 = data010[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)); +} + +// Test data for k=-0.80000000000000004, nu=0.0000000000000000. +testcase_ellint_3<double> data011[] = { + { -0.0000000000000000, -0.80000000000000004, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17510154241338902, -0.80000000000000004, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35365068839779390, -0.80000000000000004, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53926804409084561, -0.80000000000000004, 0.0000000000000000, + 0.52359877559829882 }, + { 0.73587926028070383, -0.80000000000000004, 0.0000000000000000, + 0.69813170079773179 }, + { 0.94770942970071170, -0.80000000000000004, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1789022995388239, -0.80000000000000004, 0.0000000000000000, + 1.0471975511965976 }, + { 1.4323027881876009, -0.80000000000000004, 0.0000000000000000, + 1.2217304763960306 }, + { 1.7069629739121674, -0.80000000000000004, 0.0000000000000000, + 1.3962634015954636 }, + { 1.9953027776647296, -0.80000000000000004, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.0000000000000000. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data011[i].k), Tp(data011[i].nu), + Tp(data011[i].phi)); + const Tp f0 = data011[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)); +} + +// Test data for k=-0.80000000000000004, nu=0.10000000000000001. +testcase_ellint_3<double> data012[] = { + { -0.0000000000000000, -0.80000000000000004, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17492468824017166, -0.80000000000000004, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35224443521476911, -0.80000000000000004, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53456851853226961, -0.80000000000000004, 0.10000000000000001, + 0.52359877559829882 }, + { 0.72488875602364944, -0.80000000000000004, 0.10000000000000001, + 0.69813170079773179 }, + { 0.92661354274638952, -0.80000000000000004, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1432651144499077, -0.80000000000000004, 0.10000000000000001, + 1.0471975511965976 }, + { 1.3774479927211429, -0.80000000000000004, 0.10000000000000001, + 1.2217304763960306 }, + { 1.6287092337196041, -0.80000000000000004, 0.10000000000000001, + 1.3962634015954636 }, + { 1.8910755418379521, -0.80000000000000004, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.10000000000000001. +template <typename Tp> +void test012() +{ + 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(data012) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data012[i].k), Tp(data012[i].nu), + Tp(data012[i].phi)); + const Tp f0 = data012[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)); +} + +// Test data for k=-0.80000000000000004, nu=0.20000000000000001. +testcase_ellint_3<double> data013[] = { + { -0.0000000000000000, -0.80000000000000004, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17474847286224943, -0.80000000000000004, 0.20000000000000001, + 0.17453292519943295 }, + { 0.35085779529084682, -0.80000000000000004, 0.20000000000000001, + 0.34906585039886590 }, + { 0.53000829263059157, -0.80000000000000004, 0.20000000000000001, + 0.52359877559829882 }, + { 0.71443466027453406, -0.80000000000000004, 0.20000000000000001, + 0.69813170079773179 }, + { 0.90698196872715420, -0.80000000000000004, 0.20000000000000001, + 0.87266462599716477 }, + { 1.1108198200558581, -0.80000000000000004, 0.20000000000000001, + 1.0471975511965976 }, + { 1.3284988909963957, -0.80000000000000004, 0.20000000000000001, + 1.2217304763960306 }, + { 1.5600369318140328, -0.80000000000000004, 0.20000000000000001, + 1.3962634015954636 }, + { 1.8007226661734588, -0.80000000000000004, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.20000000000000001. +template <typename Tp> +void test013() +{ + 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(data013) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data013[i].k), Tp(data013[i].nu), + Tp(data013[i].phi)); + const Tp f0 = data013[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)); +} + +// Test data for k=-0.80000000000000004, nu=0.29999999999999999. +testcase_ellint_3<double> data014[] = { + { -0.0000000000000000, -0.80000000000000004, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17457289217669891, -0.80000000000000004, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34949028801501258, -0.80000000000000004, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52558024362769318, -0.80000000000000004, 0.29999999999999999, + 0.52359877559829882 }, + { 0.70447281740094914, -0.80000000000000004, 0.29999999999999999, + 0.69813170079773179 }, + { 0.88864745641528986, -0.80000000000000004, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0811075819341465, -0.80000000000000004, 0.29999999999999999, + 1.0471975511965976 }, + { 1.2844589654082377, -0.80000000000000004, 0.29999999999999999, + 1.2217304763960306 }, + { 1.4991461361277849, -0.80000000000000004, 0.29999999999999999, + 1.3962634015954636 }, + { 1.7214611048717301, -0.80000000000000004, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.29999999999999999. +template <typename Tp> +void test014() +{ + 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(data014) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data014[i].k), Tp(data014[i].nu), + Tp(data014[i].phi)); + const Tp f0 = data014[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)); +} + +// Test data for k=-0.80000000000000004, nu=0.40000000000000002. +testcase_ellint_3<double> data015[] = { + { -0.0000000000000000, -0.80000000000000004, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17439794211872178, -0.80000000000000004, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34814144964568972, -0.80000000000000004, 0.40000000000000002, + 0.34906585039886590 }, + { 0.52127776285273075, -0.80000000000000004, 0.40000000000000002, + 0.52359877559829882 }, + { 0.69496411438966599, -0.80000000000000004, 0.40000000000000002, + 0.69813170079773179 }, + { 0.87146878427509589, -0.80000000000000004, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0537579024937762, -0.80000000000000004, 0.40000000000000002, + 1.0471975511965976 }, + { 1.2445534387922637, -0.80000000000000004, 0.40000000000000002, + 1.2217304763960306 }, + { 1.4446769766361993, -0.80000000000000004, 0.40000000000000002, + 1.3962634015954636 }, + { 1.6512267838651289, -0.80000000000000004, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.40000000000000002. +template <typename Tp> +void test015() +{ + 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(data015) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data015[i].k), Tp(data015[i].nu), + Tp(data015[i].phi)); + const Tp f0 = data015[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)); +} + +// Test data for k=-0.80000000000000004, nu=0.50000000000000000. +testcase_ellint_3<double> data016[] = { + { -0.0000000000000000, -0.80000000000000004, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17422361866118047, -0.80000000000000004, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34681083254170475, -0.80000000000000004, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51709470815494440, -0.80000000000000004, 0.50000000000000000, + 0.52359877559829882 }, + { 0.68587375344080259, -0.80000000000000004, 0.50000000000000000, + 0.69813170079773179 }, + { 0.85532571852810624, -0.80000000000000004, 0.50000000000000000, + 0.87266462599716477 }, + { 1.0284677391874906, -0.80000000000000004, 0.50000000000000000, + 1.0471975511965976 }, + { 1.2081693942686225, -0.80000000000000004, 0.50000000000000000, + 1.2217304763960306 }, + { 1.3955803006426311, -0.80000000000000004, 0.50000000000000000, + 1.3962634015954636 }, + { 1.5884528947755532, -0.80000000000000004, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.50000000000000000. +template <typename Tp> +void test016() +{ + 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(data016) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data016[i].k), Tp(data016[i].nu), + Tp(data016[i].phi)); + const Tp f0 = data016[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)); +} + +// Test data for k=-0.80000000000000004, nu=0.59999999999999998. +testcase_ellint_3<double> data017[] = { + { -0.0000000000000000, -0.80000000000000004, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17404991781414092, -0.80000000000000004, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34549800443625167, -0.80000000000000004, 0.59999999999999998, + 0.34906585039886590 }, + { 0.51302536167001556, -0.80000000000000004, 0.59999999999999998, + 0.52359877559829882 }, + { 0.67717065003912258, -0.80000000000000004, 0.59999999999999998, + 0.69813170079773179 }, + { 0.84011512421134416, -0.80000000000000004, 0.59999999999999998, + 0.87266462599716477 }, + { 1.0049863847088742, -0.80000000000000004, 0.59999999999999998, + 1.0471975511965976 }, + { 1.1748145941898918, -0.80000000000000004, 0.59999999999999998, + 1.2217304763960306 }, + { 1.3510319699755071, -0.80000000000000004, 0.59999999999999998, + 1.3962634015954636 }, + { 1.5319262547427865, -0.80000000000000004, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.59999999999999998. +template <typename Tp> +void test017() +{ + 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(data017) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data017[i].k), Tp(data017[i].nu), + Tp(data017[i].phi)); + const Tp f0 = data017[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)); +} + +// Test data for k=-0.80000000000000004, nu=0.69999999999999996. +testcase_ellint_3<double> data018[] = { + { -0.0000000000000000, -0.80000000000000004, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17387683562442202, -0.80000000000000004, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34420254775101611, -0.80000000000000004, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50906439222143685, -0.80000000000000004, 0.69999999999999996, + 0.52359877559829882 }, + { 0.66882693152688433, -0.80000000000000004, 0.69999999999999996, + 0.69813170079773179 }, + { 0.82574792844091316, -0.80000000000000004, 0.69999999999999996, + 0.87266462599716477 }, + { 0.98310431309490953, -0.80000000000000004, 0.69999999999999996, + 1.0471975511965976 }, + { 1.1440884535113258, -0.80000000000000004, 0.69999999999999996, + 1.2217304763960306 }, + { 1.3103743938952537, -0.80000000000000004, 0.69999999999999996, + 1.3962634015954636 }, + { 1.4806912324625332, -0.80000000000000004, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.69999999999999996. +template <typename Tp> +void test018() +{ + 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(data018) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data018[i].k), Tp(data018[i].nu), + Tp(data018[i].phi)); + const Tp f0 = data018[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)); +} + +// Test data for k=-0.80000000000000004, nu=0.80000000000000004. +testcase_ellint_3<double> data019[] = { + { -0.0000000000000000, -0.80000000000000004, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17370436817515206, -0.80000000000000004, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34292405894783395, -0.80000000000000004, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50520682176250087, -0.80000000000000004, 0.80000000000000004, + 0.52359877559829882 }, + { 0.66081751679736189, -0.80000000000000004, 0.80000000000000004, + 0.69813170079773179 }, + { 0.81214672249355102, -0.80000000000000004, 0.80000000000000004, + 0.87266462599716477 }, + { 0.96264481387685574, -0.80000000000000004, 0.80000000000000004, + 1.0471975511965976 }, + { 1.1156611352656258, -0.80000000000000004, 0.80000000000000004, + 1.2217304763960306 }, + { 1.2730756225143889, -0.80000000000000004, 0.80000000000000004, + 1.3962634015954636 }, + { 1.4339837018309474, -0.80000000000000004, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.80000000000000004. +template <typename Tp> +void test019() +{ + 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(data019) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data019[i].k), Tp(data019[i].nu), + Tp(data019[i].phi)); + const Tp f0 = data019[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)); +} + +// Test data for k=-0.80000000000000004, nu=0.90000000000000002. +testcase_ellint_3<double> data020[] = { + { -0.0000000000000000, -0.80000000000000004, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17353251158533153, -0.80000000000000004, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34166214791545768, -0.80000000000000004, 0.90000000000000002, + 0.34906585039886590 }, + { 0.50144799535130580, -0.80000000000000004, 0.90000000000000002, + 0.52359877559829882 }, + { 0.65311976193814447, -0.80000000000000004, 0.90000000000000002, + 0.69813170079773179 }, + { 0.79924384892320866, -0.80000000000000004, 0.90000000000000002, + 0.87266462599716477 }, + { 0.94345762353365625, -0.80000000000000004, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0892582069219159, -0.80000000000000004, 0.90000000000000002, + 1.2217304763960306 }, + { 1.2387000876610268, -0.80000000000000004, 0.90000000000000002, + 1.3962634015954636 }, + { 1.3911845406776222, -0.80000000000000004, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.80000000000000004, nu=0.90000000000000002. +template <typename Tp> +void test020() +{ + 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(data020) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data020[i].k), Tp(data020[i].nu), + Tp(data020[i].phi)); + const Tp f0 = data020[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)); +} + +// Test data for k=-0.69999999999999996, nu=0.0000000000000000. +testcase_ellint_3<double> data021[] = { + { -0.0000000000000000, -0.69999999999999996, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17496737466916720, -0.69999999999999996, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35254687535677925, -0.69999999999999996, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53536740275997130, -0.69999999999999996, 0.0000000000000000, + 0.52359877559829882 }, + { 0.72603797651684465, -0.69999999999999996, 0.0000000000000000, + 0.69813170079773179 }, + { 0.92698296348313458, -0.69999999999999996, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1400447527693316, -0.69999999999999996, 0.0000000000000000, + 1.0471975511965976 }, + { 1.3657668117194071, -0.69999999999999996, 0.0000000000000000, + 1.2217304763960306 }, + { 1.6024686895959159, -0.69999999999999996, 0.0000000000000000, + 1.3962634015954636 }, + { 1.8456939983747236, -0.69999999999999996, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.0000000000000000. +template <typename Tp> +void test021() +{ + 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(data021) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data021[i].k), Tp(data021[i].nu), + Tp(data021[i].phi)); + const Tp f0 = data021[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)); +} + +// Test data for k=-0.69999999999999996, nu=0.10000000000000001. +testcase_ellint_3<double> data022[] = { + { -0.0000000000000000, -0.69999999999999996, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17479076384884681, -0.69999999999999996, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35114844900396364, -0.69999999999999996, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53072776947527012, -0.69999999999999996, 0.10000000000000001, + 0.52359877559829882 }, + { 0.71530198262386246, -0.69999999999999996, 0.10000000000000001, + 0.69813170079773179 }, + { 0.90666760677828306, -0.69999999999999996, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1063366517438080, -0.69999999999999996, 0.10000000000000001, + 1.0471975511965976 }, + { 1.3149477243092147, -0.69999999999999996, 0.10000000000000001, + 1.2217304763960306 }, + { 1.5314886725038925, -0.69999999999999996, 0.10000000000000001, + 1.3962634015954636 }, + { 1.7528050171757608, -0.69999999999999996, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.10000000000000001. +template <typename Tp> +void test022() +{ + 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(data022) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data022[i].k), Tp(data022[i].nu), + Tp(data022[i].phi)); + const Tp f0 = data022[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)); +} + +// Test data for k=-0.69999999999999996, nu=0.20000000000000001. +testcase_ellint_3<double> data023[] = { + { -0.0000000000000000, -0.69999999999999996, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17461479077791472, -0.69999999999999996, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34976950621407538, -0.69999999999999996, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52622533231350188, -0.69999999999999996, 0.20000000000000001, + 0.52359877559829882 }, + { 0.70508774017895226, -0.69999999999999996, 0.20000000000000001, + 0.69813170079773179 }, + { 0.88775302531730294, -0.69999999999999996, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0756195476149006, -0.69999999999999996, 0.20000000000000001, + 1.0471975511965976 }, + { 1.2695349716654372, -0.69999999999999996, 0.20000000000000001, + 1.2217304763960306 }, + { 1.4690814617070540, -0.69999999999999996, 0.20000000000000001, + 1.3962634015954636 }, + { 1.6721098780092147, -0.69999999999999996, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.20000000000000001. +template <typename Tp> +void test023() +{ + 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(data023) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data023[i].k), Tp(data023[i].nu), + Tp(data023[i].phi)); + const Tp f0 = data023[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)); +} + +// Test data for k=-0.69999999999999996, nu=0.29999999999999999. +testcase_ellint_3<double> data024[] = { + { -0.0000000000000000, -0.69999999999999996, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17443945136076172, -0.69999999999999996, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34840956983535287, -0.69999999999999996, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52185308551329179, -0.69999999999999996, 0.29999999999999999, + 0.52359877559829882 }, + { 0.69535240431168266, -0.69999999999999996, 0.29999999999999999, + 0.69813170079773179 }, + { 0.87007983473964923, -0.69999999999999996, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0474657975577066, -0.69999999999999996, 0.29999999999999999, + 1.0471975511965976 }, + { 1.2286225419931889, -0.69999999999999996, 0.29999999999999999, + 1.2217304763960306 }, + { 1.4136490671013271, -0.69999999999999996, 0.29999999999999999, + 1.3962634015954636 }, + { 1.6011813647733213, -0.69999999999999996, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.29999999999999999. +template <typename Tp> +void test024() +{ + 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(data024) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data024[i].k), Tp(data024[i].nu), + Tp(data024[i].phi)); + const Tp f0 = data024[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)); +} + +// Test data for k=-0.69999999999999996, nu=0.40000000000000002. +testcase_ellint_3<double> data025[] = { + { -0.0000000000000000, -0.69999999999999996, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17426474153983226, -0.69999999999999996, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34706817945773732, -0.69999999999999996, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51760452851738159, -0.69999999999999996, 0.40000000000000002, + 0.52359877559829882 }, + { 0.68605801534722766, -0.69999999999999996, 0.40000000000000002, + 0.69813170079773179 }, + { 0.85351339387296532, -0.69999999999999996, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0215297967969537, -0.69999999999999996, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1915051074460528, -0.69999999999999996, 0.40000000000000002, + 1.2217304763960306 }, + { 1.3639821911744707, -0.69999999999999996, 0.40000000000000002, + 1.3962634015954636 }, + { 1.5382162002954762, -0.69999999999999996, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.40000000000000002. +template <typename Tp> +void test025() +{ + 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(data025) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data025[i].k), Tp(data025[i].nu), + Tp(data025[i].phi)); + const Tp f0 = data025[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)); +} + +// Test data for k=-0.69999999999999996, nu=0.50000000000000000. +testcase_ellint_3<double> data026[] = { + { -0.0000000000000000, -0.69999999999999996, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17409065729516093, -0.69999999999999996, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34574489064986091, -0.69999999999999996, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51347361925579793, -0.69999999999999996, 0.50000000000000000, + 0.52359877559829882 }, + { 0.67717079489579290, -0.69999999999999996, 0.50000000000000000, + 0.69813170079773179 }, + { 0.83793902055292280, -0.69999999999999996, 0.50000000000000000, + 0.87266462599716477 }, + { 0.99752863545289705, -0.69999999999999996, 0.50000000000000000, + 1.0471975511965976 }, + { 1.1576240080401499, -0.69999999999999996, 0.50000000000000000, + 1.2217304763960306 }, + { 1.3191464023923762, -0.69999999999999996, 0.50000000000000000, + 1.3962634015954636 }, + { 1.4818433192178544, -0.69999999999999996, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.50000000000000000. +template <typename Tp> +void test026() +{ + 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(data026) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data026[i].k), Tp(data026[i].nu), + Tp(data026[i].phi)); + const Tp f0 = data026[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)); +} + +// Test data for k=-0.69999999999999996, nu=0.59999999999999998. +testcase_ellint_3<double> data027[] = { + { -0.0000000000000000, -0.69999999999999996, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17391719464391611, -0.69999999999999996, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34443927423869031, -0.69999999999999996, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50945473266486074, -0.69999999999999996, 0.59999999999999998, + 0.52359877559829882 }, + { 0.66866056326513823, -0.69999999999999996, 0.59999999999999998, + 0.69813170079773179 }, + { 0.82325830002337352, -0.69999999999999996, 0.59999999999999998, + 0.87266462599716477 }, + { 0.97522808245669357, -0.69999999999999996, 0.59999999999999998, + 1.0471975511965976 }, + { 1.1265300613705282, -0.69999999999999996, 0.59999999999999998, + 1.2217304763960306 }, + { 1.2784066076152003, -0.69999999999999996, 0.59999999999999998, + 1.3962634015954636 }, + { 1.4309994736080540, -0.69999999999999996, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.59999999999999998. +template <typename Tp> +void test027() +{ + 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(data027) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data027[i].k), Tp(data027[i].nu), + Tp(data027[i].phi)); + const Tp f0 = data027[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)); +} + +// Test data for k=-0.69999999999999996, nu=0.69999999999999996. +testcase_ellint_3<double> data028[] = { + { -0.0000000000000000, -0.69999999999999996, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17374434963995028, -0.69999999999999996, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34315091562900674, -0.69999999999999996, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50554262375653358, -0.69999999999999996, 0.69999999999999996, + 0.52359877559829882 }, + { 0.66050025406305812, -0.69999999999999996, 0.69999999999999996, + 0.69813170079773179 }, + { 0.80938620118847404, -0.69999999999999996, 0.69999999999999996, + 0.87266462599716477 }, + { 0.95443223855852144, -0.69999999999999996, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0978573207128302, -0.69999999999999996, 0.69999999999999996, + 1.2217304763960306 }, + { 1.2411754575007123, -0.69999999999999996, 0.69999999999999996, + 1.3962634015954636 }, + { 1.3848459188329196, -0.69999999999999996, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.69999999999999996. +template <typename Tp> +void test028() +{ + 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(data028) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data028[i].k), Tp(data028[i].nu), + Tp(data028[i].phi)); + const Tp f0 = data028[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)); +} + +// Test data for k=-0.69999999999999996, nu=0.80000000000000004. +testcase_ellint_3<double> data029[] = { + { -0.0000000000000000, -0.69999999999999996, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17357211837335737, -0.69999999999999996, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34187941416012108, -0.69999999999999996, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50173239465478270, -0.69999999999999996, 0.80000000000000004, + 0.52359877559829882 }, + { 0.65266550725988315, -0.69999999999999996, 0.80000000000000004, + 0.69813170079773179 }, + { 0.79624879865249298, -0.69999999999999996, 0.80000000000000004, + 0.87266462599716477 }, + { 0.93497577043296920, -0.69999999999999996, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0713041566930748, -0.69999999999999996, 0.80000000000000004, + 1.2217304763960306 }, + { 1.2069772023255652, -0.69999999999999996, 0.80000000000000004, + 1.3962634015954636 }, + { 1.3427110650397533, -0.69999999999999996, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.80000000000000004. +template <typename Tp> +void test029() +{ + 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(data029) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data029[i].k), Tp(data029[i].nu), + Tp(data029[i].phi)); + const Tp f0 = data029[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)); +} + +// Test data for k=-0.69999999999999996, nu=0.90000000000000002. +testcase_ellint_3<double> data030[] = { + { -0.0000000000000000, -0.69999999999999996, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17340049697003634, -0.69999999999999996, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34062438249741556, -0.69999999999999996, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49801946510076878, -0.69999999999999996, 0.90000000000000002, + 0.52359877559829882 }, + { 0.64513432604750487, -0.69999999999999996, 0.90000000000000002, + 0.69813170079773179 }, + { 0.78378145487573758, -0.69999999999999996, 0.90000000000000002, + 0.87266462599716477 }, + { 0.91671799500854634, -0.69999999999999996, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0466193579463123, -0.69999999999999996, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1754218079199146, -0.69999999999999996, 0.90000000000000002, + 1.3962634015954636 }, + { 1.3040500499695911, -0.69999999999999996, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.69999999999999996, nu=0.90000000000000002. +template <typename Tp> +void test030() +{ + 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(data030) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data030[i].k), Tp(data030[i].nu), + Tp(data030[i].phi)); + const Tp f0 = data030[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)); +} + +// Test data for k=-0.59999999999999998, nu=0.0000000000000000. +testcase_ellint_3<double> data031[] = { + { -0.0000000000000000, -0.59999999999999998, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17485154362988362, -0.59999999999999998, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35160509865544326, -0.59999999999999998, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53210652578446160, -0.59999999999999998, 0.0000000000000000, + 0.52359877559829882 }, + { 0.71805304664485670, -0.59999999999999998, 0.0000000000000000, + 0.69813170079773179 }, + { 0.91082759030195970, -0.59999999999999998, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1112333229323361, -0.59999999999999998, 0.0000000000000000, + 1.0471975511965976 }, + { 1.3191461190365270, -0.59999999999999998, 0.0000000000000000, + 1.2217304763960306 }, + { 1.5332022105084773, -0.59999999999999998, 0.0000000000000000, + 1.3962634015954636 }, + { 1.7507538029157526, -0.59999999999999998, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.0000000000000000. +template <typename Tp> +void test031() +{ + 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(data031) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data031[i].k), Tp(data031[i].nu), + Tp(data031[i].phi)); + const Tp f0 = data031[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)); +} + +// Test data for k=-0.59999999999999998, nu=0.10000000000000001. +testcase_ellint_3<double> data032[] = { + { -0.0000000000000000, -0.59999999999999998, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17467514275022014, -0.59999999999999998, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35021333086258255, -0.59999999999999998, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52751664092962713, -0.59999999999999998, 0.10000000000000001, + 0.52359877559829882 }, + { 0.70752126971957885, -0.59999999999999998, 0.10000000000000001, + 0.69813170079773179 }, + { 0.89111058756112871, -0.59999999999999998, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0789241202877768, -0.59999999999999998, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2710800210399946, -0.59999999999999998, 0.10000000000000001, + 1.2217304763960306 }, + { 1.4669060574440276, -0.59999999999999998, 0.10000000000000001, + 1.3962634015954636 }, + { 1.6648615773343014, -0.59999999999999998, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.10000000000000001. +template <typename Tp> +void test032() +{ + 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(data032) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data032[i].k), Tp(data032[i].nu), + Tp(data032[i].phi)); + const Tp f0 = data032[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)); +} + +// Test data for k=-0.59999999999999998, nu=0.20000000000000001. +testcase_ellint_3<double> data033[] = { + { -0.0000000000000000, -0.59999999999999998, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17449937871800653, -0.59999999999999998, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34884093647346553, -0.59999999999999998, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52306221119844110, -0.59999999999999998, 0.20000000000000001, + 0.52359877559829882 }, + { 0.69749955678982223, -0.59999999999999998, 0.20000000000000001, + 0.69813170079773179 }, + { 0.87274610682416853, -0.59999999999999998, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0494620540750792, -0.59999999999999998, 0.20000000000000001, + 1.0471975511965976 }, + { 1.2280847305507339, -0.59999999999999998, 0.20000000000000001, + 1.2217304763960306 }, + { 1.4085436279696886, -0.59999999999999998, 0.20000000000000001, + 1.3962634015954636 }, + { 1.5901418016279374, -0.59999999999999998, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.20000000000000001. +template <typename Tp> +void test033() +{ + 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(data033) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data033[i].k), Tp(data033[i].nu), + Tp(data033[i].phi)); + const Tp f0 = data033[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)); +} + +// Test data for k=-0.59999999999999998, nu=0.29999999999999999. +testcase_ellint_3<double> data034[] = { + { -0.0000000000000000, -0.59999999999999998, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17432424744393935, -0.59999999999999998, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34748744127146447, -0.59999999999999998, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51873632743924847, -0.59999999999999998, 0.29999999999999999, + 0.52359877559829882 }, + { 0.68794610396313127, -0.59999999999999998, 0.29999999999999999, + 0.69813170079773179 }, + { 0.85558070175468726, -0.59999999999999998, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0224416343605653, -0.59999999999999998, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1893144457936788, -0.59999999999999998, 0.29999999999999999, + 1.2217304763960306 }, + { 1.3566435377982575, -0.59999999999999998, 0.29999999999999999, + 1.3962634015954636 }, + { 1.5243814243493585, -0.59999999999999998, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.29999999999999999. +template <typename Tp> +void test034() +{ + 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(data034) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data034[i].k), Tp(data034[i].nu), + Tp(data034[i].phi)); + const Tp f0 = data034[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)); +} + +// Test data for k=-0.59999999999999998, nu=0.40000000000000002. +testcase_ellint_3<double> data035[] = { + { -0.0000000000000000, -0.59999999999999998, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17414974487670720, -0.59999999999999998, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34615238767335027, -0.59999999999999998, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51453257838108579, -0.59999999999999998, 0.40000000000000002, + 0.52359877559829882 }, + { 0.67882386787534410, -0.59999999999999998, 0.40000000000000002, + 0.69813170079773179 }, + { 0.83948470233173578, -0.59999999999999998, 0.40000000000000002, + 0.87266462599716477 }, + { 0.99753496200073977, -0.59999999999999998, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1541101404388487, -0.59999999999999998, 0.40000000000000002, + 1.2217304763960306 }, + { 1.3100911323398814, -0.59999999999999998, 0.40000000000000002, + 1.3962634015954636 }, + { 1.4659345278069984, -0.59999999999999998, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.40000000000000002. +template <typename Tp> +void test035() +{ + 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(data035) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data035[i].k), Tp(data035[i].nu), + Tp(data035[i].phi)); + const Tp f0 = data035[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)); +} + +// Test data for k=-0.59999999999999998, nu=0.50000000000000000. +testcase_ellint_3<double> data036[] = { + { -0.0000000000000000, -0.59999999999999998, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17397586700252810, -0.59999999999999998, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34483533397138516, -0.59999999999999998, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51044500461706499, -0.59999999999999998, 0.50000000000000000, + 0.52359877559829882 }, + { 0.67009988034712675, -0.59999999999999998, 0.50000000000000000, + 0.69813170079773179 }, + { 0.82434762375735193, -0.59999999999999998, 0.50000000000000000, + 0.87266462599716477 }, + { 0.97447346702798998, -0.59999999999999998, 0.50000000000000000, + 1.0471975511965976 }, + { 1.1219494000522143, -0.59999999999999998, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2680242605954486, -0.59999999999999998, 0.50000000000000000, + 1.3962634015954636 }, + { 1.4135484285693078, -0.59999999999999998, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.50000000000000000. +template <typename Tp> +void test036() +{ + 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(data036) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data036[i].k), Tp(data036[i].nu), + Tp(data036[i].phi)); + const Tp f0 = data036[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)); +} + +// Test data for k=-0.59999999999999998, nu=0.59999999999999998. +testcase_ellint_3<double> data037[] = { + { -0.0000000000000000, -0.59999999999999998, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17380260984469356, -0.59999999999999998, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34353585361777839, -0.59999999999999998, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50646805774321402, -0.59999999999999998, 0.59999999999999998, + 0.52359877559829882 }, + { 0.66174468108625517, -0.59999999999999998, 0.59999999999999998, + 0.69813170079773179 }, + { 0.81007462280278408, -0.59999999999999998, 0.59999999999999998, + 0.87266462599716477 }, + { 0.95303466945718729, -0.59999999999999998, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0924118588677503, -0.59999999999999998, 0.59999999999999998, + 1.2217304763960306 }, + { 1.2297640574847937, -0.59999999999999998, 0.59999999999999998, + 1.3962634015954636 }, + { 1.3662507535812816, -0.59999999999999998, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.59999999999999998. +template <typename Tp> +void test037() +{ + 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(data037) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data037[i].k), Tp(data037[i].nu), + Tp(data037[i].phi)); + const Tp f0 = data037[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)); +} + +// Test data for k=-0.59999999999999998, nu=0.69999999999999996. +testcase_ellint_3<double> data038[] = { + { -0.0000000000000000, -0.59999999999999998, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17362996946312009, -0.59999999999999998, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34225353454870588, -0.59999999999999998, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50259656397799546, -0.59999999999999998, 0.69999999999999996, + 0.52359877559829882 }, + { 0.65373184496628944, -0.59999999999999998, 0.69999999999999996, + 0.69813170079773179 }, + { 0.79658372884056439, -0.59999999999999998, 0.69999999999999996, + 0.87266462599716477 }, + { 0.93303240100245421, -0.59999999999999998, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0651547944716557, -0.59999999999999998, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1947676204853441, -0.59999999999999998, 0.69999999999999996, + 1.3962634015954636 }, + { 1.3232737468822811, -0.59999999999999998, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.69999999999999996. +template <typename Tp> +void test038() +{ + 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(data038) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data038[i].k), Tp(data038[i].nu), + Tp(data038[i].phi)); + const Tp f0 = data038[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)); +} + +// Test data for k=-0.59999999999999998, nu=0.80000000000000004. +testcase_ellint_3<double> data039[] = { + { -0.0000000000000000, -0.59999999999999998, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17345794195390687, -0.59999999999999998, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34098797854531027, -0.59999999999999998, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49882569168826230, -0.59999999999999998, 0.80000000000000004, + 0.52359877559829882 }, + { 0.64603758566475511, -0.59999999999999998, 0.80000000000000004, + 0.69813170079773179 }, + { 0.78380365594769730, -0.59999999999999998, 0.80000000000000004, + 0.87266462599716477 }, + { 0.91430946255611190, -0.59999999999999998, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0398955217270607, -0.59999999999999998, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1625948314277676, -0.59999999999999998, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2840021261752192, -0.59999999999999998, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.80000000000000004. +template <typename Tp> +void test039() +{ + 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(data039) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data039[i].k), Tp(data039[i].nu), + Tp(data039[i].phi)); + const Tp f0 = data039[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)); +} + +// Test data for k=-0.59999999999999998, nu=0.90000000000000002. +testcase_ellint_3<double> data040[] = { + { -0.0000000000000000, -0.59999999999999998, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17328652344890033, -0.59999999999999998, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33973880062929018, -0.59999999999999998, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49515092233122765, -0.59999999999999998, 0.90000000000000002, + 0.52359877559829882 }, + { 0.63864042139737043, -0.59999999999999998, 0.90000000000000002, + 0.69813170079773179 }, + { 0.77167205646538850, -0.59999999999999998, 0.90000000000000002, + 0.87266462599716477 }, + { 0.89673202848034383, -0.59999999999999998, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0163984492661304, -0.59999999999999998, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1328845785162431, -0.59999999999999998, 0.90000000000000002, + 1.3962634015954636 }, + { 1.2479362973851875, -0.59999999999999998, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.59999999999999998, nu=0.90000000000000002. +template <typename Tp> +void test040() +{ + 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(data040) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data040[i].k), Tp(data040[i].nu), + Tp(data040[i].phi)); + const Tp f0 = data040[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)); +} + +// Test data for k=-0.50000000000000000, nu=0.0000000000000000. +testcase_ellint_3<double> data041[] = { + { -0.0000000000000000, -0.50000000000000000, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17475385514035785, -0.50000000000000000, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35081868470101585, -0.50000000000000000, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52942862705190585, -0.50000000000000000, 0.0000000000000000, + 0.52359877559829882 }, + { 0.71164727562630326, -0.50000000000000000, 0.0000000000000000, + 0.69813170079773179 }, + { 0.89824523594227768, -0.50000000000000000, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0895506700518851, -0.50000000000000000, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2853005857432933, -0.50000000000000000, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4845545520549484, -0.50000000000000000, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6857503548125963, -0.50000000000000000, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.0000000000000000. +template <typename Tp> +void test041() +{ + 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(data041) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data041[i].k), Tp(data041[i].nu), + Tp(data041[i].phi)); + const Tp f0 = data041[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)); +} + +// Test data for k=-0.50000000000000000, nu=0.10000000000000001. +testcase_ellint_3<double> data042[] = { + { -0.0000000000000000, -0.50000000000000000, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17457763120814676, -0.50000000000000000, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34943246340849154, -0.50000000000000000, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52487937869610801, -0.50000000000000000, 0.10000000000000001, + 0.52359877559829882 }, + { 0.70127785096388395, -0.50000000000000000, 0.10000000000000001, + 0.69813170079773179 }, + { 0.87898815988624479, -0.50000000000000000, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0582764576094172, -0.50000000000000000, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2391936844060207, -0.50000000000000000, 0.10000000000000001, + 1.2217304763960306 }, + { 1.4214793542995841, -0.50000000000000000, 0.10000000000000001, + 1.3962634015954636 }, + { 1.6045524936084892, -0.50000000000000000, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.10000000000000001. +template <typename Tp> +void test042() +{ + 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(data042) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data042[i].k), Tp(data042[i].nu), + Tp(data042[i].phi)); + const Tp f0 = data042[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)); +} + +// Test data for k=-0.50000000000000000, nu=0.20000000000000001. +testcase_ellint_3<double> data043[] = { + { -0.0000000000000000, -0.50000000000000000, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17440204336345433, -0.50000000000000000, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34806552388338824, -0.50000000000000000, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52046416757129821, -0.50000000000000000, 0.20000000000000001, + 0.52359877559829882 }, + { 0.69140924550993876, -0.50000000000000000, 0.20000000000000001, + 0.69813170079773179 }, + { 0.86104678636125520, -0.50000000000000000, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0297439459053981, -0.50000000000000000, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1979214112912036, -0.50000000000000000, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3659033858648930, -0.50000000000000000, 0.20000000000000001, + 1.3962634015954636 }, + { 1.5338490483665983, -0.50000000000000000, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.20000000000000001. +template <typename Tp> +void test043() +{ + 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(data043) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data043[i].k), Tp(data043[i].nu), + Tp(data043[i].phi)); + const Tp f0 = data043[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)); +} + +// Test data for k=-0.50000000000000000, nu=0.29999999999999999. +testcase_ellint_3<double> data044[] = { + { -0.0000000000000000, -0.50000000000000000, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17422708752228896, -0.50000000000000000, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34671739434855858, -0.50000000000000000, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51617616305641889, -0.50000000000000000, 0.29999999999999999, + 0.52359877559829882 }, + { 0.68200047612545178, -0.50000000000000000, 0.29999999999999999, + 0.69813170079773179 }, + { 0.84427217869498372, -0.50000000000000000, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0035637821389782, -0.50000000000000000, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1606800483933113, -0.50000000000000000, 0.29999999999999999, + 1.2217304763960306 }, + { 1.3164407134643459, -0.50000000000000000, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4715681939859637, -0.50000000000000000, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.29999999999999999. +template <typename Tp> +void test044() +{ + 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(data044) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data044[i].k), Tp(data044[i].nu), + Tp(data044[i].phi)); + const Tp f0 = data044[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)); +} + +// Test data for k=-0.50000000000000000, nu=0.40000000000000002. +testcase_ellint_3<double> data045[] = { + { -0.0000000000000000, -0.50000000000000000, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17405275963859917, -0.50000000000000000, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34538761957029329, -0.50000000000000000, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51200902646603919, -0.50000000000000000, 0.40000000000000002, + 0.52359877559829882 }, + { 0.67301522212868792, -0.50000000000000000, 0.40000000000000002, + 0.69813170079773179 }, + { 0.82853844466313320, -0.50000000000000000, 0.40000000000000002, + 0.87266462599716477 }, + { 0.97942097862681488, -0.50000000000000000, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1268429801220616, -0.50000000000000000, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2720406704533922, -0.50000000000000000, 0.40000000000000002, + 1.3962634015954636 }, + { 1.4161679518465340, -0.50000000000000000, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.40000000000000002. +template <typename Tp> +void test045() +{ + 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(data045) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data045[i].k), Tp(data045[i].nu), + Tp(data045[i].phi)); + const Tp f0 = data045[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)); +} + +// Test data for k=-0.50000000000000000, nu=0.50000000000000000. +testcase_ellint_3<double> data046[] = { + { -0.0000000000000000, -0.50000000000000000, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17387905570381157, -0.50000000000000000, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34407576010465207, -0.50000000000000000, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50795686560160835, -0.50000000000000000, 0.50000000000000000, + 0.52359877559829882 }, + { 0.66442115453330175, -0.50000000000000000, 0.50000000000000000, + 0.69813170079773179 }, + { 0.81373829119355345, -0.50000000000000000, 0.50000000000000000, + 0.87266462599716477 }, + { 0.95705743313235825, -0.50000000000000000, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0959131991362556, -0.50000000000000000, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2318900529754597, -0.50000000000000000, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3664739530045971, -0.50000000000000000, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.50000000000000000. +template <typename Tp> +void test046() +{ + 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(data046) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data046[i].k), Tp(data046[i].nu), + Tp(data046[i].phi)); + const Tp f0 = data046[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)); +} + +// Test data for k=-0.50000000000000000, nu=0.59999999999999998. +testcase_ellint_3<double> data047[] = { + { -0.0000000000000000, -0.50000000000000000, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17370597174637581, -0.50000000000000000, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34278139158591414, -0.50000000000000000, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50401419439302719, -0.50000000000000000, 0.59999999999999998, + 0.52359877559829882 }, + { 0.65618938076167221, -0.50000000000000000, 0.59999999999999998, + 0.69813170079773179 }, + { 0.79977959248855424, -0.50000000000000000, 0.59999999999999998, + 0.87266462599716477 }, + { 0.93625925190753545, -0.50000000000000000, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0674905658379710, -0.50000000000000000, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1953481298023048, -0.50000000000000000, 0.59999999999999998, + 1.3962634015954636 }, + { 1.3215740290190876, -0.50000000000000000, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.59999999999999998. +template <typename Tp> +void test047() +{ + 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(data047) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data047[i].k), Tp(data047[i].nu), + Tp(data047[i].phi)); + const Tp f0 = data047[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)); +} + +// Test data for k=-0.50000000000000000, nu=0.69999999999999996. +testcase_ellint_3<double> data048[] = { + { -0.0000000000000000, -0.50000000000000000, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17353350383131641, -0.50000000000000000, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34150410405436771, -0.50000000000000000, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50017589696443487, -0.50000000000000000, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64829398188419962, -0.50000000000000000, 0.69999999999999996, + 0.69813170079773179 }, + { 0.78658270782402073, -0.50000000000000000, 0.69999999999999996, + 0.87266462599716477 }, + { 0.91684738336675053, -0.50000000000000000, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0412486789555937, -0.50000000000000000, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1619021847612001, -0.50000000000000000, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2807475181182502, -0.50000000000000000, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.69999999999999996. +template <typename Tp> +void test048() +{ + 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(data048) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data048[i].k), Tp(data048[i].nu), + Tp(data048[i].phi)); + const Tp f0 = data048[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)); +} + +// Test data for k=-0.50000000000000000, nu=0.80000000000000004. +testcase_ellint_3<double> data049[] = { + { -0.0000000000000000, -0.50000000000000000, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17336164805979126, -0.50000000000000000, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34024350132086773, -0.50000000000000000, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49643719555734084, -0.50000000000000000, 0.80000000000000004, + 0.52359877559829882 }, + { 0.64071162456976150, -0.50000000000000000, 0.80000000000000004, + 0.69813170079773179 }, + { 0.77407836177211908, -0.50000000000000000, 0.80000000000000004, + 0.87266462599716477 }, + { 0.89867058251905652, -0.50000000000000000, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0169181822134912, -0.50000000000000000, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1311363312779448, -0.50000000000000000, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2434165408189539, -0.50000000000000000, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.80000000000000004. +template <typename Tp> +void test049() +{ + 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(data049) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data049[i].k), Tp(data049[i].nu), + Tp(data049[i].phi)); + const Tp f0 = data049[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)); +} + +// Test data for k=-0.50000000000000000, nu=0.90000000000000002. +testcase_ellint_3<double> data050[] = { + { -0.0000000000000000, -0.50000000000000000, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17319040056865681, -0.50000000000000000, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33899920036578557, -0.50000000000000000, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49279362182695186, -0.50000000000000000, 0.90000000000000002, + 0.52359877559829882 }, + { 0.63342123379746151, -0.50000000000000000, 0.90000000000000002, + 0.69813170079773179 }, + { 0.76220595179550321, -0.50000000000000000, 0.90000000000000002, + 0.87266462599716477 }, + { 0.88160004743532294, -0.50000000000000000, 0.90000000000000002, + 1.0471975511965976 }, + { 0.99427448642310134, -0.50000000000000000, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1027091512470093, -0.50000000000000000, 0.90000000000000002, + 1.3962634015954636 }, + { 1.2091116095504744, -0.50000000000000000, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.50000000000000000, nu=0.90000000000000002. +template <typename Tp> +void test050() +{ + 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(data050) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data050[i].k), Tp(data050[i].nu), + Tp(data050[i].phi)); + const Tp f0 = data050[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)); +} + +// Test data for k=-0.40000000000000002, nu=0.0000000000000000. +testcase_ellint_3<double> data051[] = { + { -0.0000000000000000, -0.40000000000000002, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17467414669441531, -0.40000000000000002, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35018222772483443, -0.40000000000000002, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52729015917508748, -0.40000000000000002, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70662374407341255, -0.40000000000000002, 0.0000000000000000, + 0.69813170079773179 }, + { 0.88859210497602170, -0.40000000000000002, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0733136290471379, -0.40000000000000002, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2605612170157061, -0.40000000000000002, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4497513956433437, -0.40000000000000002, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6399998658645112, -0.40000000000000002, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.0000000000000000. +template <typename Tp> +void test051() +{ + 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(data051) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data051[i].k), Tp(data051[i].nu), + Tp(data051[i].phi)); + const Tp f0 = data051[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)); +} + +// Test data for k=-0.40000000000000002, nu=0.10000000000000001. +testcase_ellint_3<double> data052[] = { + { -0.0000000000000000, -0.40000000000000002, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17449806706684673, -0.40000000000000002, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34880048623856075, -0.40000000000000002, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52277322065757403, -0.40000000000000002, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69638072056918376, -0.40000000000000002, 0.10000000000000001, + 0.69813170079773179 }, + { 0.86968426619831540, -0.40000000000000002, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0428044206578095, -0.40000000000000002, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2158651158274378, -0.40000000000000002, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3889447129893322, -0.40000000000000002, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5620566886683604, -0.40000000000000002, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.10000000000000001. +template <typename Tp> +void test052() +{ + 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(data052) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data052[i].k), Tp(data052[i].nu), + Tp(data052[i].phi)); + const Tp f0 = data052[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)); +} + +// Test data for k=-0.40000000000000002, nu=0.20000000000000001. +testcase_ellint_3<double> data053[] = { + { -0.0000000000000000, -0.40000000000000002, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17432262290723399, -0.40000000000000002, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34743795258968596, -0.40000000000000002, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51838919472805123, -0.40000000000000002, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68663134739057918, -0.40000000000000002, 0.20000000000000001, + 0.69813170079773179 }, + { 0.85206432981833979, -0.40000000000000002, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0149595349004430, -0.40000000000000002, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1758349405464676, -0.40000000000000002, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3353337673882635, -0.40000000000000002, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4941414344266770, -0.40000000000000002, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.20000000000000001. +template <typename Tp> +void test053() +{ + 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(data053) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data053[i].k), Tp(data053[i].nu), + Tp(data053[i].phi)); + const Tp f0 = data053[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)); +} + +// Test data for k=-0.40000000000000002, nu=0.29999999999999999. +testcase_ellint_3<double> data054[] = { + { -0.0000000000000000, -0.40000000000000002, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17414781013591543, -0.40000000000000002, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34609415696777285, -0.40000000000000002, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51413131295862546, -0.40000000000000002, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67733527622935630, -0.40000000000000002, 0.29999999999999999, + 0.69813170079773179 }, + { 0.83558675182733266, -0.40000000000000002, 0.29999999999999999, + 0.87266462599716477 }, + { 0.98940140808865906, -0.40000000000000002, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1396968797728058, -0.40000000000000002, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2875920037865087, -0.40000000000000002, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4342789859950078, -0.40000000000000002, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.29999999999999999. +template <typename Tp> +void test054() +{ + 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(data054) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data054[i].k), Tp(data054[i].nu), + Tp(data054[i].phi)); + const Tp f0 = data054[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)); +} + +// Test data for k=-0.40000000000000002, nu=0.40000000000000002. +testcase_ellint_3<double> data055[] = { + { -0.0000000000000000, -0.40000000000000002, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17397362471112710, -0.40000000000000002, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34476864603333196, -0.40000000000000002, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50999329415379357, -0.40000000000000002, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66845674551396017, -0.40000000000000002, 0.40000000000000002, + 0.69813170079773179 }, + { 0.82012848346231748, -0.40000000000000002, 0.40000000000000002, + 0.87266462599716477 }, + { 0.96582449258349057, -0.40000000000000002, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1068473749476286, -0.40000000000000002, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2447132729159986, -0.40000000000000002, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3809986210732901, -0.40000000000000002, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.40000000000000002. +template <typename Tp> +void test055() +{ + 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(data055) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data055[i].k), Tp(data055[i].nu), + Tp(data055[i].phi)); + const Tp f0 = data055[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)); +} + +// Test data for k=-0.40000000000000002, nu=0.50000000000000000. +testcase_ellint_3<double> data056[] = { + { -0.0000000000000000, -0.40000000000000002, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17380006262854139, -0.40000000000000002, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34346098216756610, -0.40000000000000002, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50596929935059420, -0.40000000000000002, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65996392089131262, -0.40000000000000002, 0.50000000000000000, + 0.69813170079773179 }, + { 0.80558463511364786, -0.40000000000000002, 0.50000000000000000, + 0.87266462599716477 }, + { 0.94397834522857704, -0.40000000000000002, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0768075114108115, -0.40000000000000002, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2059184624251329, -0.40000000000000002, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3331797176377398, -0.40000000000000002, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.50000000000000000. +template <typename Tp> +void test056() +{ + 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(data056) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data056[i].k), Tp(data056[i].nu), + Tp(data056[i].phi)); + const Tp f0 = data056[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)); +} + +// Test data for k=-0.40000000000000002, nu=0.59999999999999998. +testcase_ellint_3<double> data057[] = { + { -0.0000000000000000, -0.40000000000000002, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17362711992081248, -0.40000000000000002, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34217074276403953, -0.40000000000000002, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50205389185761617, -0.40000000000000002, 0.59999999999999998, + 0.52359877559829882 }, + { 0.65182834920372745, -0.40000000000000002, 0.59999999999999998, + 0.69813170079773179 }, + { 0.79186512820565136, -0.40000000000000002, 0.59999999999999998, + 0.87266462599716477 }, + { 0.92365535916287134, -0.40000000000000002, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0491915663957907, -0.40000000000000002, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1705934291745104, -0.40000000000000002, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2899514672527024, -0.40000000000000002, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.59999999999999998. +template <typename Tp> +void test057() +{ + 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(data057) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data057[i].k), Tp(data057[i].nu), + Tp(data057[i].phi)); + const Tp f0 = data057[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)); +} + +// Test data for k=-0.40000000000000002, nu=0.69999999999999996. +testcase_ellint_3<double> data058[] = { + { -0.0000000000000000, -0.40000000000000002, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17345479265712871, -0.40000000000000002, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34089751955950354, -0.40000000000000002, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49824200167361343, -0.40000000000000002, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64402450341199413, -0.40000000000000002, 0.69999999999999996, + 0.69813170079773179 }, + { 0.77889207804122873, -0.40000000000000002, 0.69999999999999996, + 0.87266462599716477 }, + { 0.90468169720957992, -0.40000000000000002, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0236847823692916, -0.40000000000000002, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1382465247425164, -0.40000000000000002, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2506255923253344, -0.40000000000000002, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.69999999999999996. +template <typename Tp> +void test058() +{ + 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(data058) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data058[i].k), Tp(data058[i].nu), + Tp(data058[i].phi)); + const Tp f0 = data058[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)); +} + +// Test data for k=-0.40000000000000002, nu=0.80000000000000004. +testcase_ellint_3<double> data059[] = { + { -0.0000000000000000, -0.40000000000000002, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17328307694277156, -0.40000000000000002, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33964091800132007, -0.40000000000000002, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49452889372467451, -0.40000000000000002, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63652940095937327, -0.40000000000000002, 0.80000000000000004, + 0.69813170079773179 }, + { 0.76659772511159097, -0.40000000000000002, 0.80000000000000004, + 0.87266462599716477 }, + { 0.88691047977338111, -0.40000000000000002, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0000273200611638, -0.40000000000000002, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1084787902188007, -0.40000000000000002, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2146499565727209, -0.40000000000000002, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.80000000000000004. +template <typename Tp> +void test059() +{ + 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(data059) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data059[i].k), Tp(data059[i].nu), + Tp(data059[i].phi)); + const Tp f0 = data059[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)); +} + +// Test data for k=-0.40000000000000002, nu=0.90000000000000002. +testcase_ellint_3<double> data060[] = { + { -0.0000000000000000, -0.40000000000000002, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17311196891868130, -0.40000000000000002, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33840055664911906, -0.40000000000000002, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49091013944075340, -0.40000000000000002, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62932228186809591, -0.40000000000000002, 0.90000000000000002, + 0.69813170079773179 }, + { 0.75492278323019801, -0.40000000000000002, 0.90000000000000002, + 0.87266462599716477 }, + { 0.87021659043854294, -0.40000000000000002, 0.90000000000000002, + 1.0471975511965976 }, + { 0.97800245228239246, -0.40000000000000002, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0809625773173694, -0.40000000000000002, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1815758115929846, -0.40000000000000002, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.40000000000000002, nu=0.90000000000000002. +template <typename Tp> +void test060() +{ + 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(data060) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data060[i].k), Tp(data060[i].nu), + Tp(data060[i].phi)); + const Tp f0 = data060[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)); +} + +// Test data for k=-0.30000000000000004, nu=0.0000000000000000. +testcase_ellint_3<double> data061[] = { + { -0.0000000000000000, -0.30000000000000004, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17461228653000102, -0.30000000000000004, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34969146102798415, -0.30000000000000004, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52565822873726320, -0.30000000000000004, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70284226512408532, -0.30000000000000004, 0.0000000000000000, + 0.69813170079773179 }, + { 0.88144139195111182, -0.30000000000000004, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0614897067260523, -0.30000000000000004, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2428416824174218, -0.30000000000000004, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4251795877015925, -0.30000000000000004, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6080486199305126, -0.30000000000000004, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.0000000000000000. +template <typename Tp> +void test061() +{ + 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(data061) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data061[i].k), Tp(data061[i].nu), + Tp(data061[i].phi)); + const Tp f0 = data061[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)); +} + +// Test data for k=-0.30000000000000004, nu=0.10000000000000001. +testcase_ellint_3<double> data062[] = { + { -0.0000000000000000, -0.30000000000000004, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17443631884814378, -0.30000000000000004, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34831316835124926, -0.30000000000000004, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52116586276523857, -0.30000000000000004, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69269385837910036, -0.30000000000000004, 0.10000000000000001, + 0.69813170079773179 }, + { 0.86279023163070856, -0.30000000000000004, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0315321461438265, -0.30000000000000004, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1991449111869024, -0.30000000000000004, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3659561780923211, -0.30000000000000004, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5323534693557526, -0.30000000000000004, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.10000000000000001. +template <typename Tp> +void test062() +{ + 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(data062) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data062[i].k), Tp(data062[i].nu), + Tp(data062[i].phi)); + const Tp f0 = data062[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)); +} + +// Test data for k=-0.30000000000000004, nu=0.20000000000000001. +testcase_ellint_3<double> data063[] = { + { -0.0000000000000000, -0.30000000000000004, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17426098615372090, -0.30000000000000004, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34695402664689923, -0.30000000000000004, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51680555567038933, -0.30000000000000004, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68303375225260210, -0.30000000000000004, 0.20000000000000001, + 0.69813170079773179 }, + { 0.84540662891295026, -0.30000000000000004, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0041834051646927, -0.30000000000000004, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1599952702345711, -0.30000000000000004, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3137179520499163, -0.30000000000000004, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4663658145259875, -0.30000000000000004, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.20000000000000001. +template <typename Tp> +void test063() +{ + 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(data063) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data063[i].k), Tp(data063[i].nu), + Tp(data063[i].phi)); + const Tp f0 = data063[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)); +} + +// Test data for k=-0.30000000000000004, nu=0.29999999999999999. +testcase_ellint_3<double> data064[] = { + { -0.0000000000000000, -0.30000000000000004, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17408628437042845, -0.30000000000000004, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34561356761638401, -0.30000000000000004, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51257058617875850, -0.30000000000000004, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67382207124602866, -0.30000000000000004, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82914751587825131, -0.30000000000000004, 0.29999999999999999, + 0.87266462599716477 }, + { 0.97907434814374950, -0.30000000000000004, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1246399297351584, -0.30000000000000004, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2671793970398146, -0.30000000000000004, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4081767433479089, -0.30000000000000004, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.29999999999999999. +template <typename Tp> +void test064() +{ + 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(data064) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data064[i].k), Tp(data064[i].nu), + Tp(data064[i].phi)); + const Tp f0 = data064[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)); +} + +// Test data for k=-0.30000000000000004, nu=0.40000000000000002. +testcase_ellint_3<double> data065[] = { + { -0.0000000000000000, -0.30000000000000004, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17391220945982730, -0.30000000000000004, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34429133937639689, -0.30000000000000004, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50845471668581632, -0.30000000000000004, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66502347027873854, -0.30000000000000004, 0.40000000000000002, + 0.69813170079773179 }, + { 0.81389191978012254, -0.30000000000000004, 0.40000000000000002, + 0.87266462599716477 }, + { 0.95590618002140593, -0.30000000000000004, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0924915195213121, -0.30000000000000004, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2253651604038058, -0.30000000000000004, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3563643538969761, -0.30000000000000004, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.40000000000000002. +template <typename Tp> +void test065() +{ + 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(data065) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data065[i].k), Tp(data065[i].nu), + Tp(data065[i].phi)); + const Tp f0 = data065[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)); +} + +// Test data for k=-0.30000000000000004, nu=0.50000000000000000. +testcase_ellint_3<double> data066[] = { + { -0.0000000000000000, -0.30000000000000004, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17373875742088235, -0.30000000000000004, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34298690571124157, -0.30000000000000004, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50445214859646936, -0.30000000000000004, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65660648352418516, -0.30000000000000004, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79953670639287289, -0.30000000000000004, 0.50000000000000000, + 0.87266462599716477 }, + { 0.93443393926588558, -0.30000000000000004, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0630838369016911, -0.30000000000000004, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1875197325653026, -0.30000000000000004, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3098448759814960, -0.30000000000000004, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.50000000000000000. +template <typename Tp> +void test066() +{ + 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(data066) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data066[i].k), Tp(data066[i].nu), + Tp(data066[i].phi)); + const Tp f0 = data066[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)); +} + +// Test data for k=-0.30000000000000004, nu=0.59999999999999998. +testcase_ellint_3<double> data067[] = { + { -0.0000000000000000, -0.30000000000000004, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17356592428950826, -0.30000000000000004, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34169984536697379, -0.30000000000000004, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50055748266498457, -0.30000000000000004, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64854298527106768, -0.30000000000000004, 0.59999999999999998, + 0.69813170079773179 }, + { 0.78599329284207431, -0.30000000000000004, 0.59999999999999998, + 0.87266462599716477 }, + { 0.91445452089128221, -0.30000000000000004, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0360412952290587, -0.30000000000000004, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1530473919778639, -0.30000000000000004, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2677758800420666, -0.30000000000000004, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.59999999999999998. +template <typename Tp> +void test067() +{ + 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(data067) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data067[i].k), Tp(data067[i].nu), + Tp(data067[i].phi)); + const Tp f0 = data067[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)); +} + +// Test data for k=-0.30000000000000004, nu=0.69999999999999996. +testcase_ellint_3<double> data068[] = { + { -0.0000000000000000, -0.30000000000000004, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17339370613812227, -0.30000000000000004, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34042975138455933, -0.30000000000000004, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49676568368075985, -0.30000000000000004, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64080774055753720, -0.30000000000000004, 0.69999999999999996, + 0.69813170079773179 }, + { 0.77318507779667278, -0.30000000000000004, 0.69999999999999996, + 0.87266462599716477 }, + { 0.89579782346548631, -0.30000000000000004, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0110573286052202, -0.30000000000000004, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1214710972949633, -0.30000000000000004, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2294913236274980, -0.30000000000000004, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.69999999999999996. +template <typename Tp> +void test068() +{ + 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(data068) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data068[i].k), Tp(data068[i].nu), + Tp(data068[i].phi)); + const Tp f0 = data068[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)); +} + +// Test data for k=-0.30000000000000004, nu=0.80000000000000004. +testcase_ellint_3<double> data069[] = { + { -0.0000000000000000, -0.30000000000000004, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17322209907520361, -0.30000000000000004, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33917623046949996, -0.30000000000000004, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49307204894329176, -0.30000000000000004, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63337802830291723, -0.30000000000000004, 0.80000000000000004, + 0.69813170079773179 }, + { 0.76104540997689407, -0.30000000000000004, 0.80000000000000004, + 0.87266462599716477 }, + { 0.87832009635450736, -0.30000000000000004, 0.80000000000000004, + 1.0471975511965976 }, + { 0.98787879723171790, -0.30000000000000004, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0924036340069336, -0.30000000000000004, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1944567571590046, -0.30000000000000004, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.80000000000000004. +template <typename Tp> +void test069() +{ + 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(data069) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data069[i].k), Tp(data069[i].nu), + Tp(data069[i].phi)); + const Tp f0 = data069[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)); +} + +// Test data for k=-0.30000000000000004, nu=0.90000000000000002. +testcase_ellint_3<double> data070[] = { + { -0.0000000000000000, -0.30000000000000004, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17305109924485948, -0.30000000000000004, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33793890239556984, -0.30000000000000004, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48947218005089738, -0.30000000000000004, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62623332340775151, -0.30000000000000004, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74951596581511148, -0.30000000000000004, 0.90000000000000002, + 0.87266462599716477 }, + { 0.86189886597756005, -0.30000000000000004, 0.90000000000000002, + 1.0471975511965976 }, + { 0.96629451153092005, -0.30000000000000004, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0655269133492680, -0.30000000000000004, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1622376896064912, -0.30000000000000004, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.30000000000000004, nu=0.90000000000000002. +template <typename Tp> +void test070() +{ + 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(data070) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data070[i].k), Tp(data070[i].nu), + Tp(data070[i].phi)); + const Tp f0 = data070[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)); +} + +// Test data for k=-0.19999999999999996, nu=0.0000000000000000. +testcase_ellint_3<double> data071[] = { + { -0.0000000000000000, -0.19999999999999996, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17456817290292811, -0.19999999999999996, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34934315932086801, -0.19999999999999996, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52450880529443988, -0.19999999999999996, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70020491009844910, -0.19999999999999996, 0.0000000000000000, + 0.69813170079773179 }, + { 0.87651006649967955, -0.19999999999999996, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0534305870298994, -0.19999999999999996, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2308975521670784, -0.19999999999999996, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4087733584990738, -0.19999999999999996, 0.0000000000000000, + 1.3962634015954636 }, + { 1.5868678474541664, -0.19999999999999996, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.0000000000000000. +template <typename Tp> +void test071() +{ + 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(data071) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data071[i].k), Tp(data071[i].nu), + Tp(data071[i].phi)); + const Tp f0 = data071[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)); +} + +// Test data for k=-0.19999999999999996, nu=0.10000000000000001. +testcase_ellint_3<double> data072[] = { + { -0.0000000000000000, -0.19999999999999996, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17439228502691750, -0.19999999999999996, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34796731137565740, -0.19999999999999996, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52003370294544848, -0.19999999999999996, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69012222258631495, -0.19999999999999996, 0.10000000000000001, + 0.69813170079773179 }, + { 0.85803491465566772, -0.19999999999999996, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0238463961099364, -0.19999999999999996, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1878691059202153, -0.19999999999999996, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3505985031831940, -0.19999999999999996, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5126513474261092, -0.19999999999999996, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.10000000000000001. +template <typename Tp> +void test072() +{ + 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(data072) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data072[i].k), Tp(data072[i].nu), + Tp(data072[i].phi)); + const Tp f0 = data072[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)); +} + +// Test data for k=-0.19999999999999996, nu=0.20000000000000001. +testcase_ellint_3<double> data073[] = { + { -0.0000000000000000, -0.19999999999999996, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17421703179583750, -0.19999999999999996, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34661057411998791, -0.19999999999999996, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51569006052647393, -0.19999999999999996, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68052412821107278, -0.19999999999999996, 0.20000000000000001, + 0.69813170079773179 }, + { 0.84081341263313825, -0.19999999999999996, 0.20000000000000001, + 0.87266462599716477 }, + { 0.99683359988842890, -0.19999999999999996, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1493086715118852, -0.19999999999999996, 0.20000000000000001, + 1.2217304763960306 }, + { 1.2992699693957541, -0.19999999999999996, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4479323932249568, -0.19999999999999996, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.20000000000000001. +template <typename Tp> +void test073() +{ + 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(data073) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data073[i].k), Tp(data073[i].nu), + Tp(data073[i].phi)); + const Tp f0 = data073[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)); +} + +// Test data for k=-0.19999999999999996, nu=0.29999999999999999. +testcase_ellint_3<double> data074[] = { + { -0.0000000000000000, -0.19999999999999996, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17404240913577707, -0.19999999999999996, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34527248032587193, -0.19999999999999996, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51147118981668416, -0.19999999999999996, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67137107867777635, -0.19999999999999996, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82470418188668893, -0.19999999999999996, 0.29999999999999999, + 0.87266462599716477 }, + { 0.97202873223594299, -0.19999999999999996, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1144773569375266, -0.19999999999999996, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2535292433701000, -0.19999999999999996, 0.29999999999999999, + 1.3962634015954636 }, + { 1.3908453514752481, -0.19999999999999996, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.29999999999999999. +template <typename Tp> +void test074() +{ + 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(data074) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data074[i].k), Tp(data074[i].nu), + Tp(data074[i].phi)); + const Tp f0 = data074[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)); +} + +// Test data for k=-0.19999999999999996, nu=0.40000000000000002. +testcase_ellint_3<double> data075[] = { + { -0.0000000000000000, -0.19999999999999996, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17386841301066677, -0.19999999999999996, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34395257914113253, -0.19999999999999996, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50737088376869466, -0.19999999999999996, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66262801717277664, -0.19999999999999996, 0.40000000000000002, + 0.69813170079773179 }, + { 0.80958766645079094, -0.19999999999999996, 0.40000000000000002, + 0.87266462599716477 }, + { 0.94913754236162040, -0.19999999999999996, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0827985514223000, -0.19999999999999996, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2124212429050478, -0.19999999999999996, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3400002519661010, -0.19999999999999996, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.40000000000000002. +template <typename Tp> +void test075() +{ + 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(data075) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data075[i].k), Tp(data075[i].nu), + Tp(data075[i].phi)); + const Tp f0 = data075[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)); +} + +// Test data for k=-0.19999999999999996, nu=0.50000000000000000. +testcase_ellint_3<double> data076[] = { + { -0.0000000000000000, -0.19999999999999996, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17369503942181802, -0.19999999999999996, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34265043534362660, -0.19999999999999996, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50338337208655415, -0.19999999999999996, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65426373297163642, -0.19999999999999996, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79536193036145808, -0.19999999999999996, 0.50000000000000000, + 0.87266462599716477 }, + { 0.92791875910061605, -0.19999999999999996, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0538145052725829, -0.19999999999999996, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1752060022875899, -0.19999999999999996, 0.50000000000000000, + 1.3962634015954636 }, + { 1.2943374404397376, -0.19999999999999996, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.50000000000000000. +template <typename Tp> +void test076() +{ + 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(data076) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data076[i].k), Tp(data076[i].nu), + Tp(data076[i].phi)); + const Tp f0 = data076[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)); +} + +// Test data for k=-0.19999999999999996, nu=0.59999999999999998. +testcase_ellint_3<double> data077[] = { + { -0.0000000000000000, -0.19999999999999996, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17352228440746928, -0.19999999999999996, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34136562863713626, -0.19999999999999996, 0.59999999999999998, + 0.34906585039886590 }, + { 0.49950328177638481, -0.19999999999999996, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64625032705690832, -0.19999999999999996, 0.59999999999999998, + 0.69813170079773179 }, + { 0.78193941198403094, -0.19999999999999996, 0.59999999999999998, + 0.87266462599716477 }, + { 0.90817230934317128, -0.19999999999999996, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0271563751276462, -0.19999999999999996, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1412999379040518, -0.19999999999999996, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2530330675914561, -0.19999999999999996, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.59999999999999998. +template <typename Tp> +void test077() +{ + 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(data077) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data077[i].k), Tp(data077[i].nu), + Tp(data077[i].phi)); + const Tp f0 = data077[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)); +} + +// Test data for k=-0.19999999999999996, nu=0.69999999999999996. +testcase_ellint_3<double> data078[] = { + { -0.0000000000000000, -0.19999999999999996, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17335014404233898, -0.19999999999999996, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34009775298617811, -0.19999999999999996, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49572560201923810, -0.19999999999999996, 0.69999999999999996, + 0.52359877559829882 }, + { 0.63856276669886525, -0.19999999999999996, 0.69999999999999996, + 0.69813170079773179 }, + { 0.76924438644867565, -0.19999999999999996, 0.69999999999999996, + 0.87266462599716477 }, + { 0.88973060843856466, -0.19999999999999996, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0025230471636377, -0.19999999999999996, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1102356376093103, -0.19999999999999996, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2154356555075867, -0.19999999999999996, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.69999999999999996. +template <typename Tp> +void test078() +{ + 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(data078) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data078[i].k), Tp(data078[i].nu), + Tp(data078[i].phi)); + const Tp f0 = data078[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)); +} + +// Test data for k=-0.19999999999999996, nu=0.80000000000000004. +testcase_ellint_3<double> data079[] = { + { -0.0000000000000000, -0.19999999999999996, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17317861443718541, -0.19999999999999996, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33884641598718701, -0.19999999999999996, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49204565281259494, -0.19999999999999996, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63117851188220353, -0.19999999999999996, 0.80000000000000004, + 0.69813170079773179 }, + { 0.75721095949544170, -0.19999999999999996, 0.80000000000000004, + 0.87266462599716477 }, + { 0.87245201443919118, -0.19999999999999996, 0.80000000000000004, + 1.0471975511965976 }, + { 0.97966584238831089, -0.19999999999999996, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0816336325174360, -0.19999999999999996, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1810223448909913, -0.19999999999999996, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.80000000000000004. +template <typename Tp> +void test079() +{ + 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(data079) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data079[i].k), Tp(data079[i].nu), + Tp(data079[i].phi)); + const Tp f0 = data079[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)); +} + +// Test data for k=-0.19999999999999996, nu=0.90000000000000002. +testcase_ellint_3<double> data080[] = { + { -0.0000000000000000, -0.19999999999999996, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17300769173837280, -0.19999999999999996, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33761123827372508, -0.19999999999999996, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48845905690769426, -0.19999999999999996, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62407720017324986, -0.19999999999999996, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74578146525124289, -0.19999999999999996, 0.90000000000000002, + 0.87266462599716477 }, + { 0.85621583540073076, -0.19999999999999996, 0.90000000000000002, + 1.0471975511965976 }, + { 0.95837725988001199, -0.19999999999999996, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0551821412633928, -0.19999999999999996, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1493679916141863, -0.19999999999999996, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.19999999999999996, nu=0.90000000000000002. +template <typename Tp> +void test080() +{ + 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(data080) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data080[i].k), Tp(data080[i].nu), + Tp(data080[i].phi)); + const Tp f0 = data080[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)); +} + +// Test data for k=-0.099999999999999978, nu=0.0000000000000000. +testcase_ellint_3<double> data081[] = { + { -0.0000000000000000, -0.099999999999999978, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17454173353063665, -0.099999999999999978, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34913506721468085, -0.099999999999999978, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52382550016538953, -0.099999999999999978, 0.0000000000000000, + 0.52359877559829882 }, + { 0.69864700854177031, -0.099999999999999978, 0.0000000000000000, + 0.69813170079773179 }, + { 0.87361792586964870, -0.099999999999999978, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0487386319621685, -0.099999999999999978, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2239913752078757, -0.099999999999999978, 0.0000000000000000, + 1.2217304763960306 }, + { 1.3993423113684049, -0.099999999999999978, 0.0000000000000000, + 1.3962634015954636 }, + { 1.5747455615173562, -0.099999999999999978, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.0000000000000000. +template <typename Tp> +void test081() +{ + 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(data081) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data081[i].k), Tp(data081[i].nu), + Tp(data081[i].phi)); + const Tp f0 = data081[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)); +} + +// Test data for k=-0.099999999999999978, nu=0.10000000000000001. +testcase_ellint_3<double> data082[] = { + { -0.0000000000000000, -0.099999999999999978, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17436589347616618, -0.099999999999999978, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34776067871237354, -0.099999999999999978, 0.10000000000000001, + 0.34906585039886590 }, + { 0.51936064354727807, -0.099999999999999978, 0.10000000000000001, + 0.52359877559829882 }, + { 0.68860303749364360, -0.099999999999999978, 0.10000000000000001, + 0.69813170079773179 }, + { 0.85524561882332051, -0.099999999999999978, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0193708301908337, -0.099999999999999978, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1813474067123044, -0.099999999999999978, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3417670770424983, -0.099999999999999978, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5013711111199950, -0.099999999999999978, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.10000000000000001. +template <typename Tp> +void test082() +{ + 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(data082) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data082[i].k), Tp(data082[i].nu), + Tp(data082[i].phi)); + const Tp f0 = data082[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)); +} + +// Test data for k=-0.099999999999999978, nu=0.20000000000000001. +testcase_ellint_3<double> data083[] = { + { -0.0000000000000000, -0.099999999999999978, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17419068786141345, -0.099999999999999978, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34640537686230127, -0.099999999999999978, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51502689171753957, -0.099999999999999978, 0.20000000000000001, + 0.52359877559829882 }, + { 0.67904147863672726, -0.099999999999999978, 0.20000000000000001, + 0.69813170079773179 }, + { 0.83811885126105179, -0.099999999999999978, 0.20000000000000001, + 0.87266462599716477 }, + { 0.99255278555742810, -0.099999999999999978, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1431260546194930, -0.099999999999999978, 0.20000000000000001, + 1.2217304763960306 }, + { 1.2909589656532101, -0.099999999999999978, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4373749386463430, -0.099999999999999978, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.20000000000000001. +template <typename Tp> +void test083() +{ + 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(data083) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data083[i].k), Tp(data083[i].nu), + Tp(data083[i].phi)); + const Tp f0 = data083[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)); +} + +// Test data for k=-0.099999999999999978, nu=0.29999999999999999. +testcase_ellint_3<double> data084[] = { + { -0.0000000000000000, -0.099999999999999978, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17401611261390110, -0.099999999999999978, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34506869507511767, -0.099999999999999978, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51081757604259870, -0.099999999999999978, 0.29999999999999999, + 0.52359877559829882 }, + { 0.66992297597712303, -0.099999999999999978, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82209722856174228, -0.099999999999999978, 0.29999999999999999, + 0.87266462599716477 }, + { 0.96792430487669612, -0.099999999999999978, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1085964108954092, -0.099999999999999978, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2456748370836999, -0.099999999999999978, 0.29999999999999999, + 1.3962634015954636 }, + { 1.3809159606704959, -0.099999999999999978, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.29999999999999999. +template <typename Tp> +void test084() +{ + 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(data084) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data084[i].k), Tp(data084[i].nu), + Tp(data084[i].phi)); + const Tp f0 = data084[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)); +} + +// Test data for k=-0.099999999999999978, nu=0.40000000000000002. +testcase_ellint_3<double> data085[] = { + { -0.0000000000000000, -0.099999999999999978, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17384216369897937, -0.099999999999999978, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34375018311376782, -0.099999999999999978, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50672650758380455, -0.099999999999999978, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66121264213337616, -0.099999999999999978, 0.40000000000000002, + 0.69813170079773179 }, + { 0.80706202005774441, -0.099999999999999978, 0.40000000000000002, + 0.87266462599716477 }, + { 0.94519376138245892, -0.099999999999999978, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0771880300759584, -0.099999999999999978, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2049711557188272, -0.099999999999999978, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3306223265207477, -0.099999999999999978, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.40000000000000002. +template <typename Tp> +void test085() +{ + 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(data085) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data085[i].k), Tp(data085[i].nu), + Tp(data085[i].phi)); + const Tp f0 = data085[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)); +} + +// Test data for k=-0.099999999999999978, nu=0.50000000000000000. +testcase_ellint_3<double> data086[] = { + { -0.0000000000000000, -0.099999999999999978, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17366883711936554, -0.099999999999999978, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34244940634881876, -0.099999999999999978, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50274793281634378, -0.099999999999999978, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65287941633275093, -0.099999999999999978, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79291198790315398, -0.099999999999999978, 0.50000000000000000, + 0.87266462599716477 }, + { 0.92412201537880345, -0.099999999999999978, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0484480076799370, -0.099999999999999978, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1681168130475206, -0.099999999999999978, 0.50000000000000000, + 1.3962634015954636 }, + { 1.2854480708580160, -0.099999999999999978, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.50000000000000000. +template <typename Tp> +void test086() +{ + 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(data086) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data086[i].k), Tp(data086[i].nu), + Tp(data086[i].phi)); + const Tp f0 = data086[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)); +} + +// Test data for k=-0.099999999999999978, nu=0.59999999999999998. +testcase_ellint_3<double> data087[] = { + { -0.0000000000000000, -0.099999999999999978, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17349612891469018, -0.099999999999999978, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34116594505539438, -0.099999999999999978, 0.59999999999999998, + 0.34906585039886590 }, + { 0.49887649430466685, -0.099999999999999978, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64489553282165157, -0.099999999999999978, 0.59999999999999998, + 0.69813170079773179 }, + { 0.77956016553782437, -0.099999999999999978, 0.59999999999999998, + 0.87266462599716477 }, + { 0.90451074530096309, -0.099999999999999978, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0220113666961632, -0.099999999999999978, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1345351441065563, -0.099999999999999978, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2445798942989255, -0.099999999999999978, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.59999999999999998. +template <typename Tp> +void test087() +{ + 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(data087) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data087[i].k), Tp(data087[i].nu), + Tp(data087[i].phi)); + const Tp f0 = data087[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)); +} + +// Test data for k=-0.099999999999999978, nu=0.69999999999999996. +testcase_ellint_3<double> data088[] = { + { -0.0000000000000000, -0.099999999999999978, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17332403516105052, -0.099999999999999978, 0.69999999999999996, + 0.17453292519943295 }, + { 0.33989939374896877, -0.099999999999999978, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49510719568614081, -0.099999999999999978, 0.69999999999999996, + 0.52359877559829882 }, + { 0.63723607776354974, -0.099999999999999978, 0.69999999999999996, + 0.69813170079773179 }, + { 0.76693133887935327, -0.099999999999999978, 0.69999999999999996, + 0.87266462599716477 }, + { 0.88619382078823827, -0.099999999999999978, 0.69999999999999996, + 1.0471975511965976 }, + { 0.99758012018676490, -0.099999999999999978, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1037642270814410, -0.099999999999999978, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2073745911083187, -0.099999999999999978, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.69999999999999996. +template <typename Tp> +void test088() +{ + 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(data088) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data088[i].k), Tp(data088[i].nu), + Tp(data088[i].phi)); + const Tp f0 = data088[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)); +} + +// Test data for k=-0.099999999999999978, nu=0.80000000000000004. +testcase_ellint_3<double> data089[] = { + { -0.0000000000000000, -0.099999999999999978, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17315255197057020, -0.099999999999999978, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33864936055747985, -0.099999999999999978, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49143537041117619, -0.099999999999999978, 0.80000000000000004, + 0.52359877559829882 }, + { 0.62987861760047492, -0.099999999999999978, 0.80000000000000004, + 0.69813170079773179 }, + { 0.75496005490917517, -0.099999999999999978, 0.80000000000000004, + 0.87266462599716477 }, + { 0.86903081862701903, -0.099999999999999978, 0.80000000000000004, + 1.0471975511965976 }, + { 0.97490814820725591, -0.099999999999999978, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0754290107171083, -0.099999999999999978, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1733158866987732, -0.099999999999999978, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.80000000000000004. +template <typename Tp> +void test089() +{ + 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(data089) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data089[i].k), Tp(data089[i].nu), + Tp(data089[i].phi)); + const Tp f0 = data089[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)); +} + +// Test data for k=-0.099999999999999978, nu=0.90000000000000002. +testcase_ellint_3<double> data090[] = { + { -0.0000000000000000, -0.099999999999999978, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17298167549096569, -0.099999999999999978, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33741546662741584, -0.099999999999999978, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48785665376856879, -0.099999999999999978, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62280288554518959, -0.099999999999999978, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74358903115455199, -0.099999999999999978, 0.90000000000000002, + 0.87266462599716477 }, + { 0.85290207679298358, -0.099999999999999978, 0.90000000000000002, + 1.0471975511965976 }, + { 0.95379006645397379, -0.099999999999999978, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0492213119872327, -0.099999999999999978, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1419839485283374, -0.099999999999999978, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=-0.099999999999999978, nu=0.90000000000000002. +template <typename Tp> +void test090() +{ + 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(data090) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data090[i].k), Tp(data090[i].nu), + Tp(data090[i].phi)); + const Tp f0 = data090[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)); +} + +// Test data for k=0.0000000000000000, nu=0.0000000000000000. +testcase_ellint_3<double> data091[] = { + { -0.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17453292519943295, 0.0000000000000000, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34906585039886584, 0.0000000000000000, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52359877559829882, 0.0000000000000000, 0.0000000000000000, + 0.52359877559829882 }, + { 0.69813170079773179, 0.0000000000000000, 0.0000000000000000, + 0.69813170079773179 }, + { 0.87266462599716477, 0.0000000000000000, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0471975511965976, 0.0000000000000000, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2217304763960304, 0.0000000000000000, 0.0000000000000000, + 1.2217304763960306 }, + { 1.3962634015954631, 0.0000000000000000, 0.0000000000000000, + 1.3962634015954636 }, + { 1.5707963267948966, 0.0000000000000000, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.0000000000000000. +template <typename Tp> +void test091() +{ + 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(data091) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data091[i].k), Tp(data091[i].nu), + Tp(data091[i].phi)); + const Tp f0 = data091[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)); +} + +// Test data for k=0.0000000000000000, nu=0.10000000000000001. +testcase_ellint_3<double> data092[] = { + { -0.0000000000000000, 0.0000000000000000, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17435710107516608, 0.0000000000000000, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34769194715329604, 0.0000000000000000, 0.10000000000000001, + 0.34906585039886590 }, + { 0.51913731575866118, 0.0000000000000000, 0.10000000000000001, + 0.52359877559829882 }, + { 0.68810051897078461, 0.0000000000000000, 0.10000000000000001, + 0.69813170079773179 }, + { 0.85432615661706823, 0.0000000000000000, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0179006647340796, 0.0000000000000000, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1792120640746322, 0.0000000000000000, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3388834245070498, 0.0000000000000000, 0.10000000000000001, + 1.3962634015954636 }, + { 1.4976955329233277, 0.0000000000000000, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.10000000000000001. +template <typename Tp> +void test092() +{ + 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(data092) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data092[i].k), Tp(data092[i].nu), + Tp(data092[i].phi)); + const Tp f0 = data092[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)); +} + +// Test data for k=0.0000000000000000, nu=0.20000000000000001. +testcase_ellint_3<double> data093[] = { + { -0.0000000000000000, 0.0000000000000000, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17418191132226077, 0.0000000000000000, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34633712256943405, 0.0000000000000000, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51480684302043711, 0.0000000000000000, 0.20000000000000001, + 0.52359877559829882 }, + { 0.67855102942481949, 0.0000000000000000, 0.20000000000000001, + 0.69813170079773179 }, + { 0.83723056090326253, 0.0000000000000000, 0.20000000000000001, + 0.87266462599716477 }, + { 0.99114645269578183, 0.0000000000000000, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1411014627915537, 0.0000000000000000, 0.20000000000000001, + 1.2217304763960306 }, + { 1.2882448138013969, 0.0000000000000000, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4339343023863691, 0.0000000000000000, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.20000000000000001. +template <typename Tp> +void test093() +{ + 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(data093) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data093[i].k), Tp(data093[i].nu), + Tp(data093[i].phi)); + const Tp f0 = data093[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)); +} + +// Test data for k=0.0000000000000000, nu=0.29999999999999999. +testcase_ellint_3<double> data094[] = { + { -0.0000000000000000, 0.0000000000000000, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17400735186871727, 0.0000000000000000, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34500091027020219, 0.0000000000000000, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51060069523901541, 0.0000000000000000, 0.29999999999999999, + 0.52359877559829882 }, + { 0.66944393961375459, 0.0000000000000000, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82123776744538157, 0.0000000000000000, 0.29999999999999999, + 0.87266462599716477 }, + { 0.96657579245516523, 0.0000000000000000, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1066703663542414, 0.0000000000000000, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2431094251944901, 0.0000000000000000, 0.29999999999999999, + 1.3962634015954636 }, + { 1.3776795151134889, 0.0000000000000000, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.29999999999999999. +template <typename Tp> +void test094() +{ + 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(data094) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data094[i].k), Tp(data094[i].nu), + Tp(data094[i].phi)); + const Tp f0 = data094[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)); +} + +// Test data for k=0.0000000000000000, nu=0.40000000000000002. +testcase_ellint_3<double> data095[] = { + { -0.0000000000000000, 0.0000000000000000, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17383341868035865, 0.0000000000000000, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34368286022299821, 0.0000000000000000, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50651268947499406, 0.0000000000000000, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66074441806097550, 0.0000000000000000, 0.40000000000000002, + 0.69813170079773179 }, + { 0.80622931670113485, 0.0000000000000000, 0.40000000000000002, + 0.87266462599716477 }, + { 0.94389791565435233, 0.0000000000000000, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0753503387899728, 0.0000000000000000, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2025374759127518, 0.0000000000000000, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3275651989026322, 0.0000000000000000, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.40000000000000002. +template <typename Tp> +void test095() +{ + 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(data095) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data095[i].k), Tp(data095[i].nu), + Tp(data095[i].phi)); + const Tp f0 = data095[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)); +} + +// Test data for k=0.0000000000000000, nu=0.50000000000000000. +testcase_ellint_3<double> data096[] = { + { -0.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17366010776037047, 0.0000000000000000, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34238253799539309, 0.0000000000000000, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50253707775976408, 0.0000000000000000, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65242145347295766, 0.0000000000000000, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79210420018698058, 0.0000000000000000, 0.50000000000000000, + 0.87266462599716477 }, + { 0.92287437995632193, 0.0000000000000000, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0466900550798661, 0.0000000000000000, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1658007366618623, 0.0000000000000000, 0.50000000000000000, + 1.3962634015954636 }, + { 1.2825498301618641, 0.0000000000000000, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.50000000000000000. +template <typename Tp> +void test096() +{ + 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(data096) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data096[i].k), Tp(data096[i].nu), + Tp(data096[i].phi)); + const Tp f0 = data096[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)); +} + +// Test data for k=0.0000000000000000, nu=0.59999999999999998. +testcase_ellint_3<double> data097[] = { + { -0.0000000000000000, 0.0000000000000000, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17348741514884702, 0.0000000000000000, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34109952405241289, 0.0000000000000000, 0.59999999999999998, + 0.34906585039886590 }, + { 0.49866850781226296, 0.0000000000000000, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64444732407062510, 0.0000000000000000, 0.59999999999999998, + 0.69813170079773179 }, + { 0.77877564686544720, 0.0000000000000000, 0.59999999999999998, + 0.87266462599716477 }, + { 0.90330743691883497, 0.0000000000000000, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0203257987604104, 0.0000000000000000, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1323247918768631, 0.0000000000000000, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2418235332245127, 0.0000000000000000, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.59999999999999998. +template <typename Tp> +void test097() +{ + 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(data097) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data097[i].k), Tp(data097[i].nu), + Tp(data097[i].phi)); + const Tp f0 = data097[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)); +} + +// Test data for k=0.0000000000000000, nu=0.69999999999999996. +testcase_ellint_3<double> data098[] = { + { -0.0000000000000000, 0.0000000000000000, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17331533692234477, 0.0000000000000000, 0.69999999999999996, + 0.17453292519943295 }, + { 0.33983341309265941, 0.0000000000000000, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49490198805931990, 0.0000000000000000, 0.69999999999999996, + 0.52359877559829882 }, + { 0.63679715525145308, 0.0000000000000000, 0.69999999999999996, + 0.69813170079773179 }, + { 0.76616861049481944, 0.0000000000000000, 0.69999999999999996, + 0.87266462599716477 }, + { 0.88503143209004220, 0.0000000000000000, 0.69999999999999996, + 1.0471975511965976 }, + { 0.99596060249112173, 0.0000000000000000, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1016495050260424, 0.0000000000000000, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2047457872617382, 0.0000000000000000, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.69999999999999996. +template <typename Tp> +void test098() +{ + 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(data098) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data098[i].k), Tp(data098[i].nu), + Tp(data098[i].phi)); + const Tp f0 = data098[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)); +} + +// Test data for k=0.0000000000000000, nu=0.80000000000000004. +testcase_ellint_3<double> data099[] = { + { -0.0000000000000000, 0.0000000000000000, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17314386919344213, 0.0000000000000000, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33858381342073240, 0.0000000000000000, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49123285640844738, 0.0000000000000000, 0.80000000000000004, + 0.52359877559829882 }, + { 0.62944854858904520, 0.0000000000000000, 0.80000000000000004, + 0.69813170079773179 }, + { 0.75421778305499343, 0.0000000000000000, 0.80000000000000004, + 0.87266462599716477 }, + { 0.86790634112156639, 0.0000000000000000, 0.80000000000000004, + 1.0471975511965976 }, + { 0.97334918087427558, 0.0000000000000000, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0734012615283985, 0.0000000000000000, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1708024551734544, 0.0000000000000000, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.80000000000000004. +template <typename Tp> +void test099() +{ + 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(data099) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data099[i].k), Tp(data099[i].nu), + Tp(data099[i].phi)); + const Tp f0 = data099[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)); +} + +// Test data for k=0.0000000000000000, nu=0.90000000000000002. +testcase_ellint_3<double> data100[] = { + { -0.0000000000000000, 0.0000000000000000, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17297300811030600, 0.0000000000000000, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33735034635360817, 0.0000000000000000, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48765675230233141, 0.0000000000000000, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62238126886123568, 0.0000000000000000, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74286600807269243, 0.0000000000000000, 0.90000000000000002, + 0.87266462599716477 }, + { 0.85181283909264971, 0.0000000000000000, 0.90000000000000002, + 1.0471975511965976 }, + { 0.95228683995371122, 0.0000000000000000, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0472730487412552, 0.0000000000000000, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1395754288497419, 0.0000000000000000, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.0000000000000000, nu=0.90000000000000002. +template <typename Tp> +void test100() +{ + 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(data100) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data100[i].k), Tp(data100[i].nu), + Tp(data100[i].phi)); + const Tp f0 = data100[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)); +} + +// Test data for k=0.10000000000000009, nu=0.0000000000000000. +testcase_ellint_3<double> data101[] = { + { -0.0000000000000000, 0.10000000000000009, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17454173353063665, 0.10000000000000009, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34913506721468085, 0.10000000000000009, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52382550016538953, 0.10000000000000009, 0.0000000000000000, + 0.52359877559829882 }, + { 0.69864700854177031, 0.10000000000000009, 0.0000000000000000, + 0.69813170079773179 }, + { 0.87361792586964870, 0.10000000000000009, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0487386319621685, 0.10000000000000009, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2239913752078757, 0.10000000000000009, 0.0000000000000000, + 1.2217304763960306 }, + { 1.3993423113684049, 0.10000000000000009, 0.0000000000000000, + 1.3962634015954636 }, + { 1.5747455615173562, 0.10000000000000009, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.0000000000000000. +template <typename Tp> +void test101() +{ + 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(data101) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data101[i].k), Tp(data101[i].nu), + Tp(data101[i].phi)); + const Tp f0 = data101[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)); +} + +// Test data for k=0.10000000000000009, nu=0.10000000000000001. +testcase_ellint_3<double> data102[] = { + { -0.0000000000000000, 0.10000000000000009, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17436589347616618, 0.10000000000000009, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34776067871237354, 0.10000000000000009, 0.10000000000000001, + 0.34906585039886590 }, + { 0.51936064354727807, 0.10000000000000009, 0.10000000000000001, + 0.52359877559829882 }, + { 0.68860303749364360, 0.10000000000000009, 0.10000000000000001, + 0.69813170079773179 }, + { 0.85524561882332051, 0.10000000000000009, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0193708301908337, 0.10000000000000009, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1813474067123044, 0.10000000000000009, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3417670770424983, 0.10000000000000009, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5013711111199950, 0.10000000000000009, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.10000000000000001. +template <typename Tp> +void test102() +{ + 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(data102) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data102[i].k), Tp(data102[i].nu), + Tp(data102[i].phi)); + const Tp f0 = data102[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)); +} + +// Test data for k=0.10000000000000009, nu=0.20000000000000001. +testcase_ellint_3<double> data103[] = { + { -0.0000000000000000, 0.10000000000000009, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17419068786141345, 0.10000000000000009, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34640537686230127, 0.10000000000000009, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51502689171753957, 0.10000000000000009, 0.20000000000000001, + 0.52359877559829882 }, + { 0.67904147863672726, 0.10000000000000009, 0.20000000000000001, + 0.69813170079773179 }, + { 0.83811885126105179, 0.10000000000000009, 0.20000000000000001, + 0.87266462599716477 }, + { 0.99255278555742810, 0.10000000000000009, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1431260546194930, 0.10000000000000009, 0.20000000000000001, + 1.2217304763960306 }, + { 1.2909589656532101, 0.10000000000000009, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4373749386463430, 0.10000000000000009, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.20000000000000001. +template <typename Tp> +void test103() +{ + 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(data103) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data103[i].k), Tp(data103[i].nu), + Tp(data103[i].phi)); + const Tp f0 = data103[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)); +} + +// Test data for k=0.10000000000000009, nu=0.29999999999999999. +testcase_ellint_3<double> data104[] = { + { -0.0000000000000000, 0.10000000000000009, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17401611261390110, 0.10000000000000009, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34506869507511767, 0.10000000000000009, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51081757604259870, 0.10000000000000009, 0.29999999999999999, + 0.52359877559829882 }, + { 0.66992297597712303, 0.10000000000000009, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82209722856174228, 0.10000000000000009, 0.29999999999999999, + 0.87266462599716477 }, + { 0.96792430487669612, 0.10000000000000009, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1085964108954092, 0.10000000000000009, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2456748370836999, 0.10000000000000009, 0.29999999999999999, + 1.3962634015954636 }, + { 1.3809159606704959, 0.10000000000000009, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.29999999999999999. +template <typename Tp> +void test104() +{ + 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(data104) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data104[i].k), Tp(data104[i].nu), + Tp(data104[i].phi)); + const Tp f0 = data104[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)); +} + +// Test data for k=0.10000000000000009, nu=0.40000000000000002. +testcase_ellint_3<double> data105[] = { + { -0.0000000000000000, 0.10000000000000009, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17384216369897937, 0.10000000000000009, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34375018311376782, 0.10000000000000009, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50672650758380455, 0.10000000000000009, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66121264213337616, 0.10000000000000009, 0.40000000000000002, + 0.69813170079773179 }, + { 0.80706202005774441, 0.10000000000000009, 0.40000000000000002, + 0.87266462599716477 }, + { 0.94519376138245892, 0.10000000000000009, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0771880300759584, 0.10000000000000009, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2049711557188272, 0.10000000000000009, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3306223265207477, 0.10000000000000009, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.40000000000000002. +template <typename Tp> +void test105() +{ + 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(data105) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data105[i].k), Tp(data105[i].nu), + Tp(data105[i].phi)); + const Tp f0 = data105[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)); +} + +// Test data for k=0.10000000000000009, nu=0.50000000000000000. +testcase_ellint_3<double> data106[] = { + { -0.0000000000000000, 0.10000000000000009, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17366883711936554, 0.10000000000000009, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34244940634881876, 0.10000000000000009, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50274793281634378, 0.10000000000000009, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65287941633275093, 0.10000000000000009, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79291198790315398, 0.10000000000000009, 0.50000000000000000, + 0.87266462599716477 }, + { 0.92412201537880345, 0.10000000000000009, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0484480076799370, 0.10000000000000009, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1681168130475206, 0.10000000000000009, 0.50000000000000000, + 1.3962634015954636 }, + { 1.2854480708580160, 0.10000000000000009, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.50000000000000000. +template <typename Tp> +void test106() +{ + 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(data106) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data106[i].k), Tp(data106[i].nu), + Tp(data106[i].phi)); + const Tp f0 = data106[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)); +} + +// Test data for k=0.10000000000000009, nu=0.59999999999999998. +testcase_ellint_3<double> data107[] = { + { -0.0000000000000000, 0.10000000000000009, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17349612891469018, 0.10000000000000009, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34116594505539438, 0.10000000000000009, 0.59999999999999998, + 0.34906585039886590 }, + { 0.49887649430466685, 0.10000000000000009, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64489553282165157, 0.10000000000000009, 0.59999999999999998, + 0.69813170079773179 }, + { 0.77956016553782437, 0.10000000000000009, 0.59999999999999998, + 0.87266462599716477 }, + { 0.90451074530096309, 0.10000000000000009, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0220113666961632, 0.10000000000000009, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1345351441065563, 0.10000000000000009, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2445798942989255, 0.10000000000000009, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.59999999999999998. +template <typename Tp> +void test107() +{ + 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(data107) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data107[i].k), Tp(data107[i].nu), + Tp(data107[i].phi)); + const Tp f0 = data107[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)); +} + +// Test data for k=0.10000000000000009, nu=0.69999999999999996. +testcase_ellint_3<double> data108[] = { + { -0.0000000000000000, 0.10000000000000009, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17332403516105052, 0.10000000000000009, 0.69999999999999996, + 0.17453292519943295 }, + { 0.33989939374896877, 0.10000000000000009, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49510719568614081, 0.10000000000000009, 0.69999999999999996, + 0.52359877559829882 }, + { 0.63723607776354974, 0.10000000000000009, 0.69999999999999996, + 0.69813170079773179 }, + { 0.76693133887935327, 0.10000000000000009, 0.69999999999999996, + 0.87266462599716477 }, + { 0.88619382078823827, 0.10000000000000009, 0.69999999999999996, + 1.0471975511965976 }, + { 0.99758012018676490, 0.10000000000000009, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1037642270814410, 0.10000000000000009, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2073745911083187, 0.10000000000000009, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.69999999999999996. +template <typename Tp> +void test108() +{ + 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(data108) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data108[i].k), Tp(data108[i].nu), + Tp(data108[i].phi)); + const Tp f0 = data108[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)); +} + +// Test data for k=0.10000000000000009, nu=0.80000000000000004. +testcase_ellint_3<double> data109[] = { + { -0.0000000000000000, 0.10000000000000009, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17315255197057020, 0.10000000000000009, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33864936055747985, 0.10000000000000009, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49143537041117619, 0.10000000000000009, 0.80000000000000004, + 0.52359877559829882 }, + { 0.62987861760047492, 0.10000000000000009, 0.80000000000000004, + 0.69813170079773179 }, + { 0.75496005490917517, 0.10000000000000009, 0.80000000000000004, + 0.87266462599716477 }, + { 0.86903081862701903, 0.10000000000000009, 0.80000000000000004, + 1.0471975511965976 }, + { 0.97490814820725591, 0.10000000000000009, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0754290107171083, 0.10000000000000009, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1733158866987732, 0.10000000000000009, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.80000000000000004. +template <typename Tp> +void test109() +{ + 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(data109) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data109[i].k), Tp(data109[i].nu), + Tp(data109[i].phi)); + const Tp f0 = data109[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)); +} + +// Test data for k=0.10000000000000009, nu=0.90000000000000002. +testcase_ellint_3<double> data110[] = { + { -0.0000000000000000, 0.10000000000000009, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17298167549096569, 0.10000000000000009, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33741546662741584, 0.10000000000000009, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48785665376856879, 0.10000000000000009, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62280288554518959, 0.10000000000000009, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74358903115455199, 0.10000000000000009, 0.90000000000000002, + 0.87266462599716477 }, + { 0.85290207679298358, 0.10000000000000009, 0.90000000000000002, + 1.0471975511965976 }, + { 0.95379006645397379, 0.10000000000000009, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0492213119872327, 0.10000000000000009, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1419839485283374, 0.10000000000000009, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.10000000000000009, nu=0.90000000000000002. +template <typename Tp> +void test110() +{ + 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(data110) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data110[i].k), Tp(data110[i].nu), + Tp(data110[i].phi)); + const Tp f0 = data110[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)); +} + +// Test data for k=0.19999999999999996, nu=0.0000000000000000. +testcase_ellint_3<double> data111[] = { + { -0.0000000000000000, 0.19999999999999996, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17456817290292811, 0.19999999999999996, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34934315932086801, 0.19999999999999996, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52450880529443988, 0.19999999999999996, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70020491009844910, 0.19999999999999996, 0.0000000000000000, + 0.69813170079773179 }, + { 0.87651006649967955, 0.19999999999999996, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0534305870298994, 0.19999999999999996, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2308975521670784, 0.19999999999999996, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4087733584990738, 0.19999999999999996, 0.0000000000000000, + 1.3962634015954636 }, + { 1.5868678474541664, 0.19999999999999996, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.0000000000000000. +template <typename Tp> +void test111() +{ + 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(data111) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data111[i].k), Tp(data111[i].nu), + Tp(data111[i].phi)); + const Tp f0 = data111[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)); +} + +// Test data for k=0.19999999999999996, nu=0.10000000000000001. +testcase_ellint_3<double> data112[] = { + { -0.0000000000000000, 0.19999999999999996, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17439228502691750, 0.19999999999999996, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34796731137565740, 0.19999999999999996, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52003370294544848, 0.19999999999999996, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69012222258631495, 0.19999999999999996, 0.10000000000000001, + 0.69813170079773179 }, + { 0.85803491465566772, 0.19999999999999996, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0238463961099364, 0.19999999999999996, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1878691059202153, 0.19999999999999996, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3505985031831940, 0.19999999999999996, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5126513474261092, 0.19999999999999996, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.10000000000000001. +template <typename Tp> +void test112() +{ + 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(data112) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data112[i].k), Tp(data112[i].nu), + Tp(data112[i].phi)); + const Tp f0 = data112[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)); +} + +// Test data for k=0.19999999999999996, nu=0.20000000000000001. +testcase_ellint_3<double> data113[] = { + { -0.0000000000000000, 0.19999999999999996, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17421703179583750, 0.19999999999999996, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34661057411998791, 0.19999999999999996, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51569006052647393, 0.19999999999999996, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68052412821107278, 0.19999999999999996, 0.20000000000000001, + 0.69813170079773179 }, + { 0.84081341263313825, 0.19999999999999996, 0.20000000000000001, + 0.87266462599716477 }, + { 0.99683359988842890, 0.19999999999999996, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1493086715118852, 0.19999999999999996, 0.20000000000000001, + 1.2217304763960306 }, + { 1.2992699693957541, 0.19999999999999996, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4479323932249568, 0.19999999999999996, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.20000000000000001. +template <typename Tp> +void test113() +{ + 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(data113) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data113[i].k), Tp(data113[i].nu), + Tp(data113[i].phi)); + const Tp f0 = data113[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)); +} + +// Test data for k=0.19999999999999996, nu=0.29999999999999999. +testcase_ellint_3<double> data114[] = { + { -0.0000000000000000, 0.19999999999999996, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17404240913577707, 0.19999999999999996, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34527248032587193, 0.19999999999999996, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51147118981668416, 0.19999999999999996, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67137107867777635, 0.19999999999999996, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82470418188668893, 0.19999999999999996, 0.29999999999999999, + 0.87266462599716477 }, + { 0.97202873223594299, 0.19999999999999996, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1144773569375266, 0.19999999999999996, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2535292433701000, 0.19999999999999996, 0.29999999999999999, + 1.3962634015954636 }, + { 1.3908453514752481, 0.19999999999999996, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.29999999999999999. +template <typename Tp> +void test114() +{ + 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(data114) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data114[i].k), Tp(data114[i].nu), + Tp(data114[i].phi)); + const Tp f0 = data114[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)); +} + +// Test data for k=0.19999999999999996, nu=0.40000000000000002. +testcase_ellint_3<double> data115[] = { + { -0.0000000000000000, 0.19999999999999996, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17386841301066677, 0.19999999999999996, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34395257914113253, 0.19999999999999996, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50737088376869466, 0.19999999999999996, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66262801717277664, 0.19999999999999996, 0.40000000000000002, + 0.69813170079773179 }, + { 0.80958766645079094, 0.19999999999999996, 0.40000000000000002, + 0.87266462599716477 }, + { 0.94913754236162040, 0.19999999999999996, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0827985514223000, 0.19999999999999996, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2124212429050478, 0.19999999999999996, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3400002519661010, 0.19999999999999996, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.40000000000000002. +template <typename Tp> +void test115() +{ + 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(data115) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data115[i].k), Tp(data115[i].nu), + Tp(data115[i].phi)); + const Tp f0 = data115[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)); +} + +// Test data for k=0.19999999999999996, nu=0.50000000000000000. +testcase_ellint_3<double> data116[] = { + { -0.0000000000000000, 0.19999999999999996, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17369503942181802, 0.19999999999999996, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34265043534362660, 0.19999999999999996, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50338337208655415, 0.19999999999999996, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65426373297163642, 0.19999999999999996, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79536193036145808, 0.19999999999999996, 0.50000000000000000, + 0.87266462599716477 }, + { 0.92791875910061605, 0.19999999999999996, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0538145052725829, 0.19999999999999996, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1752060022875899, 0.19999999999999996, 0.50000000000000000, + 1.3962634015954636 }, + { 1.2943374404397376, 0.19999999999999996, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.50000000000000000. +template <typename Tp> +void test116() +{ + 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(data116) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data116[i].k), Tp(data116[i].nu), + Tp(data116[i].phi)); + const Tp f0 = data116[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)); +} + +// Test data for k=0.19999999999999996, nu=0.59999999999999998. +testcase_ellint_3<double> data117[] = { + { -0.0000000000000000, 0.19999999999999996, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17352228440746928, 0.19999999999999996, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34136562863713626, 0.19999999999999996, 0.59999999999999998, + 0.34906585039886590 }, + { 0.49950328177638481, 0.19999999999999996, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64625032705690832, 0.19999999999999996, 0.59999999999999998, + 0.69813170079773179 }, + { 0.78193941198403094, 0.19999999999999996, 0.59999999999999998, + 0.87266462599716477 }, + { 0.90817230934317128, 0.19999999999999996, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0271563751276462, 0.19999999999999996, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1412999379040518, 0.19999999999999996, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2530330675914561, 0.19999999999999996, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.59999999999999998. +template <typename Tp> +void test117() +{ + 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(data117) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data117[i].k), Tp(data117[i].nu), + Tp(data117[i].phi)); + const Tp f0 = data117[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)); +} + +// Test data for k=0.19999999999999996, nu=0.69999999999999996. +testcase_ellint_3<double> data118[] = { + { -0.0000000000000000, 0.19999999999999996, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17335014404233898, 0.19999999999999996, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34009775298617811, 0.19999999999999996, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49572560201923810, 0.19999999999999996, 0.69999999999999996, + 0.52359877559829882 }, + { 0.63856276669886525, 0.19999999999999996, 0.69999999999999996, + 0.69813170079773179 }, + { 0.76924438644867565, 0.19999999999999996, 0.69999999999999996, + 0.87266462599716477 }, + { 0.88973060843856466, 0.19999999999999996, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0025230471636377, 0.19999999999999996, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1102356376093103, 0.19999999999999996, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2154356555075867, 0.19999999999999996, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.69999999999999996. +template <typename Tp> +void test118() +{ + 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(data118) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data118[i].k), Tp(data118[i].nu), + Tp(data118[i].phi)); + const Tp f0 = data118[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)); +} + +// Test data for k=0.19999999999999996, nu=0.80000000000000004. +testcase_ellint_3<double> data119[] = { + { -0.0000000000000000, 0.19999999999999996, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17317861443718541, 0.19999999999999996, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33884641598718701, 0.19999999999999996, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49204565281259494, 0.19999999999999996, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63117851188220353, 0.19999999999999996, 0.80000000000000004, + 0.69813170079773179 }, + { 0.75721095949544170, 0.19999999999999996, 0.80000000000000004, + 0.87266462599716477 }, + { 0.87245201443919118, 0.19999999999999996, 0.80000000000000004, + 1.0471975511965976 }, + { 0.97966584238831089, 0.19999999999999996, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0816336325174360, 0.19999999999999996, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1810223448909913, 0.19999999999999996, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.80000000000000004. +template <typename Tp> +void test119() +{ + 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(data119) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data119[i].k), Tp(data119[i].nu), + Tp(data119[i].phi)); + const Tp f0 = data119[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)); +} + +// Test data for k=0.19999999999999996, nu=0.90000000000000002. +testcase_ellint_3<double> data120[] = { + { -0.0000000000000000, 0.19999999999999996, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17300769173837280, 0.19999999999999996, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33761123827372508, 0.19999999999999996, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48845905690769426, 0.19999999999999996, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62407720017324986, 0.19999999999999996, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74578146525124289, 0.19999999999999996, 0.90000000000000002, + 0.87266462599716477 }, + { 0.85621583540073076, 0.19999999999999996, 0.90000000000000002, + 1.0471975511965976 }, + { 0.95837725988001199, 0.19999999999999996, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0551821412633928, 0.19999999999999996, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1493679916141863, 0.19999999999999996, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.19999999999999996, nu=0.90000000000000002. +template <typename Tp> +void test120() +{ + 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(data120) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data120[i].k), Tp(data120[i].nu), + Tp(data120[i].phi)); + const Tp f0 = data120[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)); +} + +// Test data for k=0.30000000000000004, nu=0.0000000000000000. +testcase_ellint_3<double> data121[] = { + { -0.0000000000000000, 0.30000000000000004, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17461228653000102, 0.30000000000000004, 0.0000000000000000, + 0.17453292519943295 }, + { 0.34969146102798415, 0.30000000000000004, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52565822873726320, 0.30000000000000004, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70284226512408532, 0.30000000000000004, 0.0000000000000000, + 0.69813170079773179 }, + { 0.88144139195111182, 0.30000000000000004, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0614897067260523, 0.30000000000000004, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2428416824174218, 0.30000000000000004, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4251795877015925, 0.30000000000000004, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6080486199305126, 0.30000000000000004, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.0000000000000000. +template <typename Tp> +void test121() +{ + 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(data121) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data121[i].k), Tp(data121[i].nu), + Tp(data121[i].phi)); + const Tp f0 = data121[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)); +} + +// Test data for k=0.30000000000000004, nu=0.10000000000000001. +testcase_ellint_3<double> data122[] = { + { -0.0000000000000000, 0.30000000000000004, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17443631884814378, 0.30000000000000004, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34831316835124926, 0.30000000000000004, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52116586276523857, 0.30000000000000004, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69269385837910036, 0.30000000000000004, 0.10000000000000001, + 0.69813170079773179 }, + { 0.86279023163070856, 0.30000000000000004, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0315321461438265, 0.30000000000000004, 0.10000000000000001, + 1.0471975511965976 }, + { 1.1991449111869024, 0.30000000000000004, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3659561780923211, 0.30000000000000004, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5323534693557526, 0.30000000000000004, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.10000000000000001. +template <typename Tp> +void test122() +{ + 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(data122) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data122[i].k), Tp(data122[i].nu), + Tp(data122[i].phi)); + const Tp f0 = data122[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)); +} + +// Test data for k=0.30000000000000004, nu=0.20000000000000001. +testcase_ellint_3<double> data123[] = { + { -0.0000000000000000, 0.30000000000000004, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17426098615372090, 0.30000000000000004, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34695402664689923, 0.30000000000000004, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51680555567038933, 0.30000000000000004, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68303375225260210, 0.30000000000000004, 0.20000000000000001, + 0.69813170079773179 }, + { 0.84540662891295026, 0.30000000000000004, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0041834051646927, 0.30000000000000004, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1599952702345711, 0.30000000000000004, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3137179520499163, 0.30000000000000004, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4663658145259875, 0.30000000000000004, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.20000000000000001. +template <typename Tp> +void test123() +{ + 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(data123) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data123[i].k), Tp(data123[i].nu), + Tp(data123[i].phi)); + const Tp f0 = data123[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)); +} + +// Test data for k=0.30000000000000004, nu=0.29999999999999999. +testcase_ellint_3<double> data124[] = { + { -0.0000000000000000, 0.30000000000000004, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17408628437042845, 0.30000000000000004, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34561356761638401, 0.30000000000000004, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51257058617875850, 0.30000000000000004, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67382207124602866, 0.30000000000000004, 0.29999999999999999, + 0.69813170079773179 }, + { 0.82914751587825131, 0.30000000000000004, 0.29999999999999999, + 0.87266462599716477 }, + { 0.97907434814374950, 0.30000000000000004, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1246399297351584, 0.30000000000000004, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2671793970398146, 0.30000000000000004, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4081767433479089, 0.30000000000000004, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.29999999999999999. +template <typename Tp> +void test124() +{ + 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(data124) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data124[i].k), Tp(data124[i].nu), + Tp(data124[i].phi)); + const Tp f0 = data124[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)); +} + +// Test data for k=0.30000000000000004, nu=0.40000000000000002. +testcase_ellint_3<double> data125[] = { + { -0.0000000000000000, 0.30000000000000004, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17391220945982730, 0.30000000000000004, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34429133937639689, 0.30000000000000004, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50845471668581632, 0.30000000000000004, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66502347027873854, 0.30000000000000004, 0.40000000000000002, + 0.69813170079773179 }, + { 0.81389191978012254, 0.30000000000000004, 0.40000000000000002, + 0.87266462599716477 }, + { 0.95590618002140593, 0.30000000000000004, 0.40000000000000002, + 1.0471975511965976 }, + { 1.0924915195213121, 0.30000000000000004, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2253651604038058, 0.30000000000000004, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3563643538969761, 0.30000000000000004, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.40000000000000002. +template <typename Tp> +void test125() +{ + 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(data125) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data125[i].k), Tp(data125[i].nu), + Tp(data125[i].phi)); + const Tp f0 = data125[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)); +} + +// Test data for k=0.30000000000000004, nu=0.50000000000000000. +testcase_ellint_3<double> data126[] = { + { -0.0000000000000000, 0.30000000000000004, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17373875742088235, 0.30000000000000004, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34298690571124157, 0.30000000000000004, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50445214859646936, 0.30000000000000004, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65660648352418516, 0.30000000000000004, 0.50000000000000000, + 0.69813170079773179 }, + { 0.79953670639287289, 0.30000000000000004, 0.50000000000000000, + 0.87266462599716477 }, + { 0.93443393926588558, 0.30000000000000004, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0630838369016911, 0.30000000000000004, 0.50000000000000000, + 1.2217304763960306 }, + { 1.1875197325653026, 0.30000000000000004, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3098448759814960, 0.30000000000000004, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.50000000000000000. +template <typename Tp> +void test126() +{ + 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(data126) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data126[i].k), Tp(data126[i].nu), + Tp(data126[i].phi)); + const Tp f0 = data126[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)); +} + +// Test data for k=0.30000000000000004, nu=0.59999999999999998. +testcase_ellint_3<double> data127[] = { + { -0.0000000000000000, 0.30000000000000004, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17356592428950826, 0.30000000000000004, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34169984536697379, 0.30000000000000004, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50055748266498457, 0.30000000000000004, 0.59999999999999998, + 0.52359877559829882 }, + { 0.64854298527106768, 0.30000000000000004, 0.59999999999999998, + 0.69813170079773179 }, + { 0.78599329284207431, 0.30000000000000004, 0.59999999999999998, + 0.87266462599716477 }, + { 0.91445452089128221, 0.30000000000000004, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0360412952290587, 0.30000000000000004, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1530473919778639, 0.30000000000000004, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2677758800420666, 0.30000000000000004, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.59999999999999998. +template <typename Tp> +void test127() +{ + 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(data127) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data127[i].k), Tp(data127[i].nu), + Tp(data127[i].phi)); + const Tp f0 = data127[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)); +} + +// Test data for k=0.30000000000000004, nu=0.69999999999999996. +testcase_ellint_3<double> data128[] = { + { -0.0000000000000000, 0.30000000000000004, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17339370613812227, 0.30000000000000004, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34042975138455933, 0.30000000000000004, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49676568368075985, 0.30000000000000004, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64080774055753720, 0.30000000000000004, 0.69999999999999996, + 0.69813170079773179 }, + { 0.77318507779667278, 0.30000000000000004, 0.69999999999999996, + 0.87266462599716477 }, + { 0.89579782346548631, 0.30000000000000004, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0110573286052202, 0.30000000000000004, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1214710972949633, 0.30000000000000004, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2294913236274980, 0.30000000000000004, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.69999999999999996. +template <typename Tp> +void test128() +{ + 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(data128) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data128[i].k), Tp(data128[i].nu), + Tp(data128[i].phi)); + const Tp f0 = data128[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)); +} + +// Test data for k=0.30000000000000004, nu=0.80000000000000004. +testcase_ellint_3<double> data129[] = { + { -0.0000000000000000, 0.30000000000000004, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17322209907520361, 0.30000000000000004, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33917623046949996, 0.30000000000000004, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49307204894329176, 0.30000000000000004, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63337802830291723, 0.30000000000000004, 0.80000000000000004, + 0.69813170079773179 }, + { 0.76104540997689407, 0.30000000000000004, 0.80000000000000004, + 0.87266462599716477 }, + { 0.87832009635450736, 0.30000000000000004, 0.80000000000000004, + 1.0471975511965976 }, + { 0.98787879723171790, 0.30000000000000004, 0.80000000000000004, + 1.2217304763960306 }, + { 1.0924036340069336, 0.30000000000000004, 0.80000000000000004, + 1.3962634015954636 }, + { 1.1944567571590046, 0.30000000000000004, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.80000000000000004. +template <typename Tp> +void test129() +{ + 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(data129) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data129[i].k), Tp(data129[i].nu), + Tp(data129[i].phi)); + const Tp f0 = data129[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)); +} + +// Test data for k=0.30000000000000004, nu=0.90000000000000002. +testcase_ellint_3<double> data130[] = { + { -0.0000000000000000, 0.30000000000000004, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17305109924485948, 0.30000000000000004, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33793890239556984, 0.30000000000000004, 0.90000000000000002, + 0.34906585039886590 }, + { 0.48947218005089738, 0.30000000000000004, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62623332340775151, 0.30000000000000004, 0.90000000000000002, + 0.69813170079773179 }, + { 0.74951596581511148, 0.30000000000000004, 0.90000000000000002, + 0.87266462599716477 }, + { 0.86189886597756005, 0.30000000000000004, 0.90000000000000002, + 1.0471975511965976 }, + { 0.96629451153092005, 0.30000000000000004, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0655269133492680, 0.30000000000000004, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1622376896064912, 0.30000000000000004, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.30000000000000004, nu=0.90000000000000002. +template <typename Tp> +void test130() +{ + 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(data130) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data130[i].k), Tp(data130[i].nu), + Tp(data130[i].phi)); + const Tp f0 = data130[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)); +} + +// Test data for k=0.39999999999999991, nu=0.0000000000000000. +testcase_ellint_3<double> data131[] = { + { -0.0000000000000000, 0.39999999999999991, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17467414669441531, 0.39999999999999991, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35018222772483443, 0.39999999999999991, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52729015917508748, 0.39999999999999991, 0.0000000000000000, + 0.52359877559829882 }, + { 0.70662374407341255, 0.39999999999999991, 0.0000000000000000, + 0.69813170079773179 }, + { 0.88859210497602170, 0.39999999999999991, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0733136290471379, 0.39999999999999991, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2605612170157061, 0.39999999999999991, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4497513956433437, 0.39999999999999991, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6399998658645112, 0.39999999999999991, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.0000000000000000. +template <typename Tp> +void test131() +{ + 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(data131) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data131[i].k), Tp(data131[i].nu), + Tp(data131[i].phi)); + const Tp f0 = data131[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)); +} + +// Test data for k=0.39999999999999991, nu=0.10000000000000001. +testcase_ellint_3<double> data132[] = { + { -0.0000000000000000, 0.39999999999999991, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17449806706684673, 0.39999999999999991, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34880048623856075, 0.39999999999999991, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52277322065757403, 0.39999999999999991, 0.10000000000000001, + 0.52359877559829882 }, + { 0.69638072056918376, 0.39999999999999991, 0.10000000000000001, + 0.69813170079773179 }, + { 0.86968426619831540, 0.39999999999999991, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0428044206578095, 0.39999999999999991, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2158651158274378, 0.39999999999999991, 0.10000000000000001, + 1.2217304763960306 }, + { 1.3889447129893322, 0.39999999999999991, 0.10000000000000001, + 1.3962634015954636 }, + { 1.5620566886683604, 0.39999999999999991, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.10000000000000001. +template <typename Tp> +void test132() +{ + 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(data132) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data132[i].k), Tp(data132[i].nu), + Tp(data132[i].phi)); + const Tp f0 = data132[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)); +} + +// Test data for k=0.39999999999999991, nu=0.20000000000000001. +testcase_ellint_3<double> data133[] = { + { -0.0000000000000000, 0.39999999999999991, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17432262290723399, 0.39999999999999991, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34743795258968596, 0.39999999999999991, 0.20000000000000001, + 0.34906585039886590 }, + { 0.51838919472805123, 0.39999999999999991, 0.20000000000000001, + 0.52359877559829882 }, + { 0.68663134739057918, 0.39999999999999991, 0.20000000000000001, + 0.69813170079773179 }, + { 0.85206432981833979, 0.39999999999999991, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0149595349004430, 0.39999999999999991, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1758349405464676, 0.39999999999999991, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3353337673882635, 0.39999999999999991, 0.20000000000000001, + 1.3962634015954636 }, + { 1.4941414344266770, 0.39999999999999991, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.20000000000000001. +template <typename Tp> +void test133() +{ + 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(data133) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data133[i].k), Tp(data133[i].nu), + Tp(data133[i].phi)); + const Tp f0 = data133[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)); +} + +// Test data for k=0.39999999999999991, nu=0.29999999999999999. +testcase_ellint_3<double> data134[] = { + { -0.0000000000000000, 0.39999999999999991, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17414781013591543, 0.39999999999999991, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34609415696777285, 0.39999999999999991, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51413131295862546, 0.39999999999999991, 0.29999999999999999, + 0.52359877559829882 }, + { 0.67733527622935630, 0.39999999999999991, 0.29999999999999999, + 0.69813170079773179 }, + { 0.83558675182733266, 0.39999999999999991, 0.29999999999999999, + 0.87266462599716477 }, + { 0.98940140808865906, 0.39999999999999991, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1396968797728058, 0.39999999999999991, 0.29999999999999999, + 1.2217304763960306 }, + { 1.2875920037865087, 0.39999999999999991, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4342789859950078, 0.39999999999999991, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.29999999999999999. +template <typename Tp> +void test134() +{ + 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(data134) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data134[i].k), Tp(data134[i].nu), + Tp(data134[i].phi)); + const Tp f0 = data134[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)); +} + +// Test data for k=0.39999999999999991, nu=0.40000000000000002. +testcase_ellint_3<double> data135[] = { + { -0.0000000000000000, 0.39999999999999991, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17397362471112710, 0.39999999999999991, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34476864603333196, 0.39999999999999991, 0.40000000000000002, + 0.34906585039886590 }, + { 0.50999329415379357, 0.39999999999999991, 0.40000000000000002, + 0.52359877559829882 }, + { 0.66845674551396017, 0.39999999999999991, 0.40000000000000002, + 0.69813170079773179 }, + { 0.82012848346231748, 0.39999999999999991, 0.40000000000000002, + 0.87266462599716477 }, + { 0.96582449258349057, 0.39999999999999991, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1068473749476286, 0.39999999999999991, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2447132729159986, 0.39999999999999991, 0.40000000000000002, + 1.3962634015954636 }, + { 1.3809986210732901, 0.39999999999999991, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.40000000000000002. +template <typename Tp> +void test135() +{ + 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(data135) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data135[i].k), Tp(data135[i].nu), + Tp(data135[i].phi)); + const Tp f0 = data135[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)); +} + +// Test data for k=0.39999999999999991, nu=0.50000000000000000. +testcase_ellint_3<double> data136[] = { + { -0.0000000000000000, 0.39999999999999991, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17380006262854139, 0.39999999999999991, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34346098216756610, 0.39999999999999991, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50596929935059420, 0.39999999999999991, 0.50000000000000000, + 0.52359877559829882 }, + { 0.65996392089131262, 0.39999999999999991, 0.50000000000000000, + 0.69813170079773179 }, + { 0.80558463511364786, 0.39999999999999991, 0.50000000000000000, + 0.87266462599716477 }, + { 0.94397834522857704, 0.39999999999999991, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0768075114108115, 0.39999999999999991, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2059184624251329, 0.39999999999999991, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3331797176377398, 0.39999999999999991, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.50000000000000000. +template <typename Tp> +void test136() +{ + 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(data136) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data136[i].k), Tp(data136[i].nu), + Tp(data136[i].phi)); + const Tp f0 = data136[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)); +} + +// Test data for k=0.39999999999999991, nu=0.59999999999999998. +testcase_ellint_3<double> data137[] = { + { -0.0000000000000000, 0.39999999999999991, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17362711992081248, 0.39999999999999991, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34217074276403953, 0.39999999999999991, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50205389185761617, 0.39999999999999991, 0.59999999999999998, + 0.52359877559829882 }, + { 0.65182834920372745, 0.39999999999999991, 0.59999999999999998, + 0.69813170079773179 }, + { 0.79186512820565136, 0.39999999999999991, 0.59999999999999998, + 0.87266462599716477 }, + { 0.92365535916287134, 0.39999999999999991, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0491915663957907, 0.39999999999999991, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1705934291745104, 0.39999999999999991, 0.59999999999999998, + 1.3962634015954636 }, + { 1.2899514672527024, 0.39999999999999991, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.59999999999999998. +template <typename Tp> +void test137() +{ + 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(data137) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data137[i].k), Tp(data137[i].nu), + Tp(data137[i].phi)); + const Tp f0 = data137[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)); +} + +// Test data for k=0.39999999999999991, nu=0.69999999999999996. +testcase_ellint_3<double> data138[] = { + { -0.0000000000000000, 0.39999999999999991, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17345479265712871, 0.39999999999999991, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34089751955950354, 0.39999999999999991, 0.69999999999999996, + 0.34906585039886590 }, + { 0.49824200167361343, 0.39999999999999991, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64402450341199413, 0.39999999999999991, 0.69999999999999996, + 0.69813170079773179 }, + { 0.77889207804122873, 0.39999999999999991, 0.69999999999999996, + 0.87266462599716477 }, + { 0.90468169720957992, 0.39999999999999991, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0236847823692916, 0.39999999999999991, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1382465247425164, 0.39999999999999991, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2506255923253344, 0.39999999999999991, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.69999999999999996. +template <typename Tp> +void test138() +{ + 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(data138) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data138[i].k), Tp(data138[i].nu), + Tp(data138[i].phi)); + const Tp f0 = data138[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)); +} + +// Test data for k=0.39999999999999991, nu=0.80000000000000004. +testcase_ellint_3<double> data139[] = { + { -0.0000000000000000, 0.39999999999999991, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17328307694277156, 0.39999999999999991, 0.80000000000000004, + 0.17453292519943295 }, + { 0.33964091800132007, 0.39999999999999991, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49452889372467451, 0.39999999999999991, 0.80000000000000004, + 0.52359877559829882 }, + { 0.63652940095937327, 0.39999999999999991, 0.80000000000000004, + 0.69813170079773179 }, + { 0.76659772511159097, 0.39999999999999991, 0.80000000000000004, + 0.87266462599716477 }, + { 0.88691047977338111, 0.39999999999999991, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0000273200611640, 0.39999999999999991, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1084787902188007, 0.39999999999999991, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2146499565727209, 0.39999999999999991, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.80000000000000004. +template <typename Tp> +void test139() +{ + 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(data139) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data139[i].k), Tp(data139[i].nu), + Tp(data139[i].phi)); + const Tp f0 = data139[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)); +} + +// Test data for k=0.39999999999999991, nu=0.90000000000000002. +testcase_ellint_3<double> data140[] = { + { -0.0000000000000000, 0.39999999999999991, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17311196891868130, 0.39999999999999991, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33840055664911906, 0.39999999999999991, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49091013944075340, 0.39999999999999991, 0.90000000000000002, + 0.52359877559829882 }, + { 0.62932228186809591, 0.39999999999999991, 0.90000000000000002, + 0.69813170079773179 }, + { 0.75492278323019801, 0.39999999999999991, 0.90000000000000002, + 0.87266462599716477 }, + { 0.87021659043854294, 0.39999999999999991, 0.90000000000000002, + 1.0471975511965976 }, + { 0.97800245228239246, 0.39999999999999991, 0.90000000000000002, + 1.2217304763960306 }, + { 1.0809625773173694, 0.39999999999999991, 0.90000000000000002, + 1.3962634015954636 }, + { 1.1815758115929846, 0.39999999999999991, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.39999999999999991, nu=0.90000000000000002. +template <typename Tp> +void test140() +{ + 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(data140) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data140[i].k), Tp(data140[i].nu), + Tp(data140[i].phi)); + const Tp f0 = data140[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)); +} + +// Test data for k=0.50000000000000000, nu=0.0000000000000000. +testcase_ellint_3<double> data141[] = { + { -0.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17475385514035785, 0.50000000000000000, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35081868470101585, 0.50000000000000000, 0.0000000000000000, + 0.34906585039886590 }, + { 0.52942862705190585, 0.50000000000000000, 0.0000000000000000, + 0.52359877559829882 }, + { 0.71164727562630326, 0.50000000000000000, 0.0000000000000000, + 0.69813170079773179 }, + { 0.89824523594227768, 0.50000000000000000, 0.0000000000000000, + 0.87266462599716477 }, + { 1.0895506700518851, 0.50000000000000000, 0.0000000000000000, + 1.0471975511965976 }, + { 1.2853005857432933, 0.50000000000000000, 0.0000000000000000, + 1.2217304763960306 }, + { 1.4845545520549484, 0.50000000000000000, 0.0000000000000000, + 1.3962634015954636 }, + { 1.6857503548125963, 0.50000000000000000, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.0000000000000000. +template <typename Tp> +void test141() +{ + 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(data141) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data141[i].k), Tp(data141[i].nu), + Tp(data141[i].phi)); + const Tp f0 = data141[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)); +} + +// Test data for k=0.50000000000000000, nu=0.10000000000000001. +testcase_ellint_3<double> data142[] = { + { -0.0000000000000000, 0.50000000000000000, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17457763120814676, 0.50000000000000000, 0.10000000000000001, + 0.17453292519943295 }, + { 0.34943246340849154, 0.50000000000000000, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52487937869610801, 0.50000000000000000, 0.10000000000000001, + 0.52359877559829882 }, + { 0.70127785096388395, 0.50000000000000000, 0.10000000000000001, + 0.69813170079773179 }, + { 0.87898815988624479, 0.50000000000000000, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0582764576094172, 0.50000000000000000, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2391936844060207, 0.50000000000000000, 0.10000000000000001, + 1.2217304763960306 }, + { 1.4214793542995841, 0.50000000000000000, 0.10000000000000001, + 1.3962634015954636 }, + { 1.6045524936084892, 0.50000000000000000, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.10000000000000001. +template <typename Tp> +void test142() +{ + 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(data142) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data142[i].k), Tp(data142[i].nu), + Tp(data142[i].phi)); + const Tp f0 = data142[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)); +} + +// Test data for k=0.50000000000000000, nu=0.20000000000000001. +testcase_ellint_3<double> data143[] = { + { -0.0000000000000000, 0.50000000000000000, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17440204336345433, 0.50000000000000000, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34806552388338824, 0.50000000000000000, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52046416757129821, 0.50000000000000000, 0.20000000000000001, + 0.52359877559829882 }, + { 0.69140924550993876, 0.50000000000000000, 0.20000000000000001, + 0.69813170079773179 }, + { 0.86104678636125520, 0.50000000000000000, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0297439459053981, 0.50000000000000000, 0.20000000000000001, + 1.0471975511965976 }, + { 1.1979214112912036, 0.50000000000000000, 0.20000000000000001, + 1.2217304763960306 }, + { 1.3659033858648930, 0.50000000000000000, 0.20000000000000001, + 1.3962634015954636 }, + { 1.5338490483665983, 0.50000000000000000, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.20000000000000001. +template <typename Tp> +void test143() +{ + 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(data143) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data143[i].k), Tp(data143[i].nu), + Tp(data143[i].phi)); + const Tp f0 = data143[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)); +} + +// Test data for k=0.50000000000000000, nu=0.29999999999999999. +testcase_ellint_3<double> data144[] = { + { -0.0000000000000000, 0.50000000000000000, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17422708752228896, 0.50000000000000000, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34671739434855858, 0.50000000000000000, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51617616305641889, 0.50000000000000000, 0.29999999999999999, + 0.52359877559829882 }, + { 0.68200047612545178, 0.50000000000000000, 0.29999999999999999, + 0.69813170079773179 }, + { 0.84427217869498372, 0.50000000000000000, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0035637821389782, 0.50000000000000000, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1606800483933113, 0.50000000000000000, 0.29999999999999999, + 1.2217304763960306 }, + { 1.3164407134643459, 0.50000000000000000, 0.29999999999999999, + 1.3962634015954636 }, + { 1.4715681939859637, 0.50000000000000000, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.29999999999999999. +template <typename Tp> +void test144() +{ + 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(data144) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data144[i].k), Tp(data144[i].nu), + Tp(data144[i].phi)); + const Tp f0 = data144[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)); +} + +// Test data for k=0.50000000000000000, nu=0.40000000000000002. +testcase_ellint_3<double> data145[] = { + { -0.0000000000000000, 0.50000000000000000, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17405275963859917, 0.50000000000000000, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34538761957029329, 0.50000000000000000, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51200902646603919, 0.50000000000000000, 0.40000000000000002, + 0.52359877559829882 }, + { 0.67301522212868792, 0.50000000000000000, 0.40000000000000002, + 0.69813170079773179 }, + { 0.82853844466313320, 0.50000000000000000, 0.40000000000000002, + 0.87266462599716477 }, + { 0.97942097862681488, 0.50000000000000000, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1268429801220616, 0.50000000000000000, 0.40000000000000002, + 1.2217304763960306 }, + { 1.2720406704533922, 0.50000000000000000, 0.40000000000000002, + 1.3962634015954636 }, + { 1.4161679518465340, 0.50000000000000000, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.40000000000000002. +template <typename Tp> +void test145() +{ + 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(data145) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data145[i].k), Tp(data145[i].nu), + Tp(data145[i].phi)); + const Tp f0 = data145[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)); +} + +// Test data for k=0.50000000000000000, nu=0.50000000000000000. +testcase_ellint_3<double> data146[] = { + { -0.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17387905570381157, 0.50000000000000000, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34407576010465207, 0.50000000000000000, 0.50000000000000000, + 0.34906585039886590 }, + { 0.50795686560160835, 0.50000000000000000, 0.50000000000000000, + 0.52359877559829882 }, + { 0.66442115453330175, 0.50000000000000000, 0.50000000000000000, + 0.69813170079773179 }, + { 0.81373829119355345, 0.50000000000000000, 0.50000000000000000, + 0.87266462599716477 }, + { 0.95705743313235825, 0.50000000000000000, 0.50000000000000000, + 1.0471975511965976 }, + { 1.0959131991362556, 0.50000000000000000, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2318900529754597, 0.50000000000000000, 0.50000000000000000, + 1.3962634015954636 }, + { 1.3664739530045971, 0.50000000000000000, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.50000000000000000. +template <typename Tp> +void test146() +{ + 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(data146) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data146[i].k), Tp(data146[i].nu), + Tp(data146[i].phi)); + const Tp f0 = data146[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)); +} + +// Test data for k=0.50000000000000000, nu=0.59999999999999998. +testcase_ellint_3<double> data147[] = { + { -0.0000000000000000, 0.50000000000000000, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17370597174637581, 0.50000000000000000, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34278139158591414, 0.50000000000000000, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50401419439302719, 0.50000000000000000, 0.59999999999999998, + 0.52359877559829882 }, + { 0.65618938076167221, 0.50000000000000000, 0.59999999999999998, + 0.69813170079773179 }, + { 0.79977959248855424, 0.50000000000000000, 0.59999999999999998, + 0.87266462599716477 }, + { 0.93625925190753545, 0.50000000000000000, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0674905658379710, 0.50000000000000000, 0.59999999999999998, + 1.2217304763960306 }, + { 1.1953481298023048, 0.50000000000000000, 0.59999999999999998, + 1.3962634015954636 }, + { 1.3215740290190876, 0.50000000000000000, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.59999999999999998. +template <typename Tp> +void test147() +{ + 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(data147) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data147[i].k), Tp(data147[i].nu), + Tp(data147[i].phi)); + const Tp f0 = data147[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)); +} + +// Test data for k=0.50000000000000000, nu=0.69999999999999996. +testcase_ellint_3<double> data148[] = { + { -0.0000000000000000, 0.50000000000000000, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17353350383131641, 0.50000000000000000, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34150410405436771, 0.50000000000000000, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50017589696443487, 0.50000000000000000, 0.69999999999999996, + 0.52359877559829882 }, + { 0.64829398188419962, 0.50000000000000000, 0.69999999999999996, + 0.69813170079773179 }, + { 0.78658270782402073, 0.50000000000000000, 0.69999999999999996, + 0.87266462599716477 }, + { 0.91684738336675053, 0.50000000000000000, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0412486789555937, 0.50000000000000000, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1619021847612001, 0.50000000000000000, 0.69999999999999996, + 1.3962634015954636 }, + { 1.2807475181182502, 0.50000000000000000, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.69999999999999996. +template <typename Tp> +void test148() +{ + 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(data148) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data148[i].k), Tp(data148[i].nu), + Tp(data148[i].phi)); + const Tp f0 = data148[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)); +} + +// Test data for k=0.50000000000000000, nu=0.80000000000000004. +testcase_ellint_3<double> data149[] = { + { -0.0000000000000000, 0.50000000000000000, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17336164805979126, 0.50000000000000000, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34024350132086773, 0.50000000000000000, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49643719555734084, 0.50000000000000000, 0.80000000000000004, + 0.52359877559829882 }, + { 0.64071162456976150, 0.50000000000000000, 0.80000000000000004, + 0.69813170079773179 }, + { 0.77407836177211908, 0.50000000000000000, 0.80000000000000004, + 0.87266462599716477 }, + { 0.89867058251905652, 0.50000000000000000, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0169181822134912, 0.50000000000000000, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1311363312779448, 0.50000000000000000, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2434165408189539, 0.50000000000000000, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.80000000000000004. +template <typename Tp> +void test149() +{ + 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(data149) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data149[i].k), Tp(data149[i].nu), + Tp(data149[i].phi)); + const Tp f0 = data149[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)); +} + +// Test data for k=0.50000000000000000, nu=0.90000000000000002. +testcase_ellint_3<double> data150[] = { + { -0.0000000000000000, 0.50000000000000000, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17319040056865681, 0.50000000000000000, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33899920036578557, 0.50000000000000000, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49279362182695186, 0.50000000000000000, 0.90000000000000002, + 0.52359877559829882 }, + { 0.63342123379746151, 0.50000000000000000, 0.90000000000000002, + 0.69813170079773179 }, + { 0.76220595179550321, 0.50000000000000000, 0.90000000000000002, + 0.87266462599716477 }, + { 0.88160004743532294, 0.50000000000000000, 0.90000000000000002, + 1.0471975511965976 }, + { 0.99427448642310134, 0.50000000000000000, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1027091512470093, 0.50000000000000000, 0.90000000000000002, + 1.3962634015954636 }, + { 1.2091116095504744, 0.50000000000000000, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.50000000000000000, nu=0.90000000000000002. +template <typename Tp> +void test150() +{ + 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(data150) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data150[i].k), Tp(data150[i].nu), + Tp(data150[i].phi)); + const Tp f0 = data150[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)); +} + +// Test data for k=0.60000000000000009, nu=0.0000000000000000. +testcase_ellint_3<double> data151[] = { + { -0.0000000000000000, 0.60000000000000009, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17485154362988362, 0.60000000000000009, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35160509865544326, 0.60000000000000009, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53210652578446160, 0.60000000000000009, 0.0000000000000000, + 0.52359877559829882 }, + { 0.71805304664485670, 0.60000000000000009, 0.0000000000000000, + 0.69813170079773179 }, + { 0.91082759030195970, 0.60000000000000009, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1112333229323366, 0.60000000000000009, 0.0000000000000000, + 1.0471975511965976 }, + { 1.3191461190365270, 0.60000000000000009, 0.0000000000000000, + 1.2217304763960306 }, + { 1.5332022105084775, 0.60000000000000009, 0.0000000000000000, + 1.3962634015954636 }, + { 1.7507538029157526, 0.60000000000000009, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.0000000000000000. +template <typename Tp> +void test151() +{ + 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(data151) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data151[i].k), Tp(data151[i].nu), + Tp(data151[i].phi)); + const Tp f0 = data151[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)); +} + +// Test data for k=0.60000000000000009, nu=0.10000000000000001. +testcase_ellint_3<double> data152[] = { + { -0.0000000000000000, 0.60000000000000009, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17467514275022014, 0.60000000000000009, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35021333086258255, 0.60000000000000009, 0.10000000000000001, + 0.34906585039886590 }, + { 0.52751664092962713, 0.60000000000000009, 0.10000000000000001, + 0.52359877559829882 }, + { 0.70752126971957885, 0.60000000000000009, 0.10000000000000001, + 0.69813170079773179 }, + { 0.89111058756112871, 0.60000000000000009, 0.10000000000000001, + 0.87266462599716477 }, + { 1.0789241202877773, 0.60000000000000009, 0.10000000000000001, + 1.0471975511965976 }, + { 1.2710800210399946, 0.60000000000000009, 0.10000000000000001, + 1.2217304763960306 }, + { 1.4669060574440278, 0.60000000000000009, 0.10000000000000001, + 1.3962634015954636 }, + { 1.6648615773343014, 0.60000000000000009, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.10000000000000001. +template <typename Tp> +void test152() +{ + 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(data152) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data152[i].k), Tp(data152[i].nu), + Tp(data152[i].phi)); + const Tp f0 = data152[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)); +} + +// Test data for k=0.60000000000000009, nu=0.20000000000000001. +testcase_ellint_3<double> data153[] = { + { -0.0000000000000000, 0.60000000000000009, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17449937871800653, 0.60000000000000009, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34884093647346553, 0.60000000000000009, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52306221119844110, 0.60000000000000009, 0.20000000000000001, + 0.52359877559829882 }, + { 0.69749955678982223, 0.60000000000000009, 0.20000000000000001, + 0.69813170079773179 }, + { 0.87274610682416853, 0.60000000000000009, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0494620540750796, 0.60000000000000009, 0.20000000000000001, + 1.0471975511965976 }, + { 1.2280847305507339, 0.60000000000000009, 0.20000000000000001, + 1.2217304763960306 }, + { 1.4085436279696888, 0.60000000000000009, 0.20000000000000001, + 1.3962634015954636 }, + { 1.5901418016279374, 0.60000000000000009, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.20000000000000001. +template <typename Tp> +void test153() +{ + 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(data153) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data153[i].k), Tp(data153[i].nu), + Tp(data153[i].phi)); + const Tp f0 = data153[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)); +} + +// Test data for k=0.60000000000000009, nu=0.29999999999999999. +testcase_ellint_3<double> data154[] = { + { -0.0000000000000000, 0.60000000000000009, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17432424744393935, 0.60000000000000009, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34748744127146447, 0.60000000000000009, 0.29999999999999999, + 0.34906585039886590 }, + { 0.51873632743924847, 0.60000000000000009, 0.29999999999999999, + 0.52359877559829882 }, + { 0.68794610396313127, 0.60000000000000009, 0.29999999999999999, + 0.69813170079773179 }, + { 0.85558070175468726, 0.60000000000000009, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0224416343605658, 0.60000000000000009, 0.29999999999999999, + 1.0471975511965976 }, + { 1.1893144457936788, 0.60000000000000009, 0.29999999999999999, + 1.2217304763960306 }, + { 1.3566435377982575, 0.60000000000000009, 0.29999999999999999, + 1.3962634015954636 }, + { 1.5243814243493585, 0.60000000000000009, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.29999999999999999. +template <typename Tp> +void test154() +{ + 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(data154) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data154[i].k), Tp(data154[i].nu), + Tp(data154[i].phi)); + const Tp f0 = data154[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)); +} + +// Test data for k=0.60000000000000009, nu=0.40000000000000002. +testcase_ellint_3<double> data155[] = { + { -0.0000000000000000, 0.60000000000000009, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17414974487670720, 0.60000000000000009, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34615238767335027, 0.60000000000000009, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51453257838108579, 0.60000000000000009, 0.40000000000000002, + 0.52359877559829882 }, + { 0.67882386787534410, 0.60000000000000009, 0.40000000000000002, + 0.69813170079773179 }, + { 0.83948470233173578, 0.60000000000000009, 0.40000000000000002, + 0.87266462599716477 }, + { 0.99753496200074021, 0.60000000000000009, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1541101404388487, 0.60000000000000009, 0.40000000000000002, + 1.2217304763960306 }, + { 1.3100911323398816, 0.60000000000000009, 0.40000000000000002, + 1.3962634015954636 }, + { 1.4659345278069984, 0.60000000000000009, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.40000000000000002. +template <typename Tp> +void test155() +{ + 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(data155) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data155[i].k), Tp(data155[i].nu), + Tp(data155[i].phi)); + const Tp f0 = data155[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)); +} + +// Test data for k=0.60000000000000009, nu=0.50000000000000000. +testcase_ellint_3<double> data156[] = { + { -0.0000000000000000, 0.60000000000000009, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17397586700252810, 0.60000000000000009, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34483533397138516, 0.60000000000000009, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51044500461706499, 0.60000000000000009, 0.50000000000000000, + 0.52359877559829882 }, + { 0.67009988034712675, 0.60000000000000009, 0.50000000000000000, + 0.69813170079773179 }, + { 0.82434762375735193, 0.60000000000000009, 0.50000000000000000, + 0.87266462599716477 }, + { 0.97447346702799043, 0.60000000000000009, 0.50000000000000000, + 1.0471975511965976 }, + { 1.1219494000522143, 0.60000000000000009, 0.50000000000000000, + 1.2217304763960306 }, + { 1.2680242605954488, 0.60000000000000009, 0.50000000000000000, + 1.3962634015954636 }, + { 1.4135484285693078, 0.60000000000000009, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.50000000000000000. +template <typename Tp> +void test156() +{ + 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(data156) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data156[i].k), Tp(data156[i].nu), + Tp(data156[i].phi)); + const Tp f0 = data156[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)); +} + +// Test data for k=0.60000000000000009, nu=0.59999999999999998. +testcase_ellint_3<double> data157[] = { + { -0.0000000000000000, 0.60000000000000009, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17380260984469356, 0.60000000000000009, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34353585361777839, 0.60000000000000009, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50646805774321402, 0.60000000000000009, 0.59999999999999998, + 0.52359877559829882 }, + { 0.66174468108625517, 0.60000000000000009, 0.59999999999999998, + 0.69813170079773179 }, + { 0.81007462280278408, 0.60000000000000009, 0.59999999999999998, + 0.87266462599716477 }, + { 0.95303466945718773, 0.60000000000000009, 0.59999999999999998, + 1.0471975511965976 }, + { 1.0924118588677503, 0.60000000000000009, 0.59999999999999998, + 1.2217304763960306 }, + { 1.2297640574847937, 0.60000000000000009, 0.59999999999999998, + 1.3962634015954636 }, + { 1.3662507535812816, 0.60000000000000009, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.59999999999999998. +template <typename Tp> +void test157() +{ + 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(data157) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data157[i].k), Tp(data157[i].nu), + Tp(data157[i].phi)); + const Tp f0 = data157[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)); +} + +// Test data for k=0.60000000000000009, nu=0.69999999999999996. +testcase_ellint_3<double> data158[] = { + { -0.0000000000000000, 0.60000000000000009, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17362996946312009, 0.60000000000000009, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34225353454870588, 0.60000000000000009, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50259656397799546, 0.60000000000000009, 0.69999999999999996, + 0.52359877559829882 }, + { 0.65373184496628944, 0.60000000000000009, 0.69999999999999996, + 0.69813170079773179 }, + { 0.79658372884056439, 0.60000000000000009, 0.69999999999999996, + 0.87266462599716477 }, + { 0.93303240100245466, 0.60000000000000009, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0651547944716557, 0.60000000000000009, 0.69999999999999996, + 1.2217304763960306 }, + { 1.1947676204853441, 0.60000000000000009, 0.69999999999999996, + 1.3962634015954636 }, + { 1.3232737468822811, 0.60000000000000009, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.69999999999999996. +template <typename Tp> +void test158() +{ + 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(data158) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data158[i].k), Tp(data158[i].nu), + Tp(data158[i].phi)); + const Tp f0 = data158[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)); +} + +// Test data for k=0.60000000000000009, nu=0.80000000000000004. +testcase_ellint_3<double> data159[] = { + { -0.0000000000000000, 0.60000000000000009, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17345794195390687, 0.60000000000000009, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34098797854531027, 0.60000000000000009, 0.80000000000000004, + 0.34906585039886590 }, + { 0.49882569168826230, 0.60000000000000009, 0.80000000000000004, + 0.52359877559829882 }, + { 0.64603758566475511, 0.60000000000000009, 0.80000000000000004, + 0.69813170079773179 }, + { 0.78380365594769730, 0.60000000000000009, 0.80000000000000004, + 0.87266462599716477 }, + { 0.91430946255611223, 0.60000000000000009, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0398955217270607, 0.60000000000000009, 0.80000000000000004, + 1.2217304763960306 }, + { 1.1625948314277679, 0.60000000000000009, 0.80000000000000004, + 1.3962634015954636 }, + { 1.2840021261752192, 0.60000000000000009, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.80000000000000004. +template <typename Tp> +void test159() +{ + 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(data159) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data159[i].k), Tp(data159[i].nu), + Tp(data159[i].phi)); + const Tp f0 = data159[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)); +} + +// Test data for k=0.60000000000000009, nu=0.90000000000000002. +testcase_ellint_3<double> data160[] = { + { -0.0000000000000000, 0.60000000000000009, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17328652344890033, 0.60000000000000009, 0.90000000000000002, + 0.17453292519943295 }, + { 0.33973880062929018, 0.60000000000000009, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49515092233122765, 0.60000000000000009, 0.90000000000000002, + 0.52359877559829882 }, + { 0.63864042139737043, 0.60000000000000009, 0.90000000000000002, + 0.69813170079773179 }, + { 0.77167205646538850, 0.60000000000000009, 0.90000000000000002, + 0.87266462599716477 }, + { 0.89673202848034428, 0.60000000000000009, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0163984492661304, 0.60000000000000009, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1328845785162431, 0.60000000000000009, 0.90000000000000002, + 1.3962634015954636 }, + { 1.2479362973851875, 0.60000000000000009, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.60000000000000009, nu=0.90000000000000002. +template <typename Tp> +void test160() +{ + 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(data160) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data160[i].k), Tp(data160[i].nu), + Tp(data160[i].phi)); + const Tp f0 = data160[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)); +} + +// Test data for k=0.69999999999999996, nu=0.0000000000000000. +testcase_ellint_3<double> data161[] = { + { -0.0000000000000000, 0.69999999999999996, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17496737466916720, 0.69999999999999996, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35254687535677925, 0.69999999999999996, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53536740275997130, 0.69999999999999996, 0.0000000000000000, + 0.52359877559829882 }, + { 0.72603797651684465, 0.69999999999999996, 0.0000000000000000, + 0.69813170079773179 }, + { 0.92698296348313458, 0.69999999999999996, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1400447527693316, 0.69999999999999996, 0.0000000000000000, + 1.0471975511965976 }, + { 1.3657668117194071, 0.69999999999999996, 0.0000000000000000, + 1.2217304763960306 }, + { 1.6024686895959159, 0.69999999999999996, 0.0000000000000000, + 1.3962634015954636 }, + { 1.8456939983747236, 0.69999999999999996, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.0000000000000000. +template <typename Tp> +void test161() +{ + 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(data161) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data161[i].k), Tp(data161[i].nu), + Tp(data161[i].phi)); + const Tp f0 = data161[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)); +} + +// Test data for k=0.69999999999999996, nu=0.10000000000000001. +testcase_ellint_3<double> data162[] = { + { -0.0000000000000000, 0.69999999999999996, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17479076384884681, 0.69999999999999996, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35114844900396364, 0.69999999999999996, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53072776947527012, 0.69999999999999996, 0.10000000000000001, + 0.52359877559829882 }, + { 0.71530198262386246, 0.69999999999999996, 0.10000000000000001, + 0.69813170079773179 }, + { 0.90666760677828306, 0.69999999999999996, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1063366517438080, 0.69999999999999996, 0.10000000000000001, + 1.0471975511965976 }, + { 1.3149477243092147, 0.69999999999999996, 0.10000000000000001, + 1.2217304763960306 }, + { 1.5314886725038925, 0.69999999999999996, 0.10000000000000001, + 1.3962634015954636 }, + { 1.7528050171757608, 0.69999999999999996, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.10000000000000001. +template <typename Tp> +void test162() +{ + 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(data162) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data162[i].k), Tp(data162[i].nu), + Tp(data162[i].phi)); + const Tp f0 = data162[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)); +} + +// Test data for k=0.69999999999999996, nu=0.20000000000000001. +testcase_ellint_3<double> data163[] = { + { -0.0000000000000000, 0.69999999999999996, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17461479077791472, 0.69999999999999996, 0.20000000000000001, + 0.17453292519943295 }, + { 0.34976950621407538, 0.69999999999999996, 0.20000000000000001, + 0.34906585039886590 }, + { 0.52622533231350188, 0.69999999999999996, 0.20000000000000001, + 0.52359877559829882 }, + { 0.70508774017895226, 0.69999999999999996, 0.20000000000000001, + 0.69813170079773179 }, + { 0.88775302531730294, 0.69999999999999996, 0.20000000000000001, + 0.87266462599716477 }, + { 1.0756195476149006, 0.69999999999999996, 0.20000000000000001, + 1.0471975511965976 }, + { 1.2695349716654372, 0.69999999999999996, 0.20000000000000001, + 1.2217304763960306 }, + { 1.4690814617070540, 0.69999999999999996, 0.20000000000000001, + 1.3962634015954636 }, + { 1.6721098780092147, 0.69999999999999996, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.20000000000000001. +template <typename Tp> +void test163() +{ + 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(data163) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data163[i].k), Tp(data163[i].nu), + Tp(data163[i].phi)); + const Tp f0 = data163[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)); +} + +// Test data for k=0.69999999999999996, nu=0.29999999999999999. +testcase_ellint_3<double> data164[] = { + { -0.0000000000000000, 0.69999999999999996, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17443945136076172, 0.69999999999999996, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34840956983535287, 0.69999999999999996, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52185308551329179, 0.69999999999999996, 0.29999999999999999, + 0.52359877559829882 }, + { 0.69535240431168266, 0.69999999999999996, 0.29999999999999999, + 0.69813170079773179 }, + { 0.87007983473964923, 0.69999999999999996, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0474657975577066, 0.69999999999999996, 0.29999999999999999, + 1.0471975511965976 }, + { 1.2286225419931889, 0.69999999999999996, 0.29999999999999999, + 1.2217304763960306 }, + { 1.4136490671013271, 0.69999999999999996, 0.29999999999999999, + 1.3962634015954636 }, + { 1.6011813647733213, 0.69999999999999996, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.29999999999999999. +template <typename Tp> +void test164() +{ + 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(data164) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data164[i].k), Tp(data164[i].nu), + Tp(data164[i].phi)); + const Tp f0 = data164[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)); +} + +// Test data for k=0.69999999999999996, nu=0.40000000000000002. +testcase_ellint_3<double> data165[] = { + { -0.0000000000000000, 0.69999999999999996, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17426474153983226, 0.69999999999999996, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34706817945773732, 0.69999999999999996, 0.40000000000000002, + 0.34906585039886590 }, + { 0.51760452851738159, 0.69999999999999996, 0.40000000000000002, + 0.52359877559829882 }, + { 0.68605801534722766, 0.69999999999999996, 0.40000000000000002, + 0.69813170079773179 }, + { 0.85351339387296532, 0.69999999999999996, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0215297967969537, 0.69999999999999996, 0.40000000000000002, + 1.0471975511965976 }, + { 1.1915051074460528, 0.69999999999999996, 0.40000000000000002, + 1.2217304763960306 }, + { 1.3639821911744707, 0.69999999999999996, 0.40000000000000002, + 1.3962634015954636 }, + { 1.5382162002954762, 0.69999999999999996, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.40000000000000002. +template <typename Tp> +void test165() +{ + 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(data165) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data165[i].k), Tp(data165[i].nu), + Tp(data165[i].phi)); + const Tp f0 = data165[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)); +} + +// Test data for k=0.69999999999999996, nu=0.50000000000000000. +testcase_ellint_3<double> data166[] = { + { -0.0000000000000000, 0.69999999999999996, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17409065729516093, 0.69999999999999996, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34574489064986091, 0.69999999999999996, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51347361925579793, 0.69999999999999996, 0.50000000000000000, + 0.52359877559829882 }, + { 0.67717079489579290, 0.69999999999999996, 0.50000000000000000, + 0.69813170079773179 }, + { 0.83793902055292280, 0.69999999999999996, 0.50000000000000000, + 0.87266462599716477 }, + { 0.99752863545289705, 0.69999999999999996, 0.50000000000000000, + 1.0471975511965976 }, + { 1.1576240080401499, 0.69999999999999996, 0.50000000000000000, + 1.2217304763960306 }, + { 1.3191464023923762, 0.69999999999999996, 0.50000000000000000, + 1.3962634015954636 }, + { 1.4818433192178544, 0.69999999999999996, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.50000000000000000. +template <typename Tp> +void test166() +{ + 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(data166) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data166[i].k), Tp(data166[i].nu), + Tp(data166[i].phi)); + const Tp f0 = data166[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)); +} + +// Test data for k=0.69999999999999996, nu=0.59999999999999998. +testcase_ellint_3<double> data167[] = { + { -0.0000000000000000, 0.69999999999999996, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17391719464391611, 0.69999999999999996, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34443927423869031, 0.69999999999999996, 0.59999999999999998, + 0.34906585039886590 }, + { 0.50945473266486074, 0.69999999999999996, 0.59999999999999998, + 0.52359877559829882 }, + { 0.66866056326513823, 0.69999999999999996, 0.59999999999999998, + 0.69813170079773179 }, + { 0.82325830002337352, 0.69999999999999996, 0.59999999999999998, + 0.87266462599716477 }, + { 0.97522808245669357, 0.69999999999999996, 0.59999999999999998, + 1.0471975511965976 }, + { 1.1265300613705282, 0.69999999999999996, 0.59999999999999998, + 1.2217304763960306 }, + { 1.2784066076152003, 0.69999999999999996, 0.59999999999999998, + 1.3962634015954636 }, + { 1.4309994736080540, 0.69999999999999996, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.59999999999999998. +template <typename Tp> +void test167() +{ + 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(data167) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data167[i].k), Tp(data167[i].nu), + Tp(data167[i].phi)); + const Tp f0 = data167[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)); +} + +// Test data for k=0.69999999999999996, nu=0.69999999999999996. +testcase_ellint_3<double> data168[] = { + { -0.0000000000000000, 0.69999999999999996, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17374434963995028, 0.69999999999999996, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34315091562900674, 0.69999999999999996, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50554262375653358, 0.69999999999999996, 0.69999999999999996, + 0.52359877559829882 }, + { 0.66050025406305812, 0.69999999999999996, 0.69999999999999996, + 0.69813170079773179 }, + { 0.80938620118847404, 0.69999999999999996, 0.69999999999999996, + 0.87266462599716477 }, + { 0.95443223855852144, 0.69999999999999996, 0.69999999999999996, + 1.0471975511965976 }, + { 1.0978573207128302, 0.69999999999999996, 0.69999999999999996, + 1.2217304763960306 }, + { 1.2411754575007123, 0.69999999999999996, 0.69999999999999996, + 1.3962634015954636 }, + { 1.3848459188329196, 0.69999999999999996, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.69999999999999996. +template <typename Tp> +void test168() +{ + 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(data168) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data168[i].k), Tp(data168[i].nu), + Tp(data168[i].phi)); + const Tp f0 = data168[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)); +} + +// Test data for k=0.69999999999999996, nu=0.80000000000000004. +testcase_ellint_3<double> data169[] = { + { -0.0000000000000000, 0.69999999999999996, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17357211837335737, 0.69999999999999996, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34187941416012108, 0.69999999999999996, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50173239465478270, 0.69999999999999996, 0.80000000000000004, + 0.52359877559829882 }, + { 0.65266550725988315, 0.69999999999999996, 0.80000000000000004, + 0.69813170079773179 }, + { 0.79624879865249298, 0.69999999999999996, 0.80000000000000004, + 0.87266462599716477 }, + { 0.93497577043296920, 0.69999999999999996, 0.80000000000000004, + 1.0471975511965976 }, + { 1.0713041566930748, 0.69999999999999996, 0.80000000000000004, + 1.2217304763960306 }, + { 1.2069772023255652, 0.69999999999999996, 0.80000000000000004, + 1.3962634015954636 }, + { 1.3427110650397533, 0.69999999999999996, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.80000000000000004. +template <typename Tp> +void test169() +{ + 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(data169) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data169[i].k), Tp(data169[i].nu), + Tp(data169[i].phi)); + const Tp f0 = data169[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)); +} + +// Test data for k=0.69999999999999996, nu=0.90000000000000002. +testcase_ellint_3<double> data170[] = { + { -0.0000000000000000, 0.69999999999999996, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17340049697003634, 0.69999999999999996, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34062438249741556, 0.69999999999999996, 0.90000000000000002, + 0.34906585039886590 }, + { 0.49801946510076878, 0.69999999999999996, 0.90000000000000002, + 0.52359877559829882 }, + { 0.64513432604750487, 0.69999999999999996, 0.90000000000000002, + 0.69813170079773179 }, + { 0.78378145487573758, 0.69999999999999996, 0.90000000000000002, + 0.87266462599716477 }, + { 0.91671799500854634, 0.69999999999999996, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0466193579463123, 0.69999999999999996, 0.90000000000000002, + 1.2217304763960306 }, + { 1.1754218079199146, 0.69999999999999996, 0.90000000000000002, + 1.3962634015954636 }, + { 1.3040500499695911, 0.69999999999999996, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.69999999999999996, nu=0.90000000000000002. +template <typename Tp> +void test170() +{ + 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(data170) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data170[i].k), Tp(data170[i].nu), + Tp(data170[i].phi)); + const Tp f0 = data170[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)); +} + +// Test data for k=0.80000000000000004, nu=0.0000000000000000. +testcase_ellint_3<double> data171[] = { + { -0.0000000000000000, 0.80000000000000004, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17510154241338902, 0.80000000000000004, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35365068839779390, 0.80000000000000004, 0.0000000000000000, + 0.34906585039886590 }, + { 0.53926804409084561, 0.80000000000000004, 0.0000000000000000, + 0.52359877559829882 }, + { 0.73587926028070383, 0.80000000000000004, 0.0000000000000000, + 0.69813170079773179 }, + { 0.94770942970071170, 0.80000000000000004, 0.0000000000000000, + 0.87266462599716477 }, + { 1.1789022995388239, 0.80000000000000004, 0.0000000000000000, + 1.0471975511965976 }, + { 1.4323027881876009, 0.80000000000000004, 0.0000000000000000, + 1.2217304763960306 }, + { 1.7069629739121674, 0.80000000000000004, 0.0000000000000000, + 1.3962634015954636 }, + { 1.9953027776647296, 0.80000000000000004, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.0000000000000000. +template <typename Tp> +void test171() +{ + 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(data171) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data171[i].k), Tp(data171[i].nu), + Tp(data171[i].phi)); + const Tp f0 = data171[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)); +} + +// Test data for k=0.80000000000000004, nu=0.10000000000000001. +testcase_ellint_3<double> data172[] = { + { -0.0000000000000000, 0.80000000000000004, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17492468824017166, 0.80000000000000004, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35224443521476911, 0.80000000000000004, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53456851853226961, 0.80000000000000004, 0.10000000000000001, + 0.52359877559829882 }, + { 0.72488875602364944, 0.80000000000000004, 0.10000000000000001, + 0.69813170079773179 }, + { 0.92661354274638952, 0.80000000000000004, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1432651144499077, 0.80000000000000004, 0.10000000000000001, + 1.0471975511965976 }, + { 1.3774479927211429, 0.80000000000000004, 0.10000000000000001, + 1.2217304763960306 }, + { 1.6287092337196041, 0.80000000000000004, 0.10000000000000001, + 1.3962634015954636 }, + { 1.8910755418379521, 0.80000000000000004, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.10000000000000001. +template <typename Tp> +void test172() +{ + 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(data172) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data172[i].k), Tp(data172[i].nu), + Tp(data172[i].phi)); + const Tp f0 = data172[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)); +} + +// Test data for k=0.80000000000000004, nu=0.20000000000000001. +testcase_ellint_3<double> data173[] = { + { -0.0000000000000000, 0.80000000000000004, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17474847286224943, 0.80000000000000004, 0.20000000000000001, + 0.17453292519943295 }, + { 0.35085779529084682, 0.80000000000000004, 0.20000000000000001, + 0.34906585039886590 }, + { 0.53000829263059157, 0.80000000000000004, 0.20000000000000001, + 0.52359877559829882 }, + { 0.71443466027453406, 0.80000000000000004, 0.20000000000000001, + 0.69813170079773179 }, + { 0.90698196872715420, 0.80000000000000004, 0.20000000000000001, + 0.87266462599716477 }, + { 1.1108198200558581, 0.80000000000000004, 0.20000000000000001, + 1.0471975511965976 }, + { 1.3284988909963957, 0.80000000000000004, 0.20000000000000001, + 1.2217304763960306 }, + { 1.5600369318140328, 0.80000000000000004, 0.20000000000000001, + 1.3962634015954636 }, + { 1.8007226661734588, 0.80000000000000004, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.20000000000000001. +template <typename Tp> +void test173() +{ + 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(data173) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data173[i].k), Tp(data173[i].nu), + Tp(data173[i].phi)); + const Tp f0 = data173[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)); +} + +// Test data for k=0.80000000000000004, nu=0.29999999999999999. +testcase_ellint_3<double> data174[] = { + { -0.0000000000000000, 0.80000000000000004, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17457289217669891, 0.80000000000000004, 0.29999999999999999, + 0.17453292519943295 }, + { 0.34949028801501258, 0.80000000000000004, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52558024362769318, 0.80000000000000004, 0.29999999999999999, + 0.52359877559829882 }, + { 0.70447281740094914, 0.80000000000000004, 0.29999999999999999, + 0.69813170079773179 }, + { 0.88864745641528986, 0.80000000000000004, 0.29999999999999999, + 0.87266462599716477 }, + { 1.0811075819341465, 0.80000000000000004, 0.29999999999999999, + 1.0471975511965976 }, + { 1.2844589654082377, 0.80000000000000004, 0.29999999999999999, + 1.2217304763960306 }, + { 1.4991461361277849, 0.80000000000000004, 0.29999999999999999, + 1.3962634015954636 }, + { 1.7214611048717301, 0.80000000000000004, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.29999999999999999. +template <typename Tp> +void test174() +{ + 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(data174) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data174[i].k), Tp(data174[i].nu), + Tp(data174[i].phi)); + const Tp f0 = data174[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)); +} + +// Test data for k=0.80000000000000004, nu=0.40000000000000002. +testcase_ellint_3<double> data175[] = { + { -0.0000000000000000, 0.80000000000000004, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17439794211872178, 0.80000000000000004, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34814144964568972, 0.80000000000000004, 0.40000000000000002, + 0.34906585039886590 }, + { 0.52127776285273075, 0.80000000000000004, 0.40000000000000002, + 0.52359877559829882 }, + { 0.69496411438966599, 0.80000000000000004, 0.40000000000000002, + 0.69813170079773179 }, + { 0.87146878427509589, 0.80000000000000004, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0537579024937762, 0.80000000000000004, 0.40000000000000002, + 1.0471975511965976 }, + { 1.2445534387922637, 0.80000000000000004, 0.40000000000000002, + 1.2217304763960306 }, + { 1.4446769766361993, 0.80000000000000004, 0.40000000000000002, + 1.3962634015954636 }, + { 1.6512267838651289, 0.80000000000000004, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.40000000000000002. +template <typename Tp> +void test175() +{ + 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(data175) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data175[i].k), Tp(data175[i].nu), + Tp(data175[i].phi)); + const Tp f0 = data175[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)); +} + +// Test data for k=0.80000000000000004, nu=0.50000000000000000. +testcase_ellint_3<double> data176[] = { + { -0.0000000000000000, 0.80000000000000004, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17422361866118047, 0.80000000000000004, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34681083254170475, 0.80000000000000004, 0.50000000000000000, + 0.34906585039886590 }, + { 0.51709470815494440, 0.80000000000000004, 0.50000000000000000, + 0.52359877559829882 }, + { 0.68587375344080259, 0.80000000000000004, 0.50000000000000000, + 0.69813170079773179 }, + { 0.85532571852810624, 0.80000000000000004, 0.50000000000000000, + 0.87266462599716477 }, + { 1.0284677391874906, 0.80000000000000004, 0.50000000000000000, + 1.0471975511965976 }, + { 1.2081693942686225, 0.80000000000000004, 0.50000000000000000, + 1.2217304763960306 }, + { 1.3955803006426311, 0.80000000000000004, 0.50000000000000000, + 1.3962634015954636 }, + { 1.5884528947755532, 0.80000000000000004, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.50000000000000000. +template <typename Tp> +void test176() +{ + 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(data176) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data176[i].k), Tp(data176[i].nu), + Tp(data176[i].phi)); + const Tp f0 = data176[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)); +} + +// Test data for k=0.80000000000000004, nu=0.59999999999999998. +testcase_ellint_3<double> data177[] = { + { -0.0000000000000000, 0.80000000000000004, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17404991781414092, 0.80000000000000004, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34549800443625167, 0.80000000000000004, 0.59999999999999998, + 0.34906585039886590 }, + { 0.51302536167001556, 0.80000000000000004, 0.59999999999999998, + 0.52359877559829882 }, + { 0.67717065003912258, 0.80000000000000004, 0.59999999999999998, + 0.69813170079773179 }, + { 0.84011512421134416, 0.80000000000000004, 0.59999999999999998, + 0.87266462599716477 }, + { 1.0049863847088742, 0.80000000000000004, 0.59999999999999998, + 1.0471975511965976 }, + { 1.1748145941898918, 0.80000000000000004, 0.59999999999999998, + 1.2217304763960306 }, + { 1.3510319699755071, 0.80000000000000004, 0.59999999999999998, + 1.3962634015954636 }, + { 1.5319262547427865, 0.80000000000000004, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.59999999999999998. +template <typename Tp> +void test177() +{ + 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(data177) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data177[i].k), Tp(data177[i].nu), + Tp(data177[i].phi)); + const Tp f0 = data177[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)); +} + +// Test data for k=0.80000000000000004, nu=0.69999999999999996. +testcase_ellint_3<double> data178[] = { + { -0.0000000000000000, 0.80000000000000004, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17387683562442202, 0.80000000000000004, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34420254775101611, 0.80000000000000004, 0.69999999999999996, + 0.34906585039886590 }, + { 0.50906439222143685, 0.80000000000000004, 0.69999999999999996, + 0.52359877559829882 }, + { 0.66882693152688433, 0.80000000000000004, 0.69999999999999996, + 0.69813170079773179 }, + { 0.82574792844091316, 0.80000000000000004, 0.69999999999999996, + 0.87266462599716477 }, + { 0.98310431309490953, 0.80000000000000004, 0.69999999999999996, + 1.0471975511965976 }, + { 1.1440884535113258, 0.80000000000000004, 0.69999999999999996, + 1.2217304763960306 }, + { 1.3103743938952537, 0.80000000000000004, 0.69999999999999996, + 1.3962634015954636 }, + { 1.4806912324625332, 0.80000000000000004, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.69999999999999996. +template <typename Tp> +void test178() +{ + 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(data178) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data178[i].k), Tp(data178[i].nu), + Tp(data178[i].phi)); + const Tp f0 = data178[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)); +} + +// Test data for k=0.80000000000000004, nu=0.80000000000000004. +testcase_ellint_3<double> data179[] = { + { -0.0000000000000000, 0.80000000000000004, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17370436817515206, 0.80000000000000004, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34292405894783395, 0.80000000000000004, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50520682176250087, 0.80000000000000004, 0.80000000000000004, + 0.52359877559829882 }, + { 0.66081751679736189, 0.80000000000000004, 0.80000000000000004, + 0.69813170079773179 }, + { 0.81214672249355102, 0.80000000000000004, 0.80000000000000004, + 0.87266462599716477 }, + { 0.96264481387685574, 0.80000000000000004, 0.80000000000000004, + 1.0471975511965976 }, + { 1.1156611352656258, 0.80000000000000004, 0.80000000000000004, + 1.2217304763960306 }, + { 1.2730756225143889, 0.80000000000000004, 0.80000000000000004, + 1.3962634015954636 }, + { 1.4339837018309474, 0.80000000000000004, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.80000000000000004. +template <typename Tp> +void test179() +{ + 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(data179) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data179[i].k), Tp(data179[i].nu), + Tp(data179[i].phi)); + const Tp f0 = data179[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)); +} + +// Test data for k=0.80000000000000004, nu=0.90000000000000002. +testcase_ellint_3<double> data180[] = { + { -0.0000000000000000, 0.80000000000000004, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17353251158533153, 0.80000000000000004, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34166214791545768, 0.80000000000000004, 0.90000000000000002, + 0.34906585039886590 }, + { 0.50144799535130580, 0.80000000000000004, 0.90000000000000002, + 0.52359877559829882 }, + { 0.65311976193814447, 0.80000000000000004, 0.90000000000000002, + 0.69813170079773179 }, + { 0.79924384892320866, 0.80000000000000004, 0.90000000000000002, + 0.87266462599716477 }, + { 0.94345762353365625, 0.80000000000000004, 0.90000000000000002, + 1.0471975511965976 }, + { 1.0892582069219159, 0.80000000000000004, 0.90000000000000002, + 1.2217304763960306 }, + { 1.2387000876610268, 0.80000000000000004, 0.90000000000000002, + 1.3962634015954636 }, + { 1.3911845406776222, 0.80000000000000004, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.80000000000000004, nu=0.90000000000000002. +template <typename Tp> +void test180() +{ + 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(data180) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data180[i].k), Tp(data180[i].nu), + Tp(data180[i].phi)); + const Tp f0 = data180[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)); +} + +// Test data for k=0.89999999999999991, nu=0.0000000000000000. +testcase_ellint_3<double> data181[] = { + { -0.0000000000000000, 0.89999999999999991, 0.0000000000000000, + 0.0000000000000000 }, + { 0.17525427376115027, 0.89999999999999991, 0.0000000000000000, + 0.17453292519943295 }, + { 0.35492464591297446, 0.89999999999999991, 0.0000000000000000, + 0.34906585039886590 }, + { 0.54388221416157123, 0.89999999999999991, 0.0000000000000000, + 0.52359877559829882 }, + { 0.74797400423532501, 0.89999999999999991, 0.0000000000000000, + 0.69813170079773179 }, + { 0.97463898451966458, 0.89999999999999991, 0.0000000000000000, + 0.87266462599716477 }, + { 1.2334463254523438, 0.89999999999999991, 0.0000000000000000, + 1.0471975511965976 }, + { 1.5355247765594910, 0.89999999999999991, 0.0000000000000000, + 1.2217304763960306 }, + { 1.8882928567775117, 0.89999999999999991, 0.0000000000000000, + 1.3962634015954636 }, + { 2.2805491384227699, 0.89999999999999991, 0.0000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.0000000000000000. +template <typename Tp> +void test181() +{ + 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(data181) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data181[i].k), Tp(data181[i].nu), + Tp(data181[i].phi)); + const Tp f0 = data181[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)); +} + +// Test data for k=0.89999999999999991, nu=0.10000000000000001. +testcase_ellint_3<double> data182[] = { + { -0.0000000000000000, 0.89999999999999991, 0.10000000000000001, + 0.0000000000000000 }, + { 0.17507714233254659, 0.89999999999999991, 0.10000000000000001, + 0.17453292519943295 }, + { 0.35350932904326521, 0.89999999999999991, 0.10000000000000001, + 0.34906585039886590 }, + { 0.53911129989870987, 0.89999999999999991, 0.10000000000000001, + 0.52359877559829882 }, + { 0.73666644254508407, 0.89999999999999991, 0.10000000000000001, + 0.69813170079773179 }, + { 0.95250736612100184, 0.89999999999999991, 0.10000000000000001, + 0.87266462599716477 }, + { 1.1950199550905591, 0.89999999999999991, 0.10000000000000001, + 1.0471975511965976 }, + { 1.4741687286340848, 0.89999999999999991, 0.10000000000000001, + 1.2217304763960306 }, + { 1.7968678183506053, 0.89999999999999991, 0.10000000000000001, + 1.3962634015954636 }, + { 2.1537868513875282, 0.89999999999999991, 0.10000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.10000000000000001. +template <typename Tp> +void test182() +{ + 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(data182) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data182[i].k), Tp(data182[i].nu), + Tp(data182[i].phi)); + const Tp f0 = data182[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)); +} + +// Test data for k=0.89999999999999991, nu=0.20000000000000001. +testcase_ellint_3<double> data183[] = { + { -0.0000000000000000, 0.89999999999999991, 0.20000000000000001, + 0.0000000000000000 }, + { 0.17490065089140930, 0.89999999999999991, 0.20000000000000001, + 0.17453292519943295 }, + { 0.35211377590661436, 0.89999999999999991, 0.20000000000000001, + 0.34906585039886590 }, + { 0.53448220334204111, 0.89999999999999991, 0.20000000000000001, + 0.52359877559829882 }, + { 0.72591368943179591, 0.89999999999999991, 0.20000000000000001, + 0.69813170079773179 }, + { 0.93192539780038763, 0.89999999999999991, 0.20000000000000001, + 0.87266462599716477 }, + { 1.1600809679692681, 0.89999999999999991, 0.20000000000000001, + 1.0471975511965976 }, + { 1.4195407225882508, 0.89999999999999991, 0.20000000000000001, + 1.2217304763960306 }, + { 1.7168966476424521, 0.89999999999999991, 0.20000000000000001, + 1.3962634015954636 }, + { 2.0443194576468890, 0.89999999999999991, 0.20000000000000001, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.20000000000000001. +template <typename Tp> +void test183() +{ + 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(data183) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data183[i].k), Tp(data183[i].nu), + Tp(data183[i].phi)); + const Tp f0 = data183[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)); +} + +// Test data for k=0.89999999999999991, nu=0.29999999999999999. +testcase_ellint_3<double> data184[] = { + { -0.0000000000000000, 0.89999999999999991, 0.29999999999999999, + 0.0000000000000000 }, + { 0.17472479532647534, 0.89999999999999991, 0.29999999999999999, + 0.17453292519943295 }, + { 0.35073750187374114, 0.89999999999999991, 0.29999999999999999, + 0.34906585039886590 }, + { 0.52998766129466968, 0.89999999999999991, 0.29999999999999999, + 0.52359877559829882 }, + { 0.71566993548699565, 0.89999999999999991, 0.29999999999999999, + 0.69813170079773179 }, + { 0.91271517762560195, 0.89999999999999991, 0.29999999999999999, + 0.87266462599716477 }, + { 1.1281241199843368, 0.89999999999999991, 0.29999999999999999, + 1.0471975511965976 }, + { 1.3704929576917448, 0.89999999999999991, 0.29999999999999999, + 1.2217304763960306 }, + { 1.6461981511487711, 0.89999999999999991, 0.29999999999999999, + 1.3962634015954636 }, + { 1.9486280260314424, 0.89999999999999991, 0.29999999999999999, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.29999999999999999. +template <typename Tp> +void test184() +{ + 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(data184) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data184[i].k), Tp(data184[i].nu), + Tp(data184[i].phi)); + const Tp f0 = data184[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)); +} + +// Test data for k=0.89999999999999991, nu=0.40000000000000002. +testcase_ellint_3<double> data185[] = { + { -0.0000000000000000, 0.89999999999999991, 0.40000000000000002, + 0.0000000000000000 }, + { 0.17454957156468839, 0.89999999999999991, 0.40000000000000002, + 0.17453292519943295 }, + { 0.34938003933330430, 0.89999999999999991, 0.40000000000000002, + 0.34906585039886590 }, + { 0.52562093533067444, 0.89999999999999991, 0.40000000000000002, + 0.52359877559829882 }, + { 0.70589461324915681, 0.89999999999999991, 0.40000000000000002, + 0.69813170079773179 }, + { 0.89472658511942849, 0.89999999999999991, 0.40000000000000002, + 0.87266462599716477 }, + { 1.0987419542323438, 0.89999999999999991, 0.40000000000000002, + 1.0471975511965976 }, + { 1.3261349565496301, 0.89999999999999991, 0.40000000000000002, + 1.2217304763960306 }, + { 1.5831293909853761, 0.89999999999999991, 0.40000000000000002, + 1.3962634015954636 }, + { 1.8641114227238347, 0.89999999999999991, 0.40000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.40000000000000002. +template <typename Tp> +void test185() +{ + 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(data185) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data185[i].k), Tp(data185[i].nu), + Tp(data185[i].phi)); + const Tp f0 = data185[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)); +} + +// Test data for k=0.89999999999999991, nu=0.50000000000000000. +testcase_ellint_3<double> data186[] = { + { -0.0000000000000000, 0.89999999999999991, 0.50000000000000000, + 0.0000000000000000 }, + { 0.17437497557073336, 0.89999999999999991, 0.50000000000000000, + 0.17453292519943295 }, + { 0.34804093691586013, 0.89999999999999991, 0.50000000000000000, + 0.34906585039886590 }, + { 0.52137576320372903, 0.89999999999999991, 0.50000000000000000, + 0.52359877559829882 }, + { 0.69655163996912262, 0.89999999999999991, 0.50000000000000000, + 0.69813170079773179 }, + { 0.87783188683054236, 0.89999999999999991, 0.50000000000000000, + 0.87266462599716477 }, + { 1.0716015959755183, 0.89999999999999991, 0.50000000000000000, + 1.0471975511965976 }, + { 1.2857636916026749, 0.89999999999999991, 0.50000000000000000, + 1.2217304763960306 }, + { 1.5264263913252358, 0.89999999999999991, 0.50000000000000000, + 1.3962634015954636 }, + { 1.7888013241937859, 0.89999999999999991, 0.50000000000000000, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.50000000000000000. +template <typename Tp> +void test186() +{ + 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(data186) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data186[i].k), Tp(data186[i].nu), + Tp(data186[i].phi)); + const Tp f0 = data186[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)); +} + +// Test data for k=0.89999999999999991, nu=0.59999999999999998. +testcase_ellint_3<double> data187[] = { + { -0.0000000000000000, 0.89999999999999991, 0.59999999999999998, + 0.0000000000000000 }, + { 0.17420100334657815, 0.89999999999999991, 0.59999999999999998, + 0.17453292519943295 }, + { 0.34671975876122157, 0.89999999999999991, 0.59999999999999998, + 0.34906585039886590 }, + { 0.51724631570707957, 0.89999999999999991, 0.59999999999999998, + 0.52359877559829882 }, + { 0.68760879113743034, 0.89999999999999991, 0.59999999999999998, + 0.69813170079773179 }, + { 0.86192157779698364, 0.89999999999999991, 0.59999999999999998, + 0.87266462599716477 }, + { 1.0464279696166352, 0.89999999999999991, 0.59999999999999998, + 1.0471975511965976 }, + { 1.2488156247094004, 0.89999999999999991, 0.59999999999999998, + 1.2217304763960306 }, + { 1.4750988777188470, 0.89999999999999991, 0.59999999999999998, + 1.3962634015954636 }, + { 1.7211781128919521, 0.89999999999999991, 0.59999999999999998, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.59999999999999998. +template <typename Tp> +void test187() +{ + 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(data187) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data187[i].k), Tp(data187[i].nu), + Tp(data187[i].phi)); + const Tp f0 = data187[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)); +} + +// Test data for k=0.89999999999999991, nu=0.69999999999999996. +testcase_ellint_3<double> data188[] = { + { -0.0000000000000000, 0.89999999999999991, 0.69999999999999996, + 0.0000000000000000 }, + { 0.17402765093102210, 0.89999999999999991, 0.69999999999999996, + 0.17453292519943295 }, + { 0.34541608382635131, 0.89999999999999991, 0.69999999999999996, + 0.34906585039886590 }, + { 0.51322715827061693, 0.89999999999999991, 0.69999999999999996, + 0.52359877559829882 }, + { 0.67903717872440283, 0.89999999999999991, 0.69999999999999996, + 0.69813170079773179 }, + { 0.84690113601682671, 0.89999999999999991, 0.69999999999999996, + 0.87266462599716477 }, + { 1.0229914311548416, 0.89999999999999991, 0.69999999999999996, + 1.0471975511965976 }, + { 1.2148329639709381, 0.89999999999999991, 0.69999999999999996, + 1.2217304763960306 }, + { 1.4283586501307799, 0.89999999999999991, 0.69999999999999996, + 1.3962634015954636 }, + { 1.6600480747670936, 0.89999999999999991, 0.69999999999999996, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.69999999999999996. +template <typename Tp> +void test188() +{ + 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(data188) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data188[i].k), Tp(data188[i].nu), + Tp(data188[i].phi)); + const Tp f0 = data188[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)); +} + +// Test data for k=0.89999999999999991, nu=0.80000000000000004. +testcase_ellint_3<double> data189[] = { + { -0.0000000000000000, 0.89999999999999991, 0.80000000000000004, + 0.0000000000000000 }, + { 0.17385491439925149, 0.89999999999999991, 0.80000000000000004, + 0.17453292519943295 }, + { 0.34412950523113928, 0.89999999999999991, 0.80000000000000004, + 0.34906585039886590 }, + { 0.50931321668729601, 0.89999999999999991, 0.80000000000000004, + 0.52359877559829882 }, + { 0.67081081392296327, 0.89999999999999991, 0.80000000000000004, + 0.69813170079773179 }, + { 0.83268846097293259, 0.89999999999999991, 0.80000000000000004, + 0.87266462599716477 }, + { 1.0010985015814025, 0.89999999999999991, 0.80000000000000004, + 1.0471975511965976 }, + { 1.1834394045489678, 0.89999999999999991, 0.80000000000000004, + 1.2217304763960306 }, + { 1.3855695891683182, 0.89999999999999991, 0.80000000000000004, + 1.3962634015954636 }, + { 1.6044591960982200, 0.89999999999999991, 0.80000000000000004, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.80000000000000004. +template <typename Tp> +void test189() +{ + 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(data189) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data189[i].k), Tp(data189[i].nu), + Tp(data189[i].phi)); + const Tp f0 = data189[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)); +} + +// Test data for k=0.89999999999999991, nu=0.90000000000000002. +testcase_ellint_3<double> data190[] = { + { -0.0000000000000000, 0.89999999999999991, 0.90000000000000002, + 0.0000000000000000 }, + { 0.17368278986240138, 0.89999999999999991, 0.90000000000000002, + 0.17453292519943295 }, + { 0.34285962963961397, 0.89999999999999991, 0.90000000000000002, + 0.34906585039886590 }, + { 0.50549974644993312, 0.89999999999999991, 0.90000000000000002, + 0.52359877559829882 }, + { 0.66290623857720876, 0.89999999999999991, 0.90000000000000002, + 0.69813170079773179 }, + { 0.81921183128847164, 0.89999999999999991, 0.90000000000000002, + 0.87266462599716477 }, + { 0.98058481956066368, 0.89999999999999991, 0.90000000000000002, + 1.0471975511965976 }, + { 1.1543223520473569, 0.89999999999999991, 0.90000000000000002, + 1.2217304763960306 }, + { 1.3462119782292934, 0.89999999999999991, 0.90000000000000002, + 1.3962634015954636 }, + { 1.5536420236310944, 0.89999999999999991, 0.90000000000000002, + 1.5707963267948966 }, +}; + +// Test function for k=0.89999999999999991, nu=0.90000000000000002. +template <typename Tp> +void test190() +{ + 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(data190) + / sizeof(testcase_ellint_3<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::ellint_3(Tp(data190[i].k), Tp(data190[i].nu), + Tp(data190[i].phi)); + const Tp f0 = data190[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>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + test037<double>(); + test038<double>(); + test039<double>(); + test040<double>(); + test041<double>(); + test042<double>(); + test043<double>(); + test044<double>(); + test045<double>(); + test046<double>(); + test047<double>(); + test048<double>(); + test049<double>(); + test050<double>(); + test051<double>(); + test052<double>(); + test053<double>(); + test054<double>(); + test055<double>(); + test056<double>(); + test057<double>(); + test058<double>(); + test059<double>(); + test060<double>(); + test061<double>(); + test062<double>(); + test063<double>(); + test064<double>(); + test065<double>(); + test066<double>(); + test067<double>(); + test068<double>(); + test069<double>(); + test070<double>(); + test071<double>(); + test072<double>(); + test073<double>(); + test074<double>(); + test075<double>(); + test076<double>(); + test077<double>(); + test078<double>(); + test079<double>(); + test080<double>(); + test081<double>(); + test082<double>(); + test083<double>(); + test084<double>(); + test085<double>(); + test086<double>(); + test087<double>(); + test088<double>(); + test089<double>(); + test090<double>(); + test091<double>(); + test092<double>(); + test093<double>(); + test094<double>(); + test095<double>(); + test096<double>(); + test097<double>(); + test098<double>(); + test099<double>(); + test100<double>(); + test101<double>(); + test102<double>(); + test103<double>(); + test104<double>(); + test105<double>(); + test106<double>(); + test107<double>(); + test108<double>(); + test109<double>(); + test110<double>(); + test111<double>(); + test112<double>(); + test113<double>(); + test114<double>(); + test115<double>(); + test116<double>(); + test117<double>(); + test118<double>(); + test119<double>(); + test120<double>(); + test121<double>(); + test122<double>(); + test123<double>(); + test124<double>(); + test125<double>(); + test126<double>(); + test127<double>(); + test128<double>(); + test129<double>(); + test130<double>(); + test131<double>(); + test132<double>(); + test133<double>(); + test134<double>(); + test135<double>(); + test136<double>(); + test137<double>(); + test138<double>(); + test139<double>(); + test140<double>(); + test141<double>(); + test142<double>(); + test143<double>(); + test144<double>(); + test145<double>(); + test146<double>(); + test147<double>(); + test148<double>(); + test149<double>(); + test150<double>(); + test151<double>(); + test152<double>(); + test153<double>(); + test154<double>(); + test155<double>(); + test156<double>(); + test157<double>(); + test158<double>(); + test159<double>(); + test160<double>(); + test161<double>(); + test162<double>(); + test163<double>(); + test164<double>(); + test165<double>(); + test166<double>(); + test167<double>(); + test168<double>(); + test169<double>(); + test170<double>(); + test171<double>(); + test172<double>(); + test173<double>(); + test174<double>(); + test175<double>(); + test176<double>(); + test177<double>(); + test178<double>(); + test179<double>(); + test180<double>(); + test181<double>(); + test182<double>(); + test183<double>(); + test184<double>(); + test185<double>(); + test186<double>(); + test187<double>(); + test188<double>(); + test189<double>(); + test190<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile.cc new file mode 100644 index 00000000000..f988eaa081c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile_2.cc new file mode 100644 index 00000000000..49f0a70339c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/14_ellint_3/compile_2.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_nan.cc new file mode 100644 index 00000000000..f01caa05144 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_nan.cc @@ -0,0 +1,57 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_neg.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_neg.cc new file mode 100644 index 00000000000..3aa239e15af --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_neg.cc @@ -0,0 +1,128 @@ +// 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; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_pos.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_pos.cc new file mode 100644 index 00000000000..1b9e7fba2d0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/check_value_pos.cc @@ -0,0 +1,128 @@ +// 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; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile.cc new file mode 100644 index 00000000000..17f5a76649b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile_2.cc new file mode 100644 index 00000000000..901aa9fbc76 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/15_expint/compile_2.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/check_nan.cc new file mode 100644 index 00000000000..8d06a964d79 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/check_nan.cc @@ -0,0 +1,59 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile.cc new file mode 100644 index 00000000000..ac6484ba8d1 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile.cc @@ -0,0 +1,44 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile_2.cc new file mode 100644 index 00000000000..301b5df8d93 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/16_hermite/compile_2.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_nan.cc new file mode 100644 index 00000000000..e120e520355 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_nan.cc @@ -0,0 +1,173 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_value.cc new file mode 100644 index 00000000000..d453b19b8e0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/check_value.cc @@ -0,0 +1,17196 @@ +// 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. + +// hyperg + + +// 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 for a=0.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data001[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +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_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data001[i].a), Tp(data001[i].b), + Tp(data001[i].c), 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)); +} + +// Test data for a=0.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data002[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data002[i].a), Tp(data002[i].b), + Tp(data002[i].c), Tp(data002[i].x)); + const Tp f0 = data002[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)); +} + +// Test data for a=0.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data003[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data003[i].a), Tp(data003[i].b), + Tp(data003[i].c), Tp(data003[i].x)); + const Tp f0 = data003[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)); +} + +// Test data for a=0.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data004[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data004[i].a), Tp(data004[i].b), + Tp(data004[i].c), Tp(data004[i].x)); + const Tp f0 = data004[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)); +} + +// Test data for a=0.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data005[] = { + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data005[i].a), Tp(data005[i].b), + Tp(data005[i].c), Tp(data005[i].x)); + const Tp f0 = data005[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)); +} + +// Test data for a=0.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data006[] = { + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data006[i].a), Tp(data006[i].b), + Tp(data006[i].c), Tp(data006[i].x)); + const Tp f0 = data006[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)); +} + +// Test data for a=0.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data007[] = { + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data007[i].a), Tp(data007[i].b), + Tp(data007[i].c), Tp(data007[i].x)); + const Tp f0 = data007[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)); +} + +// Test data for a=0.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data008[] = { + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data008[i].a), Tp(data008[i].b), + Tp(data008[i].c), Tp(data008[i].x)); + const Tp f0 = data008[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)); +} + +// Test data for a=0.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data009[] = { + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data009[i].a), Tp(data009[i].b), + Tp(data009[i].c), Tp(data009[i].x)); + const Tp f0 = data009[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)); +} + +// Test data for a=0.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data010[] = { + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data010[i].a), Tp(data010[i].b), + Tp(data010[i].c), Tp(data010[i].x)); + const Tp f0 = data010[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)); +} + +// Test data for a=0.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data011[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data011[i].a), Tp(data011[i].b), + Tp(data011[i].c), Tp(data011[i].x)); + const Tp f0 = data011[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)); +} + +// Test data for a=0.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data012[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test012() +{ + 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(data012) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data012[i].a), Tp(data012[i].b), + Tp(data012[i].c), Tp(data012[i].x)); + const Tp f0 = data012[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)); +} + +// Test data for a=0.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data013[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test013() +{ + 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(data013) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data013[i].a), Tp(data013[i].b), + Tp(data013[i].c), Tp(data013[i].x)); + const Tp f0 = data013[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)); +} + +// Test data for a=0.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data014[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test014() +{ + 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(data014) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data014[i].a), Tp(data014[i].b), + Tp(data014[i].c), Tp(data014[i].x)); + const Tp f0 = data014[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)); +} + +// Test data for a=0.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data015[] = { + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test015() +{ + 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(data015) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data015[i].a), Tp(data015[i].b), + Tp(data015[i].c), Tp(data015[i].x)); + const Tp f0 = data015[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)); +} + +// Test data for a=0.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data016[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test016() +{ + 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(data016) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data016[i].a), Tp(data016[i].b), + Tp(data016[i].c), Tp(data016[i].x)); + const Tp f0 = data016[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)); +} + +// Test data for a=0.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data017[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test017() +{ + 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(data017) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data017[i].a), Tp(data017[i].b), + Tp(data017[i].c), Tp(data017[i].x)); + const Tp f0 = data017[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)); +} + +// Test data for a=0.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data018[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test018() +{ + 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(data018) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data018[i].a), Tp(data018[i].b), + Tp(data018[i].c), Tp(data018[i].x)); + const Tp f0 = data018[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)); +} + +// Test data for a=0.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data019[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test019() +{ + 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(data019) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data019[i].a), Tp(data019[i].b), + Tp(data019[i].c), Tp(data019[i].x)); + const Tp f0 = data019[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)); +} + +// Test data for a=0.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data020[] = { + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test020() +{ + 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(data020) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data020[i].a), Tp(data020[i].b), + Tp(data020[i].c), Tp(data020[i].x)); + const Tp f0 = data020[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)); +} + +// Test data for a=0.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data021[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test021() +{ + 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(data021) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data021[i].a), Tp(data021[i].b), + Tp(data021[i].c), Tp(data021[i].x)); + const Tp f0 = data021[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)); +} + +// Test data for a=0.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data022[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test022() +{ + 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(data022) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data022[i].a), Tp(data022[i].b), + Tp(data022[i].c), Tp(data022[i].x)); + const Tp f0 = data022[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)); +} + +// Test data for a=0.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data023[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test023() +{ + 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(data023) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data023[i].a), Tp(data023[i].b), + Tp(data023[i].c), Tp(data023[i].x)); + const Tp f0 = data023[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)); +} + +// Test data for a=0.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data024[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test024() +{ + 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(data024) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data024[i].a), Tp(data024[i].b), + Tp(data024[i].c), Tp(data024[i].x)); + const Tp f0 = data024[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)); +} + +// Test data for a=0.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data025[] = { + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test025() +{ + 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(data025) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data025[i].a), Tp(data025[i].b), + Tp(data025[i].c), Tp(data025[i].x)); + const Tp f0 = data025[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)); +} + +// Test data for a=0.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data026[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test026() +{ + 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(data026) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data026[i].a), Tp(data026[i].b), + Tp(data026[i].c), Tp(data026[i].x)); + const Tp f0 = data026[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)); +} + +// Test data for a=0.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data027[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test027() +{ + 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(data027) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data027[i].a), Tp(data027[i].b), + Tp(data027[i].c), Tp(data027[i].x)); + const Tp f0 = data027[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)); +} + +// Test data for a=0.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data028[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test028() +{ + 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(data028) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data028[i].a), Tp(data028[i].b), + Tp(data028[i].c), Tp(data028[i].x)); + const Tp f0 = data028[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)); +} + +// Test data for a=0.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data029[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test029() +{ + 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(data029) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data029[i].a), Tp(data029[i].b), + Tp(data029[i].c), Tp(data029[i].x)); + const Tp f0 = data029[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)); +} + +// Test data for a=0.0000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data030[] = { + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test030() +{ + 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(data030) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data030[i].a), Tp(data030[i].b), + Tp(data030[i].c), Tp(data030[i].x)); + const Tp f0 = data030[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)); +} + +// Test data for a=0.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data031[] = { + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test031() +{ + 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(data031) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data031[i].a), Tp(data031[i].b), + Tp(data031[i].c), Tp(data031[i].x)); + const Tp f0 = data031[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)); +} + +// Test data for a=0.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data032[] = { + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test032() +{ + 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(data032) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data032[i].a), Tp(data032[i].b), + Tp(data032[i].c), Tp(data032[i].x)); + const Tp f0 = data032[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)); +} + +// Test data for a=0.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data033[] = { + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test033() +{ + 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(data033) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data033[i].a), Tp(data033[i].b), + Tp(data033[i].c), Tp(data033[i].x)); + const Tp f0 = data033[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)); +} + +// Test data for a=0.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data034[] = { + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test034() +{ + 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(data034) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data034[i].a), Tp(data034[i].b), + Tp(data034[i].c), Tp(data034[i].x)); + const Tp f0 = data034[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)); +} + +// Test data for a=0.0000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data035[] = { + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.0000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test035() +{ + 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(data035) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data035[i].a), Tp(data035[i].b), + Tp(data035[i].c), Tp(data035[i].x)); + const Tp f0 = data035[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)); +} + +// Test data for a=0.50000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data036[] = { + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test036() +{ + 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(data036) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data036[i].a), Tp(data036[i].b), + Tp(data036[i].c), Tp(data036[i].x)); + const Tp f0 = data036[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)); +} + +// Test data for a=0.50000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data037[] = { + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test037() +{ + 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(data037) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data037[i].a), Tp(data037[i].b), + Tp(data037[i].c), Tp(data037[i].x)); + const Tp f0 = data037[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)); +} + +// Test data for a=0.50000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data038[] = { + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test038() +{ + 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(data038) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data038[i].a), Tp(data038[i].b), + Tp(data038[i].c), Tp(data038[i].x)); + const Tp f0 = data038[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)); +} + +// Test data for a=0.50000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data039[] = { + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test039() +{ + 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(data039) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data039[i].a), Tp(data039[i].b), + Tp(data039[i].c), Tp(data039[i].x)); + const Tp f0 = data039[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)); +} + +// Test data for a=0.50000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data040[] = { + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 0.50000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test040() +{ + 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(data040) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data040[i].a), Tp(data040[i].b), + Tp(data040[i].c), Tp(data040[i].x)); + const Tp f0 = data040[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)); +} + +// Test data for a=0.50000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data041[] = { + { 0.91383715388743758, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.92151232618202283, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.92955086110354823, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.93798900119104844, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.94686887307107304, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.95623987262143295, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.96616049387450154, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.97670078782187519, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.98794573712298384, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0129947682256604, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0270980168168973, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0425304520063581, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0595915916161471, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0787052023767585, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.1005053642285867, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.1260196351148746, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.1571341977338991, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.1982111053717450, 0.50000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test041() +{ + 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(data041) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data041[i].a), Tp(data041[i].b), + Tp(data041[i].c), Tp(data041[i].x)); + const Tp f0 = data041[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)); +} + +// Test data for a=0.50000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data042[] = { + { 0.95255425675562733, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.95712841850078245, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.96184734120034532, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.96672141255196242, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.97176228710138646, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.97698311668286286, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.98239883902556069, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.98802654401961032, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.99388594556732701, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0063957328951061, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0131053706824598, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0201679332118803, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0276315524377497, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0355569942816882, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0440233080381554, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0531375808028993, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0630536689840200, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0740149570414563, 0.50000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test042() +{ + 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(data042) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data042[i].a), Tp(data042[i].b), + Tp(data042[i].c), Tp(data042[i].x)); + const Tp f0 = data042[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)); +} + +// Test data for a=0.50000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data043[] = { + { 0.96694084713323891, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.97024454918852587, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.97362815600391461, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.97709622064205115, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.98065374770570624, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.98430626119885489, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.98805988669621037, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.99192145185739655, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.99589861079880937, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0042354366729904, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0086161755545404, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0131552481403503, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0178679218284707, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0227723400312978, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0278904483717863, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0332494012993472, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0388838453357794, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0448400142331342, 0.50000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test043() +{ + 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(data043) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data043[i].a), Tp(data043[i].b), + Tp(data043[i].c), Tp(data043[i].x)); + const Tp f0 = data043[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)); +} + +// Test data for a=0.50000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data044[] = { + { 0.97456073259047449, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.97715689327833344, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.97980416868943099, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.98250498942832509, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.98526199049760832, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.98807803762902813, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.99095625840920332, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.99390007937387959, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.99691327061866730, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0031648997547440, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0064131494767281, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0097505810668461, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0131838138968663, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0167204326938339, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0203692279382193, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0241405318057402, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0280467087844301, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0321029179180026, 0.50000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test044() +{ + 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(data044) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data044[i].a), Tp(data044[i].b), + Tp(data044[i].c), Tp(data044[i].x)); + const Tp f0 = data044[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)); +} + +// Test data for a=0.50000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data045[] = { + { 0.97930223035212161, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.98144406855076416, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.98362155940297302, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.98583616201745805, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.98808944235385077, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.99038308530635433, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.99271890872975732, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.99509887982916734, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99752513445413604, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0025260228440118, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0051060015613384, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0077430276253163, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0104405359789990, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0132023689128868, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0160328583559475, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0189369344885053, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0219202735809589, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0249895076611382, 0.50000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test045() +{ + 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(data045) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data045[i].a), Tp(data045[i].b), + Tp(data045[i].c), Tp(data045[i].x)); + const Tp f0 = data045[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)); +} + +// Test data for a=0.50000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data046[] = { + { 0.84089972268671609, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.85410196624968437, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.86811566011579933, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.88303688022450544, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.89897948556635565, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.91607978309961580, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.93450283399425305, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.95445115010332193, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.97617696340303095, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0263340389897240, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0557280900008410, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0889331564394962, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.1270166537925830, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.1715728752538095, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.2251482265544145, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.2922212642709541, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.3819660112501042, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.5194938532959119, 0.50000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test046() +{ + 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(data046) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data046[i].a), Tp(data046[i].b), + Tp(data046[i].c), Tp(data046[i].x)); + const Tp f0 = data046[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)); +} + +// Test data for a=0.50000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data047[] = { + { 0.90992197313391499, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.91822592662244507, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.92687104566419531, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.93588628166548815, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.94530459215552909, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.95516374875247467, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.96550736800511827, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.97638624595136270, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.98786011482678993, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0128914530682316, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0266391040215350, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0413732738729464, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0572599536532992, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0745166004060953, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0934387388831386, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.1144486980714641, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.1381966011250106, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.1658171625342397, 0.50000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test047() +{ + 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(data047) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data047[i].a), Tp(data047[i].b), + Tp(data047[i].c), Tp(data047[i].x)); + const Tp f0 = data047[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)); +} + +// Test data for a=0.50000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data048[] = { + { 0.93641908369732885, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.94256349654111315, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.94890138508461319, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.95544578858430007, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.96221121193620718, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.96921386948293542, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.97647198488394704, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.98400616412578656, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.99183986544963032, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0085177124149158, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0174294150407122, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0267781897388850, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0366157405967285, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0470052068648839, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0580253905513313, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0697774741209765, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0823965556448414, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0960739512057103, 0.50000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test048() +{ + 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(data048) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data048[i].a), Tp(data048[i].b), + Tp(data048[i].c), Tp(data048[i].x)); + const Tp f0 = data048[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)); +} + +// Test data for a=0.50000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data049[] = { + { 0.95069883346936235, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.95559618047704165, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.96061938755931653, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.96577553912851344, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.97107239473807716, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.97651848528588503, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.98212322830227139, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.98789706736195781, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.99385164237825074, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0063568569383123, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0129389344715818, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0197653907773940, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0268583912277143, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0342438793937092, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0419526514766855, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0500219124976327, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0584976491907043, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0674385240268101, 0.50000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test049() +{ + 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(data049) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data049[i].a), Tp(data049[i].b), + Tp(data049[i].c), Tp(data049[i].x)); + const Tp f0 = data049[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)); +} + +// Test data for a=0.50000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data050[] = { + { 0.95968319138913893, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.96376169072755768, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.96792900082729316, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.97218942798115737, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.97654763592586857, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.98100869054353856, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.98557811238699278, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.99026193885795544, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99506679842072221, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0050696417919618, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0102847452747090, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0156554225057022, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0211930882963096, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0269107343740711, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0328232917216298, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0389481230247195, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0453057164134614, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0519207114461246, 0.50000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test050() +{ + 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(data050) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data050[i].a), Tp(data050[i].b), + Tp(data050[i].c), Tp(data050[i].x)); + const Tp f0 = data050[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)); +} + +// Test data for a=0.50000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data051[] = { + { 0.72547625011001171, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.74535599249992990, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.76696498884737041, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.79056941504209477, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.81649658092772603, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.84515425472851657, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.87705801930702920, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.91287092917527690, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.95346258924559224, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0540925533894598, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.1180339887498949, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.1952286093343938, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.2909944487358056, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.4142135623730949, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.5811388300841900, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.8257418583505536, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.2360679774997898, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 3.1622776601683782, 0.50000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test051() +{ + 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(data051) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data051[i].a), Tp(data051[i].b), + Tp(data051[i].c), Tp(data051[i].x)); + const Tp f0 = data051[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)); +} + +// Test data for a=0.50000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data052[] = { + { 0.83664260086443798, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.85046584300227146, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.86509574979651593, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.88062082573041867, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.89714464248521586, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.91478946588967558, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.93370105322348573, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.95405511057700887, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.97606616007978142, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0261916902334731, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0550723519434702, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0872106588188091, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.1233801699379020, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.1646752981725688, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.2127272514219511, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.2701518651068637, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.3416407864998725, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.4374795179111102, 0.50000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test052() +{ + 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(data052) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data052[i].a), Tp(data052[i].b), + Tp(data052[i].c), Tp(data052[i].x)); + const Tp f0 = data052[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)); +} + +// Test data for a=0.50000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data053[] = { + { 0.88195381730235833, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.89265078469555093, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.90382937908303707, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.91553161389880577, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.92780530349281576, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.94070521140346042, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.95429450630523349, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.96864663325785849, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.98384775588541795, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0172258496884334, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0356742479163459, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0555293036908924, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0770231491562379, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.1004557416484888, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.1262270515731978, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.1548932919125086, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.1872757758134724, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.2247091713458949, 0.50000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test053() +{ + 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(data053) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data053[i].a), Tp(data053[i].b), + Tp(data053[i].c), Tp(data053[i].x)); + const Tp f0 = data053[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)); +} + +// Test data for a=0.50000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data054[] = { + { 0.90716919697107301, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.91592299407142519, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.92500027075874236, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.93442464185467167, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.94422248683737009, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.95442341810133347, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.96506085725516400, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.97617275213704069, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.98780247986309799, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0128233505813447, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0263406246541855, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0406326381700366, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0557966239802845, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0719515075786321, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0892457392422055, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.1078695188000958, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.1280752258974340, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.1502152002706476, 0.50000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test054() +{ + 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(data054) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data054[i].a), Tp(data054[i].b), + Tp(data054[i].c), Tp(data054[i].x)); + const Tp f0 = data054[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)); +} + +// Test data for a=0.50000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data055[] = { + { 0.92336416053263093, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.93078397248364519, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.93843714333600226, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.94633837784068076, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.95450388104967909, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.96295158125742764, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.97170139827854296, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.98077556918512687, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99019904777750845, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0102104261941198, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0208669540935695, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0320118665407505, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0436944599504387, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0559728828278145, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0689166967761712, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0826105758119842, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0971599106346146, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.1126998828023964, 0.50000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test055() +{ + 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(data055) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data055[i].a), Tp(data055[i].b), + Tp(data055[i].c), Tp(data055[i].x)); + const Tp f0 = data055[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)); +} + +// Test data for a=0.50000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data056[] = { + { 0.52275983209457511, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.54700336898142965, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.57468955512601971, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.60665490543315015, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.64403057859056123, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.68838183648623719, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.74193265039311085, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.80794095908995300, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.89135275749639320, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.1469266219310688, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.3552340708357489, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.6690840478838305, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 2.1815415453174483, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 3.1156892546032235, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 5.1109077417760416, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 10.560352936466296, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 33.541019662496815, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 300.66343065819501, 0.50000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test056() +{ + 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(data056) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data056[i].a), Tp(data056[i].b), + Tp(data056[i].c), Tp(data056[i].x)); + const Tp f0 = data056[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)); +} + +// Test data for a=0.50000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data057[] = { + { 0.68252041951139264, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.70394732624993395, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.72748884971552041, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.75351147371199689, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.78247589005573748, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.81497017420249818, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.85175826875009564, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.89385278481745867, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.94262778709507411, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0687327277420910, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.1529725508983291, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.2592587134058799, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.3985773194637892, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.5909902576697317, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.8776023607249752, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2.3582499003694646, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 3.3541019662496838, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 6.7198400278577859, 0.50000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test057() +{ + 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(data057) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data057[i].a), Tp(data057[i].b), + Tp(data057[i].c), Tp(data057[i].x)); + const Tp f0 = data057[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)); +} + +// Test data for a=0.50000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data058[] = { + { 0.75755211927082589, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.77603550233010998, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.79596241913438492, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.81753360792105201, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.84099165409805521, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.86663303852180873, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.89482475828629970, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.92602774279590350, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.96083064727087386, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0445570841313008, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0959004638926031, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.1560106261370562, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.2278121770678145, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.3158640214709998, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.4278095344155000, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.5778700502946612, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.7972173289196469, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 2.1789970569269732, 0.50000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test058() +{ + 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(data058) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data058[i].a), Tp(data058[i].b), + Tp(data058[i].c), Tp(data058[i].x)); + const Tp f0 = data058[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)); +} + +// Test data for a=0.50000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data059[] = { + { 0.80270093579329471, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.81884974572462788, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.83605266330015271, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.85443340762795972, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.87413762182790655, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.89533826626907331, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.91824276674115268, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.94310265050720576, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.97022678857609712, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0329098673199812, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0695865684573389, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.1108642103944570, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.1578795055970506, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.2122394794169442, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.2763274721556934, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.3539179650251021, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.4515986118197148, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.5829284571614219, 0.50000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test059() +{ + 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(data059) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data059[i].a), Tp(data059[i].b), + Tp(data059[i].c), Tp(data059[i].x)); + const Tp f0 = data059[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)); +} + +// Test data for a=0.50000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data060[] = { + { 0.83322694172301959, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.84753931604765664, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.86265784532195022, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.87866479300707079, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.89565516540263501, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.91373946207610557, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.93304721345881891, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.95373159512905148, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.97597554238828121, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0260752851887982, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0545371197996178, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0858099017045830, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.1204416568688709, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.1591587835964847, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.2029564720303347, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.2532588722007874, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.3122319926925459, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.3834948587364100, 0.50000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test060() +{ + 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(data060) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data060[i].a), Tp(data060[i].b), + Tp(data060[i].c), Tp(data060[i].x)); + const Tp f0 = data060[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)); +} + +// Test data for a=0.50000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data061[] = { + { 0.37727530159464628, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.39816010922169010, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.42283703041362453, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.45255640448730505, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.48919507154431141, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.53569358917731880, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.59689778897029566, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.68128587569875731, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.80478739308790359, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.3408664196153621, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 2.0175364359923860, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 3.6011214553736646, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 8.1799429939495312, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 25.644834637536000, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 123.13738891597615, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1088.7122410321333, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 27358.291704709951, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 8174369.0266731177, 0.50000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test061() +{ + 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(data061) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data061[i].a), Tp(data061[i].b), + Tp(data061[i].c), Tp(data061[i].x)); + const Tp f0 = data061[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)); +} + +// Test data for a=0.50000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data062[] = { + { 0.53905528308450834, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.56235533974376162, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.58887657983263575, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.61941227047262915, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.65504896640793853, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.69731666644529999, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.74844073299399128, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.81178446800105752, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.89266981277598023, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.1497248473106778, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.3729717112654571, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.7374982340374392, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 2.4134479340960580, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 3.9191255240471192, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 8.3316373077761270, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 28.323020339843335, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 225.84286572747891, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 12757.127591286655, 0.50000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test062() +{ + 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(data062) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data062[i].a), Tp(data062[i].b), + Tp(data062[i].c), Tp(data062[i].x)); + const Tp f0 = data062[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)); +} + +// Test data for a=0.50000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data063[] = { + { 0.62672622092226071, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.64931010269769829, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.67448067519076316, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.70276306239803676, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.73484179773087555, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.77162761412743897, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.81436116844816531, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.86477994787944557, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.92539820516603888, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0945599448210315, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.2190897395597264, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.3916844336856475, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.6484497630432013, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 2.0717772717131155, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2.8893613630810924, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 4.9459404075413529, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 13.487394149998716, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 136.57616044013972, 0.50000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test063() +{ + 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(data063) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data063[i].a), Tp(data063[i].b), + Tp(data063[i].c), Tp(data063[i].x)); + const Tp f0 = data063[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)); +} + +// Test data for a=0.50000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data064[] = { + { 0.68421604440344341, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.70548098055548891, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.72884342311710348, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.75466953437856243, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.78342090924662600, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.81568884278645049, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.85224480241465206, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.89411692571131696, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.94270986892954756, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0688682849120232, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.1537004376097553, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.2615455028370031, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.4045541456153436, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.6057216489444517, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.9146603020550739, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 2.4617931307620298, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 3.7267799624996498, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 9.3880118036248401, 0.50000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test064() +{ + 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(data064) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data064[i].a), Tp(data064[i].b), + Tp(data064[i].c), Tp(data064[i].x)); + const Tp f0 = data064[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)); +} + +// Test data for a=0.50000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data065[] = { + { 0.72547625011001171, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.74535599249992990, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.76696498884737041, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.79056941504209477, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.81649658092772603, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.84515425472851657, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.87705801930702920, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.91287092917527690, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.95346258924559224, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0540925533894598, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.1180339887498949, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.1952286093343938, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.2909944487358056, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.4142135623730949, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.5811388300841900, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.8257418583505536, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 2.2360679774997898, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 3.1622776601683782, 0.50000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test065() +{ + 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(data065) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data065[i].a), Tp(data065[i].b), + Tp(data065[i].c), Tp(data065[i].x)); + const Tp f0 = data065[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)); +} + +// Test data for a=0.50000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data066[] = { + { 0.26690449940521566, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.28252302866181805, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.30123616141153819, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.32421384687602628, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.35334630811776752, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.39191793127467034, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.44620488618129206, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.52980896919265685, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.67754711477562357, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.9567557771780317, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 6.1816042148333086, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 35.653088618561227, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 377.51482843179906, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 7645.8816551195359, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 354791.74537980522, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 57009889.966638684, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 83771357024.863937, 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 25866972896376408., 0.50000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test066() +{ + 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(data066) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data066[i].a), Tp(data066[i].b), + Tp(data066[i].c), Tp(data066[i].x)); + const Tp f0 = data066[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)); +} + +// Test data for a=0.50000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data067[] = { + { 0.40342659436153405, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.42420571192034318, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.44852768286073008, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.47751245808592863, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.51283632632707754, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.55713468814894307, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.61481320817757312, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.69383483410097202, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.81012002526006033, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3622225506603911, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 2.2349513086109001, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 5.1864917536761723, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 21.020560423779411, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 175.19649997100612, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 3467.1587803688708, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 225003.88683445856, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 110837674.65652709, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 6688966964170.6807, 0.50000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test067() +{ + 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(data067) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data067[i].a), Tp(data067[i].b), + Tp(data067[i].c), Tp(data067[i].x)); + const Tp f0 = data067[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)); +} + +// Test data for a=0.50000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data068[] = { + { 0.48716309885816761, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.50965859152542281, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.53554809210658971, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.56576689207507136, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.60164849637133688, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.64516711595404375, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.69938278735493542, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.76931621518401860, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.86381808725530695, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.2152051956815531, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.6052546785425543, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 2.4765586046012635, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 5.1564492216997486, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 18.446158392136365, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 150.44577670123971, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 3862.6317400115768, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 632428.34833625401, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 7426927663.3808765, 0.50000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test068() +{ + 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(data068) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data068[i].a), Tp(data068[i].b), + Tp(data068[i].c), Tp(data068[i].x)); + const Tp f0 = data068[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)); +} + +// Test data for a=0.50000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data069[] = { + { 0.54703266209548362, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.56997321774144971, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.59603026159654970, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.62596978851120511, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.66084565876898926, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.70215256667232839, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.75208916592008568, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.81403631111658648, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.89348608489854608, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1517793185139173, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3878110313656598, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.8061071794572381, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 2.7148594517859586, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 5.4529435709049361, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 19.487310275377109, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 191.69079165937470, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 10218.543981792311, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 23160836.646583911, 0.50000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test069() +{ + 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(data069) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data069[i].a), Tp(data069[i].b), + Tp(data069[i].c), Tp(data069[i].x)); + const Tp f0 = data069[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)); +} + +// Test data for a=0.50000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data070[] = { + { 0.59292067298616002, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.61572496720679915, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.64135339122875623, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.67043457419280483, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.70380956268170980, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.74263251901495231, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.78853555445528278, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.84391122775673766, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.91242401018807406, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1169059681274873, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2825928301302667, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.5385937789924939, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.9895771187893898, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2.9707335806970168, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 6.0299506157180467, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 24.259090336955577, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 406.27267173257223, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 174330.03997220192, 0.50000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=0.50000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test070() +{ + 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(data070) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data070[i].a), Tp(data070[i].b), + Tp(data070[i].c), Tp(data070[i].x)); + const Tp f0 = data070[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)); +} + +// Test data for a=1.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data071[] = { + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test071() +{ + 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(data071) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data071[i].a), Tp(data071[i].b), + Tp(data071[i].c), Tp(data071[i].x)); + const Tp f0 = data071[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)); +} + +// Test data for a=1.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data072[] = { + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test072() +{ + 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(data072) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data072[i].a), Tp(data072[i].b), + Tp(data072[i].c), Tp(data072[i].x)); + const Tp f0 = data072[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)); +} + +// Test data for a=1.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data073[] = { + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test073() +{ + 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(data073) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data073[i].a), Tp(data073[i].b), + Tp(data073[i].c), Tp(data073[i].x)); + const Tp f0 = data073[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)); +} + +// Test data for a=1.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data074[] = { + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test074() +{ + 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(data074) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data074[i].a), Tp(data074[i].b), + Tp(data074[i].c), Tp(data074[i].x)); + const Tp f0 = data074[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)); +} + +// Test data for a=1.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data075[] = { + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 1.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test075() +{ + 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(data075) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data075[i].a), Tp(data075[i].b), + Tp(data075[i].c), Tp(data075[i].x)); + const Tp f0 = data075[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)); +} + +// Test data for a=1.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data076[] = { + { 0.84089972268671609, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.85410196624968437, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.86811566011579933, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.88303688022450544, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.89897948556635565, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.91607978309961580, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.93450283399425305, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.95445115010332193, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.97617696340303095, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0263340389897240, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0557280900008410, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0889331564394962, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.1270166537925830, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.1715728752538095, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.2251482265544145, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.2922212642709541, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.3819660112501042, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.5194938532959119, 1.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test076() +{ + 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(data076) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data076[i].a), Tp(data076[i].b), + Tp(data076[i].c), Tp(data076[i].x)); + const Tp f0 = data076[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)); +} + +// Test data for a=1.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data077[] = { + { 0.90992197313391499, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.91822592662244507, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.92687104566419531, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.93588628166548815, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.94530459215552909, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.95516374875247467, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.96550736800511827, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.97638624595136270, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.98786011482678993, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0128914530682316, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0266391040215350, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0413732738729464, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0572599536532992, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0745166004060953, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0934387388831386, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.1144486980714641, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.1381966011250106, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.1658171625342397, 1.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test077() +{ + 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(data077) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data077[i].a), Tp(data077[i].b), + Tp(data077[i].c), Tp(data077[i].x)); + const Tp f0 = data077[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)); +} + +// Test data for a=1.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data078[] = { + { 0.93641908369732885, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.94256349654111315, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.94890138508461319, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.95544578858430007, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.96221121193620718, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.96921386948293542, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.97647198488394704, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.98400616412578656, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.99183986544963032, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0085177124149158, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0174294150407122, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0267781897388850, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0366157405967285, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0470052068648839, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0580253905513313, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0697774741209765, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0823965556448414, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0960739512057103, 1.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test078() +{ + 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(data078) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data078[i].a), Tp(data078[i].b), + Tp(data078[i].c), Tp(data078[i].x)); + const Tp f0 = data078[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)); +} + +// Test data for a=1.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data079[] = { + { 0.95069883346936235, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.95559618047704165, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.96061938755931653, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.96577553912851344, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.97107239473807716, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.97651848528588503, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.98212322830227139, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.98789706736195781, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.99385164237825074, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0063568569383123, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0129389344715818, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0197653907773940, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0268583912277143, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0342438793937092, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0419526514766855, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0500219124976327, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0584976491907043, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0674385240268101, 1.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test079() +{ + 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(data079) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data079[i].a), Tp(data079[i].b), + Tp(data079[i].c), Tp(data079[i].x)); + const Tp f0 = data079[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)); +} + +// Test data for a=1.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data080[] = { + { 0.95968319138913893, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.96376169072755768, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.96792900082729316, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.97218942798115737, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.97654763592586857, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.98100869054353856, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.98557811238699278, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.99026193885795544, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99506679842072221, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0050696417919618, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0102847452747090, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0156554225057022, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0211930882963096, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0269107343740711, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0328232917216298, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0389481230247195, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0453057164134614, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0519207114461246, 1.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test080() +{ + 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(data080) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data080[i].a), Tp(data080[i].b), + Tp(data080[i].c), Tp(data080[i].x)); + const Tp f0 = data080[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)); +} + +// Test data for a=1.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data081[] = { + { 0.71317098463599404, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.73473333112764871, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.75804035866024377, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.78333938207622600, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.81093021621632877, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.84118059155303226, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.87454754822497005, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.91160778396977304, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.95310179804324857, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0536051565782629, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.1157177565710485, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.1889164797957747, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.2770640594149765, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.3862943611198899, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.5271512197902593, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.7199611490370503, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.0117973905426232, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 2.5584278811044912, 1.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test081() +{ + 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(data081) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data081[i].a), Tp(data081[i].b), + Tp(data081[i].c), Tp(data081[i].x)); + const Tp f0 = data081[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)); +} + +// Test data for a=1.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data082[] = { + { 0.83165649828125576, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.84626246650116577, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.86165287670267410, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.87790681762615241, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.89511583784087689, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.91338673957393823, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.93284521667331954, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.95364066873549813, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.97595268969924187, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0260530485179122, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0544523154103413, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0856358366643180, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.1201824010510930, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.1588830833596719, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.2028682930536780, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.2538561433469468, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.3147120107267418, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.3910528844853491, 1.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test082() +{ + 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(data082) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data082[i].a), Tp(data082[i].b), + Tp(data082[i].c), Tp(data082[i].x)); + const Tp f0 = data082[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)); +} + +// Test data for a=1.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data083[] = { + { 0.87917686994924527, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.89033956110358414, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.90196195126098366, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.91408080149514692, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.92673756761314952, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.93997926630123407, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.95385955885019291, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.96844012412988900, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.98379242268046208, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0171615499181177, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0353950776091037, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0548437030651112, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0756840039415978, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0981384722661196, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.1224950318916129, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.1491396357184527, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.1786158344507012, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.2117500593515478, 1.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test083() +{ + 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(data083) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data083[i].a), Tp(data083[i].b), + Tp(data083[i].c), Tp(data083[i].x)); + const Tp f0 = data083[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)); +} + +// Test data for a=1.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data084[] = { + { 0.90538259348578409, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.91444830598832050, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.92381915945974002, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.93351553488501815, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.94356001859234884, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.95397775039949584, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.96479684710618019, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.97604892281308531, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.98776973540356938, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0127864273812119, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0261830717772533, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0402531144740719, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0550712790827002, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0707271945059007, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0873302420658923, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.1050168587085545, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.1239622188477687, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.1444006183097781, 1.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test084() +{ + 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(data084) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data084[i].a), Tp(data084[i].b), + Tp(data084[i].c), Tp(data084[i].x)); + const Tp f0 = data084[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)); +} + +// Test data for a=1.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data085[] = { + { 0.92211295632330403, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.92975727737040659, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.93761992348333467, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.94571346180587801, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.95405164371146867, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.96264956879205954, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.97152388013493096, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.98069299877709348, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99017740778385854, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0101865087004833, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0207660479892111, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0317718013185031, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0432419144892398, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0552206786504446, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0677601383233675, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0809223485579968, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0947826783002668, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.1094349304493603, 1.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test085() +{ + 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(data085) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data085[i].a), Tp(data085[i].b), + Tp(data085[i].c), Tp(data085[i].x)); + const Tp f0 = data085[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)); +} + +// Test data for a=1.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data086[] = { + { 0.52631578947368429, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.55555555555555558, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.58823529411764708, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.62500000000000000, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.66666666666666663, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.71428571428571430, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.76923076923076927, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.83333333333333337, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.90909090909090906, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.1111111111111112, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.2500000000000000, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.4285714285714286, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.6666666666666663, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 2.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 2.5000000000000004, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 3.3333333333333330, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 5.0000000000000009, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9.9999999999999929, 1.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test086() +{ + 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(data086) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data086[i].a), Tp(data086[i].b), + Tp(data086[i].c), Tp(data086[i].x)); + const Tp f0 = data086[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)); +} + +// Test data for a=1.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data087[] = { + { 0.70351947549341520, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.72637503722092711, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.75099661564391251, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.77761647796730871, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.80651221621216451, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.83801894346580275, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.87254582050258467, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.91059888544083678, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.95281329145592386, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0532154477379738, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.1138692114741471, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.1838976095305187, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.2660586631630237, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.3644676665613118, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.4856585347316102, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.6409590443536872, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.8528798927325769, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 2.1789423102929644, 1.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test087() +{ + 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(data087) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data087[i].a), Tp(data087[i].b), + Tp(data087[i].c), Tp(data087[i].x)); + const Tp f0 = data087[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)); +} + +// Test data for a=1.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data088[] = { + { 0.78068027379106253, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.79924541976981278, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.81891305585650942, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.83979799626213270, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.86203315303160166, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.88577352485361693, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.91120135738402208, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.93853291956703588, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.96802755388922956, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0348375559194773, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0730246119544820, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.1151788396279341, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.1621066403893472, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.2148922218710421, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.2750496810838674, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.3448048570872917, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.4276833109859521, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.5299976259379788, 1.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test088() +{ + 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(data088) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data088[i].a), Tp(data088[i].b), + Tp(data088[i].c), Tp(data088[i].x)); + const Tp f0 = data088[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)); +} + +// Test data for a=1.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data089[] = { + { 0.82510759951857582, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.84072786892782092, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.85710884896562356, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.87431674418118333, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.89242659229727017, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.91152392685930339, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.93170685950993570, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.95308871926790661, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.97580144325325802, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0258682619030324, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0536269616706000, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0835447330793833, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.1159538758396654, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.1512736659291880, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.1900463690116090, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.2329961591622411, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.2811334345669059, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.3359629014132051, 1.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test089() +{ + 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(data089) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data089[i].a), Tp(data089[i].b), + Tp(data089[i].c), Tp(data089[i].x)); + const Tp f0 = data089[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)); +} + +// Test data for a=1.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data090[] = { + { 0.85426123653345876, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.86774543390930370, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.88178859537254239, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.89643269097060951, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.91172456687216763, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.92771674975966134, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.94446842993888647, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.96204667481937678, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.98052794339012128, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0205643671068179, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0423395201078882, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0654651277885334, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0901078068101382, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.1164691415928940, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.1447972335326551, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.1754040384534161, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.2086928679893112, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.2452055640510711, 1.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test090() +{ + 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(data090) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data090[i].a), Tp(data090[i].b), + Tp(data090[i].c), Tp(data090[i].x)); + const Tp f0 = data090[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)); +} + +// Test data for a=1.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data091[] = { + { 0.25646288779245091, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.28273129096174382, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.31438201170962976, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.35308837890625017, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.40123456790123463, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.46230737192836319, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.54156016946185359, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.64718364197530875, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.79246636158732342, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.3103947568968148, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.8017578125000004, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 2.6374427321949185, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 4.1975308641975282, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 7.4999999999999964, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 15.859375000000012, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 43.734567901234513, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 194.99999999999994, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 2777.4999999999832, 1.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test091() +{ + 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(data091) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data091[i].a), Tp(data091[i].b), + Tp(data091[i].c), Tp(data091[i].x)); + const Tp f0 = data091[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)); +} + +// Test data for a=1.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data092[] = { + { 0.46398891966759004, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.49382716049382713, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.52768166089965396, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.56640624999999978, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.61111111111111116, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.66326530612244894, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.72485207100591698, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.79861111111111094, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.88842975206611552, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.1419753086419753, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.3281249999999998, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.5816326530612239, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.9444444444444444, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 2.5000000000000000, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 3.4374999999999996, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 5.2777777777777715, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 9.9999999999999947, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 32.499999999999837, 1.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test092() +{ + 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(data092) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data092[i].a), Tp(data092[i].b), + Tp(data092[i].c), Tp(data092[i].x)); + const Tp f0 = data092[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)); +} + +// Test data for a=1.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data093[] = { + { 0.57476744883397501, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.60302731682513933, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.63425708719096396, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.66895764182970419, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.70775063063963428, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.75141762103495924, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.80095569442603298, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.85765823887436754, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.92323549576335540, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0911622464839472, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.2013226178607666, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.3373332072682687, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.5099074378209716, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.7368822229245819, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2.0505871832661429, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 2.5172389775867967, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 3.3015631983556144, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 5.0005935155044519, 1.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test093() +{ + 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(data093) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data093[i].a), Tp(data093[i].b), + Tp(data093[i].c), Tp(data093[i].x)); + const Tp f0 = data093[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)); +} + +// Test data for a=1.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data094[] = { + { 0.64582752605387961, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.67184161997264169, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.70012779922368040, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.73100784656910256, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.76486919089091077, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.80218301124334579, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.84352883533234446, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.88962858902212572, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.94139473468584123, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0669812691939897, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.1443996012177726, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.2350966976721314, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.3431264370409088, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.4745266814162399, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.6388137104840066, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.8522074849776518, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 2.1458016978417458, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 2.5927464669826339, 1.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test094() +{ + 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(data094) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data094[i].a), Tp(data094[i].b), + Tp(data094[i].c), Tp(data094[i].x)); + const Tp f0 = data094[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)); +} + +// Test data for a=1.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data095[] = { + { 0.69583236336670629, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.71968920666899694, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.74533885416044232, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.77300145361503014, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.80293630810919514, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.83545132638592035, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.87091544744412508, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.90977522877919847, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.95257738192069130, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0528968282789379, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.1123617169062123, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.1798254572896132, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.2572069000522696, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.3471600884974377, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.4535032279573519, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.5820245752814948, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.7421756366906538, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.9513145531098233, 1.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test095() +{ + 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(data095) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data095[i].a), Tp(data095[i].b), + Tp(data095[i].c), Tp(data095[i].x)); + const Tp f0 = data095[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)); +} + +// Test data for a=1.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data096[] = { + { 0.12307420104127871, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.13818870041457423, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.15739165631811691, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.18249038606882068, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.21644171225027786, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.26433326159804160, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.33544459430654533, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.44788516696232517, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.63989153514168362, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.7568608796813312, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 3.5836558871799027, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 8.8077526749963226, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 27.285841702089190, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 113.55555555555557, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 706.24023437500091, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 8064.1687976651992, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 271267.22222222196, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 123456789.99999890, 1.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test096() +{ + 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(data096) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data096[i].a), Tp(data096[i].b), + Tp(data096[i].c), Tp(data096[i].x)); + const Tp f0 = data096[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)); +} + +// Test data for a=1.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data097[] = { + { 0.28363728383055758, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.30933003169808387, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.33998437757128797, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.37713553224291119, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.42299736538419658, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.48086597727600106, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.55583495759293045, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.65612850114039667, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.79573668772968120, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3184712058058303, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.8576958065941214, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 2.8759509651764228, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 5.1046225531822182, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 11.095238095238095, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 32.797154017857174, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 158.01935680536477, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1815.9523809523814, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 163302.14285714156, 1.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test097() +{ + 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(data097) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data097[i].a), Tp(data097[i].b), + Tp(data097[i].c), Tp(data097[i].x)); + const Tp f0 = data097[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)); +} + +// Test data for a=1.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data098[] = { + { 0.39006633302741794, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.41898885698103294, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.45245557983812590, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.49160548618861633, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.53798419230517980, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.59373881442067344, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.66193391357076115, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.74708402736952129, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.85609281019430605, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.1974451135148187, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.4820886036706347, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.9201183180477521, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2.6569338297733336, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 4.0634920634920650, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 7.3102678571428568, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 17.512574302697733, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 74.206349206349131, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1342.8571428571363, 1.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test098() +{ + 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(data098) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data098[i].a), Tp(data098[i].b), + Tp(data098[i].c), Tp(data098[i].x)); + const Tp f0 = data098[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)); +} + +// Test data for a=1.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data099[] = { + { 0.46726928123633193, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.49687547629934464, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.53045208856322235, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.56884765624999978, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.61316872427983526, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.66488500161969544, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.72598998634501577, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.79925411522633782, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.88863845062192193, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1423563481176653, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3302951388888888, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.5889212827988335, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.9650205761316870, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 2.5555555555555549, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 3.5937500000000013, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 5.7818930041152203, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 12.222222222222220, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 54.999999999999780, 1.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test099() +{ + 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(data099) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data099[i].a), Tp(data099[i].b), + Tp(data099[i].c), Tp(data099[i].x)); + const Tp f0 = data099[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)); +} + +// Test data for a=1.0000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data100[] = { + { 0.52631578947368429, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.55555555555555558, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.58823529411764708, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.62500000000000000, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.66666666666666663, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.71428571428571430, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.76923076923076927, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.83333333333333337, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.90909090909090906, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1111111111111112, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2500000000000000, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.4285714285714286, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.6666666666666663, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2.0000000000000000, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 2.5000000000000004, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 3.3333333333333330, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 5.0000000000000009, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 9.9999999999999929, 1.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test100() +{ + 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(data100) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data100[i].a), Tp(data100[i].b), + Tp(data100[i].c), Tp(data100[i].x)); + const Tp f0 = data100[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)); +} + +// Test data for a=1.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data101[] = { + { 0.058479236576646373, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.065788544763137669, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.075184824937824662, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.087707688693157260, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.10521567442213345, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.13135877960541525, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.17423854066297104, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.25492082527223525, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.44025895219654843, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 3.3698615820910360, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 17.997089220808483, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 153.73298291118951, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 2159.1667587825627, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 55188.105263157879, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 3191209.3921857267, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 646910975.29152656, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1254834626850.2659, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 5.8479532163741414e+17, 1.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test101() +{ + 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(data101) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data101[i].a), Tp(data101[i].b), + Tp(data101[i].c), Tp(data101[i].x)); + const Tp f0 = data101[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)); +} + +// Test data for a=1.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data102[] = { + { 0.15519511120894947, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.17197165701692899, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.19276847315207363, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.21920107206179093, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.25386158960390581, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.30115970686600657, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.36916408142057117, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.47406175901569558, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.65237908266239919, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.8227213362622299, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 4.3716358339791332, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 15.670841312959222, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 94.742651122760179, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1081.7275541795671, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 27809.787731465960, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2329811.1715181042, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1537787532.6780224, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 141562653506999.88, 1.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test102() +{ + 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(data102) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data102[i].a), Tp(data102[i].b), + Tp(data102[i].c), Tp(data102[i].x)); + const Tp f0 = data102[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)); +} + +// Test data for a=1.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data103[] = { + { 0.23253645591196570, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.25484220947068353, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.28181987881113829, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.31508211677735765, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.35706285886959599, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.41160053409238195, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.48508083111181949, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.58885194371375260, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.74482241684585748, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.4700356864367146, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 2.4955144453055143, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 5.3506594845833471, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 16.618413752184221, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 89.310629514963878, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1029.3439900542960, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 35659.847863372350, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 8009309.6233230168, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 145640590027.39731, 1.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test103() +{ + 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(data103) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data103[i].a), Tp(data103[i].b), + Tp(data103[i].c), Tp(data103[i].x)); + const Tp f0 = data103[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)); +} + +// Test data for a=1.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data104[] = { + { 0.29614148314592498, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.32176277356430810, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.35217870475550522, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.38885270445515091, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.43389978380608424, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.49048612522269436, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.56355539635634611, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.66123153239117682, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.79773363961895427, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.3245132157016595, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.9065148749742076, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 3.1328798652457452, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 6.4172532944033476, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 19.071683734222436, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 104.41989641582512, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1510.5743992324240, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 115518.14360562043, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 414930455.29173034, 1.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test104() +{ + 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(data104) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data104[i].a), Tp(data104[i].b), + Tp(data104[i].c), Tp(data104[i].x)); + const Tp f0 = data104[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)); +} + +// Test data for a=1.0000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data105[] = { + { 0.34954259539177696, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.37714038609235123, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.40942091659748725, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.44767109606846428, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.49368984777532254, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.55006638216982318, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.62065830207408912, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.71145554513583786, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.83223839666914623, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.2466748028187731, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.6386752725021749, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 2.3340068725479681, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 3.7848108613132054, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 7.6754638550304133, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 23.344217312927277, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 149.83491198246921, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3936.9253501916060, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 2794143.5036480185, 1.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=1.0000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test105() +{ + 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(data105) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data105[i].a), Tp(data105[i].b), + Tp(data105[i].c), Tp(data105[i].x)); + const Tp f0 = data105[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)); +} + +// Test data for a=2.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data106[] = { + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test106() +{ + 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(data106) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data106[i].a), Tp(data106[i].b), + Tp(data106[i].c), Tp(data106[i].x)); + const Tp f0 = data106[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)); +} + +// Test data for a=2.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data107[] = { + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test107() +{ + 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(data107) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data107[i].a), Tp(data107[i].b), + Tp(data107[i].c), Tp(data107[i].x)); + const Tp f0 = data107[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)); +} + +// Test data for a=2.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data108[] = { + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test108() +{ + 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(data108) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data108[i].a), Tp(data108[i].b), + Tp(data108[i].c), Tp(data108[i].x)); + const Tp f0 = data108[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)); +} + +// Test data for a=2.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data109[] = { + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test109() +{ + 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(data109) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data109[i].a), Tp(data109[i].b), + Tp(data109[i].c), Tp(data109[i].x)); + const Tp f0 = data109[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)); +} + +// Test data for a=2.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data110[] = { + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 2.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test110() +{ + 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(data110) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data110[i].a), Tp(data110[i].b), + Tp(data110[i].c), Tp(data110[i].x)); + const Tp f0 = data110[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)); +} + +// Test data for a=2.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data111[] = { + { 0.72547625011001171, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.74535599249992990, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.76696498884737041, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.79056941504209477, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.81649658092772603, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.84515425472851657, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.87705801930702920, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.91287092917527690, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.95346258924559224, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0540925533894598, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.1180339887498949, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.1952286093343938, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.2909944487358056, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.4142135623730949, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.5811388300841900, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.8257418583505536, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.2360679774997898, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 3.1622776601683782, 2.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test111() +{ + 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(data111) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data111[i].a), Tp(data111[i].b), + Tp(data111[i].c), Tp(data111[i].x)); + const Tp f0 = data111[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)); +} + +// Test data for a=2.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data112[] = { + { 0.83664260086443798, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.85046584300227146, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.86509574979651593, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.88062082573041867, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.89714464248521586, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.91478946588967558, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.93370105322348573, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.95405511057700887, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.97606616007978142, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0261916902334731, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0550723519434702, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0872106588188091, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.1233801699379020, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.1646752981725688, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.2127272514219511, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.2701518651068637, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.3416407864998725, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.4374795179111102, 2.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test112() +{ + 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(data112) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data112[i].a), Tp(data112[i].b), + Tp(data112[i].c), Tp(data112[i].x)); + const Tp f0 = data112[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)); +} + +// Test data for a=2.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data113[] = { + { 0.88195381730235833, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.89265078469555093, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.90382937908303707, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.91553161389880577, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.92780530349281576, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.94070521140346042, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.95429450630523349, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.96864663325785849, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.98384775588541795, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0172258496884334, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0356742479163459, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0555293036908924, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0770231491562379, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.1004557416484888, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.1262270515731978, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.1548932919125086, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.1872757758134724, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.2247091713458949, 2.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test113() +{ + 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(data113) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data113[i].a), Tp(data113[i].b), + Tp(data113[i].c), Tp(data113[i].x)); + const Tp f0 = data113[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)); +} + +// Test data for a=2.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data114[] = { + { 0.90716919697107301, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.91592299407142519, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.92500027075874236, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.93442464185467167, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.94422248683737009, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.95442341810133347, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.96506085725516400, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.97617275213704069, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.98780247986309799, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0128233505813447, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0263406246541855, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0406326381700366, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0557966239802845, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0719515075786321, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0892457392422055, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.1078695188000958, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.1280752258974340, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.1502152002706476, 2.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test114() +{ + 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(data114) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data114[i].a), Tp(data114[i].b), + Tp(data114[i].c), Tp(data114[i].x)); + const Tp f0 = data114[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)); +} + +// Test data for a=2.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data115[] = { + { 0.92336416053263093, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.93078397248364519, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.93843714333600226, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.94633837784068076, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.95450388104967909, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.96295158125742764, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.97170139827854296, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.98077556918512687, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.99019904777750845, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0102104261941198, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0208669540935695, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0320118665407505, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0436944599504387, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0559728828278145, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0689166967761712, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0826105758119842, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0971599106346146, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.1126998828023964, 2.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test115() +{ + 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(data115) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data115[i].a), Tp(data115[i].b), + Tp(data115[i].c), Tp(data115[i].x)); + const Tp f0 = data115[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)); +} + +// Test data for a=2.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data116[] = { + { 0.52631578947368429, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.55555555555555558, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.58823529411764708, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.62500000000000000, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.66666666666666663, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.71428571428571430, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.76923076923076927, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.83333333333333337, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.90909090909090906, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.1111111111111112, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.2500000000000000, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.4285714285714286, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.6666666666666663, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 2.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 2.5000000000000004, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 3.3333333333333330, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 5.0000000000000009, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9.9999999999999929, 2.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test116() +{ + 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(data116) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data116[i].a), Tp(data116[i].b), + Tp(data116[i].c), Tp(data116[i].x)); + const Tp f0 = data116[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)); +} + +// Test data for a=2.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data117[] = { + { 0.70351947549341520, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.72637503722092711, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.75099661564391251, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.77761647796730871, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.80651221621216451, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.83801894346580275, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.87254582050258467, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.91059888544083678, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.95281329145592386, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0532154477379738, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.1138692114741471, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.1838976095305187, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.2660586631630237, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.3644676665613118, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.4856585347316102, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.6409590443536872, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.8528798927325769, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 2.1789423102929644, 2.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test117() +{ + 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(data117) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data117[i].a), Tp(data117[i].b), + Tp(data117[i].c), Tp(data117[i].x)); + const Tp f0 = data117[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)); +} + +// Test data for a=2.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data118[] = { + { 0.78068027379106253, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.79924541976981278, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.81891305585650942, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.83979799626213270, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.86203315303160166, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.88577352485361693, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.91120135738402208, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.93853291956703588, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.96802755388922956, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0348375559194773, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0730246119544820, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.1151788396279341, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.1621066403893472, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.2148922218710421, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.2750496810838674, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.3448048570872917, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.4276833109859521, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.5299976259379788, 2.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test118() +{ + 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(data118) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data118[i].a), Tp(data118[i].b), + Tp(data118[i].c), Tp(data118[i].x)); + const Tp f0 = data118[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)); +} + +// Test data for a=2.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data119[] = { + { 0.82510759951857582, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.84072786892782092, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.85710884896562356, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.87431674418118333, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.89242659229727017, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.91152392685930339, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.93170685950993570, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.95308871926790661, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.97580144325325802, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0258682619030324, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0536269616706000, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0835447330793833, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.1159538758396654, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.1512736659291880, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.1900463690116090, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.2329961591622411, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.2811334345669059, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.3359629014132051, 2.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test119() +{ + 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(data119) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data119[i].a), Tp(data119[i].b), + Tp(data119[i].c), Tp(data119[i].x)); + const Tp f0 = data119[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)); +} + +// Test data for a=2.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data120[] = { + { 0.85426123653345876, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.86774543390930370, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.88178859537254239, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.89643269097060951, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.91172456687216763, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.92771674975966134, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.94446842993888647, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.96204667481937678, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.98052794339012128, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0205643671068179, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0423395201078882, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0654651277885334, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0901078068101382, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.1164691415928940, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.1447972335326551, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.1754040384534161, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.2086928679893112, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.2452055640510711, 2.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test120() +{ + 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(data120) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data120[i].a), Tp(data120[i].b), + Tp(data120[i].c), Tp(data120[i].x)); + const Tp f0 = data120[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)); +} + +// Test data for a=2.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data121[] = { + { 0.27700831024930750, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.30864197530864196, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.34602076124567477, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.39062499999999994, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.44444444444444442, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.51020408163265307, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.59171597633136097, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.69444444444444453, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.82644628099173545, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.2345679012345681, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.5624999999999998, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 2.0408163265306127, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 2.7777777777777768, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 4.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 6.2500000000000036, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 11.111111111111109, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 25.000000000000007, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 99.999999999999872, 2.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test121() +{ + 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(data121) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data121[i].a), Tp(data121[i].b), + Tp(data121[i].c), Tp(data121[i].x)); + const Tp f0 = data121[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)); +} + +// Test data for a=2.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data122[] = { + { 0.50515448477320868, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.53674994210078020, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.57194655162437447, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.61137322330312327, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.65581297297972574, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.70625323977290932, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.76395739449542643, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.83056871002513311, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.90826553449323655, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.1098784992198341, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.2437942741831700, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.4105343768544543, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.6238435648986016, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.9065970003160624, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 2.3001951284393627, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2.8891774744673464, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 3.8827206436045336, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 6.0316345867773542, 2.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test122() +{ + 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(data122) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data122[i].a), Tp(data122[i].b), + Tp(data122[i].c), Tp(data122[i].x)); + const Tp f0 = data122[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)); +} + +// Test data for a=2.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data123[] = { + { 0.61824560969673303, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.64645665839161048, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.67712272792612083, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.71058076074636822, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.74723387423852861, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.78756892188863126, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.83218012557592713, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.88180144818204143, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.93735184459468934, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0712594799044883, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.1531330932162096, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.2483404191094898, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.3606934909972501, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.4957544469027071, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.6620777107871287, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.8738132387064506, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 2.1570670242247409, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 2.5700735959225494, 2.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test123() +{ + 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(data123) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data123[i].a), Tp(data123[i].b), + Tp(data123[i].c), Tp(data123[i].x)); + const Tp f0 = data123[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)); +} + +// Test data for a=2.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data124[] = { + { 0.68776713859043437, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.71280582849489826, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.73962983054724929, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.76844343025262085, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.79948476671182911, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.83303347721461229, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.86942060391338782, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.90904161711581655, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.95237381468647742, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0526413941912305, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.1112045278881502, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.1768500306393046, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.2510971588297888, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.3359896747789315, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.4343740183432725, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.5504011881337365, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.6905307012604318, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.8658920279264424, 2.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test124() +{ + 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(data124) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data124[i].a), Tp(data124[i].b), + Tp(data124[i].c), Tp(data124[i].x)); + const Tp f0 = data124[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)); +} + +// Test data for a=2.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data125[] = { + { 0.73530262886958830, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.75768898977673638, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.78143483544640069, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.80667428603297209, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.83356078772438325, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.86227093001346145, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.89300925500556994, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.92601438873425990, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.96156696230910810, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0417127776179342, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0871896789480930, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.1370264514689949, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.1919677804049154, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.2529628761065934, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.3212511796458866, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.3985017309668506, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.4870567523847895, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.5904049523738040, 2.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test125() +{ + 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(data125) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data125[i].a), Tp(data125[i].b), + Tp(data125[i].c), Tp(data125[i].x)); + const Tp f0 = data125[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)); +} + +// Test data for a=2.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data126[] = { + { 0.040386107340619266, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.052922149401344633, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.070429627772374270, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.095367431640624972, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.13168724279835387, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.18593443208187066, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.26932907434290437, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.40187757201646096, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.62092132305915493, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.6935087808430296, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 3.0517578124999991, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 5.9499018266198629, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 12.860082304526737, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 32.000000000000000, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 97.656250000000114, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 411.52263374485580, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 3124.9999999999991, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 99999.999999999665, 2.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test126() +{ + 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(data126) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data126[i].a), Tp(data126[i].b), + Tp(data126[i].c), Tp(data126[i].x)); + const Tp f0 = data126[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)); +} + +// Test data for a=2.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data127[] = { + { 0.21140107887447140, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.24005486968449935, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.27478119275391821, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.31738281249999994, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.37037037037037035, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.43731778425655982, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.52344105598543444, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.63657407407407429, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.78888054094665638, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3031550068587108, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.7578125000000002, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 2.4781341107871717, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 3.7037037037037037, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 5.9999999999999982, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 10.937500000000005, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 24.074074074074076, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 74.999999999999957, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 549.99999999999670, 2.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test127() +{ + 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(data127) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data127[i].a), Tp(data127[i].b), + Tp(data127[i].c), Tp(data127[i].x)); + const Tp f0 = data127[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)); +} + +// Test data for a=2.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data128[] = { + { 0.33250915203252107, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.36566851047721960, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.40414812182437942, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.44916943268118470, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.50233081077479569, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.56575808728873322, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.64233106844971422, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.73603371116919514, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.85251256240112439, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.1909065696197674, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.4447095285569311, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.7935243137840653, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2.2937035820494454, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 3.0524711083016687, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 4.2976512669354259, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 6.5977107563194677, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 11.793747206577530, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 29.997625937982058, 2.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test128() +{ + 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(data128) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data128[i].a), Tp(data128[i].b), + Tp(data128[i].c), Tp(data128[i].x)); + const Tp f0 = data128[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)); +} + +// Test data for a=2.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data129[] = { + { 0.42108197362250305, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.45503172013983051, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.49345609813624303, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.53720880551221295, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.58736431524847466, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.64529222467897962, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.71276337354393904, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.79210466220795306, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.88643063455510596, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1387832139040652, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3114025920844752, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.5307655016768162, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.8170727950333345, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 2.2037865486700836, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 2.7506766056439380, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 3.5764534935716972, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 4.9587762302155403, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 7.7740847924166800, 2.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test129() +{ + 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(data129) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data129[i].a), Tp(data129[i].b), + Tp(data129[i].c), Tp(data129[i].x)); + const Tp f0 = data129[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)); +} + +// Test data for a=2.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data130[] = { + { 0.48860241312958425, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.52193382517068487, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.55902375003954219, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.60049055150230346, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.64709127927203480, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.69976233335368998, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.75967529501081055, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.82831498895254407, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.90759090169653933, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1088712278667465, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2387445478440853, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.3959812720437546, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.5897930661091164, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.8340789380307454, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 2.1509548085970764, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2.5782406951207504, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3.1877847194242737, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 4.1421596631676900, 2.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test130() +{ + 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(data130) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data130[i].a), Tp(data130[i].b), + Tp(data130[i].c), Tp(data130[i].x)); + const Tp f0 = data130[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)); +} + +// Test data for a=2.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data131[] = { + { 0.0016310376661280216, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.0028007538972582421, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.0049603324681551939, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.0090949470177292789, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.017341529915832606, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.034571613033607777, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.072538150286405714, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.16150558288984579, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.38554328942953148, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 2.8679719907924444, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 9.3132257461547816, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 35.401331746414378, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 165.38171687920172, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1024.0000000000000, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 9536.7431640625200, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 169350.87808430271, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 9765624.9999999944, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9999999999.9999332, 2.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test131() +{ + 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(data131) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data131[i].a), Tp(data131[i].b), + Tp(data131[i].c), Tp(data131[i].x)); + const Tp f0 = data131[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)); +} + +// Test data for a=2.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data132[] = { + { 0.071191280690193509, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.085646504654238079, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.10478215656371073, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.13074816337653575, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.16701141666848116, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.21939323375313971, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.29813515331786627, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.42225974638874386, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.62942145962174867, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.7218685262373197, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 3.2855760483514689, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 7.1616652508907093, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 18.612326808485907, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 61.476190476190474, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 286.27580915178623, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2274.9441142102296, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 47229.761904761865, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 9961460.7142856438, 2.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test132() +{ + 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(data132) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data132[i].a), Tp(data132[i].b), + Tp(data132[i].c), Tp(data132[i].x)); + const Tp f0 = data132[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)); +} + +// Test data for a=2.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data133[] = { + { 0.14747230019381052, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.17073600100690603, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.19982795745135354, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.23681776864188067, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.28475624360398022, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.34827500743063144, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.43464829159684681, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.55576053438064787, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.73195020913445485, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.4310223867822929, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 2.1742563399057540, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 3.5769231236256043, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 6.5620441134844363, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 14.063492063492063, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 38.085937500000036, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 150.92973632068282, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1212.3015873015852, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 55107.142857142389, 2.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test133() +{ + 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(data133) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data133[i].a), Tp(data133[i].b), + Tp(data133[i].c), Tp(data133[i].x)); + const Tp f0 = data133[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)); +} + +// Test data for a=2.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data134[] = { + { 0.21658059714090588, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.24513539602702844, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.27967018274845046, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.32196044921874994, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.37448559670781900, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.44078856032208796, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.52606701446027815, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.63818158436214001, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.78944971882612769, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.3044251384443430, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.7659505208333335, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 2.5093710953769270, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 3.8065843621399158, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 6.3333333333333313, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 12.109375000000004, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 29.115226337448540, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 108.33333333333330, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1224.9999999999923, 2.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test134() +{ + 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(data134) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data134[i].a), Tp(data134[i].b), + Tp(data134[i].c), Tp(data134[i].x)); + const Tp f0 = data134[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)); +} + +// Test data for a=2.0000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data135[] = { + { 0.27700831024930750, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.30864197530864196, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.34602076124567477, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.39062499999999994, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.44444444444444442, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.51020408163265307, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.59171597633136097, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.69444444444444453, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.82644628099173545, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.2345679012345681, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.5624999999999998, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 2.0408163265306127, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 2.7777777777777768, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 4.0000000000000000, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 6.2500000000000036, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 11.111111111111109, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 25.000000000000007, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 99.999999999999872, 2.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test135() +{ + 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(data135) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data135[i].a), Tp(data135[i].b), + Tp(data135[i].c), Tp(data135[i].x)); + const Tp f0 = data135[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)); +} + +// Test data for a=2.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data136[] = { + { 2.6602838683283435e-06, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 7.8442223930072316e-06, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 2.4604898194634598e-05, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 8.2718061255302686e-05, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.00030072865982171723, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.0011951964277455193, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.0052617832469731814, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.026084053304588847, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.14864362802414346, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 8.2252633399699757, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 86.736173798840269, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1253.2542894196865, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 27351.112277912434, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1048576.0000000000, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 90949470.177293226, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 28679719907.924358, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 95367431640624.906, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9.9999999999998657e+19, 2.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test136() +{ + 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(data136) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data136[i].a), Tp(data136[i].b), + Tp(data136[i].c), Tp(data136[i].x)); + const Tp f0 = data136[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)); +} + +// Test data for a=2.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data137[] = { + { 0.018828092583720951, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.023381944060455316, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.029789623984280793, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.039191021482500497, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.053727813036721514, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.077762010061669024, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.12110505620123302, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.20870149809080590, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.41429234328785769, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 3.1308087404153113, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 13.586180626453050, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 87.117304082784415, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 889.26474381242826, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 16231.913312693494, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 653537.51168945129, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 87756230.793848589, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 101493977171.74945, 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 21375960679556916., 2.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test137() +{ + 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(data137) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data137[i].a), Tp(data137[i].b), + Tp(data137[i].c), Tp(data137[i].x)); + const Tp f0 = data137[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(1.0000000000000008e-12)); +} + +// Test data for a=2.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data138[] = { + { 0.049200410661854252, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.059460876757152226, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.073244762686653350, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.092334626017932922, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.11976760350696837, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.16102414609169383, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.22670456785796222, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.33912903252727361, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.55049794600858060, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 2.1254722872032232, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 5.6261213886736172, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 20.137315891130996, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 108.04381584643853, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 992.41692466460245, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 19055.363816004465, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1105471.9504312086, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 448521363.90608919, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 19078917293639.004, 2.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test138() +{ + 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(data138) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data138[i].a), Tp(data138[i].b), + Tp(data138[i].c), Tp(data138[i].x)); + const Tp f0 = data138[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)); +} + +// Test data for a=2.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data139[] = { + { 0.083753547015334745, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.099238444687035701, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.11938294012867758, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.14622683905023326, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.18303556733713025, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.23527764069382409, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.31261681740827085, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.43327581880538862, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.63445840637296658, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.7438842395813297, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 3.5070840938209269, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 8.6573372006089713, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 28.779342118408906, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 147.50178613955714, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1427.1686016136398, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 36780.643714655642, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 5313869.6058585485, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 46057280607.381966, 2.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test139() +{ + 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(data139) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data139[i].a), Tp(data139[i].b), + Tp(data139[i].c), Tp(data139[i].x)); + const Tp f0 = data139[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)); +} + +// Test data for a=2.0000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data140[] = { + { 0.11920045035073683, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.13907946814302774, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.16431439792559688, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.19698796016987008, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.24028510928790570, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.29926031296483119, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.38229327814229169, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.50402047283093110, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.69167261179586503, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.5503152253394308, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 2.6469548193635797, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 5.1882631330566813, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 12.476792759124516, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 41.026391565091259, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 220.92584715988204, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2677.0834450236207, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 141774.31260689779, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 254267148.83196995, 2.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=2.0000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test140() +{ + 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(data140) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data140[i].a), Tp(data140[i].b), + Tp(data140[i].c), Tp(data140[i].x)); + const Tp f0 = data140[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)); +} + +// Test data for a=5.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data141[] = { + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test141() +{ + 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(data141) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data141[i].a), Tp(data141[i].b), + Tp(data141[i].c), Tp(data141[i].x)); + const Tp f0 = data141[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)); +} + +// Test data for a=5.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data142[] = { + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test142() +{ + 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(data142) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data142[i].a), Tp(data142[i].b), + Tp(data142[i].c), Tp(data142[i].x)); + const Tp f0 = data142[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)); +} + +// Test data for a=5.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data143[] = { + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test143() +{ + 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(data143) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data143[i].a), Tp(data143[i].b), + Tp(data143[i].c), Tp(data143[i].x)); + const Tp f0 = data143[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)); +} + +// Test data for a=5.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data144[] = { + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test144() +{ + 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(data144) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data144[i].a), Tp(data144[i].b), + Tp(data144[i].c), Tp(data144[i].x)); + const Tp f0 = data144[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)); +} + +// Test data for a=5.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data145[] = { + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 5.0000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test145() +{ + 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(data145) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data145[i].a), Tp(data145[i].b), + Tp(data145[i].c), Tp(data145[i].x)); + const Tp f0 = data145[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)); +} + +// Test data for a=5.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data146[] = { + { 0.52275983209457511, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.54700336898142965, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.57468955512601971, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.60665490543315015, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.64403057859056123, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.68838183648623719, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.74193265039311085, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.80794095908995300, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.89135275749639320, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.1469266219310688, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.3552340708357489, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.6690840478838305, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 2.1815415453174483, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 3.1156892546032235, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 5.1109077417760416, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 10.560352936466296, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 33.541019662496815, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 300.66343065819501, 5.0000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test146() +{ + 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(data146) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data146[i].a), Tp(data146[i].b), + Tp(data146[i].c), Tp(data146[i].x)); + const Tp f0 = data146[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)); +} + +// Test data for a=5.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data147[] = { + { 0.68252041951139264, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.70394732624993395, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.72748884971552041, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.75351147371199689, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.78247589005573748, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.81497017420249818, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.85175826875009564, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.89385278481745867, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.94262778709507411, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0687327277420910, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.1529725508983291, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.2592587134058799, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.3985773194637892, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.5909902576697317, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.8776023607249752, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2.3582499003694646, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 3.3541019662496838, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 6.7198400278577859, 5.0000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test147() +{ + 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(data147) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data147[i].a), Tp(data147[i].b), + Tp(data147[i].c), Tp(data147[i].x)); + const Tp f0 = data147[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)); +} + +// Test data for a=5.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data148[] = { + { 0.75755211927082589, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.77603550233010998, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.79596241913438492, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.81753360792105201, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.84099165409805521, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.86663303852180873, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.89482475828629970, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.92602774279590350, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.96083064727087386, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0445570841313008, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0959004638926031, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.1560106261370562, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.2278121770678145, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.3158640214709998, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.4278095344155000, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.5778700502946612, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.7972173289196469, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 2.1789970569269732, 5.0000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test148() +{ + 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(data148) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data148[i].a), Tp(data148[i].b), + Tp(data148[i].c), Tp(data148[i].x)); + const Tp f0 = data148[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)); +} + +// Test data for a=5.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data149[] = { + { 0.80270093579329471, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.81884974572462788, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.83605266330015271, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.85443340762795972, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.87413762182790655, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.89533826626907331, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.91824276674115268, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.94310265050720576, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.97022678857609712, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0329098673199812, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0695865684573389, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.1108642103944570, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.1578795055970506, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.2122394794169442, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.2763274721556934, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.3539179650251021, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.4515986118197148, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.5829284571614219, 5.0000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test149() +{ + 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(data149) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data149[i].a), Tp(data149[i].b), + Tp(data149[i].c), Tp(data149[i].x)); + const Tp f0 = data149[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)); +} + +// Test data for a=5.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data150[] = { + { 0.83322694172301959, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.84753931604765664, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.86265784532195022, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.87866479300707079, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.89565516540263501, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.91373946207610557, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.93304721345881891, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.95373159512905148, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.97597554238828121, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0260752851887982, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0545371197996178, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0858099017045830, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.1204416568688709, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.1591587835964847, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.2029564720303347, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.2532588722007874, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.3122319926925459, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.3834948587364100, 5.0000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test150() +{ + 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(data150) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data150[i].a), Tp(data150[i].b), + Tp(data150[i].c), Tp(data150[i].x)); + const Tp f0 = data150[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)); +} + +// Test data for a=5.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data151[] = { + { 0.25646288779245091, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.28273129096174382, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.31438201170962976, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.35308837890625017, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.40123456790123463, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.46230737192836319, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.54156016946185359, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.64718364197530875, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.79246636158732342, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.3103947568968148, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.8017578125000004, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 2.6374427321949185, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 4.1975308641975282, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 7.4999999999999964, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 15.859375000000012, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 43.734567901234513, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 194.99999999999994, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 2777.4999999999832, 5.0000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test151() +{ + 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(data151) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data151[i].a), Tp(data151[i].b), + Tp(data151[i].c), Tp(data151[i].x)); + const Tp f0 = data151[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)); +} + +// Test data for a=5.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data152[] = { + { 0.46398891966759004, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.49382716049382713, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.52768166089965396, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.56640624999999978, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.61111111111111116, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.66326530612244894, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.72485207100591698, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.79861111111111094, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.88842975206611552, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.1419753086419753, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.3281249999999998, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.5816326530612239, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.9444444444444444, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 2.5000000000000000, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 3.4374999999999996, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 5.2777777777777715, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 9.9999999999999947, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 32.499999999999837, 5.0000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test152() +{ + 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(data152) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data152[i].a), Tp(data152[i].b), + Tp(data152[i].c), Tp(data152[i].x)); + const Tp f0 = data152[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)); +} + +// Test data for a=5.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data153[] = { + { 0.57476744883397501, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.60302731682513933, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.63425708719096396, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.66895764182970419, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.70775063063963428, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.75141762103495924, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.80095569442603298, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.85765823887436754, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.92323549576335540, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0911622464839472, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.2013226178607666, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.3373332072682687, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.5099074378209716, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.7368822229245819, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2.0505871832661429, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 2.5172389775867967, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 3.3015631983556144, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 5.0005935155044519, 5.0000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test153() +{ + 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(data153) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data153[i].a), Tp(data153[i].b), + Tp(data153[i].c), Tp(data153[i].x)); + const Tp f0 = data153[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)); +} + +// Test data for a=5.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data154[] = { + { 0.64582752605387961, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.67184161997264169, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.70012779922368040, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.73100784656910256, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.76486919089091077, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.80218301124334579, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.84352883533234446, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.88962858902212572, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.94139473468584123, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0669812691939897, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.1443996012177726, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.2350966976721314, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.3431264370409088, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.4745266814162399, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.6388137104840066, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.8522074849776518, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 2.1458016978417458, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 2.5927464669826339, 5.0000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test154() +{ + 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(data154) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data154[i].a), Tp(data154[i].b), + Tp(data154[i].c), Tp(data154[i].x)); + const Tp f0 = data154[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)); +} + +// Test data for a=5.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data155[] = { + { 0.69583236336670629, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.71968920666899694, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.74533885416044232, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.77300145361503014, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.80293630810919514, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.83545132638592035, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.87091544744412508, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.90977522877919847, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.95257738192069130, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0528968282789379, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.1123617169062123, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.1798254572896132, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.2572069000522696, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.3471600884974377, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.4535032279573519, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.5820245752814948, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.7421756366906538, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.9513145531098233, 5.0000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test155() +{ + 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(data155) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data155[i].a), Tp(data155[i].b), + Tp(data155[i].c), Tp(data155[i].x)); + const Tp f0 = data155[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)); +} + +// Test data for a=5.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data156[] = { + { 0.040386107340619266, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.052922149401344633, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.070429627772374270, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.095367431640624972, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.13168724279835387, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.18593443208187066, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.26932907434290437, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.40187757201646096, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.62092132305915493, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.6935087808430296, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 3.0517578124999991, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 5.9499018266198629, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 12.860082304526737, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 32.000000000000000, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 97.656250000000114, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 411.52263374485580, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 3124.9999999999991, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 99999.999999999665, 5.0000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test156() +{ + 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(data156) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data156[i].a), Tp(data156[i].b), + Tp(data156[i].c), Tp(data156[i].x)); + const Tp f0 = data156[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)); +} + +// Test data for a=5.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data157[] = { + { 0.21140107887447140, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.24005486968449935, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.27478119275391821, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.31738281249999994, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.37037037037037035, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.43731778425655982, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.52344105598543444, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.63657407407407429, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.78888054094665638, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3031550068587108, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.7578125000000002, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 2.4781341107871717, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 3.7037037037037037, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 5.9999999999999982, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 10.937500000000005, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 24.074074074074076, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 74.999999999999957, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 549.99999999999670, 5.0000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test157() +{ + 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(data157) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data157[i].a), Tp(data157[i].b), + Tp(data157[i].c), Tp(data157[i].x)); + const Tp f0 = data157[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)); +} + +// Test data for a=5.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data158[] = { + { 0.33250915203252107, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.36566851047721960, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.40414812182437942, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.44916943268118470, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.50233081077479569, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.56575808728873322, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.64233106844971422, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.73603371116919514, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.85251256240112439, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.1909065696197674, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.4447095285569311, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.7935243137840653, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2.2937035820494454, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 3.0524711083016687, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 4.2976512669354259, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 6.5977107563194677, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 11.793747206577530, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 29.997625937982058, 5.0000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test158() +{ + 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(data158) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data158[i].a), Tp(data158[i].b), + Tp(data158[i].c), Tp(data158[i].x)); + const Tp f0 = data158[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)); +} + +// Test data for a=5.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data159[] = { + { 0.42108197362250305, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.45503172013983051, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.49345609813624303, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.53720880551221295, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.58736431524847466, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.64529222467897962, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.71276337354393904, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.79210466220795306, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.88643063455510596, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1387832139040652, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3114025920844752, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.5307655016768162, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.8170727950333345, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 2.2037865486700836, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 2.7506766056439380, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 3.5764534935716972, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 4.9587762302155403, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 7.7740847924166800, 5.0000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test159() +{ + 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(data159) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data159[i].a), Tp(data159[i].b), + Tp(data159[i].c), Tp(data159[i].x)); + const Tp f0 = data159[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)); +} + +// Test data for a=5.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data160[] = { + { 0.48860241312958425, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.52193382517068487, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.55902375003954219, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.60049055150230346, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.64709127927203480, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.69976233335368998, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.75967529501081055, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.82831498895254407, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.90759090169653933, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1088712278667465, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2387445478440853, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.3959812720437546, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.5897930661091164, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.8340789380307454, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 2.1509548085970764, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2.5782406951207504, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3.1877847194242737, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 4.1421596631676900, 5.0000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test160() +{ + 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(data160) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data160[i].a), Tp(data160[i].b), + Tp(data160[i].c), Tp(data160[i].x)); + const Tp f0 = data160[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)); +} + +// Test data for a=5.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data161[] = { + { -0.0047236848832209691, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -0.0073321496427103212, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -0.010977302557845672, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -0.015692785382270907, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { -0.020728547477518677, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { -0.022767481479412769, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -0.010634636868114139, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.050699832580781923, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.27045765367659280, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 3.4387055868901171, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 12.052059173583981, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 45.565319600798020, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 196.23532998018572, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1032.0000000000002, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 7376.0986328125073, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 86964.639536655843, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2596875.0000000009, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 766224999.99999273, 5.0000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test161() +{ + 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(data161) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data161[i].a), Tp(data161[i].b), + Tp(data161[i].c), Tp(data161[i].x)); + const Tp f0 = data161[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.5000000000000015e-12)); +} + +// Test data for a=5.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data162[] = { + { 0.016473280625778897, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.023520955289486407, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.034179084066004943, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.050663948059082052, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.076817558299039843, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.11952927776691676, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.19163799520552813, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.31815307784636504, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.55036208180243285, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.9287183337378946, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 4.0054321289062473, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 9.1373492337376394, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 23.576817558299005, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 71.999999999999972, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 280.76171875000023, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1611.7969821673514, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 18749.999999999996, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1224999.9999999879, 5.0000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test162() +{ + 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(data162) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data162[i].a), Tp(data162[i].b), + Tp(data162[i].c), Tp(data162[i].x)); + const Tp f0 = data162[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)); +} + +// Test data for a=5.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data163[] = { + { 0.067462409738203513, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.084813629887172517, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.10799223563666410, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.13947766136095369, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.18305927261494304, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.24468431546783445, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.33397274564972956, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.46703323887436765, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.67194346197695642, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.5503148146900136, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 2.5278200136940998, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 4.3933515329658954, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 8.3000308946110888, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 17.570215556257921, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 43.847462183266167, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 141.86909082943853, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 736.63489653168926, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 12117.500593515439, 5.0000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test163() +{ + 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(data163) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data163[i].a), Tp(data163[i].b), + Tp(data163[i].c), Tp(data163[i].x)); + const Tp f0 = data163[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)); +} + +// Test data for a=5.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data164[] = { + { 0.12409443806004232, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.14886910375100412, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.18023328876836334, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.22044046981094714, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.27271160690708801, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.34174821195025840, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.43457788826160237, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.56199385898404552, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.74109892753745221, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.3869229400096228, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.9890168748121255, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 2.9741205609307424, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 4.6924751038237300, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 7.9555939380658254, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 14.933102063314404, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 32.780461638447491, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 94.848124287773530, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 523.16034401517425, 5.0000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test164() +{ + 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(data164) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data164[i].a), Tp(data164[i].b), + Tp(data164[i].c), Tp(data164[i].x)); + const Tp f0 = data164[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)); +} + +// Test data for a=5.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data165[] = { + { 0.17885405888526873, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.20861302518993380, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.24504033307244924, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.29007236051133478, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.34635542859732726, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.41756858504598376, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.50892615622124382, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.62798173270509761, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.78595487360378424, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.2972517637384813, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.7224028197396388, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 2.3527690438263305, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 3.3305218060101116, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 4.9383884076775466, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 7.8007604680775229, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 13.518663719271885, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 27.285345906502567, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 75.572415101501988, 5.0000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test165() +{ + 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(data165) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data165[i].a), Tp(data165[i].b), + Tp(data165[i].c), Tp(data165[i].x)); + const Tp f0 = data165[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)); +} + +// Test data for a=5.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data166[] = { + { 0.00063586451658060152, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.0010334743461762443, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.0015326246054669515, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.0019007018181583387, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.0012845577715431577, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { -0.0027213806178058826, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -0.015121744574954068, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { -0.036637840562974443, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.019117849062621491, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 9.8116901852350615, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 84.255589172244044, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 773.87517619421294, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 8556.9725363053585, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 129023.99999999996, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 3174543.3807373112, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 175133896.95814410, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 43564453125.000061, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 446859999999993.50, 5.0000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test166() +{ + 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(data166) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data166[i].a), Tp(data166[i].b), + Tp(data166[i].c), Tp(data166[i].x)); + const Tp f0 = data166[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(1.0000000000000006e-11)); +} + +// Test data for a=5.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data167[] = { + { -0.00030045430691819899, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { -0.00031119487747328581, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { -0.00014589213141649274, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.00056843418860809121, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.0028902549859721725, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.0098776037238877470, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.030689217428863914, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.094211590019076599, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.29791981455918376, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 3.6646308771236793, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 15.133991837501521, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 73.331330046144089, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 441.01791167787133, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 3583.9999999999991, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 45299.530029296984, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1157231.0002427341, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 107421875.00000016, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 234999999999.99734, 5.0000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test167() +{ + 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(data167) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data167[i].a), Tp(data167[i].b), + Tp(data167[i].c), Tp(data167[i].x)); + const Tp f0 = data167[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.5000000000000014e-11)); +} + +// Test data for a=5.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data168[] = { + { 0.0058530497315411210, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.0088526869356855692, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.013770987983443108, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.022108932690960800, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.036786236450921578, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.063750669040426422, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.11577228680714464, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.22197573416125735, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.45361312968415268, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 2.4162889363082747, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 6.5381564791240399, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 20.415771011498428, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 76.870682056629221, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 373.58730158730162, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2626.2555803571477, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 33060.960671081048, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1203521.8253968258, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 584564285.71427989, 5.0000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test168() +{ + 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(data168) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data168[i].a), Tp(data168[i].b), + Tp(data168[i].c), Tp(data168[i].x)); + const Tp f0 = data168[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.5000000000000015e-12)); +} + +// Test data for a=5.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data169[] = { + { 0.020248990107069400, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.027876687750502421, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.039154648888447781, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.056251883506774923, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.082914189910074432, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.12585357817786477, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.19761423206224929, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.32280443863359243, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.55250024062839465, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.9374297986599267, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 4.0849049886067696, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 9.5926988633258983, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 25.958314281359531, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 85.333333333333300, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 372.31445312500028, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 2545.3436976070675, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 39583.333333333343, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 4599999.9999999627, 5.0000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test169() +{ + 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(data169) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data169[i].a), Tp(data169[i].b), + Tp(data169[i].c), Tp(data169[i].x)); + const Tp f0 = data169[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)); +} + +// Test data for a=5.0000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data170[] = { + { 0.040386107340619266, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.052922149401344633, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.070429627772374270, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.095367431640624972, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.13168724279835387, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.18593443208187066, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.26932907434290437, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.40187757201646096, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.62092132305915493, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.6935087808430296, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 3.0517578124999991, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 5.9499018266198629, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 12.860082304526737, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 32.000000000000000, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 97.656250000000114, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 411.52263374485580, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3124.9999999999991, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 99999.999999999665, 5.0000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test170() +{ + 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(data170) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data170[i].a), Tp(data170[i].b), + Tp(data170[i].c), Tp(data170[i].x)); + const Tp f0 = data170[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)); +} + +// Test data for a=5.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data171[] = { + { -1.8650300348791041e-05, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -3.6488008415183135e-05, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -6.4614776410999025e-05, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -8.4495207102575916e-05, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 2.2276197023819217e-05, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.00070736115111467578, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.0027829732057272809, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.0013283545664373570, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { -0.041767631015048733, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 61.311496556100003, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 2397.4420539085681, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 103687.60998586559, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 6247196.6451068865, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 656408576.00000000, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 165334768098.54715, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 175097125520816.81, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.6818275451660257e+18, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 2.9794599999999321e+25, 5.0000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test171() +{ + 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(data171) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data171[i].a), Tp(data171[i].b), + Tp(data171[i].c), Tp(data171[i].x)); + const Tp f0 = data171[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.0000000000000034e-10)); +} + +// Test data for a=5.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data172[] = { + { -3.6403884515183385e-06, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { -9.5873829247725586e-06, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { -2.6052245147354694e-05, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { -7.2378303598294010e-05, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { -0.00020048577321454082, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -0.00051222704046236022, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { -0.00080950511491911315, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.0043473422174314449, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.081078342558623825, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 12.794854084397739, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 195.15639104739046, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 3938.7991953190131, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 118521.48653762060, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 6291455.9999999972, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 773070496.50699198, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 363276452167.04102, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 2002716064453133.0, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 4.5999999999999109e+21, 5.0000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test172() +{ + 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(data172) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data172[i].a), Tp(data172[i].b), + Tp(data172[i].c), Tp(data172[i].x)); + const Tp f0 = data172[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.5000000000000013e-09)); +} + +// Test data for a=5.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data173[] = { + { 0.00014313323624069244, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.00025426183473140697, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.00048255612836426809, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.00099096904674788092, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.0022347805521915607, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.0056271390060292376, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.016109059519227226, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.053453465775608999, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.20995202901839258, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 5.9534372167648799, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 46.157632071205875, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 494.32074431164915, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 7989.5277611775946, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 224179.55830753347, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 13848144.485282511, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 2948587692.8891716, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 5940513286161.6602, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 2.8531757655945201e+18, 5.0000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test173() +{ + 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(data173) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data173[i].a), Tp(data173[i].b), + Tp(data173[i].c), Tp(data173[i].x)); + const Tp f0 = data173[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(1.0000000000000006e-10)); +} + +// Test data for a=5.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data174[] = { + { 0.0012492049968742865, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.0019931241968014451, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.0033203386861411057, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.0058191894509855282, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.010830090368313866, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.021653062305193163, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.047180821280919084, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.11405637279736180, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.31275468794720990, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 3.8598904658643969, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 18.806301417906667, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 122.77054465017432, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1168.4762146808946, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 18437.511788521082, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 597441.79669264762, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 59390411.369227782, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 44681668993.361603, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 4559673269683164.0, 5.0000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test174() +{ + 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(data174) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data174[i].a), Tp(data174[i].b), + Tp(data174[i].c), Tp(data174[i].x)); + const Tp f0 = data174[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(1.0000000000000006e-11)); +} + +// Test data for a=5.0000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data175[] = { + { 0.0038867957051371450, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.0058484892597364443, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.0090987656053757009, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.014714392537270733, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.024900404542056769, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.044460184663785055, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.084638849196356836, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.17409058241290998, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.39357055823580755, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 2.9410794636226596, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 10.417226071414344, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 46.930585873140835, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 290.76717121814852, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2788.1641083374830, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 50228.117718560752, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2433042.3476752634, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 705345246.77141762, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 15652478868616.762, 5.0000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=5.0000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test175() +{ + 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(data175) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data175[i].a), Tp(data175[i].b), + Tp(data175[i].c), Tp(data175[i].x)); + const Tp f0 = data175[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(1.0000000000000008e-12)); +} + +// Test data for a=10.000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data176[] = { + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test176() +{ + 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(data176) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data176[i].a), Tp(data176[i].b), + Tp(data176[i].c), Tp(data176[i].x)); + const Tp f0 = data176[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)); +} + +// Test data for a=10.000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data177[] = { + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test177() +{ + 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(data177) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data177[i].a), Tp(data177[i].b), + Tp(data177[i].c), Tp(data177[i].x)); + const Tp f0 = data177[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)); +} + +// Test data for a=10.000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data178[] = { + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test178() +{ + 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(data178) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data178[i].a), Tp(data178[i].b), + Tp(data178[i].c), Tp(data178[i].x)); + const Tp f0 = data178[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)); +} + +// Test data for a=10.000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data179[] = { + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test179() +{ + 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(data179) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data179[i].a), Tp(data179[i].b), + Tp(data179[i].c), Tp(data179[i].x)); + const Tp f0 = data179[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)); +} + +// Test data for a=10.000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data180[] = { + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 10.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test180() +{ + 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(data180) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data180[i].a), Tp(data180[i].b), + Tp(data180[i].c), Tp(data180[i].x)); + const Tp f0 = data180[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)); +} + +// Test data for a=10.000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data181[] = { + { 0.37727530159464628, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.39816010922169010, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.42283703041362453, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.45255640448730505, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.48919507154431141, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.53569358917731880, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.59689778897029566, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.68128587569875731, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.80478739308790359, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.3408664196153621, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 2.0175364359923860, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 3.6011214553736646, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 8.1799429939495312, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 25.644834637536000, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 123.13738891597615, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1088.7122410321333, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 27358.291704709951, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 8174369.0266731177, 10.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test181() +{ + 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(data181) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data181[i].a), Tp(data181[i].b), + Tp(data181[i].c), Tp(data181[i].x)); + const Tp f0 = data181[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)); +} + +// Test data for a=10.000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data182[] = { + { 0.53905528308450834, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.56235533974376162, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.58887657983263575, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.61941227047262915, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.65504896640793853, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.69731666644529999, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.74844073299399128, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.81178446800105752, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.89266981277598023, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.1497248473106778, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.3729717112654571, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.7374982340374392, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 2.4134479340960580, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 3.9191255240471192, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 8.3316373077761270, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 28.323020339843335, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 225.84286572747891, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 12757.127591286655, 10.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test182() +{ + 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(data182) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data182[i].a), Tp(data182[i].b), + Tp(data182[i].c), Tp(data182[i].x)); + const Tp f0 = data182[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)); +} + +// Test data for a=10.000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data183[] = { + { 0.62672622092226071, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.64931010269769829, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.67448067519076316, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.70276306239803676, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.73484179773087555, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.77162761412743897, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.81436116844816531, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.86477994787944557, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.92539820516603888, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0945599448210315, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.2190897395597264, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.3916844336856475, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.6484497630432013, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 2.0717772717131155, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2.8893613630810924, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 4.9459404075413529, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 13.487394149998716, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 136.57616044013972, 10.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test183() +{ + 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(data183) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data183[i].a), Tp(data183[i].b), + Tp(data183[i].c), Tp(data183[i].x)); + const Tp f0 = data183[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)); +} + +// Test data for a=10.000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data184[] = { + { 0.68421604440344341, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.70548098055548891, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.72884342311710348, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.75466953437856243, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.78342090924662600, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.81568884278645049, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.85224480241465206, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.89411692571131696, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.94270986892954756, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0688682849120232, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.1537004376097553, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.2615455028370031, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.4045541456153436, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.6057216489444517, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.9146603020550739, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 2.4617931307620298, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 3.7267799624996498, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 9.3880118036248401, 10.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test184() +{ + 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(data184) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data184[i].a), Tp(data184[i].b), + Tp(data184[i].c), Tp(data184[i].x)); + const Tp f0 = data184[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)); +} + +// Test data for a=10.000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data185[] = { + { 0.72547625011001171, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.74535599249992990, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.76696498884737041, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.79056941504209477, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.81649658092772603, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.84515425472851657, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.87705801930702920, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.91287092917527690, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.95346258924559224, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0540925533894598, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.1180339887498949, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.1952286093343938, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.2909944487358056, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.4142135623730949, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.5811388300841900, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.8257418583505536, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 2.2360679774997898, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 3.1622776601683782, 10.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test185() +{ + 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(data185) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data185[i].a), Tp(data185[i].b), + Tp(data185[i].c), Tp(data185[i].x)); + const Tp f0 = data185[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)); +} + +// Test data for a=10.000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data186[] = { + { 0.12307420104127871, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.13818870041457423, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.15739165631811691, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.18249038606882068, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.21644171225027786, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.26433326159804160, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.33544459430654533, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.44788516696232517, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.63989153514168362, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.7568608796813312, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 3.5836558871799027, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 8.8077526749963226, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 27.285841702089190, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 113.55555555555557, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 706.24023437500091, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 8064.1687976651992, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 271267.22222222196, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 123456789.99999890, 10.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test186() +{ + 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(data186) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data186[i].a), Tp(data186[i].b), + Tp(data186[i].c), Tp(data186[i].x)); + const Tp f0 = data186[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)); +} + +// Test data for a=10.000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data187[] = { + { 0.28363728383055758, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.30933003169808387, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.33998437757128797, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.37713553224291119, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.42299736538419658, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.48086597727600106, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.55583495759293045, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.65612850114039667, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.79573668772968120, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3184712058058303, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.8576958065941214, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 2.8759509651764228, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 5.1046225531822182, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 11.095238095238095, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 32.797154017857174, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 158.01935680536477, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1815.9523809523814, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 163302.14285714156, 10.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test187() +{ + 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(data187) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data187[i].a), Tp(data187[i].b), + Tp(data187[i].c), Tp(data187[i].x)); + const Tp f0 = data187[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)); +} + +// Test data for a=10.000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data188[] = { + { 0.39006633302741794, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.41898885698103294, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.45245557983812590, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.49160548618861633, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.53798419230517980, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.59373881442067344, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.66193391357076115, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.74708402736952129, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.85609281019430605, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.1974451135148187, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.4820886036706347, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.9201183180477521, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2.6569338297733336, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 4.0634920634920650, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 7.3102678571428568, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 17.512574302697733, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 74.206349206349131, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1342.8571428571363, 10.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test188() +{ + 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(data188) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data188[i].a), Tp(data188[i].b), + Tp(data188[i].c), Tp(data188[i].x)); + const Tp f0 = data188[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)); +} + +// Test data for a=10.000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data189[] = { + { 0.46726928123633193, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.49687547629934464, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.53045208856322235, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.56884765624999978, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.61316872427983526, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.66488500161969544, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.72598998634501577, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.79925411522633782, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.88863845062192193, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1423563481176653, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3302951388888888, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.5889212827988335, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.9650205761316870, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 2.5555555555555549, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 3.5937500000000013, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 5.7818930041152203, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 12.222222222222220, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 54.999999999999780, 10.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test189() +{ + 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(data189) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data189[i].a), Tp(data189[i].b), + Tp(data189[i].c), Tp(data189[i].x)); + const Tp f0 = data189[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)); +} + +// Test data for a=10.000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data190[] = { + { 0.52631578947368429, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.55555555555555558, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.58823529411764708, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.62500000000000000, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.66666666666666663, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.71428571428571430, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.76923076923076927, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.83333333333333337, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.90909090909090906, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1111111111111112, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2500000000000000, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.4285714285714286, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.6666666666666663, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2.0000000000000000, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 2.5000000000000004, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 3.3333333333333330, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 5.0000000000000009, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 9.9999999999999929, 10.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test190() +{ + 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(data190) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data190[i].a), Tp(data190[i].b), + Tp(data190[i].c), Tp(data190[i].x)); + const Tp f0 = data190[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)); +} + +// Test data for a=10.000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data191[] = { + { 0.0016310376661280216, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.0028007538972582421, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.0049603324681551939, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.0090949470177292789, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.017341529915832606, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.034571613033607777, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.072538150286405714, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.16150558288984579, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.38554328942953148, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 2.8679719907924444, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 9.3132257461547816, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 35.401331746414378, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 165.38171687920172, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1024.0000000000000, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 9536.7431640625200, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 169350.87808430271, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 9765624.9999999944, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9999999999.9999332, 10.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test191() +{ + 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(data191) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data191[i].a), Tp(data191[i].b), + Tp(data191[i].c), Tp(data191[i].x)); + const Tp f0 = data191[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)); +} + +// Test data for a=10.000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data192[] = { + { 0.071191280690193509, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.085646504654238079, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.10478215656371073, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.13074816337653575, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.16701141666848116, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.21939323375313971, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.29813515331786627, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.42225974638874386, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.62942145962174867, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.7218685262373197, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 3.2855760483514689, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 7.1616652508907093, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 18.612326808485907, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 61.476190476190474, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 286.27580915178623, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2274.9441142102296, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 47229.761904761865, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 9961460.7142856438, 10.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test192() +{ + 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(data192) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data192[i].a), Tp(data192[i].b), + Tp(data192[i].c), Tp(data192[i].x)); + const Tp f0 = data192[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)); +} + +// Test data for a=10.000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data193[] = { + { 0.14747230019381052, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.17073600100690603, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.19982795745135354, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.23681776864188067, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.28475624360398022, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.34827500743063144, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.43464829159684681, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.55576053438064787, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.73195020913445485, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.4310223867822929, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 2.1742563399057540, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 3.5769231236256043, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 6.5620441134844363, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 14.063492063492063, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 38.085937500000036, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 150.92973632068282, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1212.3015873015852, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 55107.142857142389, 10.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test193() +{ + 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(data193) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data193[i].a), Tp(data193[i].b), + Tp(data193[i].c), Tp(data193[i].x)); + const Tp f0 = data193[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)); +} + +// Test data for a=10.000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data194[] = { + { 0.21658059714090588, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.24513539602702844, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.27967018274845046, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.32196044921874994, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.37448559670781900, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.44078856032208796, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.52606701446027815, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.63818158436214001, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.78944971882612769, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.3044251384443430, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.7659505208333335, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 2.5093710953769270, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 3.8065843621399158, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 6.3333333333333313, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 12.109375000000004, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 29.115226337448540, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 108.33333333333330, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1224.9999999999923, 10.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test194() +{ + 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(data194) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data194[i].a), Tp(data194[i].b), + Tp(data194[i].c), Tp(data194[i].x)); + const Tp f0 = data194[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)); +} + +// Test data for a=10.000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data195[] = { + { 0.27700831024930750, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.30864197530864196, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.34602076124567477, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.39062499999999994, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.44444444444444442, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.51020408163265307, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.59171597633136097, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.69444444444444453, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.82644628099173545, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.2345679012345681, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.5624999999999998, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 2.0408163265306127, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 2.7777777777777768, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 4.0000000000000000, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 6.2500000000000036, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 11.111111111111109, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 25.000000000000007, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 99.999999999999872, 10.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test195() +{ + 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(data195) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data195[i].a), Tp(data195[i].b), + Tp(data195[i].c), Tp(data195[i].x)); + const Tp f0 = data195[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)); +} + +// Test data for a=10.000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data196[] = { + { 0.00063586451658060152, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.0010334743461762443, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.0015326246054669515, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.0019007018181583387, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.0012845577715431577, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { -0.0027213806178058826, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -0.015121744574954068, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { -0.036637840562974443, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.019117849062621491, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 9.8116901852350615, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 84.255589172244044, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 773.87517619421294, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 8556.9725363053585, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 129023.99999999996, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 3174543.3807373112, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 175133896.95814410, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 43564453125.000061, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 446859999999993.50, 10.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test196() +{ + 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(data196) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data196[i].a), Tp(data196[i].b), + Tp(data196[i].c), Tp(data196[i].x)); + const Tp f0 = data196[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(1.0000000000000006e-11)); +} + +// Test data for a=10.000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data197[] = { + { -0.00030045430691819899, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { -0.00031119487747328581, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { -0.00014589213141649274, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.00056843418860809121, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.0028902549859721725, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.0098776037238877470, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.030689217428863914, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.094211590019076599, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.29791981455918376, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 3.6646308771236793, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 15.133991837501521, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 73.331330046144089, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 441.01791167787133, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 3583.9999999999991, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 45299.530029296984, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1157231.0002427341, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 107421875.00000016, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 234999999999.99734, 10.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test197() +{ + 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(data197) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data197[i].a), Tp(data197[i].b), + Tp(data197[i].c), Tp(data197[i].x)); + const Tp f0 = data197[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.5000000000000014e-11)); +} + +// Test data for a=10.000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data198[] = { + { 0.0058530497315411210, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.0088526869356855692, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.013770987983443108, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.022108932690960800, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.036786236450921578, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.063750669040426422, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.11577228680714464, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.22197573416125735, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.45361312968415268, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 2.4162889363082747, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 6.5381564791240399, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 20.415771011498428, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 76.870682056629221, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 373.58730158730162, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 2626.2555803571477, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 33060.960671081048, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1203521.8253968258, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 584564285.71427989, 10.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test198() +{ + 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(data198) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data198[i].a), Tp(data198[i].b), + Tp(data198[i].c), Tp(data198[i].x)); + const Tp f0 = data198[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.5000000000000015e-12)); +} + +// Test data for a=10.000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data199[] = { + { 0.020248990107069400, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.027876687750502421, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.039154648888447781, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.056251883506774923, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.082914189910074432, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.12585357817786477, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.19761423206224929, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.32280443863359243, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.55250024062839465, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.9374297986599267, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 4.0849049886067696, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 9.5926988633258983, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 25.958314281359531, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 85.333333333333300, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 372.31445312500028, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 2545.3436976070675, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 39583.333333333343, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 4599999.9999999627, 10.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test199() +{ + 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(data199) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data199[i].a), Tp(data199[i].b), + Tp(data199[i].c), Tp(data199[i].x)); + const Tp f0 = data199[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)); +} + +// Test data for a=10.000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data200[] = { + { 0.040386107340619266, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.052922149401344633, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.070429627772374270, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.095367431640624972, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.13168724279835387, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.18593443208187066, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.26932907434290437, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.40187757201646096, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.62092132305915493, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.6935087808430296, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 3.0517578124999991, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 5.9499018266198629, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 12.860082304526737, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 32.000000000000000, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 97.656250000000114, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 411.52263374485580, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3124.9999999999991, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 99999.999999999665, 10.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test200() +{ + 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(data200) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data200[i].a), Tp(data200[i].b), + Tp(data200[i].c), Tp(data200[i].x)); + const Tp f0 = data200[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)); +} + +// Test data for a=10.000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data201[] = { + { 2.3388730079478623e-05, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -2.3204970759807341e-05, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -0.00016219730505520291, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -0.00044366962360925706, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { -0.00071863577205454770, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 4.4378596544453810e-05, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.0044446568070623570, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.0071045155183571103, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { -0.049961558159890146, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 51.305449964107403, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1435.9545414461309, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 39657.913058984115, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1346016.4468570501, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 68086556.444444403, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 6646235808.7301531, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1954852335479.9702, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 4573796225043418.0, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.8280190368899683e+21, 10.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test201() +{ + 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(data201) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data201[i].a), Tp(data201[i].b), + Tp(data201[i].c), Tp(data201[i].x)); + const Tp f0 = data201[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(1.0000000000000006e-10)); +} + +// Test data for a=10.000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data202[] = { + { 1.3504013648882651e-05, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 3.1753432098404372e-05, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 6.2032098207659688e-05, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 8.8747213942768282e-05, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0478094697243911e-05, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -0.00055998751006011325, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { -0.0024718654966577563, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { -0.0027000264053619817, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.066515394406810674, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 11.579200866389527, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 137.50750548795256, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1901.3196072993419, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 34210.659507137796, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 920588.19047619053, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 45876220.933028772, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 6234608574.0963297, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 5445391090029.7783, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 4.6508713107142163e+17, 10.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test202() +{ + 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(data202) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data202[i].a), Tp(data202[i].b), + Tp(data202[i].c), Tp(data202[i].x)); + const Tp f0 = data202[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.5000000000000013e-09)); +} + +// Test data for a=10.000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data203[] = { + { -2.6846726901567720e-05, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { -4.7817237144207266e-05, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { -7.2908121941975601e-05, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { -6.0427853197480476e-05, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.00020559720946645182, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.0017056910683365828, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.0088037230970526795, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.041510819735141674, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.19754880805677258, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 5.6130947302779246, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 36.475357196722442, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 289.29483001400672, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 3010.8676549536503, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 45844.317460317419, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1221852.6431492427, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 79585968.928968787, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 26733475942.460335, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 500206428571421.19, 10.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test203() +{ + 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(data203) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data203[i].a), Tp(data203[i].b), + Tp(data203[i].c), Tp(data203[i].x)); + const Tp f0 = data203[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.5000000000000017e-10)); +} + +// Test data for a=10.000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data204[] = { + { 0.00025866179054245944, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.00053402577739214288, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.0011390075227240345, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.0025224267119483192, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.0058340332124251467, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.014189256143045285, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.036590990011337567, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.10106560781146992, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.30278778538531409, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 3.7187249990350599, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 16.023275545901704, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 83.265377219882822, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 553.31413918843987, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 5148.4444444444416, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 78082.084655761908, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 2565874.8781353114, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 346137152.77777809, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1472499999999.9834, 10.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test204() +{ + 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(data204) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data204[i].a), Tp(data204[i].b), + Tp(data204[i].c), Tp(data204[i].x)); + const Tp f0 = data204[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(1.0000000000000006e-10)); +} + +// Test data for a=10.000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data205[] = { + { 0.0016310376661280216, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.0028007538972582421, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.0049603324681551939, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.0090949470177292789, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.017341529915832606, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.034571613033607777, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.072538150286405714, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.16150558288984579, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.38554328942953148, 10.000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 2.8679719907924444, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 9.3132257461547816, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 35.401331746414378, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 165.38171687920172, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1024.0000000000000, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 9536.7431640625200, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 169350.87808430271, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 9765624.9999999944, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 9999999999.9999332, 10.000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test205() +{ + 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(data205) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data205[i].a), Tp(data205[i].b), + Tp(data205[i].c), Tp(data205[i].x)); + const Tp f0 = data205[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)); +} + +// Test data for a=10.000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data206[] = { + { -2.1776535308707967e-07, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -2.9128833151427998e-06, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -9.4755553429035093e-06, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -1.2844297353813116e-05, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 3.6576965483568809e-05, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.00020847453890692649, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -0.00022868510398174632, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { -0.0021855513841942732, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.014662111759334634, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 746.44776348798098, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 136080.48445225612, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 23094279.597826406, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 5315913395.5545301, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 2261935718399.9990, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 2669150854828235.0, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.7499363099365994e+19, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.8881518494606140e+24, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.4165513933661626e+33, 10.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test206() +{ + 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(data206) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data206[i].a), Tp(data206[i].b), + Tp(data206[i].c), Tp(data206[i].x)); + const Tp f0 = data206[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(1.0000000000000005e-08)); +} + +// Test data for a=10.000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data207[] = { + { 1.7149006973860441e-07, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 3.2399324904088936e-07, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.6015317712089860e-07, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { -2.0500917204199595e-06, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { -1.0175546788599472e-05, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -1.1720101988202453e-05, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.00014199637113974185, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.00021263363640642297, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { -0.0072649256698441751, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 90.430293772869618, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 6248.1455940292308, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 501143.39852548984, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 58852027.356439680, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 12942923093.333330, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 7618073993853.6592, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 22630251562549288., 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.3708372433980356e+21, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.4154113619999653e+29, 10.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test207() +{ + 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(data207) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data207[i].a), Tp(data207[i].b), + Tp(data207[i].c), Tp(data207[i].x)); + const Tp f0 = data207[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.0000000000000024e-08)); +} + +// Test data for a=10.000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data208[] = { + { -1.6667473370780257e-08, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 8.6214844067774863e-08, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 5.7778331238835108e-07, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 2.1911400500362969e-06, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 4.7440049217100417e-06, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { -1.0564233314924258e-05, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { -0.00017990026051856349, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { -0.00027618146288744351, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.030606019577723392, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 27.832854169493341, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 874.00624088575228, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 36049.199340831554, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2270967.7298624986, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 266979100.44444439, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 80311224337.493027, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 110111693103799.72, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 2.4838871426052618e+18, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 5.4626349999998603e+25, 10.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test208() +{ + 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(data208) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data208[i].a), Tp(data208[i].b), + Tp(data208[i].c), Tp(data208[i].x)); + const Tp f0 = data208[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.0000000000000019e-07)); +} + +// Test data for a=10.000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data209[] = { + { -1.5843795893321480e-07, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { -5.4877275994033766e-07, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { -1.7169507967745992e-06, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { -4.5236439748752000e-06, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { -5.5690492560325806e-06, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 5.6914115606934911e-05, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.00082507252097519922, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.0085739249288229857, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.088244357683754757, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 13.387208440156897, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 226.77895441155110, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 5281.5716482686785, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 189431.77762850464, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 12408149.333333332, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1966782292.5839682, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1274123112205.7495, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 10903676350911508., 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 5.1849999999998819e+22, 10.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test209() +{ + 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(data209) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data209[i].a), Tp(data209[i].b), + Tp(data209[i].c), Tp(data209[i].x)); + const Tp f0 = data209[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.5000000000000012e-08)); +} + +// Test data for a=10.000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data210[] = { + { 2.6602838683283435e-06, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 7.8442223930072316e-06, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 2.4604898194634598e-05, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 8.2718061255302686e-05, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.00030072865982171723, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.0011951964277455193, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.0052617832469731814, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.026084053304588847, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.14864362802414346, 10.000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 8.2252633399699757, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 86.736173798840269, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1253.2542894196865, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 27351.112277912434, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1048576.0000000000, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 90949470.177293226, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 28679719907.924358, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 95367431640624.906, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 9.9999999999998657e+19, 10.000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=10.000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test210() +{ + 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(data210) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data210[i].a), Tp(data210[i].b), + Tp(data210[i].c), Tp(data210[i].x)); + const Tp f0 = data210[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)); +} + +// Test data for a=20.000000000000000, b=0.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data211[] = { + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test211() +{ + 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(data211) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data211[i].a), Tp(data211[i].b), + Tp(data211[i].c), Tp(data211[i].x)); + const Tp f0 = data211[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)); +} + +// Test data for a=20.000000000000000, b=0.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data212[] = { + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test212() +{ + 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(data212) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data212[i].a), Tp(data212[i].b), + Tp(data212[i].c), Tp(data212[i].x)); + const Tp f0 = data212[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)); +} + +// Test data for a=20.000000000000000, b=0.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data213[] = { + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test213() +{ + 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(data213) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data213[i].a), Tp(data213[i].b), + Tp(data213[i].c), Tp(data213[i].x)); + const Tp f0 = data213[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)); +} + +// Test data for a=20.000000000000000, b=0.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data214[] = { + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test214() +{ + 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(data214) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data214[i].a), Tp(data214[i].b), + Tp(data214[i].c), Tp(data214[i].x)); + const Tp f0 = data214[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)); +} + +// Test data for a=20.000000000000000, b=0.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data215[] = { + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.0000000000000000, 20.000000000000000, 0.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test215() +{ + 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(data215) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data215[i].a), Tp(data215[i].b), + Tp(data215[i].c), Tp(data215[i].x)); + const Tp f0 = data215[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)); +} + +// Test data for a=20.000000000000000, b=0.50000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data216[] = { + { 0.26690449940521566, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.28252302866181805, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.30123616141153819, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.32421384687602628, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.35334630811776752, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.39191793127467034, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.44620488618129206, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.52980896919265685, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.67754711477562357, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 1.9567557771780317, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 6.1816042148333086, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 35.653088618561227, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 377.51482843179906, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 7645.8816551195359, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 354791.74537980522, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 57009889.966638684, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 83771357024.863937, 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 25866972896376408., 20.000000000000000, 0.50000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.50000000000000000, c=2.0000000000000000. +template <typename Tp> +void test216() +{ + 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(data216) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data216[i].a), Tp(data216[i].b), + Tp(data216[i].c), Tp(data216[i].x)); + const Tp f0 = data216[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)); +} + +// Test data for a=20.000000000000000, b=0.50000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data217[] = { + { 0.40342659436153405, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.42420571192034318, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.44852768286073008, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.47751245808592863, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.51283632632707754, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.55713468814894307, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.61481320817757312, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.69383483410097202, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.81012002526006033, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.3622225506603911, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 2.2349513086109001, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 5.1864917536761723, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 21.020560423779411, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 175.19649997100612, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 3467.1587803688708, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 225003.88683445856, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 110837674.65652709, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 6688966964170.6807, 20.000000000000000, 0.50000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.50000000000000000, c=4.0000000000000000. +template <typename Tp> +void test217() +{ + 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(data217) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data217[i].a), Tp(data217[i].b), + Tp(data217[i].c), Tp(data217[i].x)); + const Tp f0 = data217[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)); +} + +// Test data for a=20.000000000000000, b=0.50000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data218[] = { + { 0.48716309885816761, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.50965859152542281, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.53554809210658971, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.56576689207507136, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.60164849637133688, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.64516711595404375, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.69938278735493542, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.76931621518401860, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.86381808725530695, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.2152051956815531, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 1.6052546785425543, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 2.4765586046012635, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 5.1564492216997486, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 18.446158392136365, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 150.44577670123971, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 3862.6317400115768, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 632428.34833625401, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 7426927663.3808765, 20.000000000000000, 0.50000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.50000000000000000, c=6.0000000000000000. +template <typename Tp> +void test218() +{ + 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(data218) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data218[i].a), Tp(data218[i].b), + Tp(data218[i].c), Tp(data218[i].x)); + const Tp f0 = data218[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)); +} + +// Test data for a=20.000000000000000, b=0.50000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data219[] = { + { 0.54703266209548362, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.56997321774144971, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.59603026159654970, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.62596978851120511, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.66084565876898926, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.70215256667232839, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.75208916592008568, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.81403631111658648, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.89348608489854608, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.1517793185139173, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.3878110313656598, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 1.8061071794572381, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 2.7148594517859586, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 5.4529435709049361, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 19.487310275377109, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 191.69079165937470, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 10218.543981792311, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 23160836.646583911, 20.000000000000000, 0.50000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.50000000000000000, c=8.0000000000000000. +template <typename Tp> +void test219() +{ + 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(data219) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data219[i].a), Tp(data219[i].b), + Tp(data219[i].c), Tp(data219[i].x)); + const Tp f0 = data219[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)); +} + +// Test data for a=20.000000000000000, b=0.50000000000000000, c=10.000000000000000. +testcase_hyperg<double> data220[] = { + { 0.59292067298616002, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.61572496720679915, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.64135339122875623, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.67043457419280483, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.70380956268170980, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.74263251901495231, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.78853555445528278, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.84391122775673766, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.91242401018807406, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.1169059681274873, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.2825928301302667, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1.5385937789924939, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 1.9895771187893898, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2.9707335806970168, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 6.0299506157180467, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 24.259090336955577, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 406.27267173257223, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 174330.03997220192, 20.000000000000000, 0.50000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=0.50000000000000000, c=10.000000000000000. +template <typename Tp> +void test220() +{ + 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(data220) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data220[i].a), Tp(data220[i].b), + Tp(data220[i].c), Tp(data220[i].x)); + const Tp f0 = data220[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)); +} + +// Test data for a=20.000000000000000, b=1.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data221[] = { + { 0.058479236576646373, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 0.065788544763137669, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 0.075184824937824662, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 0.087707688693157260, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.10521567442213345, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.13135877960541525, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.17423854066297104, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.25492082527223525, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.44025895219654843, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 3.3698615820910360, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 17.997089220808483, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 153.73298291118951, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 2159.1667587825627, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 55188.105263157879, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 3191209.3921857267, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 646910975.29152656, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 1254834626850.2659, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 5.8479532163741414e+17, 20.000000000000000, 1.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=1.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test221() +{ + 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(data221) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data221[i].a), Tp(data221[i].b), + Tp(data221[i].c), Tp(data221[i].x)); + const Tp f0 = data221[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)); +} + +// Test data for a=20.000000000000000, b=1.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data222[] = { + { 0.15519511120894947, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.17197165701692899, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.19276847315207363, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.21920107206179093, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.25386158960390581, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.30115970686600657, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.36916408142057117, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.47406175901569558, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.65237908266239919, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 1.8227213362622299, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 4.3716358339791332, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 15.670841312959222, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 94.742651122760179, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 1081.7275541795671, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 27809.787731465960, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2329811.1715181042, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1537787532.6780224, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 141562653506999.88, 20.000000000000000, 1.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=1.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test222() +{ + 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(data222) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data222[i].a), Tp(data222[i].b), + Tp(data222[i].c), Tp(data222[i].x)); + const Tp f0 = data222[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)); +} + +// Test data for a=20.000000000000000, b=1.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data223[] = { + { 0.23253645591196570, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.25484220947068353, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.28181987881113829, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.31508211677735765, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.35706285886959599, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.41160053409238195, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.48508083111181949, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.58885194371375260, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.74482241684585748, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 1.4700356864367146, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 2.4955144453055143, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 5.3506594845833471, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 16.618413752184221, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 89.310629514963878, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1029.3439900542960, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 35659.847863372350, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 8009309.6233230168, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 145640590027.39731, 20.000000000000000, 1.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=1.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test223() +{ + 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(data223) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data223[i].a), Tp(data223[i].b), + Tp(data223[i].c), Tp(data223[i].x)); + const Tp f0 = data223[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)); +} + +// Test data for a=20.000000000000000, b=1.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data224[] = { + { 0.29614148314592498, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.32176277356430810, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.35217870475550522, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.38885270445515091, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.43389978380608424, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.49048612522269436, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.56355539635634611, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.66123153239117682, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.79773363961895427, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.3245132157016595, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 1.9065148749742076, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 3.1328798652457452, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 6.4172532944033476, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 19.071683734222436, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 104.41989641582512, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1510.5743992324240, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 115518.14360562043, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 414930455.29173034, 20.000000000000000, 1.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=1.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test224() +{ + 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(data224) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data224[i].a), Tp(data224[i].b), + Tp(data224[i].c), Tp(data224[i].x)); + const Tp f0 = data224[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)); +} + +// Test data for a=20.000000000000000, b=1.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data225[] = { + { 0.34954259539177696, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.37714038609235123, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.40942091659748725, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.44767109606846428, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.49368984777532254, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.55006638216982318, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.62065830207408912, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.71145554513583786, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.83223839666914623, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.2466748028187731, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 1.6386752725021749, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 2.3340068725479681, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 3.7848108613132054, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 7.6754638550304133, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 23.344217312927277, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 149.83491198246921, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 3936.9253501916060, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 2794143.5036480185, 20.000000000000000, 1.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=1.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test225() +{ + 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(data225) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data225[i].a), Tp(data225[i].b), + Tp(data225[i].c), Tp(data225[i].x)); + const Tp f0 = data225[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)); +} + +// Test data for a=20.000000000000000, b=2.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data226[] = { + { 2.6602838683283435e-06, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 7.8442223930072316e-06, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 2.4604898194634598e-05, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { 8.2718061255302686e-05, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 0.00030072865982171723, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.0011951964277455193, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.0052617832469731814, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.026084053304588847, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.14864362802414346, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 8.2252633399699757, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 86.736173798840269, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 1253.2542894196865, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 27351.112277912434, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1048576.0000000000, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 90949470.177293226, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 28679719907.924358, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 95367431640624.906, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 9.9999999999998657e+19, 20.000000000000000, 2.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=2.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test226() +{ + 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(data226) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data226[i].a), Tp(data226[i].b), + Tp(data226[i].c), Tp(data226[i].x)); + const Tp f0 = data226[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)); +} + +// Test data for a=20.000000000000000, b=2.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data227[] = { + { 0.018828092583720951, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 0.023381944060455316, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 0.029789623984280793, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 0.039191021482500497, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { 0.053727813036721514, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { 0.077762010061669024, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.12110505620123302, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.20870149809080590, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.41429234328785769, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 3.1308087404153113, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 13.586180626453050, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 87.117304082784415, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 889.26474381242826, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 16231.913312693494, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 653537.51168945129, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 87756230.793848589, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 101493977171.74945, 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 21375960679556916., 20.000000000000000, 2.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=2.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test227() +{ + 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(data227) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data227[i].a), Tp(data227[i].b), + Tp(data227[i].c), Tp(data227[i].x)); + const Tp f0 = data227[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(1.0000000000000008e-12)); +} + +// Test data for a=20.000000000000000, b=2.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data228[] = { + { 0.049200410661854252, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.059460876757152226, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.073244762686653350, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.092334626017932922, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.11976760350696837, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.16102414609169383, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.22670456785796222, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.33912903252727361, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.55049794600858060, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 2.1254722872032232, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 5.6261213886736172, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 20.137315891130996, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 108.04381584643853, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 992.41692466460245, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 19055.363816004465, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 1105471.9504312086, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 448521363.90608919, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 19078917293639.004, 20.000000000000000, 2.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=2.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test228() +{ + 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(data228) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data228[i].a), Tp(data228[i].b), + Tp(data228[i].c), Tp(data228[i].x)); + const Tp f0 = data228[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)); +} + +// Test data for a=20.000000000000000, b=2.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data229[] = { + { 0.083753547015334745, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.099238444687035701, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.11938294012867758, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.14622683905023326, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.18303556733713025, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.23527764069382409, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.31261681740827085, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.43327581880538862, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.63445840637296658, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 1.7438842395813297, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 3.5070840938209269, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 8.6573372006089713, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 28.779342118408906, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 147.50178613955714, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1427.1686016136398, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 36780.643714655642, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 5313869.6058585485, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 46057280607.381966, 20.000000000000000, 2.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=2.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test229() +{ + 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(data229) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data229[i].a), Tp(data229[i].b), + Tp(data229[i].c), Tp(data229[i].x)); + const Tp f0 = data229[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)); +} + +// Test data for a=20.000000000000000, b=2.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data230[] = { + { 0.11920045035073683, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.13907946814302774, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.16431439792559688, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.19698796016987008, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.24028510928790570, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.29926031296483119, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.38229327814229169, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.50402047283093110, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.69167261179586503, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 1.5503152253394308, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 2.6469548193635797, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 5.1882631330566813, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 12.476792759124516, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 41.026391565091259, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 220.92584715988204, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2677.0834450236207, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 141774.31260689779, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 254267148.83196995, 20.000000000000000, 2.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=2.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test230() +{ + 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(data230) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data230[i].a), Tp(data230[i].b), + Tp(data230[i].c), Tp(data230[i].x)); + const Tp f0 = data230[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)); +} + +// Test data for a=20.000000000000000, b=5.0000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data231[] = { + { -1.8650300348791041e-05, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -3.6488008415183135e-05, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -6.4614776410999025e-05, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -8.4495207102575916e-05, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 2.2276197023819217e-05, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.00070736115111467578, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { 0.0027829732057272809, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.0013283545664373570, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { -0.041767631015048733, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 61.311496556100003, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 2397.4420539085681, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 103687.60998586559, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 6247196.6451068865, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 656408576.00000000, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 165334768098.54715, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 175097125520816.81, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.6818275451660257e+18, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 2.9794599999999321e+25, 20.000000000000000, 5.0000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=5.0000000000000000, c=2.0000000000000000. +template <typename Tp> +void test231() +{ + 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(data231) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data231[i].a), Tp(data231[i].b), + Tp(data231[i].c), Tp(data231[i].x)); + const Tp f0 = data231[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.0000000000000034e-10)); +} + +// Test data for a=20.000000000000000, b=5.0000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data232[] = { + { -3.6403884515183385e-06, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { -9.5873829247725586e-06, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { -2.6052245147354694e-05, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { -7.2378303598294010e-05, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { -0.00020048577321454082, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -0.00051222704046236022, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { -0.00080950511491911315, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.0043473422174314449, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.081078342558623825, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 12.794854084397739, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 195.15639104739046, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 3938.7991953190131, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 118521.48653762060, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 6291455.9999999972, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 773070496.50699198, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 363276452167.04102, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 2002716064453133.0, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 4.5999999999999109e+21, 20.000000000000000, 5.0000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=5.0000000000000000, c=4.0000000000000000. +template <typename Tp> +void test232() +{ + 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(data232) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data232[i].a), Tp(data232[i].b), + Tp(data232[i].c), Tp(data232[i].x)); + const Tp f0 = data232[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.5000000000000013e-09)); +} + +// Test data for a=20.000000000000000, b=5.0000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data233[] = { + { 0.00014313323624069244, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 0.00025426183473140697, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 0.00048255612836426809, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 0.00099096904674788092, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 0.0022347805521915607, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 0.0056271390060292376, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { 0.016109059519227226, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 0.053453465775608999, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.20995202901839258, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 5.9534372167648799, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 46.157632071205875, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 494.32074431164915, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 7989.5277611775946, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 224179.55830753347, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 13848144.485282511, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 2948587692.8891716, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 5940513286161.6602, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 2.8531757655945201e+18, 20.000000000000000, 5.0000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=5.0000000000000000, c=6.0000000000000000. +template <typename Tp> +void test233() +{ + 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(data233) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data233[i].a), Tp(data233[i].b), + Tp(data233[i].c), Tp(data233[i].x)); + const Tp f0 = data233[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(1.0000000000000006e-10)); +} + +// Test data for a=20.000000000000000, b=5.0000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data234[] = { + { 0.0012492049968742865, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 0.0019931241968014451, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 0.0033203386861411057, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { 0.0058191894509855282, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { 0.010830090368313866, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 0.021653062305193163, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.047180821280919084, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.11405637279736180, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.31275468794720990, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 3.8598904658643969, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 18.806301417906667, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 122.77054465017432, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1168.4762146808946, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 18437.511788521082, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 597441.79669264762, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 59390411.369227782, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 44681668993.361603, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 4559673269683164.0, 20.000000000000000, 5.0000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=5.0000000000000000, c=8.0000000000000000. +template <typename Tp> +void test234() +{ + 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(data234) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data234[i].a), Tp(data234[i].b), + Tp(data234[i].c), Tp(data234[i].x)); + const Tp f0 = data234[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(1.0000000000000006e-11)); +} + +// Test data for a=20.000000000000000, b=5.0000000000000000, c=10.000000000000000. +testcase_hyperg<double> data235[] = { + { 0.0038867957051371450, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 0.0058484892597364443, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 0.0090987656053757009, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 0.014714392537270733, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.024900404542056769, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.044460184663785055, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.084638849196356836, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.17409058241290998, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.39357055823580755, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 2.9410794636226596, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 10.417226071414344, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 46.930585873140835, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 290.76717121814852, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 2788.1641083374830, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 50228.117718560752, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 2433042.3476752634, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 705345246.77141762, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 15652478868616.762, 20.000000000000000, 5.0000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=5.0000000000000000, c=10.000000000000000. +template <typename Tp> +void test235() +{ + 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(data235) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data235[i].a), Tp(data235[i].b), + Tp(data235[i].c), Tp(data235[i].x)); + const Tp f0 = data235[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(1.0000000000000008e-12)); +} + +// Test data for a=20.000000000000000, b=10.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data236[] = { + { -2.1776535308707967e-07, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { -2.9128833151427998e-06, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { -9.4755553429035093e-06, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -1.2844297353813116e-05, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { 3.6576965483568809e-05, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 0.00020847453890692649, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -0.00022868510398174632, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { -0.0021855513841942732, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { 0.014662111759334634, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 746.44776348798098, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 136080.48445225612, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 23094279.597826406, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 5315913395.5545301, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 2261935718399.9990, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 2669150854828235.0, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 1.7499363099365994e+19, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 2.8881518494606140e+24, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 1.4165513933661626e+33, 20.000000000000000, 10.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=10.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test236() +{ + 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(data236) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data236[i].a), Tp(data236[i].b), + Tp(data236[i].c), Tp(data236[i].x)); + const Tp f0 = data236[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(1.0000000000000005e-08)); +} + +// Test data for a=20.000000000000000, b=10.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data237[] = { + { 1.7149006973860441e-07, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { 3.2399324904088936e-07, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.6015317712089860e-07, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { -2.0500917204199595e-06, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { -1.0175546788599472e-05, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -1.1720101988202453e-05, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 0.00014199637113974185, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { 0.00021263363640642297, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { -0.0072649256698441751, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 90.430293772869618, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 6248.1455940292308, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 501143.39852548984, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 58852027.356439680, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 12942923093.333330, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 7618073993853.6592, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 22630251562549288., 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.3708372433980356e+21, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.4154113619999653e+29, 20.000000000000000, 10.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=10.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test237() +{ + 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(data237) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data237[i].a), Tp(data237[i].b), + Tp(data237[i].c), Tp(data237[i].x)); + const Tp f0 = data237[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.0000000000000024e-08)); +} + +// Test data for a=20.000000000000000, b=10.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data238[] = { + { -1.6667473370780257e-08, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { 8.6214844067774863e-08, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { 5.7778331238835108e-07, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { 2.1911400500362969e-06, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 4.7440049217100417e-06, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { -1.0564233314924258e-05, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { -0.00017990026051856349, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { -0.00027618146288744351, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { 0.030606019577723392, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 27.832854169493341, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 874.00624088575228, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 36049.199340831554, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 2270967.7298624986, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 266979100.44444439, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 80311224337.493027, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 110111693103799.72, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 2.4838871426052618e+18, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 5.4626349999998603e+25, 20.000000000000000, 10.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=10.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test238() +{ + 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(data238) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data238[i].a), Tp(data238[i].b), + Tp(data238[i].c), Tp(data238[i].x)); + const Tp f0 = data238[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.0000000000000019e-07)); +} + +// Test data for a=20.000000000000000, b=10.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data239[] = { + { -1.5843795893321480e-07, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { -5.4877275994033766e-07, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { -1.7169507967745992e-06, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { -4.5236439748752000e-06, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { -5.5690492560325806e-06, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 5.6914115606934911e-05, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 0.00082507252097519922, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { 0.0085739249288229857, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.088244357683754757, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 13.387208440156897, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 226.77895441155110, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 5281.5716482686785, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 189431.77762850464, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 12408149.333333332, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1966782292.5839682, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 1274123112205.7495, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 10903676350911508., 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 5.1849999999998819e+22, 20.000000000000000, 10.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=10.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test239() +{ + 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(data239) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data239[i].a), Tp(data239[i].b), + Tp(data239[i].c), Tp(data239[i].x)); + const Tp f0 = data239[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.5000000000000012e-08)); +} + +// Test data for a=20.000000000000000, b=10.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data240[] = { + { 2.6602838683283435e-06, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { 7.8442223930072316e-06, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 2.4604898194634598e-05, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 8.2718061255302686e-05, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 0.00030072865982171723, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { 0.0011951964277455193, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { 0.0052617832469731814, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.026084053304588847, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.14864362802414346, 20.000000000000000, 10.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 8.2252633399699757, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 86.736173798840269, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 1253.2542894196865, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 27351.112277912434, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 1048576.0000000000, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 90949470.177293226, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 28679719907.924358, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 95367431640624.906, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 9.9999999999998657e+19, 20.000000000000000, 10.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=10.000000000000000, c=10.000000000000000. +template <typename Tp> +void test240() +{ + 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(data240) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data240[i].a), Tp(data240[i].b), + Tp(data240[i].c), Tp(data240[i].x)); + const Tp f0 = data240[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)); +} + +// Test data for a=20.000000000000000, b=20.000000000000000, c=2.0000000000000000. +testcase_hyperg<double> data241[] = { + { 7.4612991101768883e-09, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.90000000000000002 }, + { 1.1006588946889981e-07, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.80000000000000004 }, + { 2.0126933743389316e-07, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.69999999999999996 }, + { -1.0013775379801016e-06, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.59999999999999998 }, + { -3.0371956856472516e-06, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.50000000000000000 }, + { 2.2012669924527286e-05, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.40000000000000002 }, + { -6.2415598025417670e-05, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.30000000000000004 }, + { 0.00033551320394378602, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.19999999999999996 }, + { -0.0062342152641436353, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.0000000000000000 }, + { 34830.688900741610, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.10000000000000009 }, + { 67626221.263030857, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.19999999999999996 }, + { 102764604848.69762, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.30000000000000004 }, + { 220278355222373.38, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.39999999999999991 }, + { 1.0422324699794536e+18, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.50000000000000000 }, + { 1.9128731788368004e+22, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.60000000000000009 }, + { 3.5234592919485287e+27, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.69999999999999996 }, + { 5.0867023209025249e+34, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.80000000000000004 }, + { 3.7461088506658564e+46, 20.000000000000000, 20.000000000000000, + 2.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=20.000000000000000, c=2.0000000000000000. +template <typename Tp> +void test241() +{ + 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(data241) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data241[i].a), Tp(data241[i].b), + Tp(data241[i].c), Tp(data241[i].x)); + const Tp f0 = data241[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(1.0000000000000005e-07)); +} + +// Test data for a=20.000000000000000, b=20.000000000000000, c=4.0000000000000000. +testcase_hyperg<double> data242[] = { + { -1.5895900796973045e-09, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.90000000000000002 }, + { -2.4403576837293198e-09, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.80000000000000004 }, + { 1.1622915290732117e-08, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.69999999999999996 }, + { 6.3899796307731726e-08, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.59999999999999998 }, + { -1.3503608352807462e-07, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.50000000000000000 }, + { -1.2198533623899163e-06, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.40000000000000002 }, + { 9.9086618119129001e-06, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.30000000000000004 }, + { -7.6797020080162010e-05, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.19999999999999996 }, + { 0.0013196405087170875, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.0000000000000000 }, + { 2274.2044768143564, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.10000000000000009 }, + { 1611640.1560475440, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.19999999999999996 }, + { 1147063984.7359734, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.30000000000000004 }, + { 1253162497163.8311, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.39999999999999991 }, + { 3071321673390476.0, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.50000000000000000 }, + { 2.8221123559124324e+19, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.60000000000000009 }, + { 2.3658463807419519e+24, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.69999999999999996 }, + { 1.2596553731345468e+31, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.80000000000000004 }, + { 1.9627175792062075e+42, 20.000000000000000, 20.000000000000000, + 4.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=20.000000000000000, c=4.0000000000000000. +template <typename Tp> +void test242() +{ + 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(data242) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data242[i].a), Tp(data242[i].b), + Tp(data242[i].c), Tp(data242[i].x)); + const Tp f0 = data242[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.5000000000000006e-06)); +} + +// Test data for a=20.000000000000000, b=20.000000000000000, c=6.0000000000000000. +testcase_hyperg<double> data243[] = { + { 8.0159808156941562e-11, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.90000000000000002 }, + { -6.4422687845093557e-10, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.80000000000000004 }, + { -3.7526134186308981e-09, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.69999999999999996 }, + { -1.7692034167897114e-09, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.59999999999999998 }, + { 7.9304558772837909e-08, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.50000000000000000 }, + { 5.9348070318594204e-08, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.40000000000000002 }, + { -3.5827694517425210e-06, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.30000000000000004 }, + { 4.4951490418284159e-05, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.19999999999999996 }, + { -0.0013716249406310486, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.0000000000000000 }, + { 415.32493304415505, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.10000000000000009 }, + { 121300.42991518594, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.19999999999999996 }, + { 42725673.833462097, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.30000000000000004 }, + { 24588915328.261719, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.39999999999999991 }, + { 31929082412503.652, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.50000000000000000 }, + { 1.4934954443280477e+17, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.60000000000000009 }, + { 5.7726220597696125e+21, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.69999999999999996 }, + { 1.1454387824049374e+28, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.80000000000000004 }, + { 3.8088637321581534e+38, 20.000000000000000, 20.000000000000000, + 6.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=20.000000000000000, c=6.0000000000000000. +template <typename Tp> +void test243() +{ + 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(data243) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data243[i].a), Tp(data243[i].b), + Tp(data243[i].c), Tp(data243[i].x)); + const Tp f0 = data243[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.5000000000000005e-05)); +} + +// Test data for a=20.000000000000000, b=20.000000000000000, c=8.0000000000000000. +testcase_hyperg<double> data244[] = { + { 1.0699072529874453e-10, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.90000000000000002 }, + { 5.4297753417228627e-10, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.80000000000000004 }, + { 9.7625471266824426e-10, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.69999999999999996 }, + { -6.7257762867770348e-09, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.59999999999999998 }, + { -5.4634571496175302e-08, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.50000000000000000 }, + { 1.4595644213893387e-07, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.40000000000000002 }, + { 3.3515966497049909e-06, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.30000000000000004 }, + { -6.5848086985914887e-05, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.19999999999999996 }, + { 0.0034800171306214813, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.0000000000000000 }, + { 130.93865856750304, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.10000000000000009 }, + { 17850.203502975532, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.19999999999999996 }, + { 3307058.5655149994, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.30000000000000004 }, + { 1041065396.2302787, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.39999999999999991 }, + { 735221357488.41736, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.50000000000000000 }, + { 1785176805049585.2, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.60000000000000009 }, + { 3.2302829930269192e+19, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.69999999999999996 }, + { 2.4184909805178299e+25, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.80000000000000004 }, + { 1.7340021007794567e+35, 20.000000000000000, 20.000000000000000, + 8.0000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=20.000000000000000, c=8.0000000000000000. +template <typename Tp> +void test244() +{ + 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(data244) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data244[i].a), Tp(data244[i].b), + Tp(data244[i].c), Tp(data244[i].x)); + const Tp f0 = data244[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.5000000000000005e-05)); +} + +// Test data for a=20.000000000000000, b=20.000000000000000, c=10.000000000000000. +testcase_hyperg<double> data245[] = { + { -1.7945363894141429e-10, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.90000000000000002 }, + { -4.4440666675421800e-10, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.80000000000000004 }, + { 6.6171630913717945e-10, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.69999999999999996 }, + { 1.5453889642199650e-08, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.59999999999999998 }, + { 7.5754083860094422e-08, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.50000000000000000 }, + { -4.1113628639873710e-07, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.40000000000000002 }, + { -9.5300704265214247e-06, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.30000000000000004 }, + { 0.00016081533175785109, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.19999999999999996 }, + { 0.017684650940379486, 20.000000000000000, 20.000000000000000, + 10.000000000000000, -0.099999999999999978 }, + { 1.0000000000000000, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.0000000000000000 }, + { 57.562247312454403, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.10000000000000009 }, + { 4124.4159820362511, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.19999999999999996 }, + { 428774.21436196787, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.30000000000000004 }, + { 76996819.900892526, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.39999999999999991 }, + { 30473174828.943691, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.50000000000000000 }, + { 39291970835753.094, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.60000000000000009 }, + { 3.3890331048069018e+17, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.69999999999999996 }, + { 9.7157373454594049e+22, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.80000000000000004 }, + { 1.5205808288860858e+32, 20.000000000000000, 20.000000000000000, + 10.000000000000000, 0.89999999999999991 }, +}; + +// Test function for a=20.000000000000000, b=20.000000000000000, c=10.000000000000000. +template <typename Tp> +void test245() +{ + 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(data245) + / sizeof(testcase_hyperg<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::hyperg(Tp(data245[i].a), Tp(data245[i].b), + Tp(data245[i].c), Tp(data245[i].x)); + const Tp f0 = data245[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.5000000000000005e-05)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + test037<double>(); + test038<double>(); + test039<double>(); + test040<double>(); + test041<double>(); + test042<double>(); + test043<double>(); + test044<double>(); + test045<double>(); + test046<double>(); + test047<double>(); + test048<double>(); + test049<double>(); + test050<double>(); + test051<double>(); + test052<double>(); + test053<double>(); + test054<double>(); + test055<double>(); + test056<double>(); + test057<double>(); + test058<double>(); + test059<double>(); + test060<double>(); + test061<double>(); + test062<double>(); + test063<double>(); + test064<double>(); + test065<double>(); + test066<double>(); + test067<double>(); + test068<double>(); + test069<double>(); + test070<double>(); + test071<double>(); + test072<double>(); + test073<double>(); + test074<double>(); + test075<double>(); + test076<double>(); + test077<double>(); + test078<double>(); + test079<double>(); + test080<double>(); + test081<double>(); + test082<double>(); + test083<double>(); + test084<double>(); + test085<double>(); + test086<double>(); + test087<double>(); + test088<double>(); + test089<double>(); + test090<double>(); + test091<double>(); + test092<double>(); + test093<double>(); + test094<double>(); + test095<double>(); + test096<double>(); + test097<double>(); + test098<double>(); + test099<double>(); + test100<double>(); + test101<double>(); + test102<double>(); + test103<double>(); + test104<double>(); + test105<double>(); + test106<double>(); + test107<double>(); + test108<double>(); + test109<double>(); + test110<double>(); + test111<double>(); + test112<double>(); + test113<double>(); + test114<double>(); + test115<double>(); + test116<double>(); + test117<double>(); + test118<double>(); + test119<double>(); + test120<double>(); + test121<double>(); + test122<double>(); + test123<double>(); + test124<double>(); + test125<double>(); + test126<double>(); + test127<double>(); + test128<double>(); + test129<double>(); + test130<double>(); + test131<double>(); + test132<double>(); + test133<double>(); + test134<double>(); + test135<double>(); + test136<double>(); + test137<double>(); + test138<double>(); + test139<double>(); + test140<double>(); + test141<double>(); + test142<double>(); + test143<double>(); + test144<double>(); + test145<double>(); + test146<double>(); + test147<double>(); + test148<double>(); + test149<double>(); + test150<double>(); + test151<double>(); + test152<double>(); + test153<double>(); + test154<double>(); + test155<double>(); + test156<double>(); + test157<double>(); + test158<double>(); + test159<double>(); + test160<double>(); + test161<double>(); + test162<double>(); + test163<double>(); + test164<double>(); + test165<double>(); + test166<double>(); + test167<double>(); + test168<double>(); + test169<double>(); + test170<double>(); + test171<double>(); + test172<double>(); + test173<double>(); + test174<double>(); + test175<double>(); + test176<double>(); + test177<double>(); + test178<double>(); + test179<double>(); + test180<double>(); + test181<double>(); + test182<double>(); + test183<double>(); + test184<double>(); + test185<double>(); + test186<double>(); + test187<double>(); + test188<double>(); + test189<double>(); + test190<double>(); + test191<double>(); + test192<double>(); + test193<double>(); + test194<double>(); + test195<double>(); + test196<double>(); + test197<double>(); + test198<double>(); + test199<double>(); + test200<double>(); + test201<double>(); + test202<double>(); + test203<double>(); + test204<double>(); + test205<double>(); + test206<double>(); + test207<double>(); + test208<double>(); + test209<double>(); + test210<double>(); + test211<double>(); + test212<double>(); + test213<double>(); + test214<double>(); + test215<double>(); + test216<double>(); + test217<double>(); + test218<double>(); + test219<double>(); + test220<double>(); + test221<double>(); + test222<double>(); + test223<double>(); + test224<double>(); + test225<double>(); + test226<double>(); + test227<double>(); + test228<double>(); + test229<double>(); + test230<double>(); + test231<double>(); + test232<double>(); + test233<double>(); + test234<double>(); + test235<double>(); + test236<double>(); + test237<double>(); + test238<double>(); + test239<double>(); + test240<double>(); + test241<double>(); + test242<double>(); + test243<double>(); + test244<double>(); + test245<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile.cc new file mode 100644 index 00000000000..3c322af3e1f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile_2.cc new file mode 100644 index 00000000000..fe51de72ce7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/17_hyperg/compile_2.cc @@ -0,0 +1,42 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_nan.cc new file mode 100644 index 00000000000..121a4528d06 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_nan.cc @@ -0,0 +1,59 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_value.cc new file mode 100644 index 00000000000..ceef9d17119 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/check_value.cc @@ -0,0 +1,470 @@ +// 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. + +// laguerre + + +// 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 for n=0. +testcase_laguerre<double> data001[] = { + { 1.0000000000000000, 0, 0.0000000000000000 }, + { 1.0000000000000000, 0, 5.0000000000000000 }, + { 1.0000000000000000, 0, 10.000000000000000 }, + { 1.0000000000000000, 0, 15.000000000000000 }, + { 1.0000000000000000, 0, 20.000000000000000 }, + { 1.0000000000000000, 0, 25.000000000000000 }, + { 1.0000000000000000, 0, 30.000000000000000 }, + { 1.0000000000000000, 0, 35.000000000000000 }, + { 1.0000000000000000, 0, 40.000000000000000 }, + { 1.0000000000000000, 0, 45.000000000000000 }, + { 1.0000000000000000, 0, 50.000000000000000 }, + { 1.0000000000000000, 0, 55.000000000000000 }, + { 1.0000000000000000, 0, 60.000000000000000 }, + { 1.0000000000000000, 0, 65.000000000000000 }, + { 1.0000000000000000, 0, 70.000000000000000 }, + { 1.0000000000000000, 0, 75.000000000000000 }, + { 1.0000000000000000, 0, 80.000000000000000 }, + { 1.0000000000000000, 0, 85.000000000000000 }, + { 1.0000000000000000, 0, 90.000000000000000 }, + { 1.0000000000000000, 0, 95.000000000000000 }, + { 1.0000000000000000, 0, 100.00000000000000 }, +}; + +// Test function for n=0. +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_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data001[i].n), 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)); +} + +// Test data for n=1. +testcase_laguerre<double> data002[] = { + { 1.0000000000000000, 1, 0.0000000000000000 }, + { -4.0000000000000000, 1, 5.0000000000000000 }, + { -9.0000000000000000, 1, 10.000000000000000 }, + { -14.000000000000000, 1, 15.000000000000000 }, + { -19.000000000000000, 1, 20.000000000000000 }, + { -24.000000000000000, 1, 25.000000000000000 }, + { -29.000000000000000, 1, 30.000000000000000 }, + { -34.000000000000000, 1, 35.000000000000000 }, + { -39.000000000000000, 1, 40.000000000000000 }, + { -44.000000000000000, 1, 45.000000000000000 }, + { -49.000000000000000, 1, 50.000000000000000 }, + { -54.000000000000000, 1, 55.000000000000000 }, + { -59.000000000000000, 1, 60.000000000000000 }, + { -64.000000000000000, 1, 65.000000000000000 }, + { -69.000000000000000, 1, 70.000000000000000 }, + { -74.000000000000000, 1, 75.000000000000000 }, + { -79.000000000000000, 1, 80.000000000000000 }, + { -84.000000000000000, 1, 85.000000000000000 }, + { -89.000000000000000, 1, 90.000000000000000 }, + { -94.000000000000000, 1, 95.000000000000000 }, + { -99.000000000000000, 1, 100.00000000000000 }, +}; + +// Test function for n=1. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data002[i].n), Tp(data002[i].x)); + const Tp f0 = data002[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)); +} + +// Test data for n=2. +testcase_laguerre<double> data003[] = { + { 1.0000000000000000, 2, 0.0000000000000000 }, + { 3.5000000000000000, 2, 5.0000000000000000 }, + { 31.000000000000000, 2, 10.000000000000000 }, + { 83.500000000000000, 2, 15.000000000000000 }, + { 161.00000000000000, 2, 20.000000000000000 }, + { 263.50000000000000, 2, 25.000000000000000 }, + { 391.00000000000000, 2, 30.000000000000000 }, + { 543.50000000000000, 2, 35.000000000000000 }, + { 721.00000000000000, 2, 40.000000000000000 }, + { 923.50000000000000, 2, 45.000000000000000 }, + { 1151.0000000000000, 2, 50.000000000000000 }, + { 1403.5000000000000, 2, 55.000000000000000 }, + { 1681.0000000000000, 2, 60.000000000000000 }, + { 1983.5000000000000, 2, 65.000000000000000 }, + { 2311.0000000000000, 2, 70.000000000000000 }, + { 2663.5000000000000, 2, 75.000000000000000 }, + { 3041.0000000000000, 2, 80.000000000000000 }, + { 3443.5000000000000, 2, 85.000000000000000 }, + { 3871.0000000000000, 2, 90.000000000000000 }, + { 4323.5000000000000, 2, 95.000000000000000 }, + { 4801.0000000000000, 2, 100.00000000000000 }, +}; + +// Test function for n=2. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data003[i].n), Tp(data003[i].x)); + const Tp f0 = data003[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)); +} + +// Test data for n=5. +testcase_laguerre<double> data004[] = { + { 1.0000000000000000, 5, 0.0000000000000000 }, + { -3.1666666666666665, 5, 5.0000000000000000 }, + { 34.333333333333329, 5, 10.000000000000000 }, + { -355.25000000000000, 5, 15.000000000000000 }, + { -4765.6666666666670, 5, 20.000000000000000 }, + { -23040.666666666664, 5, 25.000000000000000 }, + { -74399.000000000000, 5, 30.000000000000000 }, + { -190559.41666666663, 5, 35.000000000000000 }, + { -418865.66666666663, 5, 40.000000000000000 }, + { -825411.50000000000, 5, 45.000000000000000 }, + { -1498165.6666666665, 5, 50.000000000000000 }, + { -2550096.9166666670, 5, 55.000000000000000 }, + { -4122299.0000000000, 5, 60.000000000000000 }, + { -6387115.6666666670, 5, 65.000000000000000 }, + { -9551265.6666666679, 5, 70.000000000000000 }, + { -13858967.750000000, 5, 75.000000000000000 }, + { -19595065.666666664, 5, 80.000000000000000 }, + { -27088153.166666668, 5, 85.000000000000000 }, + { -36713699.000000000, 5, 90.000000000000000 }, + { -48897171.916666657, 5, 95.000000000000000 }, + { -64117165.666666664, 5, 100.00000000000000 }, +}; + +// Test function for n=5. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data004[i].n), Tp(data004[i].x)); + const Tp f0 = data004[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)); +} + +// Test data for n=10. +testcase_laguerre<double> data005[] = { + { 1.0000000000000000, 10, 0.0000000000000000 }, + { 1.7562761794532620, 10, 5.0000000000000000 }, + { 27.984126984126981, 10, 10.000000000000000 }, + { -237.51841517857147, 10, 15.000000000000000 }, + { 3227.8077601410932, 10, 20.000000000000000 }, + { -45786.199797453693, 10, 25.000000000000000 }, + { 15129.571428571489, 10, 30.000000000000000 }, + { 7764800.8179494590, 10, 35.000000000000000 }, + { 79724066.608465582, 10, 40.000000000000000 }, + { 469865425.65122765, 10, 45.000000000000000 }, + { 2037190065.3738980, 10, 50.000000000000000 }, + { 7187828002.9825764, 10, 55.000000000000000 }, + { 21804200401.000000, 10, 60.000000000000000 }, + { 58854343015.616211, 10, 65.000000000000000 }, + { 144688291819.51855, 10, 70.000000000000000 }, + { 329425241736.70038, 10, 75.000000000000000 }, + { 703324772760.08276, 10, 80.000000000000000 }, + { 1421627560118.6157, 10, 85.000000000000000 }, + { 2741055412243.8569, 10, 90.000000000000000 }, + { 5071986977681.8652, 10, 95.000000000000000 }, + { 9051283795429.5723, 10, 100.00000000000000 }, +}; + +// Test function for n=10. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data005[i].n), Tp(data005[i].x)); + const Tp f0 = data005[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)); +} + +// Test data for n=20. +testcase_laguerre<double> data006[] = { + { 1.0000000000000000, 20, 0.0000000000000000 }, + { 2.0202257444769129, 20, 5.0000000000000000 }, + { -11.961333867812119, 20, 10.000000000000000 }, + { -50.151037960139455, 20, 15.000000000000000 }, + { 2829.4728613531738, 20, 20.000000000000000 }, + { -11583.947899113535, 20, 25.000000000000000 }, + { -18439.424502520938, 20, 30.000000000000000 }, + { -38838.223606979467, 20, 35.000000000000000 }, + { 24799805.877530701, 20, 40.000000000000000 }, + { -673953823.59913290, 20, 45.000000000000000 }, + { 7551960453.7672529, 20, 50.000000000000000 }, + { 31286508510.614754, 20, 55.000000000000000 }, + { -1379223608444.9155, 20, 60.000000000000000 }, + { -6692517968212.9727, 20, 65.000000000000000 }, + { 165423821874449.94, 20, 70.000000000000000 }, + { 3082390018008546.5, 20, 75.000000000000000 }, + { 29500368536981676., 20, 80.000000000000000 }, + { 2.0353526354974186e+17, 20, 85.000000000000000 }, + { 1.1292309514432899e+18, 20, 90.000000000000000 }, + { 5.3239262855563100e+18, 20, 95.000000000000000 }, + { 2.2061882785931735e+19, 20, 100.00000000000000 }, +}; + +// Test function for n=20. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data006[i].n), Tp(data006[i].x)); + const Tp f0 = data006[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(1.0000000000000008e-12)); +} + +// Test data for n=50. +testcase_laguerre<double> data007[] = { + { 1.0000000000000000, 50, 0.0000000000000000 }, + { 1.4735258819430563, 50, 5.0000000000000000 }, + { 17.534183446338233, 50, 10.000000000000000 }, + { -195.62436619077388, 50, 15.000000000000000 }, + { 980.26961889790766, 50, 20.000000000000000 }, + { 24812.277673870871, 50, 25.000000000000000 }, + { 293000.50735962350, 50, 30.000000000000000 }, + { 2316195.5013375296, 50, 35.000000000000000 }, + { -14896937.968694847, 50, 40.000000000000000 }, + { -502066598.00813466, 50, 45.000000000000000 }, + { 2513677852.6916885, 50, 50.000000000000000 }, + { 45129675503.538948, 50, 55.000000000000000 }, + { -883876565337.99207, 50, 60.000000000000000 }, + { 9361319947203.8379, 50, 65.000000000000000 }, + { -80967880733583.219, 50, 70.000000000000000 }, + { 717391079438942.88, 50, 75.000000000000000 }, + { -8217471769564850.0, 50, 80.000000000000000 }, + { 1.2595276229009984e+17, 50, 85.000000000000000 }, + { -2.1140031308048906e+18, 50, 90.000000000000000 }, + { 3.2438187475835138e+19, 50, 95.000000000000000 }, + { -3.9710103487094673e+20, 50, 100.00000000000000 }, +}; + +// Test function for n=50. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data007[i].n), Tp(data007[i].x)); + const Tp f0 = data007[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)); +} + +// Test data for n=100. +testcase_laguerre<double> data008[] = { + { 1.0000000000000000, 100, 0.0000000000000000 }, + { 1.4555271625328832, 100, 5.0000000000000000 }, + { 13.277662844303402, 100, 10.000000000000000 }, + { 91.737038454342013, 100, 15.000000000000000 }, + { 1854.0367283243393, 100, 20.000000000000000 }, + { -11281.698886837237, 100, 25.000000000000000 }, + { 170141.86987046539, 100, 30.000000000000000 }, + { -2950092.7025822792, 100, 35.000000000000000 }, + { -7272442.3156007063, 100, 40.000000000000000 }, + { 295697471.90876174, 100, 45.000000000000000 }, + { 4847420871.2690468, 100, 50.000000000000000 }, + { 59406998102.392273, 100, 55.000000000000000 }, + { 693492765740.29736, 100, 60.000000000000000 }, + { 6606192010150.3096, 100, 65.000000000000000 }, + { 17125518672239.707, 100, 70.000000000000000 }, + { -870493767065151.38, 100, 75.000000000000000 }, + { -13763178176383754., 100, 80.000000000000000 }, + { 30667078414479724., 100, 85.000000000000000 }, + { 2.1307220490380198e+18, 100, 90.000000000000000 }, + { -7.2706523009007862e+18, 100, 95.000000000000000 }, + { -2.6292260693068920e+20, 100, 100.00000000000000 }, +}; + +// Test function for n=100. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_laguerre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::laguerre(Tp(data008[i].n), Tp(data008[i].x)); + const Tp f0 = data008[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>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile.cc new file mode 100644 index 00000000000..750724cf0d0 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile.cc @@ -0,0 +1,44 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile_2.cc new file mode 100644 index 00000000000..157cc29649c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/18_laguerre/compile_2.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_nan.cc new file mode 100644 index 00000000000..e051b3cadff --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_nan.cc @@ -0,0 +1,59 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_value.cc new file mode 100644 index 00000000000..dd70e0bd736 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/check_value.cc @@ -0,0 +1,470 @@ +// 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. + +// legendre + + +// 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 for l=0. +testcase_legendre<double> data001[] = { + { 1.0000000000000000, 0, -1.0000000000000000 }, + { 1.0000000000000000, 0, -0.90000000000000002 }, + { 1.0000000000000000, 0, -0.80000000000000004 }, + { 1.0000000000000000, 0, -0.69999999999999996 }, + { 1.0000000000000000, 0, -0.59999999999999998 }, + { 1.0000000000000000, 0, -0.50000000000000000 }, + { 1.0000000000000000, 0, -0.40000000000000002 }, + { 1.0000000000000000, 0, -0.30000000000000004 }, + { 1.0000000000000000, 0, -0.19999999999999996 }, + { 1.0000000000000000, 0, -0.099999999999999978 }, + { 1.0000000000000000, 0, 0.0000000000000000 }, + { 1.0000000000000000, 0, 0.10000000000000009 }, + { 1.0000000000000000, 0, 0.19999999999999996 }, + { 1.0000000000000000, 0, 0.30000000000000004 }, + { 1.0000000000000000, 0, 0.39999999999999991 }, + { 1.0000000000000000, 0, 0.50000000000000000 }, + { 1.0000000000000000, 0, 0.60000000000000009 }, + { 1.0000000000000000, 0, 0.69999999999999996 }, + { 1.0000000000000000, 0, 0.80000000000000004 }, + { 1.0000000000000000, 0, 0.89999999999999991 }, + { 1.0000000000000000, 0, 1.0000000000000000 }, +}; + +// Test function for l=0. +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_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data001[i].l), 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)); +} + +// Test data for l=1. +testcase_legendre<double> data002[] = { + { -1.0000000000000000, 1, -1.0000000000000000 }, + { -0.90000000000000002, 1, -0.90000000000000002 }, + { -0.80000000000000004, 1, -0.80000000000000004 }, + { -0.69999999999999996, 1, -0.69999999999999996 }, + { -0.59999999999999998, 1, -0.59999999999999998 }, + { -0.50000000000000000, 1, -0.50000000000000000 }, + { -0.40000000000000002, 1, -0.40000000000000002 }, + { -0.30000000000000004, 1, -0.30000000000000004 }, + { -0.19999999999999996, 1, -0.19999999999999996 }, + { -0.099999999999999978, 1, -0.099999999999999978 }, + { 0.0000000000000000, 1, 0.0000000000000000 }, + { 0.10000000000000009, 1, 0.10000000000000009 }, + { 0.19999999999999996, 1, 0.19999999999999996 }, + { 0.30000000000000004, 1, 0.30000000000000004 }, + { 0.39999999999999991, 1, 0.39999999999999991 }, + { 0.50000000000000000, 1, 0.50000000000000000 }, + { 0.60000000000000009, 1, 0.60000000000000009 }, + { 0.69999999999999996, 1, 0.69999999999999996 }, + { 0.80000000000000004, 1, 0.80000000000000004 }, + { 0.89999999999999991, 1, 0.89999999999999991 }, + { 1.0000000000000000, 1, 1.0000000000000000 }, +}; + +// Test function for l=1. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data002[i].l), Tp(data002[i].x)); + const Tp f0 = data002[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)); +} + +// Test data for l=2. +testcase_legendre<double> data003[] = { + { 1.0000000000000000, 2, -1.0000000000000000 }, + { 0.71500000000000008, 2, -0.90000000000000002 }, + { 0.46000000000000019, 2, -0.80000000000000004 }, + { 0.23499999999999988, 2, -0.69999999999999996 }, + { 0.039999999999999925, 2, -0.59999999999999998 }, + { -0.12500000000000000, 2, -0.50000000000000000 }, + { -0.25999999999999995, 2, -0.40000000000000002 }, + { -0.36499999999999999, 2, -0.30000000000000004 }, + { -0.44000000000000006, 2, -0.19999999999999996 }, + { -0.48499999999999999, 2, -0.099999999999999978 }, + { -0.50000000000000000, 2, 0.0000000000000000 }, + { -0.48499999999999999, 2, 0.10000000000000009 }, + { -0.44000000000000006, 2, 0.19999999999999996 }, + { -0.36499999999999999, 2, 0.30000000000000004 }, + { -0.26000000000000012, 2, 0.39999999999999991 }, + { -0.12500000000000000, 2, 0.50000000000000000 }, + { 0.040000000000000147, 2, 0.60000000000000009 }, + { 0.23499999999999988, 2, 0.69999999999999996 }, + { 0.46000000000000019, 2, 0.80000000000000004 }, + { 0.71499999999999986, 2, 0.89999999999999991 }, + { 1.0000000000000000, 2, 1.0000000000000000 }, +}; + +// Test function for l=2. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data003[i].l), Tp(data003[i].x)); + const Tp f0 = data003[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)); +} + +// Test data for l=5. +testcase_legendre<double> data004[] = { + { -1.0000000000000000, 5, -1.0000000000000000 }, + { 0.041141249999999997, 5, -0.90000000000000002 }, + { 0.39951999999999993, 5, -0.80000000000000004 }, + { 0.36519874999999991, 5, -0.69999999999999996 }, + { 0.15263999999999994, 5, -0.59999999999999998 }, + { -0.089843750000000000, 5, -0.50000000000000000 }, + { -0.27063999999999988, 5, -0.40000000000000002 }, + { -0.34538624999999995, 5, -0.30000000000000004 }, + { -0.30751999999999996, 5, -0.19999999999999996 }, + { -0.17882874999999995, 5, -0.099999999999999978 }, + { 0.0000000000000000, 5, 0.0000000000000000 }, + { 0.17882875000000015, 5, 0.10000000000000009 }, + { 0.30751999999999996, 5, 0.19999999999999996 }, + { 0.34538624999999995, 5, 0.30000000000000004 }, + { 0.27064000000000010, 5, 0.39999999999999991 }, + { 0.089843750000000000, 5, 0.50000000000000000 }, + { -0.15264000000000022, 5, 0.60000000000000009 }, + { -0.36519874999999991, 5, 0.69999999999999996 }, + { -0.39951999999999993, 5, 0.80000000000000004 }, + { -0.041141250000000407, 5, 0.89999999999999991 }, + { 1.0000000000000000, 5, 1.0000000000000000 }, +}; + +// Test function for l=5. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data004[i].l), Tp(data004[i].x)); + const Tp f0 = data004[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)); +} + +// Test data for l=10. +testcase_legendre<double> data005[] = { + { 1.0000000000000000, 10, -1.0000000000000000 }, + { -0.26314561785585977, 10, -0.90000000000000002 }, + { 0.30052979559999998, 10, -0.80000000000000004 }, + { 0.085805795531640333, 10, -0.69999999999999996 }, + { -0.24366274560000006, 10, -0.59999999999999998 }, + { -0.18822860717773438, 10, -0.50000000000000000 }, + { 0.096839064399999869, 10, -0.40000000000000002 }, + { 0.25147634951601561, 10, -0.30000000000000004 }, + { 0.12907202559999989, 10, -0.19999999999999996 }, + { -0.12212499738710947, 10, -0.099999999999999978 }, + { -0.24609375000000000, 10, 0.0000000000000000 }, + { -0.12212499738710922, 10, 0.10000000000000009 }, + { 0.12907202559999989, 10, 0.19999999999999996 }, + { 0.25147634951601561, 10, 0.30000000000000004 }, + { 0.096839064400000258, 10, 0.39999999999999991 }, + { -0.18822860717773438, 10, 0.50000000000000000 }, + { -0.24366274559999987, 10, 0.60000000000000009 }, + { 0.085805795531640333, 10, 0.69999999999999996 }, + { 0.30052979559999998, 10, 0.80000000000000004 }, + { -0.26314561785585888, 10, 0.89999999999999991 }, + { 1.0000000000000000, 10, 1.0000000000000000 }, +}; + +// Test function for l=10. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data005[i].l), Tp(data005[i].x)); + const Tp f0 = data005[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)); +} + +// Test data for l=20. +testcase_legendre<double> data006[] = { + { 1.0000000000000000, 20, -1.0000000000000000 }, + { -0.14930823530984821, 20, -0.90000000000000002 }, + { 0.22420460541741344, 20, -0.80000000000000004 }, + { -0.20457394463834172, 20, -0.69999999999999996 }, + { 0.15916752910098114, 20, -0.59999999999999998 }, + { -0.048358381067373557, 20, -0.50000000000000000 }, + { -0.10159261558628156, 20, -0.40000000000000002 }, + { 0.18028715947998047, 20, -0.30000000000000004 }, + { -0.098042194344594741, 20, -0.19999999999999996 }, + { -0.082077130944527649, 20, -0.099999999999999978 }, + { 0.17619705200195312, 20, 0.0000000000000000 }, + { -0.082077130944528037, 20, 0.10000000000000009 }, + { -0.098042194344594741, 20, 0.19999999999999996 }, + { 0.18028715947998047, 20, 0.30000000000000004 }, + { -0.10159261558628112, 20, 0.39999999999999991 }, + { -0.048358381067373557, 20, 0.50000000000000000 }, + { 0.15916752910098084, 20, 0.60000000000000009 }, + { -0.20457394463834172, 20, 0.69999999999999996 }, + { 0.22420460541741344, 20, 0.80000000000000004 }, + { -0.14930823530984949, 20, 0.89999999999999991 }, + { 1.0000000000000000, 20, 1.0000000000000000 }, +}; + +// Test function for l=20. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data006[i].l), Tp(data006[i].x)); + const Tp f0 = data006[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)); +} + +// Test data for l=50. +testcase_legendre<double> data007[] = { + { 1.0000000000000000, 50, -1.0000000000000000 }, + { -0.17003765994383685, 50, -0.90000000000000002 }, + { 0.13879737345093118, 50, -0.80000000000000004 }, + { -0.014572731645892805, 50, -0.69999999999999996 }, + { -0.058860798844002173, 50, -0.59999999999999998 }, + { -0.031059099239609828, 50, -0.50000000000000000 }, + { 0.041569033381825368, 50, -0.40000000000000002 }, + { 0.10911051574714808, 50, -0.30000000000000004 }, + { 0.083432272204197466, 50, -0.19999999999999996 }, + { -0.038205812661313579, 50, -0.099999999999999978 }, + { -0.11227517265921705, 50, 0.0000000000000000 }, + { -0.038205812661314169, 50, 0.10000000000000009 }, + { 0.083432272204197466, 50, 0.19999999999999996 }, + { 0.10911051574714808, 50, 0.30000000000000004 }, + { 0.041569033381824647, 50, 0.39999999999999991 }, + { -0.031059099239609828, 50, 0.50000000000000000 }, + { -0.058860798844001430, 50, 0.60000000000000009 }, + { -0.014572731645892805, 50, 0.69999999999999996 }, + { 0.13879737345093118, 50, 0.80000000000000004 }, + { -0.17003765994383663, 50, 0.89999999999999991 }, + { 1.0000000000000000, 50, 1.0000000000000000 }, +}; + +// Test function for l=50. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data007[i].l), Tp(data007[i].x)); + const Tp f0 = data007[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)); +} + +// Test data for l=100. +testcase_legendre<double> data008[] = { + { 1.0000000000000000, 100, -1.0000000000000000 }, + { 0.10226582055871908, 100, -0.90000000000000002 }, + { 0.050861167913584124, 100, -0.80000000000000004 }, + { -0.077132507199778780, 100, -0.69999999999999996 }, + { -0.023747023905133110, 100, -0.59999999999999998 }, + { -0.060518025961861198, 100, -0.50000000000000000 }, + { -0.072258202125684429, 100, -0.40000000000000002 }, + { 0.057127392202801719, 100, -0.30000000000000004 }, + { 0.014681835355659636, 100, -0.19999999999999996 }, + { -0.063895098434750303, 100, -0.099999999999999978 }, + { 0.079589237387178727, 100, 0.0000000000000000 }, + { -0.063895098434749775, 100, 0.10000000000000009 }, + { 0.014681835355659636, 100, 0.19999999999999996 }, + { 0.057127392202801719, 100, 0.30000000000000004 }, + { -0.072258202125685012, 100, 0.39999999999999991 }, + { -0.060518025961861198, 100, 0.50000000000000000 }, + { -0.023747023905134217, 100, 0.60000000000000009 }, + { -0.077132507199778780, 100, 0.69999999999999996 }, + { 0.050861167913584124, 100, 0.80000000000000004 }, + { 0.10226582055871723, 100, 0.89999999999999991 }, + { 1.0000000000000000, 100, 1.0000000000000000 }, +}; + +// Test function for l=100. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::legendre(Tp(data008[i].l), Tp(data008[i].x)); + const Tp f0 = data008[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>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile.cc new file mode 100644 index 00000000000..c00cca67361 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile.cc @@ -0,0 +1,44 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile_2.cc new file mode 100644 index 00000000000..f69dfa32543 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/19_legendre/compile_2.cc @@ -0,0 +1,43 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_nan.cc new file mode 100644 index 00000000000..bdfa2e9af18 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_nan.cc @@ -0,0 +1,57 @@ +// { 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_neg.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_neg.cc new file mode 100644 index 00000000000..2a86846ea4a --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_neg.cc @@ -0,0 +1,133 @@ +// 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; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_pos.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_pos.cc new file mode 100644 index 00000000000..3188c334f5b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/check_value_pos.cc @@ -0,0 +1,223 @@ +// 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[] = { + { 5.5915824411777502, 1.2000000000000000 }, + { 3.1055472779775792, 1.3999999999999999 }, + { 2.2857656656801324, 1.6000000000000001 }, + { 1.8822296181028220, 1.8000000000000000 }, + { 1.6449340668482275, 2.0000000000000000 }, + { 1.4905432565068937, 2.2000000000000002 }, + { 1.3833428588407359, 2.3999999999999999 }, + { 1.3054778090727803, 2.6000000000000001 }, + { 1.2470314223172541, 2.7999999999999998 }, + { 1.2020569031595945, 3.0000000000000000 }, + { 1.1667733709844674, 3.2000000000000002 }, + { 1.1386637757280420, 3.3999999999999999 }, + { 1.1159890791233376, 3.6000000000000001 }, + { 1.0975105764590047, 3.7999999999999998 }, + { 1.0823232337111381, 4.0000000000000000 }, + { 1.0697514772338095, 4.2000000000000002 }, + { 1.0592817259798355, 4.4000000000000004 }, + { 1.0505173825665735, 4.5999999999999996 }, + { 1.0431480133351789, 4.7999999999999998 }, + { 1.0369277551433700, 5.0000000000000000 }, + { 1.0316598766779168, 5.2000000000000002 }, + { 1.0271855389203537, 5.4000000000000004 }, + { 1.0233754792270300, 5.5999999999999996 }, + { 1.0201237683883446, 5.7999999999999998 }, + { 1.0173430619844492, 6.0000000000000000 }, + { 1.0149609451852233, 6.2000000000000002 }, + { 1.0129170887121841, 6.4000000000000004 }, + { 1.0111610141542708, 6.5999999999999996 }, + { 1.0096503223447120, 6.7999999999999998 }, + { 1.0083492773819229, 7.0000000000000000 }, + { 1.0072276664807169, 7.2000000000000002 }, + { 1.0062598756930512, 7.4000000000000004 }, + { 1.0054241359879634, 7.5999999999999996 }, + { 1.0047019048164696, 7.7999999999999998 }, + { 1.0040773561979444, 8.0000000000000000 }, + { 1.0035369583062013, 8.1999999999999993 }, + { 1.0030691220374448, 8.4000000000000004 }, + { 1.0026639074861505, 8.5999999999999996 }, + { 1.0023127779098220, 8.8000000000000007 }, + { 1.0020083928260823, 9.0000000000000000 }, + { 1.0017444334995897, 9.1999999999999993 }, + { 1.0015154553480514, 9.4000000000000004 }, + { 1.0013167628052648, 9.5999999999999996 }, + { 1.0011443029840295, 9.8000000000000007 }, + { 1.0009945751278182, 10.000000000000000 }, + { 1.0008645533615086, 10.199999999999999 }, + { 1.0007516206744649, 10.400000000000000 }, + { 1.0006535124140847, 10.600000000000000 }, + { 1.0005682678503411, 10.800000000000001 }, + { 1.0004941886041194, 11.000000000000000 }, + { 1.0004298029239944, 11.199999999999999 }, + { 1.0003738349551168, 11.400000000000000 }, + { 1.0003251782761946, 11.600000000000000 }, + { 1.0002828730909989, 11.800000000000001 }, + { 1.0002460865533080, 12.000000000000000 }, + { 1.0002140957818750, 12.199999999999999 }, + { 1.0001862731874056, 12.400000000000000 }, + { 1.0001620737887460, 12.600000000000000 }, + { 1.0001410242422089, 12.800000000000001 }, + { 1.0001227133475783, 13.000000000000000 }, + { 1.0001067838280169, 13.199999999999999 }, + { 1.0000929252097515, 13.400000000000000 }, + { 1.0000808676518718, 13.600000000000000 }, + { 1.0000703765974504, 13.800000000000001 }, + { 1.0000612481350588, 14.000000000000000 }, + { 1.0000533049750668, 14.199999999999999 }, + { 1.0000463929582293, 14.400000000000000 }, + { 1.0000403780253397, 14.600000000000000 }, + { 1.0000351435864272, 14.800000000000001 }, + { 1.0000305882363070, 15.000000000000000 }, + { 1.0000266237704787, 15.199999999999999 }, + { 1.0000231734615617, 15.400000000000000 }, + { 1.0000201705617975, 15.600000000000000 }, + { 1.0000175570017611, 15.800000000000001 }, + { 1.0000152822594086, 16.000000000000000 }, + { 1.0000133023770337, 16.199999999999999 }, + { 1.0000115791066830, 16.399999999999999 }, + { 1.0000100791671644, 16.600000000000001 }, + { 1.0000087735980010, 16.800000000000001 }, + { 1.0000076371976379, 17.000000000000000 }, + { 1.0000066480348633, 17.199999999999999 }, + { 1.0000057870238734, 17.399999999999999 }, + { 1.0000050375546607, 17.600000000000001 }, + { 1.0000043851715013, 17.800000000000001 }, + { 1.0000038172932648, 18.000000000000000 }, + { 1.0000033229700953, 18.199999999999999 }, + { 1.0000028926717153, 18.399999999999999 }, + { 1.0000025181032419, 18.600000000000001 }, + { 1.0000021920449287, 18.800000000000001 }, + { 1.0000019082127167, 19.000000000000000 }, + { 1.0000016611368951, 19.199999999999999 }, + { 1.0000014460565094, 19.399999999999999 }, + { 1.0000012588274738, 19.600000000000001 }, + { 1.0000010958426055, 19.800000000000001 }, + { 1.0000009539620338, 20.000000000000000 }, + { 1.0000008304526344, 20.199999999999999 }, + { 1.0000007229353187, 20.399999999999999 }, + { 1.0000006293391575, 20.600000000000001 }, + { 1.0000005478614529, 20.800000000000001 }, + { 1.0000004769329869, 21.000000000000000 }, + { 1.0000004151877719, 21.199999999999999 }, + { 1.0000003614367254, 21.399999999999999 }, + { 1.0000003146447527, 21.600000000000001 }, + { 1.0000002739108020, 21.800000000000001 }, + { 1.0000002384505029, 22.000000000000000 }, + { 1.0000002075810521, 22.199999999999999 }, + { 1.0000001807080625, 22.399999999999999 }, + { 1.0000001573141093, 22.600000000000001 }, + { 1.0000001369487659, 22.800000000000001 }, + { 1.0000001192199262, 23.000000000000000 }, + { 1.0000001037862520, 23.199999999999999 }, + { 1.0000000903506006, 23.399999999999999 }, + { 1.0000000786543011, 23.600000000000001 }, + { 1.0000000684721728, 23.800000000000001 }, + { 1.0000000596081891, 24.000000000000000 }, + { 1.0000000518917020, 24.199999999999999 }, + { 1.0000000451741575, 24.399999999999999 }, + { 1.0000000393262332, 24.600000000000001 }, + { 1.0000000342353501, 24.800000000000001 }, + { 1.0000000298035037, 25.000000000000000 }, + { 1.0000000259453767, 25.199999999999999 }, + { 1.0000000225866978, 25.399999999999999 }, + { 1.0000000196628109, 25.600000000000001 }, + { 1.0000000171174297, 25.800000000000001 }, + { 1.0000000149015549, 26.000000000000000 }, + { 1.0000000129725304, 26.199999999999999 }, + { 1.0000000112932221, 26.399999999999999 }, + { 1.0000000098313035, 26.600000000000001 }, + { 1.0000000085586331, 26.800000000000001 }, + { 1.0000000074507118, 27.000000000000000 }, + { 1.0000000064862125, 27.199999999999999 }, + { 1.0000000056465688, 27.399999999999999 }, + { 1.0000000049156179, 27.600000000000001 }, + { 1.0000000042792894, 27.800000000000001 }, + { 1.0000000037253340, 28.000000000000000 }, + { 1.0000000032430887, 28.199999999999999 }, + { 1.0000000028232703, 28.399999999999999 }, + { 1.0000000024577977, 28.600000000000001 }, + { 1.0000000021396356, 28.800000000000001 }, + { 1.0000000018626598, 29.000000000000000 }, + { 1.0000000016215385, 29.199999999999999 }, + { 1.0000000014116306, 29.399999999999999 }, + { 1.0000000012288952, 29.600000000000001 }, + { 1.0000000010698147, 29.800000000000001 }, + { 1.0000000009313275, 30.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_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(2.5000000000000020e-13)); +} + +int main(int, char**) +{ + test001<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile.cc new file mode 100644 index 00000000000..9e39e03468b --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile.cc @@ -0,0 +1,42 @@ +// { 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.20 riemann_zeta + +#include <tr1/cmath> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + std::tr1::riemann_zeta(xf); + std::tr1::riemann_zetaf(xf); + std::tr1::riemann_zeta(xd); + std::tr1::riemann_zeta(xl); + std::tr1::riemann_zetal(xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile_2.cc new file mode 100644 index 00000000000..60e2667b1ec --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/20_riemann_zeta/compile_2.cc @@ -0,0 +1,42 @@ +// { 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.20 riemann_zeta + +#include <tr1/math.h> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + + riemann_zeta(xf); + riemann_zetaf(xf); + riemann_zeta(xd); + riemann_zeta(xl); + riemann_zetal(xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_nan.cc new file mode 100644 index 00000000000..2b856742d0e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_nan.cc @@ -0,0 +1,58 @@ +// { 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.21 sph_bessel + +#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 = 0; + + float a = std::tr1::sph_bessel(n, xf); + float b = std::tr1::sph_besself(n, xf); + double c = std::tr1::sph_bessel(n, xd); + long double d = std::tr1::sph_bessel(n, xl); + long double e = std::tr1::sph_bessell(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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_value.cc new file mode 100644 index 00000000000..939d641a3bf --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/check_value.cc @@ -0,0 +1,470 @@ +// 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. + +// sph_bessel + + +// 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 for n=0. +testcase_sph_bessel<double> data001[] = { + { 1.0000000000000000, 0, 0.0000000000000000 }, + { -0.19178485493262770, 0, 5.0000000000000000 }, + { -0.054402111088936986, 0, 10.000000000000000 }, + { 0.043352522677141132, 0, 15.000000000000000 }, + { 0.045647262536381385, 0, 20.000000000000000 }, + { -0.0052940700039109216, 0, 25.000000000000000 }, + { -0.032934387469762058, 0, 30.000000000000000 }, + { -0.012233790557032886, 0, 35.000000000000000 }, + { 0.018627829011983722, 0, 40.000000000000000 }, + { 0.018908967211869299, 0, 45.000000000000000 }, + { -0.0052474970740785751, 0, 50.000000000000000 }, + { -0.018177366788338544, 0, 55.000000000000000 }, + { -0.0050801770183702783, 0, 60.000000000000000 }, + { 0.012720441222924669, 0, 65.000000000000000 }, + { 0.011055581165112701, 0, 70.000000000000000 }, + { -0.0051704218054590724, 0, 75.000000000000000 }, + { -0.012423608174042190, 0, 80.000000000000000 }, + { -0.0020714778817480834, 0, 85.000000000000000 }, + { 0.0099332962622284207, 0, 90.000000000000000 }, + { 0.0071922285761696946, 0, 95.000000000000000 }, + { -0.0050636564110975880, 0, 100.00000000000000 }, +}; + +// Test function for n=0. +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_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data001[i].n), 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.5000000000000014e-11)); +} + +// Test data for n=1. +testcase_sph_bessel<double> data002[] = { + { 0.0000000000000000, 1, 0.0000000000000000 }, + { -0.095089408079170795, 1, 5.0000000000000000 }, + { 0.078466941798751549, 1, 10.000000000000000 }, + { 0.053536029035730834, 1, 15.000000000000000 }, + { -0.018121739963850528, 1, 20.000000000000000 }, + { -0.039859875274695380, 1, 25.000000000000000 }, + { -0.0062395279119115375, 1, 30.000000000000000 }, + { 0.025470240415270681, 1, 35.000000000000000 }, + { 0.017139147266606137, 1, 40.000000000000000 }, + { -0.011253622702352454, 1, 45.000000000000000 }, + { -0.019404270511323839, 1, 50.000000000000000 }, + { -0.00073280223727807778, 1, 55.000000000000000 }, + { 0.015788880056613101, 1, 60.000000000000000 }, + { 0.0088488352686322581, 1, 65.000000000000000 }, + { -0.0088894803131598157, 1, 70.000000000000000 }, + { -0.012358955887069445, 1, 75.000000000000000 }, + { 0.0012245454458125673, 1, 80.000000000000000 }, + { 0.011556531358968161, 1, 85.000000000000000 }, + { 0.0050889656932377614, 1, 90.000000000000000 }, + { -0.0076103298149331573, 1, 95.000000000000000 }, + { -0.0086738252869878150, 1, 100.00000000000000 }, +}; + +// Test function for n=1. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data002[i].n), Tp(data002[i].x)); + const Tp f0 = data002[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.0000000000000028e-11)); +} + +// Test data for n=2. +testcase_sph_bessel<double> data003[] = { + { 0.0000000000000000, 2, 0.0000000000000000 }, + { 0.13473121008512520, 2, 5.0000000000000000 }, + { 0.077942193628562445, 2, 10.000000000000000 }, + { -0.032645316869994966, 2, 15.000000000000000 }, + { -0.048365523530958965, 2, 20.000000000000000 }, + { 0.00051088497094747614, 2, 25.000000000000000 }, + { 0.032310434678570907, 2, 30.000000000000000 }, + { 0.014416954021198945, 2, 35.000000000000000 }, + { -0.017342392966988262, 2, 40.000000000000000 }, + { -0.019659208725359461, 2, 45.000000000000000 }, + { 0.0040832408433991458, 2, 50.000000000000000 }, + { 0.018137395757214285, 2, 55.000000000000000 }, + { 0.0058696210212009327, 2, 60.000000000000000 }, + { -0.012312033441295490, 2, 65.000000000000000 }, + { -0.011436558892819550, 2, 70.000000000000000 }, + { 0.0046760635699762939, 2, 75.000000000000000 }, + { 0.012469528628260161, 2, 80.000000000000000 }, + { 0.0024793554591234306, 2, 85.000000000000000 }, + { -0.0097636640724538277, 2, 90.000000000000000 }, + { -0.0074325547808517939, 2, 95.000000000000000 }, + { 0.0048034416524879537, 2, 100.00000000000000 }, +}; + +// Test function for n=2. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data003[i].n), Tp(data003[i].x)); + const Tp f0 = data003[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.5000000000000014e-11)); +} + +// Test data for n=5. +testcase_sph_bessel<double> data004[] = { + { 0.0000000000000000, 5, 0.0000000000000000 }, + { 0.10681116145650454, 5, 5.0000000000000000 }, + { -0.055534511621452197, 5, 10.000000000000000 }, + { 0.065968007076521964, 5, 15.000000000000000 }, + { 0.016683908063095686, 5, 20.000000000000000 }, + { -0.036117795989722368, 5, 25.000000000000000 }, + { -0.020504008736827509, 5, 30.000000000000000 }, + { 0.018499481206814564, 5, 35.000000000000000 }, + { 0.022448773791045016, 5, 40.000000000000000 }, + { -0.0048552694845020103, 5, 45.000000000000000 }, + { -0.020048300563664877, 5, 50.000000000000000 }, + { -0.0052999924455565672, 5, 55.000000000000000 }, + { 0.014151556281331405, 5, 60.000000000000000 }, + { 0.011354588594416765, 5, 65.000000000000000 }, + { -0.0064983781785323642, 5, 70.000000000000000 }, + { -0.013089909320064264, 5, 75.000000000000000 }, + { -0.00096200450071301611, 5, 80.000000000000000 }, + { 0.011048668899130202, 5, 85.000000000000000 }, + { 0.0065639581708135976, 5, 90.000000000000000 }, + { -0.0064646119368202771, 5, 95.000000000000000 }, + { -0.0092901489349075713, 5, 100.00000000000000 }, +}; + +// Test function for n=5. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data004[i].n), Tp(data004[i].x)); + const Tp f0 = data004[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.0000000000000028e-11)); +} + +// Test data for n=10. +testcase_sph_bessel<double> data005[] = { + { 0.0000000000000000, 10, 0.0000000000000000 }, + { 0.00040734424424946052, 10, 5.0000000000000000 }, + { 0.064605154492564279, 10, 10.000000000000000 }, + { 0.0018969790010883629, 10, 15.000000000000000 }, + { 0.039686698644626366, 10, 20.000000000000000 }, + { -0.036253285601128567, 10, 25.000000000000000 }, + { -0.014529646403897820, 10, 30.000000000000000 }, + { 0.026281264603993850, 10, 35.000000000000000 }, + { 0.013124803182748307, 10, 40.000000000000000 }, + { -0.017600831383728963, 10, 45.000000000000000 }, + { -0.015039221463465962, 10, 50.000000000000000 }, + { 0.0095256289349167356, 10, 55.000000000000000 }, + { 0.015822719394008342, 10, 60.000000000000000 }, + { -0.0019391391708249812, 10, 65.000000000000000 }, + { -0.014293389028395010, 10, 70.000000000000000 }, + { -0.0044210285031696184, 10, 75.000000000000000 }, + { 0.010516146958338822, 10, 80.000000000000000 }, + { 0.0086736275131325761, 10, 85.000000000000000 }, + { -0.0052905066357239365, 10, 90.000000000000000 }, + { -0.010258326955210765, 10, 95.000000000000000 }, + { -0.00019565785971342893, 10, 100.00000000000000 }, +}; + +// Test function for n=10. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data005[i].n), Tp(data005[i].x)); + const Tp f0 = data005[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.5000000000000017e-10)); +} + +// Test data for n=20. +testcase_sph_bessel<double> data006[] = { + { 0.0000000000000000, 20, 0.0000000000000000 }, + { 5.4277267607932098e-12, 20, 5.0000000000000000 }, + { 2.3083719613194699e-06, 20, 10.000000000000000 }, + { 0.0015467058510412503, 20, 15.000000000000000 }, + { 0.038324851639805181, 20, 20.000000000000000 }, + { 0.028500071484154683, 20, 25.000000000000000 }, + { -0.014711593353429090, 20, 30.000000000000000 }, + { -0.010797653070264238, 20, 35.000000000000000 }, + { 0.026535391837540286, 20, 40.000000000000000 }, + { -0.011582959134716381, 20, 45.000000000000000 }, + { -0.015785029898269291, 20, 50.000000000000000 }, + { 0.013885519185862756, 20, 55.000000000000000 }, + { 0.011112458964023256, 20, 60.000000000000000 }, + { -0.011938384963927570, 20, 65.000000000000000 }, + { -0.010117695207156906, 20, 70.000000000000000 }, + { 0.0089871214102383128, 20, 75.000000000000000 }, + { 0.010400578884991936, 20, 80.000000000000000 }, + { -0.0055359020656326630, 20, 85.000000000000000 }, + { -0.010639343320787519, 20, 90.000000000000000 }, + { 0.0018051661455979488, 20, 95.000000000000000 }, + { 0.010107671283873054, 20, 100.00000000000000 }, +}; + +// Test function for n=20. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data006[i].n), Tp(data006[i].x)); + const Tp f0 = data006[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.5000000000000014e-11)); +} + +// Test data for n=50. +testcase_sph_bessel<double> data007[] = { + { 0.0000000000000000, 50, 0.0000000000000000 }, + { 2.8574793504401511e-46, 50, 5.0000000000000000 }, + { 2.2306960232186471e-31, 50, 10.000000000000000 }, + { 7.6804716640080780e-23, 50, 15.000000000000000 }, + { 5.6500807918725294e-17, 50, 20.000000000000000 }, + { 1.2540416973758975e-12, 50, 25.000000000000000 }, + { 2.6901637185735330e-09, 50, 30.000000000000000 }, + { 1.0167148174422245e-06, 50, 35.000000000000000 }, + { 9.3949174038179191e-05, 50, 40.000000000000000 }, + { 0.0024888927213794552, 50, 45.000000000000000 }, + { 0.018829107369282640, 50, 50.000000000000000 }, + { 0.026373198438145548, 50, 55.000000000000000 }, + { -0.021230978268739008, 50, 60.000000000000000 }, + { 0.016539881802291316, 50, 65.000000000000000 }, + { -0.015985416061436657, 50, 70.000000000000000 }, + { 0.015462548984405593, 50, 75.000000000000000 }, + { -0.010638570118081834, 50, 80.000000000000000 }, + { 0.00046961239784540576, 50, 85.000000000000000 }, + { 0.0096065882189920234, 50, 90.000000000000000 }, + { -0.010613873910261147, 50, 95.000000000000000 }, + { 0.00057971408822773810, 50, 100.00000000000000 }, +}; + +// Test function for n=50. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data007[i].n), Tp(data007[i].x)); + const Tp f0 = data007[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.5000000000000017e-10)); +} + +// Test data for n=100. +testcase_sph_bessel<double> data008[] = { + { 0.0000000000000000, 100, 0.0000000000000000 }, + { 5.5356503033889938e-120, 100, 5.0000000000000000 }, + { 5.8320401820058771e-90, 100, 10.000000000000000 }, + { 1.7406387750766626e-72, 100, 15.000000000000000 }, + { 3.5152711125317001e-60, 100, 20.000000000000000 }, + { 9.8455459353816024e-51, 100, 25.000000000000000 }, + { 4.0888596744301567e-43, 100, 30.000000000000000 }, + { 8.8975854911134006e-37, 100, 35.000000000000000 }, + { 2.1513492547733837e-31, 100, 40.000000000000000 }, + { 9.3673586994539323e-27, 100, 45.000000000000000 }, + { 1.0190122629310465e-22, 100, 50.000000000000000 }, + { 3.4887804977690321e-19, 100, 55.000000000000000 }, + { 4.4442883425555691e-16, 100, 60.000000000000000 }, + { 2.3832619568710733e-13, 100, 65.000000000000000 }, + { 5.8948384175608103e-11, 100, 70.000000000000000 }, + { 7.1884446357022268e-09, 100, 75.000000000000000 }, + { 4.5247964400094991e-07, 100, 80.000000000000000 }, + { 1.5096093228779059e-05, 100, 85.000000000000000 }, + { 0.00026825172647807507, 100, 90.000000000000000 }, + { 0.0024744308520581030, 100, 95.000000000000000 }, + { 0.010880477011438327, 100, 100.00000000000000 }, +}; + +// Test function for n=100. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_sph_bessel<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_bessel(Tp(data008[i].n), Tp(data008[i].x)); + const Tp f0 = data008[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.0000000000000029e-12)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile.cc new file mode 100644 index 00000000000..fdc66905f26 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile.cc @@ -0,0 +1,43 @@ +// { 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.21 sph_bessel + +#include <tr1/cmath> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int n = 0; + + std::tr1::sph_bessel(n, xf); + std::tr1::sph_besself(n, xf); + std::tr1::sph_bessel(n, xd); + std::tr1::sph_bessel(n, xl); + std::tr1::sph_bessell(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile_2.cc new file mode 100644 index 00000000000..c98dee75746 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/21_sph_bessel/compile_2.cc @@ -0,0 +1,43 @@ +// { 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.21 sph_bessel + +#include <tr1/math.h> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int n = 0; + + sph_bessel(n, xf); + sph_besself(n, xf); + sph_bessel(n, xd); + sph_bessel(n, xl); + sph_bessell(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_nan.cc new file mode 100644 index 00000000000..e8bbfff188f --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_nan.cc @@ -0,0 +1,58 @@ +// { 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.22 sph_legendre + +#include <tr1/cmath> +#include <testsuite_hooks.h> + +void +test01() +{ + + float thetaf = std::numeric_limits<float>::quiet_NaN(); + double thetad = std::numeric_limits<double>::quiet_NaN(); + long double thetal = std::numeric_limits<long double>::quiet_NaN(); + unsigned int l = 2, m = 1; + + float a = std::tr1::sph_legendre(l, m, thetaf); + float b = std::tr1::sph_legendref(l, m, thetaf); + double c = std::tr1::sph_legendre(l, m, thetad); + long double d = std::tr1::sph_legendre(l, m, thetal); + long double e = std::tr1::sph_legendrel(l, m, thetal); + + 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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_value.cc new file mode 100644 index 00000000000..40433666e4c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/check_value.cc @@ -0,0 +1,2746 @@ +// 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. + +// sph_legendre + + +// 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 for l=0, m=0. +testcase_sph_legendre<double> data001[] = { + { 0.28209479177387814, 0, 0, + 0.0000000000000000 }, + { 0.28209479177387814, 0, 0, + 0.15707963267948966 }, + { 0.28209479177387814, 0, 0, + 0.31415926535897931 }, + { 0.28209479177387814, 0, 0, + 0.47123889803846897 }, + { 0.28209479177387814, 0, 0, + 0.62831853071795862 }, + { 0.28209479177387814, 0, 0, + 0.78539816339744828 }, + { 0.28209479177387814, 0, 0, + 0.94247779607693793 }, + { 0.28209479177387814, 0, 0, + 1.0995574287564276 }, + { 0.28209479177387814, 0, 0, + 1.2566370614359172 }, + { 0.28209479177387814, 0, 0, + 1.4137166941154069 }, + { 0.28209479177387814, 0, 0, + 1.5707963267948966 }, + { 0.28209479177387814, 0, 0, + 1.7278759594743860 }, + { 0.28209479177387814, 0, 0, + 1.8849555921538759 }, + { 0.28209479177387814, 0, 0, + 2.0420352248333655 }, + { 0.28209479177387814, 0, 0, + 2.1991148575128552 }, + { 0.28209479177387814, 0, 0, + 2.3561944901923448 }, + { 0.28209479177387814, 0, 0, + 2.5132741228718345 }, + { 0.28209479177387814, 0, 0, + 2.6703537555513241 }, + { 0.28209479177387814, 0, 0, + 2.8274333882308138 }, + { 0.28209479177387814, 0, 0, + 2.9845130209103035 }, + { 0.28209479177387814, 0, 0, + 3.1415926535897931 }, +}; + +// Test function for l=0, m=0. +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_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data001[i].l), Tp(data001[i].m), + Tp(data001[i].theta)); + 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)); +} + +// Test data for l=1, m=0. +testcase_sph_legendre<double> data002[] = { + { 0.48860251190291992, 1, 0, + 0.0000000000000000 }, + { 0.48258700419201100, 1, 0, + 0.15707963267948966 }, + { 0.46468860282345231, 1, 0, + 0.31415926535897931 }, + { 0.43534802584032634, 1, 0, + 0.47123889803846897 }, + { 0.39528773562374975, 1, 0, + 0.62831853071795862 }, + { 0.34549414947133544, 1, 0, + 0.78539816339744828 }, + { 0.28719335072959390, 1, 0, + 0.94247779607693793 }, + { 0.22182089855280451, 1, 0, + 1.0995574287564276 }, + { 0.15098647967228984, 1, 0, + 1.2566370614359172 }, + { 0.076434272566846345, 1, 0, + 1.4137166941154069 }, + { 2.9918275112863369e-17, 1, 0, + 1.5707963267948966 }, + { -0.076434272566846179, 1, 0, + 1.7278759594743860 }, + { -0.15098647967228976, 1, 0, + 1.8849555921538759 }, + { -0.22182089855280446, 1, 0, + 2.0420352248333655 }, + { -0.28719335072959390, 1, 0, + 2.1991148575128552 }, + { -0.34549414947133544, 1, 0, + 2.3561944901923448 }, + { -0.39528773562374969, 1, 0, + 2.5132741228718345 }, + { -0.43534802584032628, 1, 0, + 2.6703537555513241 }, + { -0.46468860282345231, 1, 0, + 2.8274333882308138 }, + { -0.48258700419201095, 1, 0, + 2.9845130209103035 }, + { -0.48860251190291992, 1, 0, + 3.1415926535897931 }, +}; + +// Test function for l=1, m=0. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data002[i].l), Tp(data002[i].m), + Tp(data002[i].theta)); + const Tp f0 = data002[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)); +} + +// Test data for l=1, m=1. +testcase_sph_legendre<double> data003[] = { + { 0.0000000000000000, 1, 1, + 0.0000000000000000 }, + { -0.054047192447077917, 1, 1, + 0.15707963267948966 }, + { -0.10676356364376104, 1, 1, + 0.31415926535897931 }, + { -0.15685106157558129, 1, 1, + 0.47123889803846897 }, + { -0.20307636581258243, 1, 1, + 0.62831853071795862 }, + { -0.24430125595146013, 1, 1, + 0.78539816339744828 }, + { -0.27951063837942880, 1, 1, + 0.94247779607693793 }, + { -0.30783754124787122, 1, 1, + 1.0995574287564276 }, + { -0.32858446219656551, 1, 1, + 1.2566370614359172 }, + { -0.34124054317667202, 1, 1, + 1.4137166941154069 }, + { -0.34549414947133567, 1, 1, + 1.5707963267948966 }, + { -0.34124054317667202, 1, 1, + 1.7278759594743860 }, + { -0.32858446219656556, 1, 1, + 1.8849555921538759 }, + { -0.30783754124787127, 1, 1, + 2.0420352248333655 }, + { -0.27951063837942880, 1, 1, + 2.1991148575128552 }, + { -0.24430125595146013, 1, 1, + 2.3561944901923448 }, + { -0.20307636581258248, 1, 1, + 2.5132741228718345 }, + { -0.15685106157558140, 1, 1, + 2.6703537555513241 }, + { -0.10676356364376104, 1, 1, + 2.8274333882308138 }, + { -0.054047192447078167, 1, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 1, 1, + 3.1415926535897931 }, +}; + +// Test function for l=1, m=1. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data003[i].l), Tp(data003[i].m), + Tp(data003[i].theta)); + const Tp f0 = data003[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)); +} + +// Test data for l=2, m=0. +testcase_sph_legendre<double> data004[] = { + { 0.63078313050504009, 2, 0, + 0.0000000000000000 }, + { 0.60762858760316607, 2, 0, + 0.15707963267948966 }, + { 0.54043148688396569, 2, 0, + 0.31415926535897931 }, + { 0.43576954875556589, 2, 0, + 0.47123889803846897 }, + { 0.30388781294457579, 2, 0, + 0.62831853071795862 }, + { 0.15769578262625994, 2, 0, + 0.78539816339744828 }, + { 0.011503752307944235, 2, 0, + 0.94247779607693793 }, + { -0.12037798350304565, 2, 0, + 1.0995574287564276 }, + { -0.22503992163144573, 2, 0, + 1.2566370614359172 }, + { -0.29223702235064597, 2, 0, + 1.4137166941154069 }, + { -0.31539156525252005, 2, 0, + 1.5707963267948966 }, + { -0.29223702235064608, 2, 0, + 1.7278759594743860 }, + { -0.22503992163144584, 2, 0, + 1.8849555921538759 }, + { -0.12037798350304577, 2, 0, + 2.0420352248333655 }, + { 0.011503752307944235, 2, 0, + 2.1991148575128552 }, + { 0.15769578262625994, 2, 0, + 2.3561944901923448 }, + { 0.30388781294457567, 2, 0, + 2.5132741228718345 }, + { 0.43576954875556562, 2, 0, + 2.6703537555513241 }, + { 0.54043148688396569, 2, 0, + 2.8274333882308138 }, + { 0.60762858760316585, 2, 0, + 2.9845130209103035 }, + { 0.63078313050504009, 2, 0, + 3.1415926535897931 }, +}; + +// Test function for l=2, m=0. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data004[i].l), Tp(data004[i].m), + Tp(data004[i].theta)); + const Tp f0 = data004[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)); +} + +// Test data for l=2, m=1. +testcase_sph_legendre<double> data005[] = { + { 0.0000000000000000, 2, 1, + 0.0000000000000000 }, + { -0.11936529291378727, 2, 1, + 0.15707963267948966 }, + { -0.22704627929027449, 2, 1, + 0.31415926535897931 }, + { -0.31250239392538215, 2, 1, + 0.47123889803846897 }, + { -0.36736859691086526, 2, 1, + 0.62831853071795862 }, + { -0.38627420202318979, 2, 1, + 0.78539816339744828 }, + { -0.36736859691086526, 2, 1, + 0.94247779607693793 }, + { -0.31250239392538226, 2, 1, + 1.0995574287564276 }, + { -0.22704627929027435, 2, 1, + 1.2566370614359172 }, + { -0.11936529291378740, 2, 1, + 1.4137166941154069 }, + { -4.7304946510089748e-17, 2, 1, + 1.5707963267948966 }, + { 0.11936529291378714, 2, 1, + 1.7278759594743860 }, + { 0.22704627929027429, 2, 1, + 1.8849555921538759 }, + { 0.31250239392538226, 2, 1, + 2.0420352248333655 }, + { 0.36736859691086526, 2, 1, + 2.1991148575128552 }, + { 0.38627420202318979, 2, 1, + 2.3561944901923448 }, + { 0.36736859691086526, 2, 1, + 2.5132741228718345 }, + { 0.31250239392538232, 2, 1, + 2.6703537555513241 }, + { 0.22704627929027449, 2, 1, + 2.8274333882308138 }, + { 0.11936529291378781, 2, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 2, 1, + 3.1415926535897931 }, +}; + +// Test function for l=2, m=1. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data005[i].l), Tp(data005[i].m), + Tp(data005[i].theta)); + const Tp f0 = data005[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)); +} + +// Test data for l=2, m=2. +testcase_sph_legendre<double> data006[] = { + { 0.0000000000000000, 2, 2, + 0.0000000000000000 }, + { 0.0094528025561622549, 2, 2, + 0.15707963267948966 }, + { 0.036885904048903795, 2, 2, + 0.31415926535897931 }, + { 0.079613961366457681, 2, 2, + 0.47123889803846897 }, + { 0.13345445455470123, 2, 2, + 0.62831853071795862 }, + { 0.19313710101159492, 2, 2, + 0.78539816339744828 }, + { 0.25281974746848851, 2, 2, + 0.94247779607693793 }, + { 0.30666024065673203, 2, 2, + 1.0995574287564276 }, + { 0.34938829797428600, 2, 2, + 1.2566370614359172 }, + { 0.37682139946702747, 2, 2, + 1.4137166941154069 }, + { 0.38627420202318979, 2, 2, + 1.5707963267948966 }, + { 0.37682139946702753, 2, 2, + 1.7278759594743860 }, + { 0.34938829797428606, 2, 2, + 1.8849555921538759 }, + { 0.30666024065673209, 2, 2, + 2.0420352248333655 }, + { 0.25281974746848851, 2, 2, + 2.1991148575128552 }, + { 0.19313710101159492, 2, 2, + 2.3561944901923448 }, + { 0.13345445455470126, 2, 2, + 2.5132741228718345 }, + { 0.079613961366457764, 2, 2, + 2.6703537555513241 }, + { 0.036885904048903795, 2, 2, + 2.8274333882308138 }, + { 0.0094528025561623433, 2, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 2, 2, + 3.1415926535897931 }, +}; + +// Test function for l=2, m=2. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data006[i].l), Tp(data006[i].m), + Tp(data006[i].theta)); + const Tp f0 = data006[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)); +} + +// Test data for l=5, m=0. +testcase_sph_legendre<double> data007[] = { + { 0.93560257962738880, 5, 0, + 0.0000000000000000 }, + { 0.77014422942080019, 5, 0, + 0.15707963267948966 }, + { 0.35892185032365215, 5, 0, + 0.31415926535897931 }, + { -0.090214932090594183, 5, 0, + 0.47123889803846897 }, + { -0.36214460396518888, 5, 0, + 0.62831853071795862 }, + { -0.35145955579226890, 5, 0, + 0.78539816339744828 }, + { -0.11441703594725168, 5, 0, + 0.94247779607693793 }, + { 0.17248966720808098, 5, 0, + 1.0995574287564276 }, + { 0.32128384287200523, 5, 0, + 1.2566370614359172 }, + { 0.24377632246714948, 5, 0, + 1.4137166941154069 }, + { 1.0741712853887702e-16, 5, 0, + 1.5707963267948966 }, + { -0.24377632246714906, 5, 0, + 1.7278759594743860 }, + { -0.32128384287200534, 5, 0, + 1.8849555921538759 }, + { -0.17248966720808118, 5, 0, + 2.0420352248333655 }, + { 0.11441703594725168, 5, 0, + 2.1991148575128552 }, + { 0.35145955579226890, 5, 0, + 2.3561944901923448 }, + { 0.36214460396518910, 5, 0, + 2.5132741228718345 }, + { 0.090214932090594724, 5, 0, + 2.6703537555513241 }, + { -0.35892185032365215, 5, 0, + 2.8274333882308138 }, + { -0.77014422942079797, 5, 0, + 2.9845130209103035 }, + { -0.93560257962738880, 5, 0, + 3.1415926535897931 }, +}; + +// Test function for l=5, m=0. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data007[i].l), Tp(data007[i].m), + Tp(data007[i].theta)); + const Tp f0 = data007[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)); +} + +// Test data for l=5, m=1. +testcase_sph_legendre<double> data008[] = { + { 0.0000000000000000, 5, 1, + 0.0000000000000000 }, + { -0.36712373713318258, 5, 1, + 0.15707963267948966 }, + { -0.54610329010534753, 5, 1, + 0.31415926535897931 }, + { -0.45381991493631785, 5, 1, + 0.47123889803846897 }, + { -0.15679720635769953, 5, 1, + 0.62831853071795862 }, + { 0.16985499419838637, 5, 1, + 0.78539816339744828 }, + { 0.34468004499725180, 5, 1, + 0.94247779607693793 }, + { 0.28349471119605985, 5, 1, + 1.0995574287564276 }, + { 0.044286619339675856, 5, 1, + 1.2566370614359172 }, + { -0.21193784177193470, 5, 1, + 1.4137166941154069 }, + { -0.32028164857621527, 5, 1, + 1.5707963267948966 }, + { -0.21193784177193514, 5, 1, + 1.7278759594743860 }, + { 0.044286619339675606, 5, 1, + 1.8849555921538759 }, + { 0.28349471119605979, 5, 1, + 2.0420352248333655 }, + { 0.34468004499725180, 5, 1, + 2.1991148575128552 }, + { 0.16985499419838637, 5, 1, + 2.3561944901923448 }, + { -0.15679720635769920, 5, 1, + 2.5132741228718345 }, + { -0.45381991493631757, 5, 1, + 2.6703537555513241 }, + { -0.54610329010534753, 5, 1, + 2.8274333882308138 }, + { -0.36712373713318397, 5, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 5, 1, + 3.1415926535897931 }, +}; + +// Test function for l=5, m=1. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data008[i].l), Tp(data008[i].m), + Tp(data008[i].theta)); + const Tp f0 = data008[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)); +} + +// Test data for l=5, m=2. +testcase_sph_legendre<double> data009[] = { + { 0.0000000000000000, 5, 2, + 0.0000000000000000 }, + { 0.078919441745546146, 5, 2, + 0.15707963267948966 }, + { 0.26373799140437981, 5, 2, + 0.31415926535897931 }, + { 0.43002359842080096, 5, 2, + 0.47123889803846897 }, + { 0.45642486439050994, 5, 2, + 0.62831853071795862 }, + { 0.29959604906083276, 5, 2, + 0.78539816339744828 }, + { 0.023781239849532242, 5, 2, + 0.94247779607693793 }, + { -0.23313989334673815, 5, 2, + 1.0995574287564276 }, + { -0.33799912776303714, 5, 2, + 1.2566370614359172 }, + { -0.23964508489529743, 5, 2, + 1.4137166941154069 }, + { -1.0377480524338170e-16, 5, 2, + 1.5707963267948966 }, + { 0.23964508489529704, 5, 2, + 1.7278759594743860 }, + { 0.33799912776303714, 5, 2, + 1.8849555921538759 }, + { 0.23313989334673837, 5, 2, + 2.0420352248333655 }, + { -0.023781239849532242, 5, 2, + 2.1991148575128552 }, + { -0.29959604906083276, 5, 2, + 2.3561944901923448 }, + { -0.45642486439050978, 5, 2, + 2.5132741228718345 }, + { -0.43002359842080118, 5, 2, + 2.6703537555513241 }, + { -0.26373799140437981, 5, 2, + 2.8274333882308138 }, + { -0.078919441745546867, 5, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 5, 2, + 3.1415926535897931 }, +}; + +// Test function for l=5, m=2. +template <typename Tp> +void test009() +{ + 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(data009) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data009[i].l), Tp(data009[i].m), + Tp(data009[i].theta)); + const Tp f0 = data009[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)); +} + +// Test data for l=5, m=5. +testcase_sph_legendre<double> data010[] = { + { 0.0000000000000000, 5, 5, + 0.0000000000000000 }, + { -4.3481439097909148e-05, 5, 5, + 0.15707963267948966 }, + { -0.0013078367086431812, 5, 5, + 0.31415926535897931 }, + { -0.0089510818191922761, 5, 5, + 0.47123889803846897 }, + { -0.032563803777573896, 5, 5, + 0.62831853071795862 }, + { -0.082047757105021310, 5, 5, + 0.78539816339744828 }, + { -0.16085328164143819, 5, 5, + 0.94247779607693793 }, + { -0.26064303436645375, 5, 5, + 1.0995574287564276 }, + { -0.36113811790820566, 5, 5, + 1.2566370614359172 }, + { -0.43625592459446139, 5, 5, + 1.4137166941154069 }, + { -0.46413220344085809, 5, 5, + 1.5707963267948966 }, + { -0.43625592459446155, 5, 5, + 1.7278759594743860 }, + { -0.36113811790820577, 5, 5, + 1.8849555921538759 }, + { -0.26064303436645381, 5, 5, + 2.0420352248333655 }, + { -0.16085328164143819, 5, 5, + 2.1991148575128552 }, + { -0.082047757105021310, 5, 5, + 2.3561944901923448 }, + { -0.032563803777573924, 5, 5, + 2.5132741228718345 }, + { -0.0089510818191923004, 5, 5, + 2.6703537555513241 }, + { -0.0013078367086431812, 5, 5, + 2.8274333882308138 }, + { -4.3481439097910151e-05, 5, 5, + 2.9845130209103035 }, + { 0.0000000000000000, 5, 5, + 3.1415926535897931 }, +}; + +// Test function for l=5, m=5. +template <typename Tp> +void test010() +{ + 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(data010) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data010[i].l), Tp(data010[i].m), + Tp(data010[i].theta)); + const Tp f0 = data010[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)); +} + +// Test data for l=10, m=0. +testcase_sph_legendre<double> data011[] = { + { 1.2927207364566027, 10, 0, + 0.0000000000000000 }, + { 0.55288895150522632, 10, 0, + 0.15707963267948966 }, + { -0.44874428379711506, 10, 0, + 0.31415926535897931 }, + { -0.25532095827149692, 10, 0, + 0.47123889803846897 }, + { 0.36625249688013967, 10, 0, + 0.62831853071795862 }, + { 0.14880806329084145, 10, 0, + 0.78539816339744828 }, + { -0.33533356797848746, 10, 0, + 0.94247779607693793 }, + { -0.080639967662335818, 10, 0, + 1.0995574287564276 }, + { 0.32197986450174521, 10, 0, + 1.2566370614359172 }, + { 0.025713542103667848, 10, 0, + 1.4137166941154069 }, + { -0.31813049373736707, 10, 0, + 1.5707963267948966 }, + { 0.025713542103666668, 10, 0, + 1.7278759594743860 }, + { 0.32197986450174532, 10, 0, + 1.8849555921538759 }, + { -0.080639967662335416, 10, 0, + 2.0420352248333655 }, + { -0.33533356797848746, 10, 0, + 2.1991148575128552 }, + { 0.14880806329084145, 10, 0, + 2.3561944901923448 }, + { 0.36625249688013994, 10, 0, + 2.5132741228718345 }, + { -0.25532095827149576, 10, 0, + 2.6703537555513241 }, + { -0.44874428379711506, 10, 0, + 2.8274333882308138 }, + { 0.55288895150521977, 10, 0, + 2.9845130209103035 }, + { 1.2927207364566027, 10, 0, + 3.1415926535897931 }, +}; + +// Test function for l=10, m=0. +template <typename Tp> +void test011() +{ + 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(data011) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data011[i].l), Tp(data011[i].m), + Tp(data011[i].theta)); + const Tp f0 = data011[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)); +} + +// Test data for l=10, m=1. +testcase_sph_legendre<double> data012[] = { + { 0.0000000000000000, 10, 1, + 0.0000000000000000 }, + { -0.74373723919063905, 10, 1, + 0.15707963267948966 }, + { -0.29035110456209551, 10, 1, + 0.31415926535897931 }, + { 0.42219282075271497, 10, 1, + 0.47123889803846897 }, + { 0.17109256898931269, 10, 1, + 0.62831853071795862 }, + { -0.35583574648544292, 10, 1, + 0.78539816339744828 }, + { -0.10089212303543979, 10, 1, + 0.94247779607693793 }, + { 0.32997652649321085, 10, 1, + 1.0995574287564276 }, + { 0.047416376890033113, 10, 1, + 1.2566370614359172 }, + { -0.31999356750295654, 10, 1, + 1.4137166941154069 }, + { -2.0430664782290766e-16, 10, 1, + 1.5707963267948966 }, + { 0.31999356750295660, 10, 1, + 1.7278759594743860 }, + { -0.047416376890032523, 10, 1, + 1.8849555921538759 }, + { -0.32997652649321102, 10, 1, + 2.0420352248333655 }, + { 0.10089212303543979, 10, 1, + 2.1991148575128552 }, + { 0.35583574648544292, 10, 1, + 2.3561944901923448 }, + { -0.17109256898931186, 10, 1, + 2.5132741228718345 }, + { -0.42219282075271553, 10, 1, + 2.6703537555513241 }, + { 0.29035110456209551, 10, 1, + 2.8274333882308138 }, + { 0.74373723919064028, 10, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 10, 1, + 3.1415926535897931 }, +}; + +// Test function for l=10, m=1. +template <typename Tp> +void test012() +{ + 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(data012) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data012[i].l), Tp(data012[i].m), + Tp(data012[i].theta)); + const Tp f0 = data012[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)); +} + +// Test data for l=10, m=2. +testcase_sph_legendre<double> data013[] = { + { 0.0000000000000000, 10, 2, + 0.0000000000000000 }, + { 0.34571695599980284, 10, 2, + 0.15707963267948966 }, + { 0.62485535978198059, 10, 2, + 0.31415926535897931 }, + { 0.098210039644716363, 10, 2, + 0.47123889803846897 }, + { -0.41494799233049656, 10, 2, + 0.62831853071795862 }, + { -0.081698973831472149, 10, 2, + 0.78539816339744828 }, + { 0.35253132222271272, 10, 2, + 0.94247779607693793 }, + { 0.049026298555981063, 10, 2, + 1.0995574287564276 }, + { -0.32791246874130797, 10, 2, + 1.2566370614359172 }, + { -0.016196782433946910, 10, 2, + 1.4137166941154069 }, + { 0.32106263400438328, 10, 2, + 1.5707963267948966 }, + { -0.016196782433945765, 10, 2, + 1.7278759594743860 }, + { -0.32791246874130797, 10, 2, + 1.8849555921538759 }, + { 0.049026298555980702, 10, 2, + 2.0420352248333655 }, + { 0.35253132222271272, 10, 2, + 2.1991148575128552 }, + { -0.081698973831472149, 10, 2, + 2.3561944901923448 }, + { -0.41494799233049667, 10, 2, + 2.5132741228718345 }, + { 0.098210039644714753, 10, 2, + 2.6703537555513241 }, + { 0.62485535978198059, 10, 2, + 2.8274333882308138 }, + { 0.34571695599980551, 10, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 10, 2, + 3.1415926535897931 }, +}; + +// Test function for l=10, m=2. +template <typename Tp> +void test013() +{ + 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(data013) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data013[i].l), Tp(data013[i].m), + Tp(data013[i].theta)); + const Tp f0 = data013[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)); +} + +// Test data for l=10, m=5. +testcase_sph_legendre<double> data014[] = { + { 0.0000000000000000, 10, 5, + 0.0000000000000000 }, + { -0.0030300124052750187, 10, 5, + 0.15707963267948966 }, + { -0.070348585248056830, 10, 5, + 0.31415926535897931 }, + { -0.30055029290703639, 10, 5, + 0.47123889803846897 }, + { -0.49987818144009166, 10, 5, + 0.62831853071795862 }, + { -0.28108771757150086, 10, 5, + 0.78539816339744828 }, + { 0.22068081187249308, 10, 5, + 0.94247779607693793 }, + { 0.33689502212592115, 10, 5, + 1.0995574287564276 }, + { -0.086095515520763985, 10, 5, + 1.2566370614359172 }, + { -0.33935827318511558, 10, 5, + 1.4137166941154069 }, + { -1.9213014340664578e-16, 10, 5, + 1.5707963267948966 }, + { 0.33935827318511552, 10, 5, + 1.7278759594743860 }, + { 0.086095515520764526, 10, 5, + 1.8849555921538759 }, + { -0.33689502212592098, 10, 5, + 2.0420352248333655 }, + { -0.22068081187249308, 10, 5, + 2.1991148575128552 }, + { 0.28108771757150086, 10, 5, + 2.3561944901923448 }, + { 0.49987818144009155, 10, 5, + 2.5132741228718345 }, + { 0.30055029290703678, 10, 5, + 2.6703537555513241 }, + { 0.070348585248056830, 10, 5, + 2.8274333882308138 }, + { 0.0030300124052750855, 10, 5, + 2.9845130209103035 }, + { 0.0000000000000000, 10, 5, + 3.1415926535897931 }, +}; + +// Test function for l=10, m=5. +template <typename Tp> +void test014() +{ + 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(data014) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data014[i].l), Tp(data014[i].m), + Tp(data014[i].theta)); + const Tp f0 = data014[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)); +} + +// Test data for l=10, m=10. +testcase_sph_legendre<double> data015[] = { + { 0.0000000000000000, 10, 10, + 0.0000000000000000 }, + { 4.7624282733343473e-09, 10, 10, + 0.15707963267948966 }, + { 4.3085156534549772e-06, 10, 10, + 0.31415926535897931 }, + { 0.00020182347649472368, 10, 10, + 0.47123889803846897 }, + { 0.0026711045506511684, 10, 10, + 0.62831853071795862 }, + { 0.016957196623256943, 10, 10, + 0.78539816339744828 }, + { 0.065174916004990341, 10, 10, + 0.94247779607693793 }, + { 0.17112476903017843, 10, 10, + 1.0995574287564276 }, + { 0.32852414199733548, 10, 10, + 1.2566370614359172 }, + { 0.47940582314838287, 10, 10, + 1.4137166941154069 }, + { 0.54263029194422152, 10, 10, + 1.5707963267948966 }, + { 0.47940582314838309, 10, 10, + 1.7278759594743860 }, + { 0.32852414199733571, 10, 10, + 1.8849555921538759 }, + { 0.17112476903017854, 10, 10, + 2.0420352248333655 }, + { 0.065174916004990341, 10, 10, + 2.1991148575128552 }, + { 0.016957196623256943, 10, 10, + 2.3561944901923448 }, + { 0.0026711045506511706, 10, 10, + 2.5132741228718345 }, + { 0.00020182347649472493, 10, 10, + 2.6703537555513241 }, + { 4.3085156534549772e-06, 10, 10, + 2.8274333882308138 }, + { 4.7624282733345673e-09, 10, 10, + 2.9845130209103035 }, + { 0.0000000000000000, 10, 10, + 3.1415926535897931 }, +}; + +// Test function for l=10, m=10. +template <typename Tp> +void test015() +{ + 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(data015) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data015[i].l), Tp(data015[i].m), + Tp(data015[i].theta)); + const Tp f0 = data015[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)); +} + +// Test data for l=20, m=0. +testcase_sph_legendre<double> data016[] = { + { 1.8062879984608917, 20, 0, + 0.0000000000000000 }, + { -0.58906549291415966, 20, 0, + 0.15707963267948966 }, + { 0.45624611402342408, 20, 0, + 0.31415926535897931 }, + { -0.39955402700466724, 20, 0, + 0.47123889803846897 }, + { 0.36818552901640750, 20, 0, + 0.62831853071795862 }, + { -0.34873131330857787, 20, 0, + 0.78539816339744828 }, + { 0.33600882829186501, 20, 0, + 0.94247779607693793 }, + { -0.32759286308122904, 20, 0, + 1.0995574287564276 }, + { 0.32222458068091320, 20, 0, + 1.2566370614359172 }, + { -0.31922731037135960, 20, 0, + 1.4137166941154069 }, + { 0.31826262039531755, 20, 0, + 1.5707963267948966 }, + { -0.31922731037135965, 20, 0, + 1.7278759594743860 }, + { 0.32222458068091336, 20, 0, + 1.8849555921538759 }, + { -0.32759286308122937, 20, 0, + 2.0420352248333655 }, + { 0.33600882829186501, 20, 0, + 2.1991148575128552 }, + { -0.34873131330857787, 20, 0, + 2.3561944901923448 }, + { 0.36818552901640839, 20, 0, + 2.5132741228718345 }, + { -0.39955402700466852, 20, 0, + 2.6703537555513241 }, + { 0.45624611402342408, 20, 0, + 2.8274333882308138 }, + { -0.58906549291416699, 20, 0, + 2.9845130209103035 }, + { 1.8062879984608917, 20, 0, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=0. +template <typename Tp> +void test016() +{ + 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(data016) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data016[i].l), Tp(data016[i].m), + Tp(data016[i].theta)); + const Tp f0 = data016[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)); +} + +// Test data for l=20, m=1. +testcase_sph_legendre<double> data017[] = { + { 0.0000000000000000, 20, 1, + 0.0000000000000000 }, + { -0.45905213045060206, 20, 1, + 0.15707963267948966 }, + { 0.31166370423309170, 20, 1, + 0.31415926535897931 }, + { -0.23278757741246814, 20, 1, + 0.47123889803846897 }, + { 0.17937240823504183, 20, 1, + 0.62831853071795862 }, + { -0.13857299972299736, 20, 1, + 0.78539816339744828 }, + { 0.10495324841927710, 20, 1, + 0.94247779607693793 }, + { -0.075707774352164178, 20, 1, + 1.0995574287564276 }, + { 0.049168697683476620, 20, 1, + 1.2566370614359172 }, + { -0.024216050551253254, 20, 1, + 1.4137166941154069 }, + { 3.9938443510694349e-16, 20, 1, + 1.5707963267948966 }, + { 0.024216050551250898, 20, 1, + 1.7278759594743860 }, + { -0.049168697683475482, 20, 1, + 1.8849555921538759 }, + { 0.075707774352163332, 20, 1, + 2.0420352248333655 }, + { -0.10495324841927710, 20, 1, + 2.1991148575128552 }, + { 0.13857299972299736, 20, 1, + 2.3561944901923448 }, + { -0.17937240823504039, 20, 1, + 2.5132741228718345 }, + { 0.23278757741246658, 20, 1, + 2.6703537555513241 }, + { -0.31166370423309170, 20, 1, + 2.8274333882308138 }, + { 0.45905213045059318, 20, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 20, 1, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=1. +template <typename Tp> +void test017() +{ + 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(data017) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data017[i].l), Tp(data017[i].m), + Tp(data017[i].theta)); + const Tp f0 = data017[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)); +} + +// Test data for l=20, m=2. +testcase_sph_legendre<double> data018[] = { + { 0.0000000000000000, 20, 2, + 0.0000000000000000 }, + { 0.87399805141574682, 20, 2, + 0.15707963267948966 }, + { -0.55116854080894984, 20, 2, + 0.31415926535897931 }, + { 0.44520137308557534, 20, 2, + 0.47123889803846897 }, + { -0.39321637877908228, 20, 2, + 0.62831853071795862 }, + { 0.36312025711350970, 20, 2, + 0.78539816339744828 }, + { -0.34427103004873094, 20, 2, + 0.94247779607693793 }, + { 0.33214917638387625, 20, 2, + 1.0995574287564276 }, + { -0.32455734448839091, 20, 2, + 1.2566370614359172 }, + { 0.32036529628513238, 20, 2, + 1.4137166941154069 }, + { -0.31902310563819986, 20, 2, + 1.5707963267948966 }, + { 0.32036529628513266, 20, 2, + 1.7278759594743860 }, + { -0.32455734448839102, 20, 2, + 1.8849555921538759 }, + { 0.33214917638387670, 20, 2, + 2.0420352248333655 }, + { -0.34427103004873094, 20, 2, + 2.1991148575128552 }, + { 0.36312025711350970, 20, 2, + 2.3561944901923448 }, + { -0.39321637877908278, 20, 2, + 2.5132741228718345 }, + { 0.44520137308557639, 20, 2, + 2.6703537555513241 }, + { -0.55116854080894984, 20, 2, + 2.8274333882308138 }, + { 0.87399805141574360, 20, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 20, 2, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=2. +template <typename Tp> +void test018() +{ + 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(data018) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data018[i].l), Tp(data018[i].m), + Tp(data018[i].theta)); + const Tp f0 = data018[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)); +} + +// Test data for l=20, m=5. +testcase_sph_legendre<double> data019[] = { + { 0.0000000000000000, 20, 5, + 0.0000000000000000 }, + { -0.10024848623504846, 20, 5, + 0.15707963267948966 }, + { -0.68115361075940595, 20, 5, + 0.31415926535897931 }, + { 0.31774532551156237, 20, 5, + 0.47123889803846897 }, + { -0.16011868165390564, 20, 5, + 0.62831853071795862 }, + { 0.085844143304116230, 20, 5, + 0.78539816339744828 }, + { -0.047467540840864686, 20, 5, + 0.94247779607693793 }, + { 0.026283575189471282, 20, 5, + 1.0995574287564276 }, + { -0.013891104052597331, 20, 5, + 1.2566370614359172 }, + { 0.0059873308239496931, 20, 5, + 1.4137166941154069 }, + { 3.9355286582083095e-16, 20, 5, + 1.5707963267948966 }, + { -0.0059873308239519040, 20, 5, + 1.7278759594743860 }, + { 0.013891104052598531, 20, 5, + 1.8849555921538759 }, + { -0.026283575189472212, 20, 5, + 2.0420352248333655 }, + { 0.047467540840864686, 20, 5, + 2.1991148575128552 }, + { -0.085844143304116230, 20, 5, + 2.3561944901923448 }, + { 0.16011868165390636, 20, 5, + 2.5132741228718345 }, + { -0.31774532551156448, 20, 5, + 2.6703537555513241 }, + { 0.68115361075940595, 20, 5, + 2.8274333882308138 }, + { 0.10024848623505037, 20, 5, + 2.9845130209103035 }, + { 0.0000000000000000, 20, 5, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=5. +template <typename Tp> +void test019() +{ + 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(data019) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data019[i].l), Tp(data019[i].m), + Tp(data019[i].theta)); + const Tp f0 = data019[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(1.0000000000000008e-12)); +} + +// Test data for l=20, m=10. +testcase_sph_legendre<double> data020[] = { + { 0.0000000000000000, 20, 10, + 0.0000000000000000 }, + { 3.0595797603706485e-05, 20, 10, + 0.15707963267948966 }, + { 0.015924453916397008, 20, 10, + 0.31415926535897931 }, + { 0.26588079118745700, 20, 10, + 0.47123889803846897 }, + { 0.54045081420686825, 20, 10, + 0.62831853071795862 }, + { -0.28215279394285597, 20, 10, + 0.78539816339744828 }, + { 0.0085297337582246665, 20, 10, + 0.94247779607693793 }, + { 0.16930127953533775, 20, 10, + 1.0995574287564276 }, + { -0.27215134048018352, 20, 10, + 1.2566370614359172 }, + { 0.32456597088029526, 20, 10, + 1.4137166941154069 }, + { -0.34057893241353715, 20, 10, + 1.5707963267948966 }, + { 0.32456597088029449, 20, 10, + 1.7278759594743860 }, + { -0.27215134048018308, 20, 10, + 1.8849555921538759 }, + { 0.16930127953533725, 20, 10, + 2.0420352248333655 }, + { 0.0085297337582246665, 20, 10, + 2.1991148575128552 }, + { -0.28215279394285597, 20, 10, + 2.3561944901923448 }, + { 0.54045081420686658, 20, 10, + 2.5132741228718345 }, + { 0.26588079118745822, 20, 10, + 2.6703537555513241 }, + { 0.015924453916397008, 20, 10, + 2.8274333882308138 }, + { 3.0595797603707854e-05, 20, 10, + 2.9845130209103035 }, + { 0.0000000000000000, 20, 10, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=10. +template <typename Tp> +void test020() +{ + 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(data020) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data020[i].l), Tp(data020[i].m), + Tp(data020[i].theta)); + const Tp f0 = data020[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)); +} + +// Test data for l=20, m=20. +testcase_sph_legendre<double> data021[] = { + { 0.0000000000000000, 20, 20, + 0.0000000000000000 }, + { 4.9264471419245886e-17, 20, 20, + 0.15707963267948966 }, + { 4.0321091681531780e-11, 20, 20, + 0.31415926535897931 }, + { 8.8474944184471664e-08, 20, 20, + 0.47123889803846897 }, + { 1.5497395129387764e-05, 20, 20, + 0.62831853071795862 }, + { 0.00062457564282984723, 20, 20, + 0.78539816339744828 }, + { 0.0092265192458967603, 20, 20, + 0.94247779607693793 }, + { 0.063606673236323269, 20, 20, + 1.0995574287564276 }, + { 0.23442909509776308, 20, 20, + 1.2566370614359172 }, + { 0.49921030481087009, 20, 20, + 1.4137166941154069 }, + { 0.63956545825776223, 20, 20, + 1.5707963267948966 }, + { 0.49921030481087064, 20, 20, + 1.7278759594743860 }, + { 0.23442909509776344, 20, 20, + 1.8849555921538759 }, + { 0.063606673236323352, 20, 20, + 2.0420352248333655 }, + { 0.0092265192458967603, 20, 20, + 2.1991148575128552 }, + { 0.00062457564282984723, 20, 20, + 2.3561944901923448 }, + { 1.5497395129387818e-05, 20, 20, + 2.5132741228718345 }, + { 8.8474944184472617e-08, 20, 20, + 2.6703537555513241 }, + { 4.0321091681531780e-11, 20, 20, + 2.8274333882308138 }, + { 4.9264471419250786e-17, 20, 20, + 2.9845130209103035 }, + { 0.0000000000000000, 20, 20, + 3.1415926535897931 }, +}; + +// Test function for l=20, m=20. +template <typename Tp> +void test021() +{ + 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(data021) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data021[i].l), Tp(data021[i].m), + Tp(data021[i].theta)); + const Tp f0 = data021[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)); +} + +// Test data for l=50, m=0. +testcase_sph_legendre<double> data022[] = { + { 2.8350175706934717, 50, 0, + 0.0000000000000000 }, + { 0.53157537495174845, 50, 0, + 0.15707963267948966 }, + { -0.46056183476301349, 50, 0, + 0.31415926535897931 }, + { -0.24876032079677909, 50, 0, + 0.47123889803846897 }, + { 0.36926172901532522, 50, 0, + 0.62831853071795862 }, + { 0.14571730283563306, 50, 0, + 0.78539816339744828 }, + { -0.33636199170850811, 50, 0, + 0.94247779607693793 }, + { -0.079132716267092035, 50, 0, + 1.0995574287564276 }, + { 0.32232921941301440, 50, 0, + 1.2566370614359172 }, + { 0.025253991969481446, 50, 0, + 1.4137166941154069 }, + { -0.31830208724152359, 50, 0, + 1.5707963267948966 }, + { 0.025253991969476128, 50, 0, + 1.7278759594743860 }, + { 0.32232921941301479, 50, 0, + 1.8849555921538759 }, + { -0.079132716267090078, 50, 0, + 2.0420352248333655 }, + { -0.33636199170850811, 50, 0, + 2.1991148575128552 }, + { 0.14571730283563306, 50, 0, + 2.3561944901923448 }, + { 0.36926172901532717, 50, 0, + 2.5132741228718345 }, + { -0.24876032079677393, 50, 0, + 2.6703537555513241 }, + { -0.46056183476301349, 50, 0, + 2.8274333882308138 }, + { 0.53157537495172380, 50, 0, + 2.9845130209103035 }, + { 2.8350175706934717, 50, 0, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=0. +template <typename Tp> +void test022() +{ + 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(data022) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data022[i].l), Tp(data022[i].m), + Tp(data022[i].theta)); + const Tp f0 = data022[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)); +} + +// Test data for l=50, m=1. +testcase_sph_legendre<double> data023[] = { + { 0.0000000000000000, 50, 1, + 0.0000000000000000 }, + { -0.63751752155226116, 50, 1, + 0.15707963267948966 }, + { -0.32616619317604312, 50, 1, + 0.31415926535897931 }, + { 0.40649930826162706, 50, 1, + 0.47123889803846897 }, + { 0.18473991408344026, 50, 1, + 0.62831853071795862 }, + { -0.35083930302013211, 50, 1, + 0.78539816339744828 }, + { -0.10755382110947098, 50, 1, + 0.94247779607693793 }, + { 0.32822568316499862, 50, 1, + 1.0995574287564276 }, + { 0.050286056609798180, 50, 1, + 1.2566370614359172 }, + { -0.31935368562159638, 50, 1, + 1.4137166941154069 }, + { -9.8421602686195941e-16, 50, 1, + 1.5707963267948966 }, + { 0.31935368562159705, 50, 1, + 1.7278759594743860 }, + { -0.050286056609795383, 50, 1, + 1.8849555921538759 }, + { -0.32822568316499923, 50, 1, + 2.0420352248333655 }, + { 0.10755382110947098, 50, 1, + 2.1991148575128552 }, + { 0.35083930302013211, 50, 1, + 2.3561944901923448 }, + { -0.18473991408343632, 50, 1, + 2.5132741228718345 }, + { -0.40649930826163039, 50, 1, + 2.6703537555513241 }, + { 0.32616619317604312, 50, 1, + 2.8274333882308138 }, + { 0.63751752155227837, 50, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 1, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=1. +template <typename Tp> +void test023() +{ + 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(data023) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data023[i].l), Tp(data023[i].m), + Tp(data023[i].theta)); + const Tp f0 = data023[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)); +} + +// Test data for l=50, m=2. +testcase_sph_legendre<double> data024[] = { + { 0.0000000000000000, 50, 2, + 0.0000000000000000 }, + { -0.37230261163839168, 50, 2, + 0.15707963267948966 }, + { 0.50051599680315972, 50, 2, + 0.31415926535897931 }, + { 0.21724795180329545, 50, 2, + 0.47123889803846897 }, + { -0.37948127307610940, 50, 2, + 0.62831853071795862 }, + { -0.13187372121003119, 50, 2, + 0.78539816339744828 }, + { 0.33959009162400194, 50, 2, + 0.94247779607693793 }, + { 0.072537503112490409, 50, 2, + 1.0995574287564276 }, + { -0.32310306941855271, 50, 2, + 1.2566370614359172 }, + { -0.023259822816436588, 50, 2, + 1.4137166941154069 }, + { 0.31842698506357275, 50, 2, + 1.5707963267948966 }, + { -0.023259822816431144, 50, 2, + 1.7278759594743860 }, + { -0.32310306941855299, 50, 2, + 1.8849555921538759 }, + { 0.072537503112488369, 50, 2, + 2.0420352248333655 }, + { 0.33959009162400194, 50, 2, + 2.1991148575128552 }, + { -0.13187372121003119, 50, 2, + 2.3561944901923448 }, + { -0.37948127307611074, 50, 2, + 2.5132741228718345 }, + { 0.21724795180328935, 50, 2, + 2.6703537555513241 }, + { 0.50051599680315972, 50, 2, + 2.8274333882308138 }, + { -0.37230261163836298, 50, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 2, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=2. +template <typename Tp> +void test024() +{ + 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(data024) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data024[i].l), Tp(data024[i].m), + Tp(data024[i].theta)); + const Tp f0 = data024[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.5000000000000015e-12)); +} + +// Test data for l=50, m=5. +testcase_sph_legendre<double> data025[] = { + { 0.0000000000000000, 50, 5, + 0.0000000000000000 }, + { -0.57750385903193069, 50, 5, + 0.15707963267948966 }, + { 0.077360497065584566, 50, 5, + 0.31415926535897931 }, + { 0.47707267400540210, 50, 5, + 0.47123889803846897 }, + { 0.055370615126630537, 50, 5, + 0.62831853071795862 }, + { -0.37629451847202855, 50, 5, + 0.78539816339744828 }, + { -0.048042277801960624, 50, 5, + 0.94247779607693793 }, + { 0.33619379362228685, 50, 5, + 1.0995574287564276 }, + { 0.025265227185719726, 50, 5, + 1.2566370614359172 }, + { -0.32083679430964518, 50, 5, + 1.4137166941154069 }, + { -9.8189201019751884e-16, 50, 5, + 1.5707963267948966 }, + { 0.32083679430964590, 50, 5, + 1.7278759594743860 }, + { -0.025265227185716856, 50, 5, + 1.8849555921538759 }, + { -0.33619379362228730, 50, 5, + 2.0420352248333655 }, + { 0.048042277801960624, 50, 5, + 2.1991148575128552 }, + { 0.37629451847202855, 50, 5, + 2.3561944901923448 }, + { -0.055370615126626936, 50, 5, + 2.5132741228718345 }, + { -0.47707267400540210, 50, 5, + 2.6703537555513241 }, + { -0.077360497065584566, 50, 5, + 2.8274333882308138 }, + { 0.57750385903191004, 50, 5, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 5, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=5. +template <typename Tp> +void test025() +{ + 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(data025) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data025[i].l), Tp(data025[i].m), + Tp(data025[i].theta)); + const Tp f0 = data025[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(1.0000000000000008e-12)); +} + +// Test data for l=50, m=10. +testcase_sph_legendre<double> data026[] = { + { 0.0000000000000000, 50, 10, + 0.0000000000000000 }, + { 0.15606941844800759, 50, 10, + 0.15707963267948966 }, + { -0.53748868836814601, 50, 10, + 0.31415926535897931 }, + { -0.49304919025183896, 50, 10, + 0.47123889803846897 }, + { -0.26267582750428264, 50, 10, + 0.62831853071795862 }, + { 0.22058983666314402, 50, 10, + 0.78539816339744828 }, + { 0.32936725160671759, 50, 10, + 0.94247779607693793 }, + { -0.092053311559446988, 50, 10, + 1.0995574287564276 }, + { -0.32542913495935555, 50, 10, + 1.2566370614359172 }, + { 0.025673223789103500, 50, 10, + 1.4137166941154069 }, + { 0.32150019350255743, 50, 10, + 1.5707963267948966 }, + { 0.025673223789108864, 50, 10, + 1.7278759594743860 }, + { -0.32542913495935494, 50, 10, + 1.8849555921538759 }, + { -0.092053311559448570, 50, 10, + 2.0420352248333655 }, + { 0.32936725160671759, 50, 10, + 2.1991148575128552 }, + { 0.22058983666314402, 50, 10, + 2.3561944901923448 }, + { -0.26267582750427909, 50, 10, + 2.5132741228718345 }, + { -0.49304919025184119, 50, 10, + 2.6703537555513241 }, + { -0.53748868836814601, 50, 10, + 2.8274333882308138 }, + { 0.15606941844801259, 50, 10, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 10, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=10. +template <typename Tp> +void test026() +{ + 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(data026) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data026[i].l), Tp(data026[i].m), + Tp(data026[i].theta)); + const Tp f0 = data026[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)); +} + +// Test data for l=50, m=20. +testcase_sph_legendre<double> data027[] = { + { 0.0000000000000000, 50, 20, + 0.0000000000000000 }, + { 3.0409598712833082e-07, 50, 20, + 0.15707963267948966 }, + { 0.030940518122882305, 50, 20, + 0.31415926535897931 }, + { 0.64134588721659935, 50, 20, + 0.47123889803846897 }, + { 0.29895244392136394, 50, 20, + 0.62831853071795862 }, + { 0.25309324781874065, 50, 20, + 0.78539816339744828 }, + { 0.34368634714931712, 50, 20, + 0.94247779607693793 }, + { 0.33996764360663956, 50, 20, + 1.0995574287564276 }, + { 0.12866267745104118, 50, 20, + 1.2566370614359172 }, + { -0.18201114398922874, 50, 20, + 1.4137166941154069 }, + { -0.33216683431510857, 50, 20, + 1.5707963267948966 }, + { -0.18201114398923304, 50, 20, + 1.7278759594743860 }, + { 0.12866267745103846, 50, 20, + 1.8849555921538759 }, + { 0.33996764360663906, 50, 20, + 2.0420352248333655 }, + { 0.34368634714931712, 50, 20, + 2.1991148575128552 }, + { 0.25309324781874065, 50, 20, + 2.3561944901923448 }, + { 0.29895244392136738, 50, 20, + 2.5132741228718345 }, + { 0.64134588721659791, 50, 20, + 2.6703537555513241 }, + { 0.030940518122882305, 50, 20, + 2.8274333882308138 }, + { 3.0409598712835877e-07, 50, 20, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 20, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=20. +template <typename Tp> +void test027() +{ + 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(data027) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data027[i].l), Tp(data027[i].m), + Tp(data027[i].theta)); + const Tp f0 = data027[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)); +} + +// Test data for l=50, m=50. +testcase_sph_legendre<double> data028[] = { + { 0.0000000000000000, 50, 50, + 0.0000000000000000 }, + { 4.1649039898151844e-41, 50, 50, + 0.15707963267948966 }, + { 2.5240684647724192e-26, 50, 50, + 0.31415926535897931 }, + { 5.6927376423967334e-18, 50, 50, + 0.47123889803846897 }, + { 2.3116239814797057e-12, 50, 50, + 0.62831853071795862 }, + { 2.3835981241325311e-08, 50, 50, + 0.78539816339744828 }, + { 1.9992410287270356e-05, 50, 50, + 0.94247779607693793 }, + { 0.0024947505670829791, 50, 50, + 1.0995574287564276 }, + { 0.065057774647971175, 50, 50, + 1.2566370614359172 }, + { 0.43050607056732243, 50, 50, + 1.4137166941154069 }, + { 0.79980281171531975, 50, 50, + 1.5707963267948966 }, + { 0.43050607056732360, 50, 50, + 1.7278759594743860 }, + { 0.065057774647971384, 50, 50, + 1.8849555921538759 }, + { 0.0024947505670829856, 50, 50, + 2.0420352248333655 }, + { 1.9992410287270356e-05, 50, 50, + 2.1991148575128552 }, + { 2.3835981241325311e-08, 50, 50, + 2.3561944901923448 }, + { 2.3116239814797222e-12, 50, 50, + 2.5132741228718345 }, + { 5.6927376423968544e-18, 50, 50, + 2.6703537555513241 }, + { 2.5240684647724192e-26, 50, 50, + 2.8274333882308138 }, + { 4.1649039898161316e-41, 50, 50, + 2.9845130209103035 }, + { 0.0000000000000000, 50, 50, + 3.1415926535897931 }, +}; + +// Test function for l=50, m=50. +template <typename Tp> +void test028() +{ + 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(data028) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data028[i].l), Tp(data028[i].m), + Tp(data028[i].theta)); + const Tp f0 = data028[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)); +} + +// Test data for l=100, m=0. +testcase_sph_legendre<double> data029[] = { + { 3.9993839251484076, 100, 0, + 0.0000000000000000 }, + { -0.60770160285935471, 100, 0, + 0.15707963267948966 }, + { 0.46193027883956100, 100, 0, + 0.31415926535897931 }, + { -0.40218718869815234, 100, 0, + 0.47123889803846897 }, + { 0.36960201406910737, 100, 0, + 0.62831853071795862 }, + { -0.34953726547378611, 100, 0, + 0.78539816339744828 }, + { 0.33646959352497846, 100, 0, + 0.94247779607693793 }, + { -0.32784733067663169, 100, 0, + 1.0995574287564276 }, + { 0.32235624474047936, 100, 0, + 1.2566370614359172 }, + { -0.31929330706601283, 100, 0, + 1.4137166941154069 }, + { 0.31830791662110325, 100, 0, + 1.5707963267948966 }, + { -0.31929330706601389, 100, 0, + 1.7278759594743860 }, + { 0.32235624474048052, 100, 0, + 1.8849555921538759 }, + { -0.32784733067663291, 100, 0, + 2.0420352248333655 }, + { 0.33646959352497846, 100, 0, + 2.1991148575128552 }, + { -0.34953726547378611, 100, 0, + 2.3561944901923448 }, + { 0.36960201406911114, 100, 0, + 2.5132741228718345 }, + { -0.40218718869815695, 100, 0, + 2.6703537555513241 }, + { 0.46193027883956100, 100, 0, + 2.8274333882308138 }, + { -0.60770160285939478, 100, 0, + 2.9845130209103035 }, + { 3.9993839251484076, 100, 0, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=0. +template <typename Tp> +void test029() +{ + 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(data029) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data029[i].l), Tp(data029[i].m), + Tp(data029[i].theta)); + const Tp f0 = data029[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(1.0000000000000008e-12)); +} + +// Test data for l=100, m=1. +testcase_sph_legendre<double> data030[] = { + { 0.0000000000000000, 100, 1, + 0.0000000000000000 }, + { -0.50851949013719622, 100, 1, + 0.15707963267948966 }, + { 0.33129641402221310, 100, 1, + 0.31415926535897931 }, + { -0.24390405750942562, 100, 1, + 0.47123889803846897 }, + { 0.18659755088414165, 100, 1, + 0.62831853071795862 }, + { -0.14355908970516640, 100, 1, + 0.78539816339744828 }, + { 0.10844906813251093, 100, 1, + 0.94247779607693793 }, + { -0.078100088690859812, 100, 1, + 1.0995574287564276 }, + { 0.050670002998304528, 100, 1, + 1.2566370614359172 }, + { -0.024941251747138762, 100, 1, + 1.4137166941154069 }, + { 1.9587949830851639e-15, 100, 1, + 1.5707963267948966 }, + { 0.024941251747127649, 100, 1, + 1.7278759594743860 }, + { -0.050670002998298595, 100, 1, + 1.8849555921538759 }, + { 0.078100088690855676, 100, 1, + 2.0420352248333655 }, + { -0.10844906813251093, 100, 1, + 2.1991148575128552 }, + { 0.14355908970516640, 100, 1, + 2.3561944901923448 }, + { -0.18659755088413349, 100, 1, + 2.5132741228718345 }, + { 0.24390405750941485, 100, 1, + 2.6703537555513241 }, + { -0.33129641402221310, 100, 1, + 2.8274333882308138 }, + { 0.50851949013714548, 100, 1, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 1, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=1. +template <typename Tp> +void test030() +{ + 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(data030) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data030[i].l), Tp(data030[i].m), + Tp(data030[i].theta)); + const Tp f0 = data030[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(1.0000000000000008e-12)); +} + +// Test data for l=100, m=2. +testcase_sph_legendre<double> data031[] = { + { 0.0000000000000000, 100, 2, + 0.0000000000000000 }, + { 0.67166274297194040, 100, 2, + 0.15707963267948966 }, + { -0.48226933687995144, 100, 2, + 0.31415926535897931 }, + { 0.41175421895715447, 100, 2, + 0.47123889803846897 }, + { -0.37475021787822460, 100, 2, + 0.62831853071795862 }, + { 0.35242909383605475, 100, 2, + 0.78539816339744828 }, + { -0.33807110409160002, 100, 2, + 0.94247779607693793 }, + { 0.32867180390709999, 100, 2, + 1.0995574287564276 }, + { -0.32271583790278469, 100, 2, + 1.2566370614359172 }, + { 0.31940354677687433, 100, 2, + 1.4137166941154069 }, + { -0.31833943693772526, 100, 2, + 1.5707963267948966 }, + { 0.31940354677687521, 100, 2, + 1.7278759594743860 }, + { -0.32271583790278524, 100, 2, + 1.8849555921538759 }, + { 0.32867180390710143, 100, 2, + 2.0420352248333655 }, + { -0.33807110409160002, 100, 2, + 2.1991148575128552 }, + { 0.35242909383605475, 100, 2, + 2.3561944901923448 }, + { -0.37475021787822771, 100, 2, + 2.5132741228718345 }, + { 0.41175421895716069, 100, 2, + 2.6703537555513241 }, + { -0.48226933687995144, 100, 2, + 2.8274333882308138 }, + { 0.67166274297196804, 100, 2, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 2, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=2. +template <typename Tp> +void test031() +{ + 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(data031) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data031[i].l), Tp(data031[i].m), + Tp(data031[i].theta)); + const Tp f0 = data031[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)); +} + +// Test data for l=100, m=5. +testcase_sph_legendre<double> data032[] = { + { 0.0000000000000000, 100, 5, + 0.0000000000000000 }, + { 0.062564361105907143, 100, 5, + 0.15707963267948966 }, + { 0.14179554455880186, 100, 5, + 0.31415926535897931 }, + { -0.14356866942906019, 100, 5, + 0.47123889803846897 }, + { 0.12355483388448507, 100, 5, + 0.62831853071795862 }, + { -0.10090029999681098, 100, 5, + 0.78539816339744828 }, + { 0.078905134460230564, 100, 5, + 0.94247779607693793 }, + { -0.058040182398187236, 100, 5, + 1.0995574287564276 }, + { 0.038142759389484152, 100, 5, + 1.2566370614359172 }, + { -0.018906264170660277, 100, 5, + 1.4137166941154069 }, + { 1.9576303042914544e-15, 100, 5, + 1.5707963267948966 }, + { 0.018906264170649747, 100, 5, + 1.7278759594743860 }, + { -0.038142759389478524, 100, 5, + 1.8849555921538759 }, + { 0.058040182398182996, 100, 5, + 2.0420352248333655 }, + { -0.078905134460230564, 100, 5, + 2.1991148575128552 }, + { 0.10090029999681098, 100, 5, + 2.3561944901923448 }, + { -0.12355483388447780, 100, 5, + 2.5132741228718345 }, + { 0.14356866942904903, 100, 5, + 2.6703537555513241 }, + { -0.14179554455880186, 100, 5, + 2.8274333882308138 }, + { -0.062564361105959004, 100, 5, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 5, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=5. +template <typename Tp> +void test032() +{ + 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(data032) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data032[i].l), Tp(data032[i].m), + Tp(data032[i].theta)); + const Tp f0 = data032[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.0000000000000029e-12)); +} + +// Test data for l=100, m=10. +testcase_sph_legendre<double> data033[] = { + { 0.0000000000000000, 100, 10, + 0.0000000000000000 }, + { -0.75366545187995670, 100, 10, + 0.15707963267948966 }, + { -0.35914570017277186, 100, 10, + 0.31415926535897931 }, + { 0.43480692911578245, 100, 10, + 0.47123889803846897 }, + { -0.40862111080315705, 100, 10, + 0.62831853071795862 }, + { 0.37832688692909400, 100, 10, + 0.78539816339744828 }, + { -0.35484056194773472, 100, 10, + 0.94247779607693793 }, + { 0.33821981171196336, 100, 10, + 1.0995574287564276 }, + { -0.32729120767830605, 100, 10, + 1.2566370614359172 }, + { 0.32110336937091455, 100, 10, + 1.4137166941154069 }, + { -0.31910064020036194, 100, 10, + 1.5707963267948966 }, + { 0.32110336937091488, 100, 10, + 1.7278759594743860 }, + { -0.32729120767830577, 100, 10, + 1.8849555921538759 }, + { 0.33821981171196341, 100, 10, + 2.0420352248333655 }, + { -0.35484056194773472, 100, 10, + 2.1991148575128552 }, + { 0.37832688692909400, 100, 10, + 2.3561944901923448 }, + { -0.40862111080315433, 100, 10, + 2.5132741228718345 }, + { 0.43480692911577806, 100, 10, + 2.6703537555513241 }, + { -0.35914570017277186, 100, 10, + 2.8274333882308138 }, + { -0.75366545187998180, 100, 10, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 10, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=10. +template <typename Tp> +void test033() +{ + 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(data033) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data033[i].l), Tp(data033[i].m), + Tp(data033[i].theta)); + const Tp f0 = data033[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(1.0000000000000008e-12)); +} + +// Test data for l=100, m=20. +testcase_sph_legendre<double> data034[] = { + { 0.0000000000000000, 100, 20, + 0.0000000000000000 }, + { 0.053569660841553138, 100, 20, + 0.15707963267948966 }, + { 0.57154926874732426, 100, 20, + 0.31415926535897931 }, + { 0.47536909969585828, 100, 20, + 0.47123889803846897 }, + { -0.28882554564109014, 100, 20, + 0.62831853071795862 }, + { 0.020116179014049645, 100, 20, + 0.78539816339744828 }, + { 0.14752195931706580, 100, 20, + 0.94247779607693793 }, + { -0.24069428588868527, 100, 20, + 1.0995574287564276 }, + { 0.29031796025014395, 100, 20, + 1.2566370614359172 }, + { -0.31437256851143475, 100, 20, + 1.4137166941154069 }, + { 0.32153954851141792, 100, 20, + 1.5707963267948966 }, + { -0.31437256851143192, 100, 20, + 1.7278759594743860 }, + { 0.29031796025014112, 100, 20, + 1.8849555921538759 }, + { -0.24069428588868211, 100, 20, + 2.0420352248333655 }, + { 0.14752195931706580, 100, 20, + 2.1991148575128552 }, + { 0.020116179014049645, 100, 20, + 2.3561944901923448 }, + { -0.28882554564109658, 100, 20, + 2.5132741228718345 }, + { 0.47536909969585378, 100, 20, + 2.6703537555513241 }, + { 0.57154926874732426, 100, 20, + 2.8274333882308138 }, + { 0.053569660841557065, 100, 20, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 20, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=20. +template <typename Tp> +void test034() +{ + 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(data034) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data034[i].l), Tp(data034[i].m), + Tp(data034[i].theta)); + const Tp f0 = data034[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.5000000000000015e-12)); +} + +// Test data for l=100, m=50. +testcase_sph_legendre<double> data035[] = { + { 0.0000000000000000, 100, 50, + 0.0000000000000000 }, + { 3.3047910392590630e-21, 100, 50, + 0.15707963267948966 }, + { 1.0592655372554983e-07, 100, 50, + 0.31415926535897931 }, + { 0.080418744223952635, 100, 50, + 0.47123889803846897 }, + { -0.56450600580393062, 100, 50, + 0.62831853071795862 }, + { 0.33338739844741766, 100, 50, + 0.78539816339744828 }, + { 0.39741714816514678, 100, 50, + 0.94247779607693793 }, + { 0.35223993750972293, 100, 50, + 1.0995574287564276 }, + { 0.17885891940721749, 100, 50, + 1.2566370614359172 }, + { -0.15341660126461953, 100, 50, + 1.4137166941154069 }, + { -0.34175924303503102, 100, 50, + 1.5707963267948966 }, + { -0.15341660126462864, 100, 50, + 1.7278759594743860 }, + { 0.17885891940721332, 100, 50, + 1.8849555921538759 }, + { 0.35223993750972149, 100, 50, + 2.0420352248333655 }, + { 0.39741714816514678, 100, 50, + 2.1991148575128552 }, + { 0.33338739844741766, 100, 50, + 2.3561944901923448 }, + { -0.56450600580392785, 100, 50, + 2.5132741228718345 }, + { 0.080418744223953439, 100, 50, + 2.6703537555513241 }, + { 1.0592655372554983e-07, 100, 50, + 2.8274333882308138 }, + { 3.3047910392597871e-21, 100, 50, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 50, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=50. +template <typename Tp> +void test035() +{ + 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(data035) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data035[i].l), Tp(data035[i].m), + Tp(data035[i].theta)); + const Tp f0 = data035[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)); +} + +// Test data for l=100, m=100. +testcase_sph_legendre<double> data036[] = { + { 0.0000000000000000, 100, 100, + 0.0000000000000000 }, + { 2.5744136608862186e-81, 100, 100, + 0.15707963267948966 }, + { 9.4551974868956498e-52, 100, 100, + 0.31415926535897931 }, + { 4.8096190703396912e-35, 100, 100, + 0.47123889803846897 }, + { 7.9305393636343450e-24, 100, 100, + 0.62831853071795862 }, + { 8.4320740610946652e-16, 100, 100, + 0.78539816339744828 }, + { 5.9319660146027522e-10, 100, 100, + 0.94247779607693793 }, + { 9.2368225946796921e-06, 100, 100, + 1.0995574287564276 }, + { 0.0062815489742043982, 100, 100, + 1.2566370614359172 }, + { 0.27505966018176986, 100, 100, + 1.4137166941154069 }, + { 0.94936713998764621, 100, 100, + 1.5707963267948966 }, + { 0.27505966018177136, 100, 100, + 1.7278759594743860 }, + { 0.0062815489742044433, 100, 100, + 1.8849555921538759 }, + { 9.2368225946797582e-06, 100, 100, + 2.0420352248333655 }, + { 5.9319660146027522e-10, 100, 100, + 2.1991148575128552 }, + { 8.4320740610946652e-16, 100, 100, + 2.3561944901923448 }, + { 7.9305393636344581e-24, 100, 100, + 2.5132741228718345 }, + { 4.8096190703399648e-35, 100, 100, + 2.6703537555513241 }, + { 9.4551974868956498e-52, 100, 100, + 2.8274333882308138 }, + { 2.5744136608873895e-81, 100, 100, + 2.9845130209103035 }, + { 0.0000000000000000, 100, 100, + 3.1415926535897931 }, +}; + +// Test function for l=100, m=100. +template <typename Tp> +void test036() +{ + 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(data036) + / sizeof(testcase_sph_legendre<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_legendre(Tp(data036[i].l), Tp(data036[i].m), + Tp(data036[i].theta)); + const Tp f0 = data036[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>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + test009<double>(); + test010<double>(); + test011<double>(); + test012<double>(); + test013<double>(); + test014<double>(); + test015<double>(); + test016<double>(); + test017<double>(); + test018<double>(); + test019<double>(); + test020<double>(); + test021<double>(); + test022<double>(); + test023<double>(); + test024<double>(); + test025<double>(); + test026<double>(); + test027<double>(); + test028<double>(); + test029<double>(); + test030<double>(); + test031<double>(); + test032<double>(); + test033<double>(); + test034<double>(); + test035<double>(); + test036<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile.cc new file mode 100644 index 00000000000..9e6be450dff --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile.cc @@ -0,0 +1,43 @@ +// { 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.22 sph_legendre + +#include <tr1/cmath> + +void +test01() +{ + float thetaf = 0.5F; + double thetad = 0.5; + long double thetal = 0.5L; + unsigned int l = 2, m = 1; + + std::tr1::sph_legendre(l, m, thetaf); + std::tr1::sph_legendref(l, m, thetaf); + std::tr1::sph_legendre(l, m, thetad); + std::tr1::sph_legendre(l, m, thetal); + std::tr1::sph_legendrel(l, m, thetal); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile_2.cc new file mode 100644 index 00000000000..177e6205b1c --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/22_sph_legendre/compile_2.cc @@ -0,0 +1,43 @@ +// { 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.22 sph_legendre + +#include <tr1/math.h> + +void +test01() +{ + float thetaf = 0.5F; + double thetad = 0.5; + long double thetal = 0.5L; + unsigned int l = 2, m = 1; + + sph_legendre(l, m, thetaf); + sph_legendref(l, m, thetaf); + sph_legendre(l, m, thetad); + sph_legendre(l, m, thetal); + sph_legendrel(l, m, thetal); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_nan.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_nan.cc new file mode 100644 index 00000000000..17f8ca6b0ac --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_nan.cc @@ -0,0 +1,58 @@ +// { 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.23 sph_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(); + + unsigned int n = 0; + + float a = std::tr1::sph_neumann(n, xf); + float b = std::tr1::sph_neumannf(n, xf); + double c = std::tr1::sph_neumann(n, xd); + long double d = std::tr1::sph_neumann(n, xl); + long double e = std::tr1::sph_neumannl(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; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_value.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_value.cc new file mode 100644 index 00000000000..e399323f1a7 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/check_value.cc @@ -0,0 +1,462 @@ +// 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. + +// sph_neumann + + +// 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 for n=0. +testcase_sph_neumann<double> data001[] = { + { -0.056732437092645263, 0, 5.0000000000000000 }, + { 0.083907152907645249, 0, 10.000000000000000 }, + { 0.050645860857254754, 0, 15.000000000000000 }, + { -0.020404103090669597, 0, 20.000000000000000 }, + { -0.039648112474538942, 0, 25.000000000000000 }, + { -0.0051417149962528020, 0, 30.000000000000000 }, + { 0.025819777288328762, 0, 35.000000000000000 }, + { 0.016673451541306544, 0, 40.000000000000000 }, + { -0.011673821973727327, 0, 45.000000000000000 }, + { -0.019299320569842265, 0, 50.000000000000000 }, + { -0.00040230465930828606, 0, 55.000000000000000 }, + { 0.015873549673585938, 0, 60.000000000000000 }, + { 0.0086531361728949541, 0, 65.000000000000000 }, + { -0.0090474171869471404, 0, 70.000000000000000 }, + { -0.012290016929663325, 0, 75.000000000000000 }, + { 0.0013798405479880946, 0, 80.000000000000000 }, + { 0.011580901686988727, 0, 85.000000000000000 }, + { 0.0049785957347685574, 0, 90.000000000000000 }, + { -0.0076860374841559963, 0, 95.000000000000000 }, + { -0.0086231887228768386, 0, 100.00000000000000 }, +}; + +// Test function for n=0. +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_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data001[i].n), 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.0000000000000028e-11)); +} + +// Test data for n=1. +testcase_sph_neumann<double> data002[] = { + { 0.18043836751409864, 1, 5.0000000000000000 }, + { 0.062792826379701516, 1, 10.000000000000000 }, + { -0.039976131953324147, 1, 15.000000000000000 }, + { -0.046667467690914864, 1, 20.000000000000000 }, + { 0.0037081455049293634, 1, 25.000000000000000 }, + { 0.032762996969886965, 1, 30.000000000000000 }, + { 0.012971498479556564, 1, 35.000000000000000 }, + { -0.018210992723451058, 1, 40.000000000000000 }, + { -0.019168385477952129, 1, 45.000000000000000 }, + { 0.0048615106626817301, 1, 50.000000000000000 }, + { 0.018170052158169303, 1, 55.000000000000000 }, + { 0.0053447361795967109, 1, 60.000000000000000 }, + { -0.012587316051033977, 1, 65.000000000000000 }, + { -0.011184829982069090, 1, 70.000000000000000 }, + { 0.0050065549130635621, 1, 75.000000000000000 }, + { 0.012440856180892041, 1, 80.000000000000000 }, + { 0.0022077237839479508, 1, 85.000000000000000 }, + { -0.0098779785318421041, 1, 90.000000000000000 }, + { -0.0072731342338976518, 1, 95.000000000000000 }, + { 0.0049774245238688201, 1, 100.00000000000000 }, +}; + +// Test function for n=1. +template <typename Tp> +void test002() +{ + 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(data002) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data002[i].n), Tp(data002[i].x)); + const Tp f0 = data002[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.5000000000000014e-11)); +} + +// Test data for n=2. +testcase_sph_neumann<double> data003[] = { + { 0.16499545760110443, 2, 5.0000000000000000 }, + { -0.065069304993734797, 2, 10.000000000000000 }, + { -0.058641087247919589, 2, 15.000000000000000 }, + { 0.013403982937032370, 2, 20.000000000000000 }, + { 0.040093089935130465, 2, 25.000000000000000 }, + { 0.0084180146932414986, 2, 30.000000000000000 }, + { -0.024707934561509628, 2, 35.000000000000000 }, + { -0.018039275995565374, 2, 40.000000000000000 }, + { 0.010395929608530519, 2, 45.000000000000000 }, + { 0.019591011209603170, 2, 50.000000000000000 }, + { 0.0013933984133902479, 2, 55.000000000000000 }, + { -0.015606312864606103, 2, 60.000000000000000 }, + { -0.0092340892214042153, 2, 65.000000000000000 }, + { 0.0085680673305727519, 2, 70.000000000000000 }, + { 0.012490279126185866, 2, 75.000000000000000 }, + { -0.00091330844120464307, 2, 80.000000000000000 }, + { -0.011502982024025860, 2, 85.000000000000000 }, + { -0.0053078616858299602, 2, 90.000000000000000 }, + { 0.0074563595609802805, 2, 95.000000000000000 }, + { 0.0087725114585929034, 2, 100.00000000000000 }, +}; + +// Test function for n=2. +template <typename Tp> +void test003() +{ + 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(data003) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data003[i].n), Tp(data003[i].x)); + const Tp f0 = data003[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.0000000000000028e-11)); +} + +// Test data for n=5. +testcase_sph_neumann<double> data004[] = { + { -0.32046504674973919, 5, 5.0000000000000000 }, + { 0.093833541678691818, 5, 10.000000000000000 }, + { 0.020475698281859061, 5, 15.000000000000000 }, + { -0.048172347757372780, 5, 20.000000000000000 }, + { -0.018309489232548347, 5, 25.000000000000000 }, + { 0.026639390496569996, 5, 30.000000000000000 }, + { 0.022006038985576210, 5, 35.000000000000000 }, + { -0.011268975348057965, 5, 40.000000000000000 }, + { -0.021770388372274862, 5, 45.000000000000000 }, + { -0.00069711319645853712, 5, 50.000000000000000 }, + { 0.017439589450220897, 5, 55.000000000000000 }, + { 0.0088699170919343089, 5, 60.000000000000000 }, + { -0.010421334444951861, 5, 65.000000000000000 }, + { -0.012746769858008551, 5, 70.000000000000000 }, + { 0.0026282888028967737, 5, 75.000000000000000 }, + { 0.012477658581324189, 5, 80.000000000000000 }, + { 0.0040771816818182642, 5, 85.000000000000000 }, + { -0.0089777759570579801, 5, 90.000000000000000 }, + { -0.0083184557896676149, 5, 95.000000000000000 }, + { 0.0037206784862748965, 5, 100.00000000000000 }, +}; + +// Test function for n=5. +template <typename Tp> +void test004() +{ + 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(data004) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data004[i].n), Tp(data004[i].x)); + const Tp f0 = data004[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.0000000000000028e-11)); +} + +// Test data for n=10. +testcase_sph_neumann<double> data005[] = { + { -26.656114405718704, 10, 5.0000000000000000 }, + { -0.17245367208805784, 10, 10.000000000000000 }, + { 0.078461689849642580, 10, 15.000000000000000 }, + { -0.036843410496289961, 10, 20.000000000000000 }, + { -0.021158339301097472, 10, 25.000000000000000 }, + { 0.031219591064754935, 10, 30.000000000000000 }, + { 0.012840593422414804, 10, 35.000000000000000 }, + { -0.021803068636888072, 10, 40.000000000000000 }, + { -0.014071636804469047, 10, 45.000000000000000 }, + { 0.013524687511158756, 10, 50.000000000000000 }, + { 0.015684932653180592, 10, 55.000000000000000 }, + { -0.0056356895567262122, 10, 60.000000000000000 }, + { -0.015364490270315362, 10, 65.000000000000000 }, + { -0.0014525575672261291, 10, 70.000000000000000 }, + { 0.012648951699549433, 10, 75.000000000000000 }, + { 0.0068571608061120358, 10, 80.000000000000000 }, + { -0.0080151152941401460, 10, 85.000000000000000 }, + { -0.0098139742219019131, 10, 90.000000000000000 }, + { 0.0025002854072314951, 10, 95.000000000000000 }, + { 0.010025777373636153, 10, 100.00000000000000 }, +}; + +// Test function for n=10. +template <typename Tp> +void test005() +{ + 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(data005) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data005[i].n), Tp(data005[i].x)); + const Tp f0 = data005[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.0000000000000028e-11)); +} + +// Test data for n=20. +testcase_sph_neumann<double> data006[] = { + { -926795140.30575454, 20, 5.0000000000000000 }, + { -1211.2106053526034, 20, 10.000000000000000 }, + { -1.5559965765652188, 20, 15.000000000000000 }, + { -0.093401132250914426, 20, 20.000000000000000 }, + { 0.044031985675276435, 20, 25.000000000000000 }, + { -0.036078033606613907, 20, 30.000000000000000 }, + { 0.029828405631319641, 20, 35.000000000000000 }, + { -0.0048414810986760785, 20, 40.000000000000000 }, + { -0.020504694681516944, 20, 45.000000000000000 }, + { 0.013759531302541211, 20, 50.000000000000000 }, + { 0.012783038861734196, 20, 55.000000000000000 }, + { -0.013117009421906418, 20, 60.000000000000000 }, + { -0.010338106075674407, 20, 65.000000000000000 }, + { 0.010538610814111246, 20, 70.000000000000000 }, + { 0.010200029094273743, 20, 75.000000000000000 }, + { -0.0073123450945617122, 20, 80.000000000000000 }, + { -0.010581510354950906, 20, 85.000000000000000 }, + { 0.0036866374015298714, 20, 90.000000000000000 }, + { 0.010498384318338270, 20, 95.000000000000000 }, + { 5.6317293788333982e-05, 20, 100.00000000000000 }, +}; + +// Test function for n=20. +template <typename Tp> +void test006() +{ + 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(data006) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data006[i].n), Tp(data006[i].x)); + const Tp f0 = data006[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(1.0000000000000007e-09)); +} + +// Test data for n=50. +testcase_sph_neumann<double> data007[] = { + { -6.9641091882698388e+42, 50, 5.0000000000000000 }, + { -4.5282272723512023e+27, 50, 10.000000000000000 }, + { -9.0004902645887027e+18, 50, 15.000000000000000 }, + { -9542541667002.5098, 50, 20.000000000000000 }, + { -363518140.71026677, 50, 25.000000000000000 }, + { -152551.57233157745, 50, 30.000000000000000 }, + { -386.26599186208625, 50, 35.000000000000000 }, + { -4.3290507947291035, 50, 40.000000000000000 }, + { -0.19968460851503764, 50, 45.000000000000000 }, + { -0.041900001504607758, 50, 50.000000000000000 }, + { 0.010696040672421900, 50, 55.000000000000000 }, + { 0.0078198768555268507, 50, 60.000000000000000 }, + { -0.010088474938191242, 50, 65.000000000000000 }, + { 0.0062423671279824801, 50, 70.000000000000000 }, + { 0.0011284242794941733, 50, 75.000000000000000 }, + { -0.0093934266037485562, 50, 80.000000000000000 }, + { 0.013108079602843424, 50, 85.000000000000000 }, + { -0.0075396607225722626, 50, 90.000000000000000 }, + { -0.0042605703552836558, 50, 95.000000000000000 }, + { 0.010747822973682470, 50, 100.00000000000000 }, +}; + +// Test function for n=50. +template <typename Tp> +void test007() +{ + 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(data007) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data007[i].n), Tp(data007[i].x)); + const Tp f0 = data007[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.5000000000000014e-11)); +} + +// Test data for n=100. +testcase_sph_neumann<double> data008[] = { + { -1.7997139826259744e+116, 100, 5.0000000000000000 }, + { -8.5732263093296254e+85, 100, 10.000000000000000 }, + { -1.9270658593711675e+68, 100, 15.000000000000000 }, + { -7.2208893582952363e+55, 100, 20.000000000000000 }, + { -2.0868752613007946e+46, 100, 25.000000000000000 }, + { -4.2496124023612646e+38, 100, 30.000000000000000 }, + { -1.7042898348910271e+32, 100, 35.000000000000000 }, + { -6.3021565260724554e+26, 100, 40.000000000000000 }, + { -1.3199917400494369e+22, 100, 45.000000000000000 }, + { -1.1256928913265985e+18, 100, 50.000000000000000 }, + { -309801083340341.00, 100, 55.000000000000000 }, + { -232585620046.64737, 100, 60.000000000000000 }, + { -421135935.93756086, 100, 65.000000000000000 }, + { -1680637.4531202619, 100, 70.000000000000000 }, + { -13868.302591128842, 100, 75.000000000000000 }, + { -227.24385709173322, 100, 80.000000000000000 }, + { -7.2807038787139486, 100, 85.000000000000000 }, + { -0.46648154448250878, 100, 90.000000000000000 }, + { -0.067270772720654542, 100, 95.000000000000000 }, + { -0.022983850491562267, 100, 100.00000000000000 }, +}; + +// Test function for n=100. +template <typename Tp> +void test008() +{ + 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(data008) + / sizeof(testcase_sph_neumann<double>); + for (unsigned int i = 0; i < num_datum; ++i) + { + const Tp f = std::tr1::sph_neumann(Tp(data008[i].n), Tp(data008[i].x)); + const Tp f0 = data008[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.5000000000000015e-12)); +} + +int main(int, char**) +{ + test001<double>(); + test002<double>(); + test003<double>(); + test004<double>(); + test005<double>(); + test006<double>(); + test007<double>(); + test008<double>(); + return 0; +} diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile.cc new file mode 100644 index 00000000000..7a26872203e --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile.cc @@ -0,0 +1,43 @@ +// { 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.23 sph_neumann + +#include <tr1/cmath> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int n = 0; + + std::tr1::sph_neumann(n, xf); + std::tr1::sph_neumannf(n, xf); + std::tr1::sph_neumann(n, xd); + std::tr1::sph_neumann(n, xl); + std::tr1::sph_neumannl(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile_2.cc b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile_2.cc new file mode 100644 index 00000000000..f9428c256e3 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/23_sph_neumann/compile_2.cc @@ -0,0 +1,43 @@ +// { 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.23 sph_neumann + +#include <tr1/math.h> + +void +test01() +{ + float xf = 0.5F; + double xd = 0.5; + long double xl = 0.5L; + unsigned int n = 0; + + sph_neumann(n, xf); + sph_neumannf(n, xf); + sph_neumann(n, xd); + sph_neumann(n, xl); + sph_neumannl(n, xl); + + return; +} + diff --git a/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/testcase.h b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/testcase.h new file mode 100644 index 00000000000..8c5aa829946 --- /dev/null +++ b/libstdc++-v3/testsuite/tr1/5_numerical_facilities/special_functions/testcase.h @@ -0,0 +1,259 @@ +// 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. + +// testcase.h + +// +// These are little PODs for special function inputs and +// expexted results for the testsuite. +// + +// 5.2.1.1 Associated Laguerre polynomials. +template <typename _Tp> +struct testcase_assoc_laguerre +{ + _Tp f0; + unsigned int n; + unsigned int m; + _Tp x; + _Tp f; +}; + +// 5.2.1.2 Associated Legendre functions. +template <typename _Tp> +struct testcase_assoc_legendre +{ + _Tp f0; + unsigned int l; + unsigned int m; + _Tp x; + _Tp f; +}; + +// 5.2.1.3 Beta function. +template <typename _Tp> +struct testcase_beta +{ + _Tp f0; + _Tp x; + _Tp y; + _Tp f; +}; + +// 5.2.1.4 Complete elliptic integrals of the first kind. +template <typename _Tp> +struct testcase_comp_ellint_1 +{ + _Tp f0; + _Tp k; + _Tp f; +}; + +// 5.2.1.5 Complete elliptic integrals of the second kind. +template <typename _Tp> +struct testcase_comp_ellint_2 +{ + _Tp f0; + _Tp k; + _Tp f; +}; + +// 5.2.1.6 Complete elliptic integrals of the third kind. +template <typename _Tp> +struct testcase_comp_ellint_3 +{ + _Tp f0; + _Tp k; + _Tp nu; + _Tp f; +}; + +// 5.2.1.7 Confluent hypergeometric functions. +template <typename _Tp> +struct testcase_conf_hyperg +{ + _Tp f0; + _Tp a; + _Tp c; + _Tp x; + _Tp f; +}; + +// 5.2.1.8 Regular modified cylindrical Bessel functions. +template <typename _Tp> +struct testcase_cyl_bessel_i +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +// 5.2.1.9 Cylindrical Bessel functions (of the first kind). +template <typename _Tp> +struct testcase_cyl_bessel_j +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +// 5.2.1.10 Irregular modified cylindrical Bessel functions. +template <typename _Tp> +struct testcase_cyl_bessel_k +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +// 5.2.1.11 Cylindrical Neumann functions. +template <typename _Tp> +struct testcase_cyl_neumann +{ + _Tp f0; + _Tp nu; + _Tp x; + _Tp f; +}; + +// 5.2.1.12 Elliptic integrals of the first kind. +template <typename _Tp> +struct testcase_ellint_1 +{ + _Tp f0; + _Tp k; + _Tp phi; + _Tp f; +}; + +// 5.2.1.13 Elliptic integrals of the second kind. +template <typename _Tp> +struct testcase_ellint_2 +{ + _Tp f0; + _Tp k; + _Tp phi; + _Tp f; +}; + +// 5.2.1.14 Elliptic integrals of the third kind. +template <typename _Tp> +struct testcase_ellint_3 +{ + _Tp f0; + _Tp k; + _Tp nu; + _Tp phi; + _Tp f; +}; + +// 5.2.1.15 Exponential integral. +template <typename _Tp> +struct testcase_expint +{ + _Tp f0; + _Tp x; + _Tp f; +}; + +// 5.2.1.16 Hermite polynomials +template <typename _Tp> +struct testcase_hermite +{ + _Tp f0; + unsigned int n; + _Tp x; + _Tp f; +}; + +// 5.2.1.17 Hypergeometric functions. +template <typename _Tp> +struct testcase_hyperg +{ + _Tp f0; + _Tp a; + _Tp b; + _Tp c; + _Tp x; + _Tp f; +}; + +// 5.2.1.18 Laguerre polynomials. +template <typename _Tp> +struct testcase_laguerre +{ + _Tp f0; + unsigned int n; + _Tp x; + _Tp f; +}; + +// 5.2.1.19 Legendre polynomials. +template <typename _Tp> +struct testcase_legendre +{ + _Tp f0; + unsigned int l; + _Tp x; + _Tp f; +}; + +// 5.2.1.20 Riemann zeta function. +template <typename _Tp> +struct testcase_riemann_zeta +{ + _Tp f0; + _Tp x; + _Tp f; +}; + +// 5.2.1.21 Spherical Bessel functions. +template <typename _Tp> +struct testcase_sph_bessel +{ + _Tp f0; + unsigned int n; + _Tp x; + _Tp f; +}; + +// 5.2.1.22 Spherical Legendre functions. +template <typename _Tp> +struct testcase_sph_legendre +{ + _Tp f0; + unsigned int l; + unsigned int m; + _Tp theta; + _Tp f; +}; + +// 5.2.1.23 Spherical Neumann functions. +template <typename _Tp> +struct testcase_sph_neumann +{ + _Tp f0; + unsigned int n; + _Tp x; + _Tp f; +}; |