mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
Add Rmath tests
This commit is contained in:
@@ -91,6 +91,7 @@ rule all-tests {
|
||||
[ check-target-builds ../accuracy//has_c99_cmath : <define>TEST_C99 ]
|
||||
[ check-target-builds ../accuracy//has_libstdcxx_tr1 : <define>TEST_LIBSTDCXX ]
|
||||
[ check-target-builds ../accuracy//has_gsl : <define>TEST_GSL <source>gsl <source>gslcblas ]
|
||||
[ check-target-builds ../accuracy//has_rmath : <define>TEST_RMATH <source>Rmath ]
|
||||
<target-os>linux:<linkflags>-lpthread <target-os>linux:<linkflags>-lrt
|
||||
] ;
|
||||
}
|
||||
|
||||
@@ -4,59 +4,66 @@
|
||||
[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 blue 42ns]]]
|
||||
[[boost::math::cbrt][[role blue 70ns]]]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
[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][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 -]]]
|
||||
[[Function][Boost][Boost[br](no internal promotion to long double)][tr1/cmath][gsl][Rmath][math.h]]
|
||||
[[assoc_laguerre[br](2240/2240 tests selected)][[role green 210ns]][[role green 183ns]][[role green 219ns]][[role green 207ns]][[role grey -]][[role grey -]]]
|
||||
[[assoc_legendre[br](205/400 tests selected)][[role red 245ns]][[role blue 98ns]][[role green 60ns]][[role red 151ns]][[role grey -]][[role grey -]]]
|
||||
[[beta (incomplete)[br](2682/3210 tests selected)][[role red 1710ns]][[role green 557ns]][[role grey -]][[role blue 740ns]][[role grey -]][[role grey -]]]
|
||||
[[beta[br](2202/2202 tests selected)][[role red 667ns]][[role green 150ns]][[role green 144ns]][[role red 375ns]][[role blue 242ns]][[role grey -]]]
|
||||
[[cbrt[br](85/85 tests selected)][[role red 41ns]][[role green 16ns]][[role blue 20ns]][[role grey -]][[role grey -]][[role blue 20ns]]]
|
||||
[[cyl_bessel_i (integer order)[br](494/526 tests selected)][[role red 770ns]][[role green 236ns]][[role green 199ns]][[role red 454ns]][[role red 1070ns]][]]
|
||||
[[cyl_bessel_i[br](177/240 tests selected)][[role red 1316ns]][[role blue 374ns]][[role green 195ns]][[role red 897ns]][[role red 1619ns]][[role grey -]]]
|
||||
[[cyl_bessel_j (integer order)[br](250/268 tests selected)][[role red 259ns]][[role green 100ns]][[role red 244ns]][[role red 253ns]][[role red 421ns]][[role blue 194ns]]]
|
||||
[[cyl_bessel_j[br](423/451 tests selected)][[role red 1038ns]][[role green 389ns]][[role green 362ns]][[role red 842ns]][[role blue 441ns]][[role grey -]]]
|
||||
[[cyl_bessel_k (integer order)[br](505/508 tests selected)][[role red 3457ns]][[role blue 348ns]][[role red 2670ns]][[role green 250ns]][[role blue 354ns]][[role grey -]]]
|
||||
[[cyl_bessel_k[br](96/279 tests selected)][[role red 4403ns]][[role green 643ns]][[role green 767ns]][[role blue 842ns]][[role blue 809ns]][[role grey -]]]
|
||||
[[cyl_neumann (integer order)[br](423/428 tests selected)][[role blue 550ns]][[role green 277ns]][[role red 686ns]][[role blue 509ns]][[role red 1036ns]][[role blue 368ns]]]
|
||||
[[cyl_neumann[br](400/450 tests selected)][[role red 1414ns]][[role green 562ns]][[role blue 722ns]][[role red 1371ns]][[role green 607ns]][[role grey -]]]
|
||||
[[digamma[br](1019/1019 tests selected)][[role blue 70ns]][[role green 38ns]][[role grey -]][[role red 102ns]][[role red 161ns]][[role grey -]]]
|
||||
[[ellint_1 (complete)[br](109/109 tests selected)][[role red 50ns]][[role green 24ns]][[role red 236ns]][[role red 281ns]][[role grey -]][]]
|
||||
[[ellint_1[br](627/629 tests selected)][[role blue 348ns]][[role green 175ns]][[role red 405ns]][[role red 464ns]][[role grey -]][[role grey -]]]
|
||||
[[ellint_2 (complete)[br](109/110 tests selected)][[role blue 55ns]][[role green 33ns]][[role red 515ns]][[role red 586ns]][[role grey -]][[role grey -]]]
|
||||
[[ellint_2[br](527/530 tests selected)][[role red 778ns]][[role green 338ns]][[role blue 630ns]][[role red 721ns]][[role grey -]][[role grey -]]]
|
||||
[[ellint_3 (complete)[br](500/500 tests selected)][[role red 1130ns]][[role green 447ns]][[role blue 810ns]][[role red 901ns]][][]]
|
||||
[[ellint_3[br](831/845 tests selected)][[role red 2072ns]][[role green 755ns]][[role blue 1197ns]][[role blue 1289ns]][[role grey -]][[role grey -]]]
|
||||
[[ellint_rc[br](201/201 tests selected)][[role blue 73ns]][[role green 45ns]][[role grey -]][[role red 205ns]][[role grey -]][[role grey -]]]
|
||||
[[ellint_rd[br](7588/7588 tests selected)][[role red 485ns]][[role green 224ns]][[role grey -]][[role blue 367ns]][[role grey -]][[role grey -]]]
|
||||
[[ellint_rf[br](7788/7788 tests selected)][[role blue 89ns]][[role green 61ns]][[role grey -]][[role red 341ns]][[role grey -]][[role grey -]]]
|
||||
[[ellint_rj[br](7642/8032 tests selected)][[role red 457ns]][[role green 197ns]][[role grey -]][[role red 2234ns]][[role grey -]][[role grey -]]]
|
||||
[[erf[br](950/950 tests selected)][[role red 37ns]][[role green 14ns]][[role blue 17ns]][[role red 142ns]][[role grey -]][[role blue 17ns]]]
|
||||
[[erfc[br](950/950 tests selected)][[role red 57ns]][[role green 21ns]][[role green 25ns]][[role red 74ns]][[role grey -]][[role green 25ns]]]
|
||||
[[expint (En)[br](1059/1059 tests selected)][[role blue 247ns]][[role green 139ns]][[role grey -]][[role red 654ns]][[role grey -]][[role grey -]]]
|
||||
[[expint[br](436/436 tests selected)][[role red 88ns]][[role green 36ns]][[role red 196ns]][[role red 140ns]][[role grey -]][[role grey -]]]
|
||||
[[expm1[br](80/80 tests selected)][[role green 9ns]][[role green 10ns]][[role green 9ns]][[role grey -]][[role grey -]][[role green 9ns]]]
|
||||
[[gamma_p[br](1379/1379 tests selected)][[role red 465ns]][[role green 195ns]][[role grey -]][[role red 927ns]][[role blue 326ns]][[role grey -]]]
|
||||
[[gamma_p_inv[br](559/559 tests selected)][[role red 1502ns]][[role green 694ns]][[role grey -]][[role grey -]][[role red 1498ns]][[role grey -]]]
|
||||
[[gamma_q[br](1371/1379 tests selected)][[role red 470ns]][[role green 189ns]][[role grey -]][[role red 1089ns]][[role blue 335ns]][[role grey -]]]
|
||||
[[gamma_q_inv[br](78/559 tests selected)][[role red 1678ns]][[role green 683ns]][[role grey -]][[role grey -]][[role green 774ns]][[role grey -]]]
|
||||
[[ibeta[br](3210/3210 tests selected)][[role red 1634ns]][[role blue 601ns]][[role grey -]][[role grey -]][[role green 480ns]][[role grey -]]]
|
||||
[[ibeta_inv[br](952/1210 tests selected)][[role red 5125ns]][[role green 2097ns]][[role grey -]][[role grey -]][[role red 57638ns]][[role grey -]]]
|
||||
[[ibetac[br](3210/3210 tests selected)][[role red 1634ns]][[role blue 585ns]][[role grey -]][[role grey -]][[role green 478ns]][[role grey -]]]
|
||||
[[ibetac_inv[br](945/1210 tests selected)][[role red 5184ns]][[role green 2116ns]][[role grey -]][[role grey -]][[role red 41755ns]][[role grey -]]]
|
||||
[[jacobi_cn[br](2368/2757 tests selected)][[role red 450ns]][[role blue 165ns]][[role grey -]][[role green 89ns]][[role grey -]][[role grey -]]]
|
||||
[[jacobi_dn[br](2368/2757 tests selected)][[role red 459ns]][[role blue 165ns]][[role grey -]][[role green 89ns]][[role grey -]][[role grey -]]]
|
||||
[[jacobi_sn[br](2368/2757 tests selected)][[role red 460ns]][[role blue 167ns]][[role grey -]][[role green 91ns]][[role grey -]][[role grey -]]]
|
||||
[[laguerre[br](280/280 tests selected)][[role green 136ns]][[role green 122ns]][[role blue 155ns]][[role green 144ns]][[role grey -]][[role grey -]]]
|
||||
[[legendre Q[br](300/300 tests selected)][[role blue 473ns]][[role green 389ns]][[role grey -]][[role green 423ns]][[role grey -]][[role grey -]]]
|
||||
[[legendre[br](300/300 tests selected)][[role green 386ns]][[role green 332ns]][[role green 364ns]][[role red 700ns]][[role grey -]][[role grey -]]]
|
||||
[[lgamma[br](400/400 tests selected)][[role red 237ns]][[role red 109ns]][[role green 45ns]][[role red 257ns]][[role blue 89ns]][[role green 45ns]]]
|
||||
[[log1p[br](80/80 tests selected)][[role green 11ns]][[role green 11ns]][[role green 11ns]][[role grey -]][[role grey -]][[role green 11ns]]]
|
||||
[[polygamma[br](823/1535 tests selected)][[role red 2789ns]][[role red 717ns]][[role grey -]][[role red 2307ns]][[role green 327ns]][[role grey -]]]
|
||||
[[sph_bessel[br](483/483 tests selected)][[role blue 1508ns]][[role green 882ns]][[role red 1885ns]][[role red 2403ns]][[role grey -]][[role grey -]]]
|
||||
[[sph_neumann[br](284/284 tests selected)][[role red 3360ns]][[role red 1576ns]][[role red 2732ns]][[role green 427ns]][[role grey -]][[role grey -]]]
|
||||
[[tgamma (incomplete)[br](1266/1379 tests selected)][[role red 687ns]][[role green 294ns]][[role grey -]][[role red 870ns]][[role grey -]][[role grey -]]]
|
||||
[[tgamma[br](400/400 tests selected)][[role red 334ns]][[role blue 94ns]][[role red 154ns]][[role blue 92ns]][[role green 76ns]][[role red 154ns]]]
|
||||
[[trigamma[br](659/659 tests selected)][[role blue 35ns]][[role green 21ns]][[role grey -]][[role red 836ns]][[role red 247ns]][[role grey -]]]
|
||||
[[zeta[br](448/448 tests selected)][[role red 492ns]][[role green 183ns]][[role red 138038ns]][[role blue 273ns]][[role grey -]][[role grey -]]]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -44,6 +44,13 @@ static const gsl_error_handler_setter handler;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef TEST_RMATH
|
||||
// Rmath overloads ftrunc, leading to strange errors from GCC unless we include this:
|
||||
#include <boost/math/special_functions.hpp>
|
||||
#define MATHLIB_STANDALONE
|
||||
#include <Rmath.h>
|
||||
#endif
|
||||
|
||||
extern std::vector<std::vector<double> > data;
|
||||
|
||||
std::string sanitize_string(const std::string& s);
|
||||
|
||||
@@ -39,6 +39,9 @@ int main()
|
||||
#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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return 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)";
|
||||
@@ -71,6 +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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
93
reporting/performance/test_digamma.cpp
Normal file
93
reporting/performance/test_digamma.cpp
Normal file
@@ -0,0 +1,93 @@
|
||||
// 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/digamma.hpp>
|
||||
#include <boost/array.hpp>
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include "../../test/table_type.hpp"
|
||||
#include "table_helper.hpp"
|
||||
#include "performance.hpp"
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
typedef double T;
|
||||
#define SC_(x) static_cast<double>(x)
|
||||
# include "digamma_data.ipp"
|
||||
# include "digamma_root_data.ipp"
|
||||
# include "digamma_small_data.ipp"
|
||||
# include "digamma_neg_data.ipp"
|
||||
static const boost::array<boost::array<T, 2>, 5> digamma_bugs = {{
|
||||
// Test cases from Rocco Romeo:
|
||||
{{ static_cast<T>(std::ldexp(1.0, -100)), SC_(-1.26765060022822940149670320537657721566490153286060651209008e30) }},
|
||||
{{ static_cast<T>(-std::ldexp(1.0, -100)), SC_(1.26765060022822940149670320537542278433509846713939348790992e30) }},
|
||||
{{ static_cast<T>(1), SC_(-0.577215664901532860606512090082402431042159335939923598805767) }},
|
||||
{{ static_cast<T>(-1) + static_cast<T>(std::ldexp(1.0, -20)), SC_(-1.04857557721314249602848739817764518743062133735858753112190e6) }},
|
||||
{{ static_cast<T>(-1) - static_cast<T>(std::ldexp(1.0, -20)), SC_(1.04857642278181269259522681939281063878220298942888100442172e6) }},
|
||||
}};
|
||||
static const boost::array<boost::array<T, 2>, 40> digamma_integers = { {
|
||||
{ 1, SC_(-0.57721566490153286060651209008240243) }, { 2, SC_(0.42278433509846713939348790991759757) }, { 3, SC_(0.92278433509846713939348790991759757) }, { 4, SC_(1.2561176684318004727268212432509309) }, { 5, SC_(1.5061176684318004727268212432509309) }, { 6, SC_(1.7061176684318004727268212432509309) }, { 7, SC_(1.8727843350984671393934879099175976) }, { 8, SC_(2.0156414779556099965363450527747404) }, { 9, SC_(2.1406414779556099965363450527747404) }, { SC_(10.0), SC_(2.2517525890667211076474561638858515) }, { SC_(11.0), SC_(2.3517525890667211076474561638858515) }, { SC_(12.0), SC_(2.4426616799758120167383652547949424) }, { SC_(13.0), SC_(2.5259950133091453500716985881282758) }, { SC_(14.0), SC_(2.6029180902322222731486216650513527) }, { SC_(15.0), SC_(2.6743466616607937017200502364799241) }, { SC_(16.0), SC_(2.7410133283274603683867169031465908) }, { SC_(17.0), SC_(2.8035133283274603683867169031465908) }, { SC_(18.0), SC_(2.8623368577392250742690698443230614) }, { SC_(19.0), SC_(2.9178924132947806298246253998786169) }, { SC_(20.0), SC_(2.9705239922421490508772569788259854) }, { SC_(21.0), SC_(3.0205239922421490508772569788259854) }, { SC_(22.0), SC_(3.0681430398611966699248760264450330) }, { SC_(23.0), SC_(3.1135975853157421244703305718995784) }, { SC_(24.0), SC_(3.1570758461853073418616349197256654) }, { SC_(25.0), SC_(3.1987425128519740085283015863923321) }, { SC_(26.0), SC_(3.2387425128519740085283015863923321) }, { SC_(27.0), SC_(3.2772040513135124700667631248538705) }, { SC_(28.0), SC_(3.3142410883505495071038001618909076) }, { SC_(29.0), SC_(3.3499553740648352213895144476051933) }, { SC_(30.0), SC_(3.3844381326855248765619282407086415) }, { SC_(31.0), SC_(3.4177714660188582098952615740419749) }, { SC_(32.0), SC_(3.4500295305349872421533260901710071) }, { SC_(33.0), SC_(3.4812795305349872421533260901710071) }, { SC_(34.0), SC_(3.5115825608380175451836291204740374) }, { SC_(35.0), SC_(3.5409943255438998981248055910622727) }, { SC_(36.0), SC_(3.5695657541153284695533770196337013) }, { SC_(37.0), SC_(3.5973435318931062473311547974114791) }, { SC_(38.0), SC_(3.6243705589201332743581818244385061) }, { SC_(39.0), SC_(3.6506863483938174848844976139121903) }, { SC_(40.0), SC_(3.6763273740348431259101386395532160) }
|
||||
} };
|
||||
static const boost::array<boost::array<T, 2>, 41> digamma_half_integers = { {
|
||||
{ SC_(0.5), SC_(-1.9635100260214234794409763329987556) }, { SC_(1.5), SC_(0.036489973978576520559023667001244433) }, { SC_(2.5), SC_(0.70315664064524318722569033366791110) }, { SC_(3.5), SC_(1.1031566406452431872256903336679111) }, { SC_(4.5), SC_(1.3888709263595289015114046193821968) }, { SC_(5.5), SC_(1.6110931485817511237336268416044190) }, { SC_(6.5), SC_(1.7929113303999329419154450234226009) }, { SC_(7.5), SC_(1.9467574842460867880692911772687547) }, { SC_(8.5), SC_(2.0800908175794201214026245106020880) }, { SC_(9.5), SC_(2.1977378764029495331673303929550292) }, { SC_(10.5), SC_(2.3030010342976863752725935508497661) }, { SC_(11.5), SC_(2.3982391295357816133678316460878613) }, { SC_(12.5), SC_(2.4851956512749120481504403417400352) }, { SC_(13.5), SC_(2.5651956512749120481504403417400352) }, { SC_(14.5), SC_(2.6392697253489861222245144158141093) }, { SC_(15.5), SC_(2.7082352425903654325693420020210058) }, { SC_(16.5), SC_(2.7727513716226234970854710342790703) }, { SC_(17.5), SC_(2.8333574322286841031460770948851310) }, { SC_(18.5), SC_(2.8905002893715412460032199520279881) }, { SC_(19.5), SC_(2.9445543434255953000572740060820421) }, { SC_(20.5), SC_(2.9958363947076465821085560573640934) }, { SC_(21.5), SC_(3.0446168825125246308890438622421422) }, { SC_(22.5), SC_(3.0911285104195013750750903738700492) }, { SC_(23.5), SC_(3.1355729548639458195195348183144936) }, { SC_(24.5), SC_(3.1781261463533075216471943927825787) }, { SC_(25.5), SC_(3.2189424728839197665451535764560481) }, { SC_(26.5), SC_(3.2581581591584295704667222039070285) }, { SC_(27.5), SC_(3.2958940082150333440516278642843870) }, { SC_(28.5), SC_(3.3322576445786697076879915006480234) }, { SC_(29.5), SC_(3.3673453638769153217230792199462690) }, { SC_(30.5), SC_(3.4012436689616610844349436267259300) }, { SC_(31.5), SC_(3.4340305542075627237792059218078972) }, { SC_(32.5), SC_(3.4657765859535944698109519535539290) }, { SC_(33.5), SC_(3.4965458167228252390417211843231597) }, { SC_(34.5), SC_(3.5263965629914819554596316320843538) }, { SC_(35.5), SC_(3.5553820702378587670538345306350784) }, { SC_(36.5), SC_(3.5835510843223658093073556573956418) }, { SC_(37.5), SC_(3.6109483445963384120470816847929021) }, { SC_(38.5), SC_(3.6376150112630050787137483514595687) }, { SC_(39.5), SC_(3.6635890372370310527397223774335947) }, { SC_(40.5), SC_(3.6889054929332335843852919976867593) }
|
||||
} };
|
||||
|
||||
add_data(digamma_data);
|
||||
add_data(digamma_root_data);
|
||||
add_data(digamma_small_data);
|
||||
add_data(digamma_neg_data);
|
||||
add_data(digamma_bugs);
|
||||
add_data(digamma_integers);
|
||||
add_data(digamma_half_integers);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::digamma(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
|
||||
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_psi(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return ::digamma(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "digamma[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
|
||||
double time = exec_timed_test([](const std::vector<double>& v){ return boost::math::digamma(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, "Boost");
|
||||
//
|
||||
// Boost again, but with promotion to long double turned off:
|
||||
//
|
||||
#if !defined(COMPILER_COMPARISON_TABLES)
|
||||
if(sizeof(long double) != sizeof(double))
|
||||
{
|
||||
double time = exec_timed_test([](const std::vector<double>& v){ return boost::math::digamma(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){ return gsl_sf_psi(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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return ::digamma(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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,9 @@ int main()
|
||||
#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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return pgamma(v[1], v[0], 1.0, 1, 0); }, [](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)";
|
||||
@@ -65,6 +68,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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return pgamma(v[1], v[0], 1.0, 1, 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
71
reporting/performance/test_gamma_p_inv.cpp
Normal file
71
reporting/performance/test_gamma_p_inv.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 "gamma_inv_data.ipp"
|
||||
# include "gamma_inv_big_data.ipp"
|
||||
# include "gamma_inv_small_data.ipp"
|
||||
|
||||
add_data(gamma_inv_data);
|
||||
add_data(gamma_inv_big_data);
|
||||
add_data(gamma_inv_small_data);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
std::cout << "screening Boost data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::gamma_p_inv(v[0], v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
|
||||
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "screening Rmath data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return qgamma(v[1], v[0], 1.0, 1, 0); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "gamma_p_inv[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_inv(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_inv(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_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return qgamma(v[1], v[0], 1.0, 1, 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -41,6 +41,10 @@ int main()
|
||||
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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening GSL data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return pgamma(v[1], v[0], 1.0, 0, 0); }, [](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)";
|
||||
@@ -68,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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return pgamma(v[1], v[0], 1.0, 0, 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
71
reporting/performance/test_gamma_q_inv.cpp
Normal file
71
reporting/performance/test_gamma_q_inv.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 "gamma_inv_data.ipp"
|
||||
# include "gamma_inv_big_data.ipp"
|
||||
# include "gamma_inv_small_data.ipp"
|
||||
|
||||
add_data(gamma_inv_data);
|
||||
add_data(gamma_inv_big_data);
|
||||
add_data(gamma_inv_small_data);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
std::cout << "screening Boost data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::gamma_q_inv(v[0], v[1]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
|
||||
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "screening Rmath data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return qgamma(v[1], v[0], 1.0, 0, 0); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "gamma_q_inv[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_inv(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_inv(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_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return qgamma(v[1], v[0], 1.0, 0, 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
74
reporting/performance/test_ibeta.cpp
Normal file
74
reporting/performance/test_ibeta.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_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return ::pbeta(v[2], v[0], v[1], 1, 0); }, [](const std::vector<double>& v){ return v[5]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ibeta[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::ibeta(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::ibeta(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_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return ::pbeta(v[2], v[0], v[1], 1, 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
68
reporting/performance/test_ibeta_inv.cpp
Normal file
68
reporting/performance/test_ibeta_inv.cpp
Normal file
@@ -0,0 +1,68 @@
|
||||
// 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_inv_data.ipp"
|
||||
|
||||
add_data(ibeta_inv_data);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
std::cout << "Screening boost data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::ibeta_inv(v[0], v[1], v[2]); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
|
||||
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return ::qbeta(v[2], v[0], v[1], 1, 0); }, [](const std::vector<double>& v){ return v[3]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ibeta_inv[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::ibeta_inv(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::ibeta_inv(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_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return ::qbeta(v[2], v[0], v[1], 1, 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
74
reporting/performance/test_ibetac.cpp
Normal file
74
reporting/performance/test_ibetac.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::ibetac(v[0], v[1], v[2]); }, [](const std::vector<double>& v){ return v[6]; });
|
||||
|
||||
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return ::pbeta(v[2], v[0], v[1], 0, 0); }, [](const std::vector<double>& v){ return v[6]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ibetac[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::ibetac(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::ibetac(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_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return ::pbeta(v[2], v[0], v[1], 0, 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
68
reporting/performance/test_ibetac_inv.cpp
Normal file
68
reporting/performance/test_ibetac_inv.cpp
Normal file
@@ -0,0 +1,68 @@
|
||||
// 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_inv_data.ipp"
|
||||
|
||||
add_data(ibeta_inv_data);
|
||||
|
||||
unsigned data_total = data.size();
|
||||
|
||||
std::cout << "Screening boost data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return boost::math::ibetac_inv(v[0], v[1], v[2]); }, [](const std::vector<double>& v){ return v[4]; });
|
||||
|
||||
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return ::qbeta(v[2], v[0], v[1], 0, 0); }, [](const std::vector<double>& v){ return v[4]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "ibetac_inv[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::ibetac_inv(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::ibetac_inv(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_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return ::qbeta(v[2], v[0], v[1], 0, 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -74,6 +74,9 @@ int main()
|
||||
#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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return bessel_i(v[1], static_cast<int>(v[0]), 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)";
|
||||
@@ -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, "gsl");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return bessel_i(v[1], static_cast<int>(v[0]), 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -59,6 +59,10 @@ int main()
|
||||
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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening GSL data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return bessel_i(v[1], v[0], 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,15 +86,20 @@ int main()
|
||||
|
||||
|
||||
#if defined(TEST_LIBSTDCXX) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return std::tr1::cyl_bessel_i(static_cast<int>(v[0]), v[1]); });
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return std::tr1::cyl_bessel_i(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, "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]); });
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gsl_sf_bessel_Inu(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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return bessel_i(v[1], v[0], 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -105,6 +105,9 @@ int main()
|
||||
#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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return bessel_j(v[1], static_cast<int>(v[0])); }, [](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)";
|
||||
@@ -142,6 +145,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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return bessel_j(v[1], static_cast<int>(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, "Rmath");
|
||||
#endif
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -65,6 +65,10 @@ int main()
|
||||
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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return bessel_j(v[1], v[0]); }, [](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)";
|
||||
@@ -97,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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return bessel_j(v[1], 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -70,6 +70,9 @@ int main()
|
||||
#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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return bessel_k(v[1], static_cast<int>(v[0]), 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)";
|
||||
@@ -102,6 +105,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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return bessel_k(v[1], static_cast<int>(v[0]), 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -60,6 +60,10 @@ int main()
|
||||
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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening libstdc++ data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return bessel_k(v[1], v[0], 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)";
|
||||
@@ -92,6 +96,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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return bessel_k(v[1], v[0], 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ int main()
|
||||
#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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return lgammafn(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)";
|
||||
@@ -77,7 +80,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, "gsl");
|
||||
#endif
|
||||
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return lgammafn(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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -173,6 +173,9 @@ int main()
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_psi_n(static_cast<int>(v[0]), v[1]); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return ::psigamma(v[1], static_cast<int>(v[0])); }, [](const std::vector<double>& v){ return v[2]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "polygamma[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -200,6 +203,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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return ::psigamma(v[1], static_cast<int>(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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -42,6 +42,9 @@ int main()
|
||||
#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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gammafn(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)";
|
||||
@@ -77,6 +80,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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return gammafn(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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,9 @@ int main()
|
||||
#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return gsl_sf_psi_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 ::trigamma(v[0]); }, [](const std::vector<double>& v){ return v[1]; });
|
||||
#endif
|
||||
|
||||
unsigned data_used = data.size();
|
||||
std::string function = "trigamma[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
|
||||
@@ -63,6 +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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return ::trigamma(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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -77,6 +77,9 @@ int main()
|
||||
#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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
screen_data([](const std::vector<double>& v){ return bessel_y(v[1], static_cast<int>(v[0])); }, [](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)";
|
||||
@@ -114,6 +117,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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return bessel_y(v[1], static_cast<int>(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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -64,6 +64,10 @@ int main()
|
||||
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
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
std::cout << "Screening Rmath data:\n";
|
||||
screen_data([](const std::vector<double>& v){ return bessel_y(v[1], v[0]); }, [](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)";
|
||||
@@ -96,6 +100,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, "gsl");
|
||||
#endif
|
||||
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
|
||||
time = exec_timed_test([](const std::vector<double>& v){ return bessel_y(v[1], 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, "Rmath");
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user