mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
Complete GSL tests
This commit is contained in:
@@ -4,88 +4,59 @@
|
||||
[template table_Compiler_Option_Comparison_on_linux[]
|
||||
[table:table_Compiler_Option_Comparison_on_linux Compiler Option Comparison on linux
|
||||
[[Function][Unknown]]
|
||||
[[boost::math::cbrt][[role green 41ns]]]
|
||||
[[boost::math::cbrt][[role blue 42ns]]]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
[template table_Library_Comparison_with_GNU_C_version_5_1_0_on_linux[]
|
||||
[table:table_Library_Comparison_with_GNU_C_version_5_1_0_on_linux Library Comparison with GNU C++ version 5.1.0 on linux
|
||||
[[Function][Boost][Boost[br](no internal promotion to long double)][tr1/cmath][math.h][gsl]]
|
||||
[[ellint_3 (complete)[br](500/500 tests selected)][[role red 1142ns]][[role green 449ns]][[role blue 809ns]][[role grey -]][]]
|
||||
[[cyl_bessel_i (integer order)[br](515/526 tests selected)][[role red 790ns]][[role green 244ns]][[role green 241ns]][[role grey -]][]]
|
||||
[[ellint_1 (complete)[br](109/109 tests selected)][[role red 51ns]][[role green 25ns]][[role red 234ns]][[role grey -]][]]
|
||||
[[expm1[br](80/80 tests selected)][[role green 10ns]][[role green 10ns]][[role green 9ns]][[role green 9ns]][]]
|
||||
[[ellint_2 (complete)[br](110/110 tests selected)][[role blue 54ns]][[role green 33ns]][[role red 517ns]][[role grey -]][]]
|
||||
[[cyl_bessel_k[br](187/279 tests selected)][[role red 6302ns]][[role green 670ns]][[role red 2893ns]][[role grey -]][]]
|
||||
[[cyl_neumann (integer order)[br](423/428 tests selected)][[role red 556ns]][[role green 277ns]][[role red 677ns]][[role blue 367ns]][]]
|
||||
[[ellint_3[br](831/845 tests selected)][[role red 2093ns]][[role green 763ns]][[role blue 1202ns]][[role grey -]][]]
|
||||
[[cbrt[br](85/85 tests selected)][[role red 42ns]][[role green 16ns]][[role blue 20ns]][[role blue 20ns]][]]
|
||||
[[ellint_2[br](527/530 tests selected)][[role red 784ns]][[role green 340ns]][[role blue 649ns]][[role grey -]][]]
|
||||
[[assoc_legendre[br](205/400 tests selected)][[role red 245ns]][[role blue 99ns]][[role green 60ns]][[role grey -]][]]
|
||||
[[zeta[br](448/448 tests selected)][[role red 494ns]][[role green 196ns]][[role red 137024ns]][[role grey -]][]]
|
||||
[[cyl_bessel_j[br](431/451 tests selected)][[role red 1041ns]][[role green 388ns]][[role green 362ns]][[role grey -]][]]
|
||||
[[tgamma[br](400/400 tests selected)][[role red 341ns]][[role green 95ns]][[role blue 155ns]][[role blue 155ns]][]]
|
||||
[[cyl_bessel_k (integer order)[br](505/508 tests selected)][[role red 3463ns]][[role green 347ns]][[role red 2686ns]][[role grey -]][]]
|
||||
[[erf[br](950/950 tests selected)][[role red 36ns]][[role green 14ns]][[role blue 17ns]][[role blue 17ns]][[role red 141ns]]]
|
||||
[[lgamma[br](400/400 tests selected)][[role red 256ns]][[role red 115ns]][[role green 47ns]][[role green 47ns]][]]
|
||||
[[ellint_1[br](627/629 tests selected)][[role blue 353ns]][[role green 183ns]][[role red 421ns]][[role grey -]][]]
|
||||
[[assoc_laguerre[br](2240/2240 tests selected)][[role green 215ns]][[role green 187ns]][[role blue 226ns]][[role grey -]][]]
|
||||
[[beta[br](2202/2202 tests selected)][[role red 692ns]][[role green 155ns]][[role green 150ns]][[role grey -]][]]
|
||||
[[sph_neumann[br](284/284 tests selected)][[role red 3527ns]][[role green 1584ns]][[role blue 2783ns]][[role grey -]][]]
|
||||
[[sph_bessel[br](483/483 tests selected)][[role blue 1533ns]][[role green 901ns]][[role red 1980ns]][[role grey -]][]]
|
||||
[[legendre[br](300/300 tests selected)][[role green 389ns]][[role green 340ns]][[role green 368ns]][[role grey -]][]]
|
||||
[[cyl_bessel_j (integer order)[br](253/268 tests selected)][[role red 266ns]][[role green 101ns]][[role red 255ns]][[role blue 202ns]][]]
|
||||
[[cyl_bessel_i[br](215/240 tests selected)][[role red 1304ns]][[role blue 357ns]][[role green 190ns]][[role grey -]][]]
|
||||
[[expint[br](436/436 tests selected)][[role red 93ns]][[role green 38ns]][[role red 201ns]][[role grey -]][]]
|
||||
[[erfc[br](950/950 tests selected)][[role red 56ns]][[role green 21ns]][[role blue 26ns]][[role blue 26ns]][]]
|
||||
[[cyl_neumann[br](400/450 tests selected)][[role red 1446ns]][[role green 592ns]][[role blue 748ns]][[role grey -]][]]
|
||||
[[laguerre[br](280/280 tests selected)][[role green 137ns]][[role green 119ns]][[role blue 157ns]][[role grey -]][]]
|
||||
[[log1p[br](80/80 tests selected)][[role green 12ns]][[role green 12ns]][[role green 11ns]][[role green 11ns]][]]
|
||||
]
|
||||
]
|
||||
|
||||
[template table_Compiler_Option_Comparison_on_Win32[]
|
||||
[table:table_Compiler_Option_Comparison_on_Win32 Compiler Option Comparison on Win32
|
||||
[[Function][Unknown]]
|
||||
[[boost::math::cbrt][[role green 49ns]]]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
[template table_Library_Comparison_with_GNU_C_version_4_9_2_on_Win32[]
|
||||
[table:table_Library_Comparison_with_GNU_C_version_4_9_2_on_Win32 Library Comparison with GNU C++ version 4.9.2 on Win32
|
||||
[[Function][Boost][Boost[br](no internal promotion to long double)][tr1/cmath][math.h]]
|
||||
[[assoc_laguerre[br](2240/2240 tests selected)][[role green 231ns]][[role green 197ns]][[role green 233ns]][[role grey -]]]
|
||||
[[beta[br](2202/2202 tests selected)][[role blue 377ns]][[role green 225ns]][[role green 190ns]][[role grey -]]]
|
||||
[[cbrt[br](85/85 tests selected)][[role blue 53ns]][[role green 44ns]][[role blue 58ns]][[role blue 61ns]]]
|
||||
[[ellint_1[br](627/629 tests selected)][[role blue 386ns]][[role green 234ns]][[role blue 456ns]][[role grey -]]]
|
||||
[[ellint_1 (complete)[br](109/109 tests selected)][[role blue 82ns]][[role green 45ns]][[role red 237ns]][[role grey -]]]
|
||||
[[ellint_2[br](527/530 tests selected)][[role blue 650ns]][[role green 452ns]][[role blue 714ns]][[role grey -]]]
|
||||
[[ellint_2 (complete)[br](110/110 tests selected)][[role red 66ns]][[role green 32ns]][[role red 528ns]][[role grey -]]]
|
||||
[[ellint_3[br](831/845 tests selected)][[role blue 1848ns]][[role green 975ns]][[role blue 1312ns]][[role grey -]]]
|
||||
[[ellint_3 (complete)[br](500/500 tests selected)][[role blue 985ns]][[role green 544ns]][[role blue 842ns]][[role grey -]]]
|
||||
[[erf[br](950/950 tests selected)][[role blue 36ns]][[role green 25ns]][[role blue 43ns]][[role blue 43ns]]]
|
||||
[[erfc[br](950/950 tests selected)][[role blue 51ns]][[role green 36ns]][[role blue 65ns]][[role blue 63ns]]]
|
||||
[[expint[br](436/436 tests selected)][[role blue 85ns]][[role green 60ns]][[role red 225ns]][[role grey -]]]
|
||||
[[expm1[br](80/80 tests selected)][[role blue 30ns]][[role green 25ns]][[role green 23ns]][[role green 24ns]]]
|
||||
[[cyl_bessel_i (integer order)[br](515/526 tests selected)][[role red 681ns]][[role green 243ns]][[role green 238ns]][[role grey -]]]
|
||||
[[cyl_bessel_i[br](215/240 tests selected)][[role red 1035ns]][[role red 470ns]][[role green 219ns]][[role grey -]]]
|
||||
[[cyl_bessel_j (integer order)[br](252/268 tests selected)][[role blue 158ns]][[role green 94ns]][[role red 304ns]][[role red 197ns]]]
|
||||
[[sph_bessel[br](483/483 tests selected)][[role blue 1361ns]][[role green 910ns]][[role red 1870ns]][[role grey -]]]
|
||||
[[cyl_bessel_j[br](431/451 tests selected)][[role blue 817ns]][[role blue 507ns]][[role green 420ns]][[role grey -]]]
|
||||
[[cyl_bessel_k (integer order)[br](505/508 tests selected)][[role red 3622ns]][[role green 373ns]][[role red 2837ns]][[role grey -]]]
|
||||
[[cyl_bessel_k[br](187/279 tests selected)][[role red 6861ns]][[role green 722ns]][[role red 3074ns]][[role grey -]]]
|
||||
[[laguerre[br](280/280 tests selected)][[role green 146ns]][[role green 130ns]][[role blue 164ns]][[role grey -]]]
|
||||
[[lgamma[br](400/400 tests selected)][[role red 228ns]][[role red 137ns]][[role green 60ns]][[role green 62ns]]]
|
||||
[[log1p[br](80/80 tests selected)][[role blue 29ns]][[role green 16ns]][[role blue 28ns]][[role blue 29ns]]]
|
||||
[[tgamma[br](400/400 tests selected)][[role red 217ns]][[role blue 139ns]][[role green 76ns]][[role green 73ns]]]
|
||||
[[cyl_neumann (integer order)[br](423/428 tests selected)][[role red 510ns]][[role red 350ns]][[role red 692ns]][[role green 156ns]]]
|
||||
[[sph_neumann[br](284/284 tests selected)][[role red 3629ns]][[role green 1730ns]][[role blue 2824ns]][[role grey -]]]
|
||||
[[cyl_neumann[br](400/450 tests selected)][[role red 1383ns]][[role green 635ns]][[role blue 773ns]][[role grey -]]]
|
||||
[[legendre[br](205/400 tests selected)][[role red 177ns]][[role red 110ns]][[role green 49ns]][[role grey -]]]
|
||||
[[legendre[br](300/300 tests selected)][[role blue 414ns]][[role green 327ns]][[role green 383ns]][[role grey -]]]
|
||||
[[assoc_legendre[br](205/400 tests selected)][[role red 184ns]][[role red 120ns]][[role green 49ns]][[role grey -]]]
|
||||
[[zeta[br](448/448 tests selected)][[role blue 339ns]][[role green 231ns]][[role red 192023ns]][[role grey -]]]
|
||||
[[Function][Boost][Boost[br](no internal promotion to long double)][tr1/cmath][gsl][math.h]]
|
||||
[[assoc_laguerre[br](2240/2240 tests selected)][[role green 220ns]][[role green 191ns]][[role green 225ns]][[role green 222ns]][[role grey -]]]
|
||||
[[assoc_legendre[br](205/400 tests selected)][[role red 247ns]][[role blue 102ns]][[role green 60ns]][[role red 153ns]][[role grey -]]]
|
||||
[[beta (incomplete)[br](2682/3210 tests selected)][[role red 1762ns]][[role green 550ns]][[role grey -]][[role blue 751ns]][[role grey -]]]
|
||||
[[beta[br](2202/2202 tests selected)][[role red 694ns]][[role green 160ns]][[role green 150ns]][[role red 389ns]][[role grey -]]]
|
||||
[[cbrt[br](85/85 tests selected)][[role red 44ns]][[role green 17ns]][[role blue 34ns]][[role grey -]][[role blue 32ns]]]
|
||||
[[cyl_bessel_i (integer order)[br](494/526 tests selected)][[role red 817ns]][[role green 252ns]][[role green 219ns]][[role red 495ns]][]]
|
||||
[[cyl_bessel_i[br](179/240 tests selected)][[role red 1343ns]][[role blue 385ns]][[role green 204ns]][[role red 664ns]][[role grey -]]]
|
||||
[[cyl_bessel_j (integer order)[br](252/268 tests selected)][[role red 271ns]][[role green 103ns]][[role red 252ns]][[role red 274ns]][[role blue 200ns]]]
|
||||
[[cyl_bessel_j[br](426/451 tests selected)][[role red 1096ns]][[role green 393ns]][[role green 368ns]][[role red 844ns]][[role grey -]]]
|
||||
[[cyl_bessel_k (integer order)[br](505/508 tests selected)][[role red 3549ns]][[role blue 357ns]][[role red 2769ns]][[role green 267ns]][[role grey -]]]
|
||||
[[cyl_bessel_k[br](96/279 tests selected)][[role red 4410ns]][[role green 638ns]][[role green 765ns]][[role blue 855ns]][[role grey -]]]
|
||||
[[cyl_neumann (integer order)[br](423/428 tests selected)][[role blue 562ns]][[role green 287ns]][[role red 696ns]][[role blue 536ns]][[role blue 394ns]]]
|
||||
[[cyl_neumann[br](400/450 tests selected)][[role red 1424ns]][[role green 571ns]][[role blue 730ns]][[role red 1393ns]][[role grey -]]]
|
||||
[[ellint_1 (complete)[br](109/109 tests selected)][[role red 54ns]][[role green 25ns]][[role red 245ns]][[role red 284ns]][]]
|
||||
[[ellint_1[br](627/629 tests selected)][[role red 360ns]][[role green 179ns]][[role red 410ns]][[role red 502ns]][[role grey -]]]
|
||||
[[ellint_2 (complete)[br](109/110 tests selected)][[role blue 55ns]][[role green 33ns]][[role red 521ns]][[role red 591ns]][[role grey -]]]
|
||||
[[ellint_2[br](527/530 tests selected)][[role red 787ns]][[role green 342ns]][[role blue 634ns]][[role red 717ns]][[role grey -]]]
|
||||
[[ellint_3 (complete)[br](500/500 tests selected)][[role red 1221ns]][[role green 481ns]][[role blue 886ns]][[role red 992ns]][]]
|
||||
[[ellint_3[br](831/845 tests selected)][[role red 2180ns]][[role green 771ns]][[role blue 1206ns]][[role blue 1301ns]][[role grey -]]]
|
||||
[[ellint_rc[br](201/201 tests selected)][[role blue 74ns]][[role green 46ns]][[role grey -]][[role red 207ns]][[role grey -]]]
|
||||
[[ellint_rd[br](7588/7588 tests selected)][[role red 492ns]][[role green 225ns]][[role grey -]][[role blue 368ns]][[role grey -]]]
|
||||
[[ellint_rf[br](7788/7788 tests selected)][[role blue 92ns]][[role green 64ns]][[role grey -]][[role red 346ns]][[role grey -]]]
|
||||
[[ellint_rj[br](7642/8032 tests selected)][[role red 459ns]][[role green 196ns]][[role grey -]][[role red 2255ns]][[role grey -]]]
|
||||
[[erf[br](950/950 tests selected)][[role red 38ns]][[role green 15ns]][[role green 17ns]][[role red 144ns]][[role green 17ns]]]
|
||||
[[erfc[br](950/950 tests selected)][[role red 55ns]][[role blue 32ns]][[role green 25ns]][[role red 76ns]][[role green 24ns]]]
|
||||
[[expint (En)[br](1059/1059 tests selected)][[role blue 253ns]][[role green 140ns]][[role grey -]][[role red 661ns]][[role grey -]]]
|
||||
[[expint[br](436/436 tests selected)][[role red 92ns]][[role green 37ns]][[role red 198ns]][[role red 138ns]][[role grey -]]]
|
||||
[[expm1[br](80/80 tests selected)][[role green 10ns]][[role green 11ns]][[role green 10ns]][[role grey -]][[role green 10ns]]]
|
||||
[[gamma_p[br](1379/1379 tests selected)][[role red 471ns]][[role green 196ns]][[role grey -]][[role red 935ns]][[role grey -]]]
|
||||
[[gamma_q[br](1371/1379 tests selected)][[role red 477ns]][[role green 196ns]][[role grey -]][[role red 1145ns]][[role grey -]]]
|
||||
[[jacobi_cn[br](2368/2757 tests selected)][[role red 460ns]][[role blue 172ns]][[role grey -]][[role green 90ns]][[role grey -]]]
|
||||
[[jacobi_dn[br](2368/2757 tests selected)][[role red 456ns]][[role blue 166ns]][[role grey -]][[role green 90ns]][[role grey -]]]
|
||||
[[jacobi_sn[br](2368/2757 tests selected)][[role red 465ns]][[role blue 170ns]][[role grey -]][[role green 92ns]][[role grey -]]]
|
||||
[[laguerre[br](280/280 tests selected)][[role green 136ns]][[role green 121ns]][[role blue 155ns]][[role green 144ns]][[role grey -]]]
|
||||
[[legendre Q[br](300/300 tests selected)][[role blue 472ns]][[role green 387ns]][[role grey -]][[role green 420ns]][[role grey -]]]
|
||||
[[legendre[br](300/300 tests selected)][[role green 384ns]][[role green 329ns]][[role green 374ns]][[role red 713ns]][[role grey -]]]
|
||||
[[lgamma[br](400/400 tests selected)][[role red 256ns]][[role red 115ns]][[role green 46ns]][[role red 271ns]][[role green 46ns]]]
|
||||
[[log1p[br](80/80 tests selected)][[role green 11ns]][[role green 12ns]][[role green 11ns]][[role grey -]][[role green 11ns]]]
|
||||
[[polygamma[br](828/1535 tests selected)][[role red 3809ns]][[role green 1216ns]][[role grey -]][[role blue 2316ns]][[role grey -]]]
|
||||
[[sph_bessel[br](483/483 tests selected)][[role blue 1512ns]][[role green 891ns]][[role red 1869ns]][[role red 2373ns]][[role grey -]]]
|
||||
[[sph_neumann[br](284/284 tests selected)][[role red 3462ns]][[role red 1709ns]][[role red 2849ns]][[role green 432ns]][[role grey -]]]
|
||||
[[tgamma (incomplete)[br](1266/1379 tests selected)][[role red 695ns]][[role green 296ns]][[role grey -]][[role red 877ns]][[role grey -]]]
|
||||
[[tgamma[br](400/400 tests selected)][[role red 337ns]][[role green 94ns]][[role blue 154ns]][[role green 90ns]][[role blue 157ns]]]
|
||||
[[trigamma[br](659/659 tests selected)][[role blue 35ns]][[role green 21ns]][[role grey -]][[role red 844ns]][[role grey -]]]
|
||||
[[zeta[br](448/448 tests selected)][[role red 495ns]][[role green 186ns]][[role red 144658ns]][[role blue 283ns]][[role grey -]]]
|
||||
]
|
||||
]
|
||||
|
||||
@@ -97,35 +68,19 @@
|
||||
[endsect]
|
||||
]
|
||||
|
||||
|
||||
[template section_Library_Comparison_with_GNU_C_version_5_1_0_on_linux[]
|
||||
[section:section_Library_Comparison_with_GNU_C_version_5_1_0_on_linux Library Comparison with GNU C++ version 5.1.0 on linux]
|
||||
[table_Library_Comparison_with_GNU_C_version_5_1_0_on_linux]
|
||||
[endsect]
|
||||
]
|
||||
|
||||
[template section_Compiler_Option_Comparison_on_Win32[]
|
||||
[section:section_Compiler_Option_Comparison_on_Win32 Compiler Option Comparison on Win32]
|
||||
[table_Compiler_Option_Comparison_on_Win32]
|
||||
[endsect]
|
||||
]
|
||||
|
||||
|
||||
[template section_Library_Comparison_with_GNU_C_version_4_9_2_on_Win32[]
|
||||
[section:section_Library_Comparison_with_GNU_C_version_4_9_2_on_Win32 Library Comparison with GNU C++ version 4.9.2 on Win32]
|
||||
[table_Library_Comparison_with_GNU_C_version_4_9_2_on_Win32]
|
||||
[endsect]
|
||||
]
|
||||
|
||||
[template all_sections[]
|
||||
[section_Compiler_Option_Comparison_on_Win32]
|
||||
[section_Compiler_Option_Comparison_on_linux]
|
||||
[section_Library_Comparison_with_GNU_C_version_4_9_2_on_Win32]
|
||||
[section_Library_Comparison_with_GNU_C_version_5_1_0_on_linux]
|
||||
]
|
||||
|
||||
[template all_tables[]
|
||||
[table_Compiler_Option_Comparison_on_Win32]
|
||||
[table_Compiler_Option_Comparison_on_linux]
|
||||
[table_Library_Comparison_with_GNU_C_version_4_9_2_on_Win32]
|
||||
[table_Library_Comparison_with_GNU_C_version_5_1_0_on_linux]
|
||||
]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -282,6 +282,7 @@ void add_cell(boost::intmax_t val, const std::string& table_name, const std::str
|
||||
}
|
||||
//
|
||||
// Convert back to a string and insert into content:
|
||||
std::sort(table_data.begin(), table_data.end(), [](std::vector<std::string> const& a, std::vector<std::string> const& b) { return a[0] < b[0]; } );
|
||||
std::string c = save_table(table_data);
|
||||
content.replace(table_location.position(1), table_location.length(1), c);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,28 @@
|
||||
#include <gsl/gsl_sf.h>
|
||||
#include <gsl/gsl_errno.h>
|
||||
#include <gsl/gsl_version.h>
|
||||
|
||||
void gsl_handler(const char * reason, const char * file, int line, int gsl_errno)
|
||||
{
|
||||
if(gsl_errno == GSL_ERANGE) return; // handle zero or infinity in our test code.
|
||||
throw std::domain_error(reason);
|
||||
}
|
||||
|
||||
struct gsl_error_handler_setter
|
||||
{
|
||||
gsl_error_handler_t * old_handler;
|
||||
gsl_error_handler_setter()
|
||||
{
|
||||
old_handler = gsl_set_error_handler(gsl_handler);
|
||||
}
|
||||
~gsl_error_handler_setter()
|
||||
{
|
||||
gsl_set_error_handler(old_handler);
|
||||
}
|
||||
};
|
||||
|
||||
static const gsl_error_handler_setter handler;
|
||||
|
||||
#endif
|
||||
|
||||
extern std::vector<std::vector<double> > data;
|
||||
|
||||
@@ -32,6 +32,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::assoc_laguerre(v[0], v[1], v[2]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_laguerre_n(v[0], v[1], v[2]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "assoc_laguerre[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -59,6 +62,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_laguerre_n(v[0], v[1], v[2]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -32,6 +32,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::assoc_legendre(v[0], v[1], v[2]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_legendre_Plm(v[0], v[1], v[2]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "assoc_legendre[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -59,7 +62,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_legendre_Plm(v[0], v[1], v[2]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::beta(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_beta(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "beta[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -63,7 +66,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_beta(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
74
reporting/performance/test_beta_inc.cpp
Normal file
74
reporting/performance/test_beta_inc.cpp
Normal file
@@ -0,0 +1,74 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/beta.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
# include "ibeta_small_data.ipp"
|
||||
# include "ibeta_data.ipp"
|
||||
# include "ibeta_large_data.ipp"
|
||||
# include "ibeta_int_data.ipp"
|
||||
|
||||
add_data(ibeta_small_data);
|
||||
add_data(ibeta_data);
|
||||
add_data(ibeta_large_data);
|
||||
add_data(ibeta_int_data);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
std::cout << "Screening boost data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::ibeta(v[0], v[1], v[2]); }, [](const std::vector<double>& v){ return v[5]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening gsl data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_beta_inc(v[0], v[1], v[2]); }, [](const std::vector<double>& v){ return v[5]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "beta (incomplete)[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::beta(v[0], v[1], v[2]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::beta(v[0], v[1], v[2], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_beta_inc(v[0], v[1], v[2]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
128
reporting/performance/test_cn.cpp
Normal file
128
reporting/performance/test_cn.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/jacobi_elliptic.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
static const boost::array<boost::array<T, 5>, 36> data1 = {{
|
||||
{{ SC_(0.0), SC_(0.0), SC_(0.0), SC_(1.0), SC_(1.0) }},
|
||||
{{ ldexp(T(1), -25), ldexp(T(1), -25), SC_(2.98023223876953080883700663838486782870427050521881839342311e-8), SC_(0.99999999999999955591079014993741669975171697261290223678373), SC_(0.99999999999999999999999999999960556954738949421406900774443) }},
|
||||
{{ -ldexp(T(1), -25), ldexp(T(1), -25), SC_(-2.98023223876953080883700663838486782870427050521881839342311e-8), SC_(0.99999999999999955591079014993741669975171697261290223678373), SC_(0.99999999999999999999999999999960556954738949421406900774443) }},
|
||||
{{ SC_(0.25), ldexp(T(1), -25), SC_(0.247403959254522927383635623557663763268693729825996390997241), SC_(0.968912421710644784709721529742747886950140086772629513814665), SC_(0.99999999999999997281786831901333837240938011109848356555885) }},
|
||||
{{ SC_(-0.25), ldexp(T(1), -25), SC_(-0.247403959254522927383635623557663763268693729825996390997241), SC_(0.968912421710644784709721529742747886950140086772629513814665), SC_(0.99999999999999997281786831901333837240938011109848356555885) }},
|
||||
{{ SC_(1.25), ldexp(T(1), -25), SC_(0.948984619355586147780156037971989352776684194861616269831136), SC_(0.315322362395268865789580233344649598639316847638615703458263), SC_(0.99999999999999960006577747263860127231780811081154547949983) }},
|
||||
{{ SC_(-1.25), ldexp(T(1), -25), SC_(-0.948984619355586147780156037971989352776684194861616269831136), SC_(0.315322362395268865789580233344649598639316847638615703458263), SC_(0.99999999999999960006577747263860127231780811081154547949983) }},
|
||||
{{ SC_(25.0), ldexp(T(1), -25), SC_(-0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }},
|
||||
{{ SC_(-25.0), ldexp(T(1), -25), SC_(0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }},
|
||||
{{ ldexp(T(1), -25), SC_(0.5), SC_(2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }},
|
||||
{{ -ldexp(T(1), -25), SC_(0.5), SC_(-2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }},
|
||||
{{ SC_(0.25), SC_(0.5), SC_(0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }},
|
||||
{{ SC_(-0.25), SC_(0.5), SC_(-0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }},
|
||||
{{ SC_(1.25), SC_(0.5), SC_(0.928561236426319775700204388269999130782711902203415239399579), SC_(0.371179242693370810357222594552131893184749696381729988511999), SC_(0.885688154799196841458565445994481097477880319663264816077719) }},
|
||||
{{ SC_(-1.25), SC_(0.5), SC_(-0.928561236426319775700204388269999130782711902203415239399579), SC_(0.371179242693370810357222594552131893184749696381729988511999), SC_(0.885688154799196841458565445994481097477880319663264816077719) }},
|
||||
{{ SC_(25.0), SC_(0.5), SC_(-0.969223071486651608400225080456020493867827336842041561445359), SC_(-0.246184154035106463351874891855925292474628176040625311168501), SC_(0.874729477852721764836147376110255133761608728373832418508248) }},
|
||||
{{ SC_(-25.0), SC_(0.5), SC_(0.969223071486651608400225080456020493867827336842041561445359), SC_(-0.246184154035106463351874891855925292474628176040625311168501), SC_(0.874729477852721764836147376110255133761608728373832418508248) }},
|
||||
{{ ldexp(T(1), -25), 1 - ldexp(T(1), -9), SC_(2.98023223876953036939562331632512854347569015560128614888589e-8), SC_(0.99999999999999955591079014993754766348947956082687878223721), SC_(0.99999999999999955764381956001984590118394542979655101564079) }},
|
||||
{{ -ldexp(T(1), -25), 1 - ldexp(T(1), -9), SC_(-2.98023223876953036939562331632512854347569015560128614888589e-8), SC_(0.99999999999999955591079014993754766348947956082687878223721), SC_(0.99999999999999955764381956001984590118394542979655101564079) }},
|
||||
{{ SC_(0.25), 1 - ldexp(T(1), -9), SC_(0.244928335616519632082236089277654937383208524525331032303082), SC_(0.969541185516180906431546524888118346090913555188425579774305), SC_(0.969661908643964623248878987955178702010392829596222190545649) }},
|
||||
{{ SC_(-0.25), 1 - ldexp(T(1), -9), SC_(-0.244928335616519632082236089277654937383208524525331032303082), SC_(0.969541185516180906431546524888118346090913555188425579774305), SC_(0.969661908643964623248878987955178702010392829596222190545649) }},
|
||||
{{ SC_(1.25), 1 - ldexp(T(1), -9), SC_(0.848768940045053312079390719205939167551169094157365783446523), SC_(0.528763923140371497228677918580246099580380684604621321430057), SC_(0.531415689278260818860813380561526095359692710060403584603095) }},
|
||||
{{ SC_(-1.25), 1 - ldexp(T(1), -9), SC_(-0.848768940045053312079390719205939167551169094157365783446523), SC_(0.528763923140371497228677918580246099580380684604621321430057), SC_(0.531415689278260818860813380561526095359692710060403584603095) }},
|
||||
{{ SC_(25.0), 1 - ldexp(T(1), -9), SC_(-0.0252326124525503880903568715488227138184083895871544015366337), SC_(-0.999681606947341709011836635135181960590782564534371631099332), SC_(0.999682849652724146508471774051629114156076052044812654903417) }},
|
||||
{{ SC_(-25.0), 1 - ldexp(T(1), -9), SC_(0.0252326124525503880903568715488227138184083895871544015366337), SC_(-0.999681606947341709011836635135181960590782564534371631099332), SC_(0.999682849652724146508471774051629114156076052044812654903417) }},
|
||||
|
||||
// Try modulus > 1
|
||||
{{ ldexp(T(1), -25), SC_(1.5), SC_(2.98023223876952981622027157475276613133414644789222481971590e-8), SC_(0.999999999999999555910790149937712522591174851747994454928040), SC_(0.999999999999999000799277837359575841918151654603571877092161) }},
|
||||
{{ -ldexp(T(1), -25), SC_(1.5), SC_(-2.98023223876952981622027157475276613133414644789222481971590e-8), SC_(0.999999999999999555910790149937712522591174851747994454928040), SC_(0.999999999999999000799277837359575841918151654603571877092161) }},
|
||||
{{ SC_(0.25), SC_(1.5), SC_(0.241830488135945315134822478837394038661484435596992059686086), SC_(0.970318512143270619246031961334217540099946232418710982266812), SC_(0.931888155181641649031244632258710371461078255228024421800363) }},
|
||||
{{ SC_(-0.25), SC_(1.5), SC_(-0.241830488135945315134822478837394038661484435596992059686086), SC_(0.970318512143270619246031961334217540099946232418710982266812), SC_(0.931888155181641649031244632258710371461078255228024421800363) }},
|
||||
{{ SC_(1.25), SC_(1.5), SC_(0.665875890711922169121186264316618499018039094009893317545462), SC_(0.746062529663971452521312655373498959968622875614588791642250), SC_(-0.0486921028438866868299166778939466685768843580182675008164949) }},
|
||||
{{ SC_(-1.25), SC_(1.5), SC_(-0.665875890711922169121186264316618499018039094009893317545462), SC_(0.746062529663971452521312655373498959968622875614588791642250), SC_(-0.0486921028438866868299166778939466685768843580182675008164949) }},
|
||||
{{ SC_(25.0), SC_(1.5), SC_(0.618665338981368217712277210270169521641154921220796362724248), SC_(0.785654630447163313102421517325310755764805805534154371583941), SC_(0.372585153048138377269609818284480926623056458773704266654150) }},
|
||||
{{ SC_(-25.0), SC_(1.5), SC_(-0.618665338981368217712277210270169521641154921220796362724248), SC_(0.785654630447163313102421517325310755764805805534154371583941), SC_(0.372585153048138377269609818284480926623056458773704266654150) }},
|
||||
|
||||
// Special Values:
|
||||
{{ SC_(0.0), SC_(0.5), SC_(0.0), SC_(1.0), SC_(1.0) }},
|
||||
{{ SC_(5.0), SC_(0.0), SC_(-0.958924274663138468893154406155993973352461543964601778131672), SC_(0.283662185463226264466639171513557308334422592252215944930359), SC_(1.0) }},
|
||||
{{ SC_(5.0), SC_(1.0), SC_(0.999909204262595131210990447534473021089812615990547862736429), SC_(0.0134752822213045573055191382448821552908373539417006868332819), SC_(0.0134752822213045573055191382448821552908373539417006868332819) }},
|
||||
}};
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
#include "jacobi_elliptic.ipp"
|
||||
#include "jacobi_elliptic_small.ipp"
|
||||
#include "jacobi_near_1.ipp"
|
||||
#include "jacobi_large_phi.ipp"
|
||||
|
||||
add_data(data1);
|
||||
add_data(jacobi_elliptic);
|
||||
add_data(jacobi_elliptic_small);
|
||||
add_data(jacobi_near_1);
|
||||
add_data(jacobi_large_phi);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
|
||||
std::cout << "Screening Boost data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::jacobi_cn(v[1], v[0]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening GSL data:\n";
|
||||
screen_data([](const std::vector<double>& v)
|
||||
{
|
||||
double s, c, d;
|
||||
gsl_sf_elljac_e(v[0], v[1] * v[1], &s, &c, &d);
|
||||
return c;
|
||||
}, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "jacobi_cn[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::jacobi_cn(v[1], v[2]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::jacobi_cn(v[1], v[0], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v)
|
||||
{
|
||||
double s, c, d;
|
||||
gsl_sf_elljac_e(v[0], v[1] * v[1], &s, &c, &d);
|
||||
return c;
|
||||
});
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
128
reporting/performance/test_dn.cpp
Normal file
128
reporting/performance/test_dn.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/jacobi_elliptic.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
static const boost::array<boost::array<T, 5>, 36> data1 = {{
|
||||
{{ SC_(0.0), SC_(0.0), SC_(0.0), SC_(1.0), SC_(1.0) }},
|
||||
{{ ldexp(T(1), -25), ldexp(T(1), -25), SC_(2.98023223876953080883700663838486782870427050521881839342311e-8), SC_(0.99999999999999955591079014993741669975171697261290223678373), SC_(0.99999999999999999999999999999960556954738949421406900774443) }},
|
||||
{{ -ldexp(T(1), -25), ldexp(T(1), -25), SC_(-2.98023223876953080883700663838486782870427050521881839342311e-8), SC_(0.99999999999999955591079014993741669975171697261290223678373), SC_(0.99999999999999999999999999999960556954738949421406900774443) }},
|
||||
{{ SC_(0.25), ldexp(T(1), -25), SC_(0.247403959254522927383635623557663763268693729825996390997241), SC_(0.968912421710644784709721529742747886950140086772629513814665), SC_(0.99999999999999997281786831901333837240938011109848356555885) }},
|
||||
{{ SC_(-0.25), ldexp(T(1), -25), SC_(-0.247403959254522927383635623557663763268693729825996390997241), SC_(0.968912421710644784709721529742747886950140086772629513814665), SC_(0.99999999999999997281786831901333837240938011109848356555885) }},
|
||||
{{ SC_(1.25), ldexp(T(1), -25), SC_(0.948984619355586147780156037971989352776684194861616269831136), SC_(0.315322362395268865789580233344649598639316847638615703458263), SC_(0.99999999999999960006577747263860127231780811081154547949983) }},
|
||||
{{ SC_(-1.25), ldexp(T(1), -25), SC_(-0.948984619355586147780156037971989352776684194861616269831136), SC_(0.315322362395268865789580233344649598639316847638615703458263), SC_(0.99999999999999960006577747263860127231780811081154547949983) }},
|
||||
{{ SC_(25.0), ldexp(T(1), -25), SC_(-0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }},
|
||||
{{ SC_(-25.0), ldexp(T(1), -25), SC_(0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }},
|
||||
{{ ldexp(T(1), -25), SC_(0.5), SC_(2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }},
|
||||
{{ -ldexp(T(1), -25), SC_(0.5), SC_(-2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }},
|
||||
{{ SC_(0.25), SC_(0.5), SC_(0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }},
|
||||
{{ SC_(-0.25), SC_(0.5), SC_(-0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }},
|
||||
{{ SC_(1.25), SC_(0.5), SC_(0.928561236426319775700204388269999130782711902203415239399579), SC_(0.371179242693370810357222594552131893184749696381729988511999), SC_(0.885688154799196841458565445994481097477880319663264816077719) }},
|
||||
{{ SC_(-1.25), SC_(0.5), SC_(-0.928561236426319775700204388269999130782711902203415239399579), SC_(0.371179242693370810357222594552131893184749696381729988511999), SC_(0.885688154799196841458565445994481097477880319663264816077719) }},
|
||||
{{ SC_(25.0), SC_(0.5), SC_(-0.969223071486651608400225080456020493867827336842041561445359), SC_(-0.246184154035106463351874891855925292474628176040625311168501), SC_(0.874729477852721764836147376110255133761608728373832418508248) }},
|
||||
{{ SC_(-25.0), SC_(0.5), SC_(0.969223071486651608400225080456020493867827336842041561445359), SC_(-0.246184154035106463351874891855925292474628176040625311168501), SC_(0.874729477852721764836147376110255133761608728373832418508248) }},
|
||||
{{ ldexp(T(1), -25), 1 - ldexp(T(1), -9), SC_(2.98023223876953036939562331632512854347569015560128614888589e-8), SC_(0.99999999999999955591079014993754766348947956082687878223721), SC_(0.99999999999999955764381956001984590118394542979655101564079) }},
|
||||
{{ -ldexp(T(1), -25), 1 - ldexp(T(1), -9), SC_(-2.98023223876953036939562331632512854347569015560128614888589e-8), SC_(0.99999999999999955591079014993754766348947956082687878223721), SC_(0.99999999999999955764381956001984590118394542979655101564079) }},
|
||||
{{ SC_(0.25), 1 - ldexp(T(1), -9), SC_(0.244928335616519632082236089277654937383208524525331032303082), SC_(0.969541185516180906431546524888118346090913555188425579774305), SC_(0.969661908643964623248878987955178702010392829596222190545649) }},
|
||||
{{ SC_(-0.25), 1 - ldexp(T(1), -9), SC_(-0.244928335616519632082236089277654937383208524525331032303082), SC_(0.969541185516180906431546524888118346090913555188425579774305), SC_(0.969661908643964623248878987955178702010392829596222190545649) }},
|
||||
{{ SC_(1.25), 1 - ldexp(T(1), -9), SC_(0.848768940045053312079390719205939167551169094157365783446523), SC_(0.528763923140371497228677918580246099580380684604621321430057), SC_(0.531415689278260818860813380561526095359692710060403584603095) }},
|
||||
{{ SC_(-1.25), 1 - ldexp(T(1), -9), SC_(-0.848768940045053312079390719205939167551169094157365783446523), SC_(0.528763923140371497228677918580246099580380684604621321430057), SC_(0.531415689278260818860813380561526095359692710060403584603095) }},
|
||||
{{ SC_(25.0), 1 - ldexp(T(1), -9), SC_(-0.0252326124525503880903568715488227138184083895871544015366337), SC_(-0.999681606947341709011836635135181960590782564534371631099332), SC_(0.999682849652724146508471774051629114156076052044812654903417) }},
|
||||
{{ SC_(-25.0), 1 - ldexp(T(1), -9), SC_(0.0252326124525503880903568715488227138184083895871544015366337), SC_(-0.999681606947341709011836635135181960590782564534371631099332), SC_(0.999682849652724146508471774051629114156076052044812654903417) }},
|
||||
|
||||
// Try modulus > 1
|
||||
{{ ldexp(T(1), -25), SC_(1.5), SC_(2.98023223876952981622027157475276613133414644789222481971590e-8), SC_(0.999999999999999555910790149937712522591174851747994454928040), SC_(0.999999999999999000799277837359575841918151654603571877092161) }},
|
||||
{{ -ldexp(T(1), -25), SC_(1.5), SC_(-2.98023223876952981622027157475276613133414644789222481971590e-8), SC_(0.999999999999999555910790149937712522591174851747994454928040), SC_(0.999999999999999000799277837359575841918151654603571877092161) }},
|
||||
{{ SC_(0.25), SC_(1.5), SC_(0.241830488135945315134822478837394038661484435596992059686086), SC_(0.970318512143270619246031961334217540099946232418710982266812), SC_(0.931888155181641649031244632258710371461078255228024421800363) }},
|
||||
{{ SC_(-0.25), SC_(1.5), SC_(-0.241830488135945315134822478837394038661484435596992059686086), SC_(0.970318512143270619246031961334217540099946232418710982266812), SC_(0.931888155181641649031244632258710371461078255228024421800363) }},
|
||||
{{ SC_(1.25), SC_(1.5), SC_(0.665875890711922169121186264316618499018039094009893317545462), SC_(0.746062529663971452521312655373498959968622875614588791642250), SC_(-0.0486921028438866868299166778939466685768843580182675008164949) }},
|
||||
{{ SC_(-1.25), SC_(1.5), SC_(-0.665875890711922169121186264316618499018039094009893317545462), SC_(0.746062529663971452521312655373498959968622875614588791642250), SC_(-0.0486921028438866868299166778939466685768843580182675008164949) }},
|
||||
{{ SC_(25.0), SC_(1.5), SC_(0.618665338981368217712277210270169521641154921220796362724248), SC_(0.785654630447163313102421517325310755764805805534154371583941), SC_(0.372585153048138377269609818284480926623056458773704266654150) }},
|
||||
{{ SC_(-25.0), SC_(1.5), SC_(-0.618665338981368217712277210270169521641154921220796362724248), SC_(0.785654630447163313102421517325310755764805805534154371583941), SC_(0.372585153048138377269609818284480926623056458773704266654150) }},
|
||||
|
||||
// Special Values:
|
||||
{{ SC_(0.0), SC_(0.5), SC_(0.0), SC_(1.0), SC_(1.0) }},
|
||||
{{ SC_(5.0), SC_(0.0), SC_(-0.958924274663138468893154406155993973352461543964601778131672), SC_(0.283662185463226264466639171513557308334422592252215944930359), SC_(1.0) }},
|
||||
{{ SC_(5.0), SC_(1.0), SC_(0.999909204262595131210990447534473021089812615990547862736429), SC_(0.0134752822213045573055191382448821552908373539417006868332819), SC_(0.0134752822213045573055191382448821552908373539417006868332819) }},
|
||||
}};
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
#include "jacobi_elliptic.ipp"
|
||||
#include "jacobi_elliptic_small.ipp"
|
||||
#include "jacobi_near_1.ipp"
|
||||
#include "jacobi_large_phi.ipp"
|
||||
|
||||
add_data(data1);
|
||||
add_data(jacobi_elliptic);
|
||||
add_data(jacobi_elliptic_small);
|
||||
add_data(jacobi_near_1);
|
||||
add_data(jacobi_large_phi);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
|
||||
std::cout << "Screening Boost data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::jacobi_dn(v[1], v[0]); }, [](const std::vector<double>& v){ return v[4]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening GSL data:\n";
|
||||
screen_data([](const std::vector<double>& v)
|
||||
{
|
||||
double s, c, d;
|
||||
gsl_sf_elljac_e(v[0], v[1] * v[1], &s, &c, &d);
|
||||
return d;
|
||||
}, [](const std::vector<double>& v){ return v[4]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "jacobi_dn[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::jacobi_dn(v[1], v[2]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::jacobi_dn(v[1], v[0], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v)
|
||||
{
|
||||
double s, c, d;
|
||||
gsl_sf_elljac_e(v[0], v[1] * v[1], &s, &c, &d);
|
||||
return d;
|
||||
});
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -54,6 +54,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::ellint_1(v[1], v[0]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_ellint_F(v[0], v[1], GSL_PREC_DOUBLE); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ellint_1[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -81,7 +84,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_ellint_F(v[0], v[1], GSL_PREC_DOUBLE); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -44,6 +44,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::comp_ellint_1(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_ellint_Kcomp(v[0], GSL_PREC_DOUBLE); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ellint_1 (complete)[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -71,7 +74,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_ellint_Kcomp(v[0], GSL_PREC_DOUBLE); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::ellint_2(v[1], v[0]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_ellint_E(v[0], v[1], GSL_PREC_DOUBLE); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ellint_2[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -72,7 +75,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_ellint_E(v[0], v[1], GSL_PREC_DOUBLE); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -45,6 +45,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::comp_ellint_2(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_ellint_Ecomp(v[0], GSL_PREC_DOUBLE); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ellint_2 (complete)[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -72,7 +75,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_ellint_Ecomp(v[0], GSL_PREC_DOUBLE); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -113,6 +113,10 @@ int main()
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1 ::ellint_3(v[2], -v[0], v[1]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_ellint_P(v[1], v[2], -v[0], GSL_PREC_DOUBLE); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ellint_3[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -140,7 +144,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_ellint_P(v[1], v[2], -v[0], GSL_PREC_DOUBLE); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::comp_ellint_3(v[1], -v[0]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_ellint_Pcomp(v[1], -v[0], GSL_PREC_DOUBLE); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ellint_3 (complete)[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -59,7 +62,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_ellint_Pcomp(v[1], -v[0], GSL_PREC_DOUBLE); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
65
reporting/performance/test_ellint_rc.cpp
Normal file
65
reporting/performance/test_ellint_rc.cpp
Normal file
@@ -0,0 +1,65 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/ellint_rc.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
|
||||
int main()
|
||||
{
|
||||
#include "ellint_rc_data.ipp"
|
||||
|
||||
add_data(ellint_rc_data);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::ellint_rc(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_ellint_RC(v[0], v[1], GSL_PREC_DOUBLE); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ellint_rc[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::ellint_rc(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::ellint_rc(v[0], v[1], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_ellint_RC(v[0], v[1], GSL_PREC_DOUBLE); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
75
reporting/performance/test_ellint_rd.cpp
Normal file
75
reporting/performance/test_ellint_rd.cpp
Normal file
@@ -0,0 +1,75 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/ellint_rd.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
|
||||
int main()
|
||||
{
|
||||
#include "ellint_rd_data.ipp"
|
||||
#include "ellint_rd_xyy.ipp"
|
||||
#include "ellint_rd_xxz.ipp"
|
||||
#include "ellint_rd_0yy.ipp"
|
||||
#include "ellint_rd_xxx.ipp"
|
||||
#include "ellint_rd_0xy.ipp"
|
||||
|
||||
add_data(ellint_rd_data);
|
||||
add_data(ellint_rd_xyy);
|
||||
add_data(ellint_rd_xxz);
|
||||
add_data(ellint_rd_0yy);
|
||||
add_data(ellint_rd_xxx);
|
||||
add_data(ellint_rd_0xy);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::ellint_rd(v[0], v[1], v[2]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_ellint_RD(v[0], v[1], v[2], GSL_PREC_DOUBLE); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ellint_rd[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::ellint_rd(v[0], v[1], v[2]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::ellint_rd(v[0], v[1], v[2], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_ellint_RD(v[0], v[1], v[2], GSL_PREC_DOUBLE); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
73
reporting/performance/test_ellint_rf.cpp
Normal file
73
reporting/performance/test_ellint_rf.cpp
Normal file
@@ -0,0 +1,73 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/ellint_rf.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
|
||||
int main()
|
||||
{
|
||||
#include "ellint_rf_data.ipp"
|
||||
#include "ellint_rf_xxx.ipp"
|
||||
#include "ellint_rf_xyy.ipp"
|
||||
#include "ellint_rf_0yy.ipp"
|
||||
#include "ellint_rf_xy0.ipp"
|
||||
|
||||
add_data(ellint_rf_data);
|
||||
add_data(ellint_rf_xxx);
|
||||
add_data(ellint_rf_xyy);
|
||||
add_data(ellint_rf_0yy);
|
||||
add_data(ellint_rf_xy0);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::ellint_rf(v[0], v[1], v[2]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_ellint_RF(v[0], v[1], v[2], GSL_PREC_DOUBLE); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ellint_rf[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::ellint_rf(v[0], v[1], v[2]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::ellint_rf(v[0], v[1], v[2], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_ellint_RF(v[0], v[1], v[2], GSL_PREC_DOUBLE); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
73
reporting/performance/test_ellint_rj.cpp
Normal file
73
reporting/performance/test_ellint_rj.cpp
Normal file
@@ -0,0 +1,73 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/ellint_rj.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
|
||||
int main()
|
||||
{
|
||||
#include "ellint_rj_data.ipp"
|
||||
#include "ellint_rj_e4.ipp"
|
||||
#include "ellint_rj_e3.ipp"
|
||||
#include "ellint_rj_e2.ipp"
|
||||
#include "ellint_rj_zp.ipp"
|
||||
|
||||
add_data(ellint_rj_data);
|
||||
add_data(ellint_rj_e4);
|
||||
add_data(ellint_rj_e3);
|
||||
add_data(ellint_rj_e2);
|
||||
add_data(ellint_rj_zp);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::ellint_rj(v[0], v[1], v[2], v[3]); }, [](const std::vector<double>& v){ return v[4]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_ellint_RJ(v[0], v[1], v[2], v[3], GSL_PREC_DOUBLE); }, [](const std::vector<double>& v){ return v[4]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ellint_rj[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::ellint_rj(v[0], v[1], v[2], v[3]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::ellint_rj(v[0], v[1], v[2], v[3], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_ellint_RJ(v[0], v[1], v[2], v[3], GSL_PREC_DOUBLE); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::erfc(v[0]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_erfc(v[0]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "erfc[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -69,6 +72,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_erfc(v[0]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -34,6 +34,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::expint(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_expint_Ei(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "expint[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -61,7 +64,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_expint_Ei(v[0]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
69
reporting/performance/test_expint_n.cpp
Normal file
69
reporting/performance/test_expint_n.cpp
Normal file
@@ -0,0 +1,69 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/expint.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
|
||||
int main()
|
||||
{
|
||||
#include "expint_data.ipp"
|
||||
#include "expint_small_data.ipp"
|
||||
#include "expint_1_data.ipp"
|
||||
|
||||
add_data(expint_data);
|
||||
add_data(expint_small_data);
|
||||
add_data(expint_1_data);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::expint(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_expint_En(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "expint (En)[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::expint(static_cast<int>(v[0]), v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::expint(static_cast<int>(v[0]), v[1], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_expint_En(static_cast<int>(v[0]), v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
71
reporting/performance/test_gamma_p.cpp
Normal file
71
reporting/performance/test_gamma_p.cpp
Normal file
@@ -0,0 +1,71 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/gamma.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
|
||||
int main()
|
||||
{
|
||||
# include "igamma_med_data.ipp"
|
||||
# include "igamma_small_data.ipp"
|
||||
# include "igamma_big_data.ipp"
|
||||
# include "igamma_int_data.ipp"
|
||||
|
||||
add_data(igamma_med_data);
|
||||
add_data(igamma_small_data);
|
||||
add_data(igamma_big_data);
|
||||
add_data(igamma_int_data);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::gamma_p(v[0], v[1]); }, [](const std::vector<double>& v){ return v[5]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_gamma_inc_P(v[0], v[1]); }, [](const std::vector<double>& v){ return v[5]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "gamma_p[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::gamma_p(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::gamma_p(v[0], v[1], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_gamma_inc_P(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
74
reporting/performance/test_gamma_q.cpp
Normal file
74
reporting/performance/test_gamma_q.cpp
Normal file
@@ -0,0 +1,74 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/gamma.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
|
||||
int main()
|
||||
{
|
||||
# include "igamma_med_data.ipp"
|
||||
# include "igamma_small_data.ipp"
|
||||
# include "igamma_big_data.ipp"
|
||||
# include "igamma_int_data.ipp"
|
||||
|
||||
add_data(igamma_med_data);
|
||||
add_data(igamma_small_data);
|
||||
add_data(igamma_big_data);
|
||||
add_data(igamma_int_data);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
|
||||
std::cout << "Screening Boost data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::gamma_q(v[0], v[1]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening GSL data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_gamma_inc_Q(v[0], v[1]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "gamma_q[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::gamma_q(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::gamma_q(v[0], v[1], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_gamma_inc_Q(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
71
reporting/performance/test_igamma.cpp
Normal file
71
reporting/performance/test_igamma.cpp
Normal file
@@ -0,0 +1,71 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/gamma.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
|
||||
int main()
|
||||
{
|
||||
# include "igamma_med_data.ipp"
|
||||
# include "igamma_small_data.ipp"
|
||||
# include "igamma_big_data.ipp"
|
||||
# include "igamma_int_data.ipp"
|
||||
|
||||
add_data(igamma_med_data);
|
||||
add_data(igamma_small_data);
|
||||
add_data(igamma_big_data);
|
||||
add_data(igamma_int_data);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::tgamma(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_gamma_inc(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "tgamma (incomplete)[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::tgamma(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::tgamma(v[0], v[1], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_gamma_inc(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -71,6 +71,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::cyl_bessel_i(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_bessel_In(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "cyl_bessel_i (integer order)[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -98,6 +101,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_bessel_In(static_cast<int>(v[0]), v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -55,6 +55,10 @@ int main()
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::cyl_bessel_i(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening GSL data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_bessel_Inu(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "cyl_bessel_i[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -82,7 +86,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_bessel_Inu(static_cast<int>(v[0]), v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -102,6 +102,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::cyl_bessel_j(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_bessel_Jn(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "cyl_bessel_j (integer order)[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -134,6 +137,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_bessel_Jn(static_cast<int>(v[0]), v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -31,6 +31,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::sph_bessel(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_bessel_jl(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "sph_bessel[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -58,6 +61,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_bessel_jl(static_cast<int>(v[0]), v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -61,6 +61,10 @@ int main()
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::cyl_bessel_j(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_bessel_Jnu(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "cyl_bessel_j[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -88,7 +92,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_bessel_Jnu(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -67,6 +67,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::cyl_bessel_k(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_bessel_Kn(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "cyl_bessel_k (integer order)[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -94,7 +97,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_bessel_Kn(static_cast<int>(v[0]), v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,10 @@ int main()
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::cyl_bessel_k(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_bessel_Knu(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "cyl_bessel_k[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -83,7 +87,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_bessel_Knu(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::laguerre(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_laguerre_n(v[0], 0, v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "laguerre[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -59,6 +62,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_laguerre_n(v[0], 0, v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -34,6 +34,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::legendre(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_legendre_Pl(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "legendre[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -61,7 +64,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_legendre_Pl(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
67
reporting/performance/test_legendre_q.cpp
Normal file
67
reporting/performance/test_legendre_q.cpp
Normal file
@@ -0,0 +1,67 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/legendre.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
|
||||
int main()
|
||||
{
|
||||
# include "legendre_p.ipp"
|
||||
# include "legendre_p_large.ipp"
|
||||
|
||||
add_data(legendre_p);
|
||||
add_data(legendre_p_large);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::legendre_q(v[0], v[1]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_legendre_Ql(v[0], v[1]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "legendre Q[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::legendre_q(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::legendre_q(v[0], v[1], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_legendre_Ql(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -36,9 +36,12 @@ int main()
|
||||
#if defined(TEST_C99) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return ::lgamma(v[0]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_C99) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::lgamma(v[0]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_lngamma(v[0]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "lgamma[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -64,11 +67,16 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "math.h");
|
||||
#endif
|
||||
#if defined(TEST_C99) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return std::tr1::lgamma(v[0]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_lngamma(v[0]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
206
reporting/performance/test_polygamma.cpp
Normal file
206
reporting/performance/test_polygamma.cpp
Normal file
File diff suppressed because one or more lines are too long
128
reporting/performance/test_sn.cpp
Normal file
128
reporting/performance/test_sn.cpp
Normal file
@@ -0,0 +1,128 @@
|
||||
// Copyright John Maddock 2015.
|
||||
// Use, modification and distribution are subject to the
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning (disable : 4224)
|
||||
#endif
|
||||
|
||||
#include <boost/math/special_functions/jacobi_elliptic.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
static const boost::array<boost::array<T, 5>, 36> data1 = {{
|
||||
{{ SC_(0.0), SC_(0.0), SC_(0.0), SC_(1.0), SC_(1.0) }},
|
||||
{{ ldexp(T(1), -25), ldexp(T(1), -25), SC_(2.98023223876953080883700663838486782870427050521881839342311e-8), SC_(0.99999999999999955591079014993741669975171697261290223678373), SC_(0.99999999999999999999999999999960556954738949421406900774443) }},
|
||||
{{ -ldexp(T(1), -25), ldexp(T(1), -25), SC_(-2.98023223876953080883700663838486782870427050521881839342311e-8), SC_(0.99999999999999955591079014993741669975171697261290223678373), SC_(0.99999999999999999999999999999960556954738949421406900774443) }},
|
||||
{{ SC_(0.25), ldexp(T(1), -25), SC_(0.247403959254522927383635623557663763268693729825996390997241), SC_(0.968912421710644784709721529742747886950140086772629513814665), SC_(0.99999999999999997281786831901333837240938011109848356555885) }},
|
||||
{{ SC_(-0.25), ldexp(T(1), -25), SC_(-0.247403959254522927383635623557663763268693729825996390997241), SC_(0.968912421710644784709721529742747886950140086772629513814665), SC_(0.99999999999999997281786831901333837240938011109848356555885) }},
|
||||
{{ SC_(1.25), ldexp(T(1), -25), SC_(0.948984619355586147780156037971989352776684194861616269831136), SC_(0.315322362395268865789580233344649598639316847638615703458263), SC_(0.99999999999999960006577747263860127231780811081154547949983) }},
|
||||
{{ SC_(-1.25), ldexp(T(1), -25), SC_(-0.948984619355586147780156037971989352776684194861616269831136), SC_(0.315322362395268865789580233344649598639316847638615703458263), SC_(0.99999999999999960006577747263860127231780811081154547949983) }},
|
||||
{{ SC_(25.0), ldexp(T(1), -25), SC_(-0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }},
|
||||
{{ SC_(-25.0), ldexp(T(1), -25), SC_(0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }},
|
||||
{{ ldexp(T(1), -25), SC_(0.5), SC_(2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }},
|
||||
{{ -ldexp(T(1), -25), SC_(0.5), SC_(-2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }},
|
||||
{{ SC_(0.25), SC_(0.5), SC_(0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }},
|
||||
{{ SC_(-0.25), SC_(0.5), SC_(-0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }},
|
||||
{{ SC_(1.25), SC_(0.5), SC_(0.928561236426319775700204388269999130782711902203415239399579), SC_(0.371179242693370810357222594552131893184749696381729988511999), SC_(0.885688154799196841458565445994481097477880319663264816077719) }},
|
||||
{{ SC_(-1.25), SC_(0.5), SC_(-0.928561236426319775700204388269999130782711902203415239399579), SC_(0.371179242693370810357222594552131893184749696381729988511999), SC_(0.885688154799196841458565445994481097477880319663264816077719) }},
|
||||
{{ SC_(25.0), SC_(0.5), SC_(-0.969223071486651608400225080456020493867827336842041561445359), SC_(-0.246184154035106463351874891855925292474628176040625311168501), SC_(0.874729477852721764836147376110255133761608728373832418508248) }},
|
||||
{{ SC_(-25.0), SC_(0.5), SC_(0.969223071486651608400225080456020493867827336842041561445359), SC_(-0.246184154035106463351874891855925292474628176040625311168501), SC_(0.874729477852721764836147376110255133761608728373832418508248) }},
|
||||
{{ ldexp(T(1), -25), 1 - ldexp(T(1), -9), SC_(2.98023223876953036939562331632512854347569015560128614888589e-8), SC_(0.99999999999999955591079014993754766348947956082687878223721), SC_(0.99999999999999955764381956001984590118394542979655101564079) }},
|
||||
{{ -ldexp(T(1), -25), 1 - ldexp(T(1), -9), SC_(-2.98023223876953036939562331632512854347569015560128614888589e-8), SC_(0.99999999999999955591079014993754766348947956082687878223721), SC_(0.99999999999999955764381956001984590118394542979655101564079) }},
|
||||
{{ SC_(0.25), 1 - ldexp(T(1), -9), SC_(0.244928335616519632082236089277654937383208524525331032303082), SC_(0.969541185516180906431546524888118346090913555188425579774305), SC_(0.969661908643964623248878987955178702010392829596222190545649) }},
|
||||
{{ SC_(-0.25), 1 - ldexp(T(1), -9), SC_(-0.244928335616519632082236089277654937383208524525331032303082), SC_(0.969541185516180906431546524888118346090913555188425579774305), SC_(0.969661908643964623248878987955178702010392829596222190545649) }},
|
||||
{{ SC_(1.25), 1 - ldexp(T(1), -9), SC_(0.848768940045053312079390719205939167551169094157365783446523), SC_(0.528763923140371497228677918580246099580380684604621321430057), SC_(0.531415689278260818860813380561526095359692710060403584603095) }},
|
||||
{{ SC_(-1.25), 1 - ldexp(T(1), -9), SC_(-0.848768940045053312079390719205939167551169094157365783446523), SC_(0.528763923140371497228677918580246099580380684604621321430057), SC_(0.531415689278260818860813380561526095359692710060403584603095) }},
|
||||
{{ SC_(25.0), 1 - ldexp(T(1), -9), SC_(-0.0252326124525503880903568715488227138184083895871544015366337), SC_(-0.999681606947341709011836635135181960590782564534371631099332), SC_(0.999682849652724146508471774051629114156076052044812654903417) }},
|
||||
{{ SC_(-25.0), 1 - ldexp(T(1), -9), SC_(0.0252326124525503880903568715488227138184083895871544015366337), SC_(-0.999681606947341709011836635135181960590782564534371631099332), SC_(0.999682849652724146508471774051629114156076052044812654903417) }},
|
||||
|
||||
// Try modulus > 1
|
||||
{{ ldexp(T(1), -25), SC_(1.5), SC_(2.98023223876952981622027157475276613133414644789222481971590e-8), SC_(0.999999999999999555910790149937712522591174851747994454928040), SC_(0.999999999999999000799277837359575841918151654603571877092161) }},
|
||||
{{ -ldexp(T(1), -25), SC_(1.5), SC_(-2.98023223876952981622027157475276613133414644789222481971590e-8), SC_(0.999999999999999555910790149937712522591174851747994454928040), SC_(0.999999999999999000799277837359575841918151654603571877092161) }},
|
||||
{{ SC_(0.25), SC_(1.5), SC_(0.241830488135945315134822478837394038661484435596992059686086), SC_(0.970318512143270619246031961334217540099946232418710982266812), SC_(0.931888155181641649031244632258710371461078255228024421800363) }},
|
||||
{{ SC_(-0.25), SC_(1.5), SC_(-0.241830488135945315134822478837394038661484435596992059686086), SC_(0.970318512143270619246031961334217540099946232418710982266812), SC_(0.931888155181641649031244632258710371461078255228024421800363) }},
|
||||
{{ SC_(1.25), SC_(1.5), SC_(0.665875890711922169121186264316618499018039094009893317545462), SC_(0.746062529663971452521312655373498959968622875614588791642250), SC_(-0.0486921028438866868299166778939466685768843580182675008164949) }},
|
||||
{{ SC_(-1.25), SC_(1.5), SC_(-0.665875890711922169121186264316618499018039094009893317545462), SC_(0.746062529663971452521312655373498959968622875614588791642250), SC_(-0.0486921028438866868299166778939466685768843580182675008164949) }},
|
||||
{{ SC_(25.0), SC_(1.5), SC_(0.618665338981368217712277210270169521641154921220796362724248), SC_(0.785654630447163313102421517325310755764805805534154371583941), SC_(0.372585153048138377269609818284480926623056458773704266654150) }},
|
||||
{{ SC_(-25.0), SC_(1.5), SC_(-0.618665338981368217712277210270169521641154921220796362724248), SC_(0.785654630447163313102421517325310755764805805534154371583941), SC_(0.372585153048138377269609818284480926623056458773704266654150) }},
|
||||
|
||||
// Special Values:
|
||||
{{ SC_(0.0), SC_(0.5), SC_(0.0), SC_(1.0), SC_(1.0) }},
|
||||
{{ SC_(5.0), SC_(0.0), SC_(-0.958924274663138468893154406155993973352461543964601778131672), SC_(0.283662185463226264466639171513557308334422592252215944930359), SC_(1.0) }},
|
||||
{{ SC_(5.0), SC_(1.0), SC_(0.999909204262595131210990447534473021089812615990547862736429), SC_(0.0134752822213045573055191382448821552908373539417006868332819), SC_(0.0134752822213045573055191382448821552908373539417006868332819) }},
|
||||
}};
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
#include "jacobi_elliptic.ipp"
|
||||
#include "jacobi_elliptic_small.ipp"
|
||||
#include "jacobi_near_1.ipp"
|
||||
#include "jacobi_large_phi.ipp"
|
||||
|
||||
add_data(data1);
|
||||
add_data(jacobi_elliptic);
|
||||
add_data(jacobi_elliptic_small);
|
||||
add_data(jacobi_near_1);
|
||||
add_data(jacobi_large_phi);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
|
||||
std::cout << "Screening Boost data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::jacobi_sn(v[1], v[0]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening GSL data:\n";
|
||||
screen_data([](const std::vector<double>& v)
|
||||
{
|
||||
double s, c, d;
|
||||
gsl_sf_elljac_e(v[0], v[1] * v[1], &s, &c, &d);
|
||||
return s;
|
||||
}, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "jacobi_sn[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time;
|
||||
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::jacobi_sn(v[1], v[2]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return boost::math::jacobi_sn(v[1], v[0], boost::math::policies::make_policy(boost::math::policies::promote_double<false>())); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "Boost[br](no internal promotion to long double)");
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v)
|
||||
{
|
||||
double s, c, d;
|
||||
gsl_sf_elljac_e(v[0], v[1] * v[1], &s, &c, &d);
|
||||
return s;
|
||||
});
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -39,6 +39,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::tgamma(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_gamma(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "tgamma[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -69,7 +72,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_gamma(v[0]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
69
reporting/performance/test_trigamma.cpp
Normal file
69
reporting/performance/test_trigamma.cpp
Normal file
File diff suppressed because one or more lines are too long
@@ -74,6 +74,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::cyl_neumann(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_bessel_Yn(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "cyl_neumann (integer order)[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -106,7 +109,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_bessel_Yn(static_cast<int>(v[0]), v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::sph_neumann(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_bessel_yl(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "sph_neumann[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -59,7 +62,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_bessel_yl(static_cast<int>(v[0]), v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,10 @@ int main()
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::cyl_neumann(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening GSL data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_bessel_Ynu(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "cyl_neumann[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -87,7 +91,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_bessel_Ynu(v[0], v[1]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,9 @@ int main()
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return std::tr1::riemann_zeta(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_zeta(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "zeta[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -61,7 +64,11 @@ int main()
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "tr1/cmath");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_zeta(v[0]); });
|
||||
std::cout << time << std::endl;
|
||||
report_execution_time(time, std::string("Library Comparison with ") + std::string(BOOST_COMPILER) + std::string(" on ") + BOOST_PLATFORM, function, "gsl");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user