mirror of
https://github.com/boostorg/math.git
synced 2026-01-19 04:22:09 +00:00
Change test data so it always uses the SC_ macro:
it helps multiprecision tests, and in particular allows us to test types whose precision varies at runtime.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
// Boost Software License, Version 1.0. (See accompanying file
|
||||
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
static const boost::array<boost::array<T, 4>, 435> igamma_inva_data = { {
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 4>, 435> igamma_inva_data = { {
|
||||
{{ SC_(0.11342023313045501708984375), SC_(0.097540400922298431396484375), SC_(1.035869900800721563193351335409353423054156223778352824799732510014114331303190861923913851617789576), SC_(0.05862165929221091309602935851268320728966552926925608108837955463403857541085640683871851098187935567) }},
|
||||
{{ SC_(0.11342023313045501708984375), SC_(0.12698681652545928955078125), SC_(0.93513162632210132756150227031041961003749580131891848591112697892138664595709032559736553036690404), SC_(0.07702073629515159209895492482246819546302457039495283952439305125976814739590655422243170396591695024) }},
|
||||
{{ SC_(0.11342023313045501708984375), SC_(0.135477006435394287109375), SC_(0.9100380607375349140135424653157145054283763683426464165277887838730942363760587929004439481331867906), SC_(0.08239454114833290164904666725589763295213501324448854257672874472236795673343348101283994380015493955) }},
|
||||
|
||||
@@ -1562,8 +1562,6 @@ void test_powm1_sqrtp1m1(T, const char* type_name)
|
||||
{{ SC_(9.68867778778076171875), SC_(0.438671648502349853515625), SC_(1.707985158316040663526167707818201486792) }},
|
||||
{{ SC_(9.68867778778076171875), SC_(0.903765499591827392578125), SC_(6.786671267376742594913276377075578069747) }},
|
||||
}};
|
||||
#undef SC_
|
||||
|
||||
|
||||
using namespace std;
|
||||
|
||||
|
||||
@@ -101,33 +101,33 @@ template <class T>
|
||||
void test_bessel(T, const char* name)
|
||||
{
|
||||
// function values calculated on http://functions.wolfram.com/
|
||||
static const boost::array<boost::array<T, 3>, 10> i0_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 10> i0_data = {{
|
||||
{{ SC_(0.0), SC_(0.0), SC_(1.0) }},
|
||||
{{ SC_(0.0), SC_(1.0), SC_(1.26606587775200833559824462521471753760767031135496220680814) }},
|
||||
{{ SC_(0.0), SC_(-2.0), SC_(2.27958530233606726743720444081153335328584110278545905407084) }},
|
||||
{{ SC_(0.0), SC_(4.0), SC_(11.3019219521363304963562701832171024974126165944353377060065) }},
|
||||
{{ SC_(0.0), SC_(-7.0), SC_(168.593908510289698857326627187500840376522679234531714193194) }},
|
||||
{{ SC_(0.0), T(1) / 1024, SC_(1.00000023841859331241759166109699567801556273303717896447683) }},
|
||||
{{ SC_(0.0), T(SC_(1.0)) / (1024*1024), SC_(1.00000000000022737367544324498417583090700894607432256476338) }},
|
||||
{{ SC_(0.0), SC_(0.0009765625), SC_(1.00000023841859331241759166109699567801556273303717896447683) }},
|
||||
{{ SC_(0.0), SC_(9.5367431640625e-7), SC_(1.00000000000022737367544324498417583090700894607432256476338) }},
|
||||
{{ SC_(0.0), SC_(-1.0), SC_(1.26606587775200833559824462521471753760767031135496220680814) }},
|
||||
{{ SC_(0.0), SC_(100.0), SC_(1.07375170713107382351972085760349466128840319332527279540154e42) }},
|
||||
{{ SC_(0.0), SC_(200.0), SC_(2.03968717340972461954167312677945962233267573614834337894328e85) }},
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 10> i1_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 10> i1_data = {{
|
||||
{{ SC_(1.0), SC_(0.0), SC_(0.0) }},
|
||||
{{ SC_(1.0), SC_(1.0), SC_(0.565159103992485027207696027609863307328899621621092009480294) }},
|
||||
{{ SC_(1.0), SC_(-2.0), SC_(-1.59063685463732906338225442499966624795447815949553664713229) }},
|
||||
{{ SC_(1.0), SC_(4.0), SC_(9.75946515370444990947519256731268090005597033325296730692753) }},
|
||||
{{ SC_(1.0), SC_(-8.0), SC_(-399.873136782560098219083086145822754889628443904067647306574) }},
|
||||
{{ SC_(1.0), T(SC_(1.0))/1024, SC_(0.000488281308207663226432087816784315537514225208473395063575150) }},
|
||||
{{ SC_(1.0), T(SC_(1.0))/(1024*1024), SC_(4.76837158203179210108624277276025646653133998635956784292029E-7) }},
|
||||
{{ SC_(1.0), SC_(0.0009765625), SC_(0.000488281308207663226432087816784315537514225208473395063575150) }},
|
||||
{{ SC_(1.0), SC_(9.5367431640625e-7), SC_(4.76837158203179210108624277276025646653133998635956784292029E-7) }},
|
||||
{{ SC_(1.0), SC_(-10.0), SC_(-2670.98830370125465434103196677215254914574515378753771310849) }},
|
||||
{{ SC_(1.0), SC_(100.0), SC_(1.06836939033816248120614576322429526544612284405623226965918e42) }},
|
||||
{{ SC_(1.0), SC_(200.0), SC_(2.03458154933206270342742797713906950389661161681122964159220e85) }},
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 11> in_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 11> in_data = {{
|
||||
{{ SC_(-2.0), SC_(0.0), SC_(0.0) }},
|
||||
{{ SC_(2.0), T(SC_(1.0))/(1024*1024), SC_(1.13686837721624646204093977095674566928522671779753217215467e-13) }},
|
||||
{{ SC_(2.0), SC_(9.5367431640625e-7), SC_(1.13686837721624646204093977095674566928522671779753217215467e-13) }},
|
||||
{{ SC_(5.0), SC_(10.0), SC_(777.188286403259959907293484802339632852674154572666041953297) }},
|
||||
{{ SC_(-5.0), SC_(100.0), SC_(9.47009387303558124618275555002161742321578485033007130107740e41) }},
|
||||
{{ SC_(-5.0), SC_(-1.0), SC_(-0.000271463155956971875181073905153777342383564426758143634974124) }},
|
||||
@@ -138,25 +138,25 @@ void test_bessel(T, const char* name)
|
||||
{{ SC_(-100.0), SC_(-200.0), SC_(4.35275044972702191438729017441198257508190719030765213981307e74) }},
|
||||
{{ SC_(10.0), SC_(1e-100), SC_(2.69114445546737213403880070546737213403880070546737213403880e-1010) }},
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 10> iv_data = {{
|
||||
{{ SC_(2.25), T(1)/(1024*1024), SC_(2.34379212133481347189068464680335815256364262507955635911656e-15) }},
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 10> iv_data = {{
|
||||
{{ SC_(2.25), SC_(9.5367431640625e-7), SC_(2.34379212133481347189068464680335815256364262507955635911656e-15) }},
|
||||
{{ SC_(5.5), SC_(3.125), SC_(0.0583514045989371500460946536220735787163510569634133670181210) }},
|
||||
{{ T(-5) + T(1)/1024, SC_(2.125), SC_(0.0267920938009571023702933210070984416052633027166975342895062) }},
|
||||
{{ SC_(-4.9990234375), SC_(2.125), SC_(0.0267920938009571023702933210070984416052633027166975342895062) }},
|
||||
{{ SC_(-5.5), SC_(10.0), SC_(597.577606961369169607937419869926705730305175364662688426534) }},
|
||||
{{ SC_(-5.5), SC_(100.0), SC_(9.22362906144706871737354069133813819358704200689067071415379e41) }},
|
||||
{{ T(-10486074)/(1024*1024), T(1)/1024, SC_(1.41474005665181350367684623930576333542989766867888186478185e35) }},
|
||||
{{ T(-10486074)/(1024*1024), SC_(50.0), SC_(1.07153277202900671531087024688681954238311679648319534644743e20) }},
|
||||
{{ T(144794)/1024, SC_(100.0), SC_(2066.27694757392660413922181531984160871678224178890247540320) }},
|
||||
{{ T(144794)/1024, SC_(200.0), SC_(2.23699739472246928794922868978337381373643889659337595319774e64) }},
|
||||
{{ T(-144794)/1024, SC_(100.0), SC_(2066.27694672763190927440969155740243346136463461655104698748) }},
|
||||
{{ SC_(-10.0002994537353515625), SC_(0.0009765625), SC_(1.41474005665181350367684623930576333542989766867888186478185e35) }},
|
||||
{{ SC_(-10.0002994537353515625), SC_(50.0), SC_(1.07153277202900671531087024688681954238311679648319534644743e20) }},
|
||||
{{ SC_(141.400390625), SC_(100.0), SC_(2066.27694757392660413922181531984160871678224178890247540320) }},
|
||||
{{ SC_(141.400390625), SC_(200.0), SC_(2.23699739472246928794922868978337381373643889659337595319774e64) }},
|
||||
{{ SC_(-141.400390625), SC_(100.0), SC_(2066.27694672763190927440969155740243346136463461655104698748) }},
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 5> iv_large_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 5> iv_large_data = {{
|
||||
// Bug report https://svn.boost.org/trac/boost/ticket/5560:
|
||||
{{ SC_(-1.0), static_cast<T>(ldexp(0.5, -512)), SC_(1.86458518280005168582274132886573345934411788365010172356788e-155) }},
|
||||
{{ SC_(1.0), static_cast<T>(ldexp(0.5, -512)), SC_(1.86458518280005168582274132886573345934411788365010172356788e-155) }},
|
||||
{{ SC_(-1.125), static_cast<T>(ldexp(0.5, -512)), SC_(-1.34963720853101363690381585556234820027343435206156667634081e173) }},
|
||||
{{ SC_(1.125), static_cast<T>(ldexp(0.5, -512)), SC_(8.02269390325932403421158766283366891170783955777638875887348e-175) }},
|
||||
{{ SC_(0.5), static_cast<T>(ldexp(0.5, -683)), SC_(8.90597649117647254543282704099383321071493400182381039079219e-104) }},
|
||||
{{ SC_(-1.0), SC_(3.7291703656001033716454826577314669186882357673002034471357591666031391925350591524680874452002139016807558e-155), SC_(1.86458518280005168582274132886573345934411788365010172356788e-155) }},
|
||||
{{ SC_(1.0), SC_(3.7291703656001033716454826577314669186882357673002034471357591666031391925350591524680874452002139016807558e-155), SC_(1.86458518280005168582274132886573345934411788365010172356788e-155) }},
|
||||
{{ SC_(-1.125), SC_(3.7291703656001033716454826577314669186882357673002034471357591666031391925350591524680874452002139016807558e-155), SC_(-1.34963720853101363690381585556234820027343435206156667634081e173) }},
|
||||
{{ SC_(1.125), SC_(3.7291703656001033716454826577314669186882357673002034471357591666031391925350591524680874452002139016807558e-155), SC_(8.02269390325932403421158766283366891170783955777638875887348e-175) }},
|
||||
{{ SC_(0.5), SC_(1.2458993688871959419388378518880931736878259938089494331010226962863582408064841833232475731084062642684629e-206), SC_(8.90597649117647254543282704099383321071493400182381039079219e-104) }},
|
||||
}};
|
||||
|
||||
do_test_cyl_bessel_i<T>(i0_data, name, "Bessel I0: Mathworld Data");
|
||||
|
||||
@@ -147,15 +147,15 @@ void test_bessel(T, const char* name)
|
||||
{{ SC_(0.0), SC_(1e-10), SC_(0.999999999999999999997500000000000000000) }},
|
||||
{{ SC_(0.0), SC_(-1e+01), SC_(-0.2459357644513483351977608624853287538296) }},
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 6> j0_tricky = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 6> j0_tricky = {{
|
||||
// Big numbers make the accuracy of std::sin the limiting factor:
|
||||
{ { SC_(0.0), SC_(1e+03), SC_(0.02478668615242017456133073111569370878617) } },
|
||||
{ { SC_(0.0), SC_(1e+05), SC_(-0.001719201116235972192570601477073201747532) } },
|
||||
// test at the roots:
|
||||
{ { SC_(0.0), T(2521642.0) / (1024 * 1024), SC_(1.80208819970046790002973759410972422387259992955354630042138e-7) } },
|
||||
{ { SC_(0.0), T(5788221.0) / (1024 * 1024), SC_(-1.37774249380686777043369399806210229535671843632174587432454e-7) } },
|
||||
{ { SC_(0.0), T(9074091.0) / (1024 * 1024), SC_(1.03553057441100845081018471279571355857520645127532785991335e-7) } },
|
||||
{ { SC_(0.0), T(12364320.0) / (1024 * 1024), SC_(-3.53017140778223781420794006033810387155048392363051866610931e-9) } }
|
||||
{ { SC_(0.0), SC_(2.4048252105712890625) /*T(2521642.0) / (1024 * 1024)*/, SC_(1.80208819970046790002973759410972422387259992955354630042138e-7) } },
|
||||
{ { SC_(0.0), SC_(5.52007770538330078125) /*T(5788221.0) / (1024 * 1024)*/, SC_(-1.37774249380686777043369399806210229535671843632174587432454e-7) } },
|
||||
{ { SC_(0.0), SC_(8.65372753143310546875) /*T(9074091.0) / (1024 * 1024)*/, SC_(1.03553057441100845081018471279571355857520645127532785991335e-7) } },
|
||||
{ { SC_(0.0), SC_(11.791534423828125) /*T(12364320.0) / (1024 * 1024)*/, SC_(-3.53017140778223781420794006033810387155048392363051866610931e-9) } }
|
||||
}};
|
||||
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 8> j1_data = {{
|
||||
@@ -168,14 +168,14 @@ void test_bessel(T, const char* name)
|
||||
{ { SC_(1.0), SC_(1e-10), SC_(4.999999999999999999993750000000000000000e-11) } },
|
||||
{ { SC_(1.0), SC_(-1e+01), SC_(-4.347274616886143666974876802585928830627e-02) } },
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 5> j1_tricky = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 5> j1_tricky = {{
|
||||
// Big numbers make the accuracy of std::sin the limiting factor:
|
||||
{ { SC_(1.0), SC_(1e+03), SC_(4.728311907089523917576071901216916285418e-03) } },
|
||||
{ { SC_(1.0), SC_(1e+05), SC_(1.846757562882567716362123967114215743694e-03) } },
|
||||
// test zeros:
|
||||
{ { SC_(1.0), T(4017834) / (1024 * 1024), SC_(3.53149033321258645807835062770856949751958513973522222203044e-7) } },
|
||||
{ { SC_(1.0), T(7356375) / (1024 * 1024), SC_(-2.31227973111067286051984021150135526024117175836722748404342e-7) } },
|
||||
{ { SC_(1.0), T(10667654) / (1024 * 1024), SC_(1.24591331097191900488116495350277530373473085499043086981229e-7) } },
|
||||
{ { SC_(1.0), SC_(3.8317050933837890625) /*T(4017834) / (1024 * 1024)*/, SC_(3.53149033321258645807835062770856949751958513973522222203044e-7) } },
|
||||
{ { SC_(1.0), SC_(7.01558589935302734375) /*T(7356375) / (1024 * 1024)*/, SC_(-2.31227973111067286051984021150135526024117175836722748404342e-7) } },
|
||||
{ { SC_(1.0), SC_(10.1734676361083984375) /*T(10667654) / (1024 * 1024)*/, SC_(1.24591331097191900488116495350277530373473085499043086981229e-7) } },
|
||||
}};
|
||||
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 17> jn_data = {{
|
||||
@@ -210,12 +210,12 @@ void test_bessel(T, const char* name)
|
||||
do_test_cyl_bessel_j_int<T>(j1_tricky, name, "Bessel J1: Mathworld Data (tricky cases) (Integer Version)");
|
||||
do_test_cyl_bessel_j_int<T>(jn_data, name, "Bessel JN: Mathworld Data (Integer Version)");
|
||||
|
||||
static const boost::array<boost::array<T, 3>, 21> jv_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 20> jv_data = {{
|
||||
//SC_(-2.4), {{ SC_(0.0), std::numeric_limits<T>::infinity() }},
|
||||
{ { T(22.5), T(0.0), SC_(0.0) } },
|
||||
{ { T(2457.0) / 1024, T(1.0) / 1024, SC_(3.80739920118603335646474073457326714709615200130620574875292e-9) } },
|
||||
{{ SC_(5.5), T(3217)/1024, SC_(0.0281933076257506091621579544064767140470089107926550720453038) }},
|
||||
{{ SC_(-5.5), T(3217)/1024, SC_(-2.55820064470647911823175836997490971806135336759164272675969) }},
|
||||
{ { SC_(22.5), SC_(0.0), SC_(0.0) } },
|
||||
{ { SC_(2.3994140625) /*2457.0 / 1024*/, SC_(0.0009765625) /* 1 / 1024*/, SC_(3.80739920118603335646474073457326714709615200130620574875292e-9) } },
|
||||
{{ SC_(5.5), SC_(3.1416015625) /* 3217/1024*/, SC_(0.0281933076257506091621579544064767140470089107926550720453038) }},
|
||||
{{ SC_(-5.5), SC_(3.1416015625) /* 3217/1024*/, SC_(-2.55820064470647911823175836997490971806135336759164272675969) }},
|
||||
{{ SC_(-5.5), SC_(1e+04), SC_(2.449843111985605522111159013846599118397e-03) }},
|
||||
{{ SC_(5.5), SC_(1e+04), SC_(0.00759343502722670361395585198154817047185480147294665270646578) }},
|
||||
{{ SC_(5.5), SC_(1e+06), SC_(-0.000747424248595630177396350688505919533097973148718960064663632) }},
|
||||
@@ -225,25 +225,24 @@ void test_bessel(T, const char* name)
|
||||
{{ SC_(-5.5), SC_(1e+04), SC_(0.00244984311198560552211115901384659911839737686676766460822577) }},
|
||||
{{ SC_(-5.5), SC_(1e+06), SC_(0.000279243200433579511095229508894156656558211060453622750659554) }},
|
||||
{ { SC_(-0.5), SC_(101.0), SC_(0.0708184798097594268482290389188138201440114881159344944791454) } },
|
||||
{{ T(-10486074) / (1024*1024), T(1)/1024, SC_(1.41474013160494695750009004222225969090304185981836460288562e35) }},
|
||||
{ { T(-10486074) / (1024 * 1024), SC_(15.0), SC_(-0.0902239288885423309568944543848111461724911781719692852541489) } },
|
||||
{{ T(10486074) / (1024*1024), SC_(1e+02), SC_(-0.0547064914615137807616774867984047583596945624129838091326863) }},
|
||||
{{ T(10486074) / (1024*1024), SC_(2e+04), SC_(-0.00556783614400875611650958980796060611309029233226596737701688) }},
|
||||
{{ T(-10486074) / (1024*1024), SC_(1e+02), SC_(-0.0547613660316806551338637153942604550779513947674222863858713) }},
|
||||
{{ SC_(-10.0002994537353515625) /* -10486074 / (1024*1024)*/, SC_(0.0009765625) /* 1/1024*/, SC_(1.41474013160494695750009004222225969090304185981836460288562e35) }},
|
||||
{ { SC_(-10.0002994537353515625) /* -10486074 / (1024*1024)*/, SC_(15.0), SC_(-0.0902239288885423309568944543848111461724911781719692852541489) } },
|
||||
{{ SC_(-10.0002994537353515625) /* -10486074 / (1024*1024)*/, SC_(100.0), SC_(-0.05476136603168065513386371539426045507795139476742228638) }},
|
||||
{{ SC_(-10.0002994537353515625) /* -10486074 / (1024*1024)*/, SC_(20000.0), SC_(-0.00556869085445857782456414284057389040183758546505700058) }},
|
||||
// Bug report https://svn.boost.org/trac/boost/ticket/4812:
|
||||
{{ SC_(1.5), T(8034)/1024, SC_(0.0339477646369710610146236955872928005087352629422508823945264) }},
|
||||
{{ SC_(8.5), boost::math::constants::pi<T>() * 4, SC_(0.0436807946352780974532519564114026730332781693877984686758680) }},
|
||||
{{ SC_(-8.5), boost::math::constants::pi<T>() * 4, SC_(-0.257086543428224355151772807588810984369026142375675714560864) }},
|
||||
{{ SC_(1.5), SC_(7.845703125) /* 8034/1024*/, SC_(0.0339477646369710610146236955872928005087352629422508823945264) }},
|
||||
{{ SC_(8.5), SC_(12.566370614359172953850573533118011536788677597500423283899778369231265625144835994512139301368468271928592346053) /*Pi * 4*/, SC_(0.0436807946352780974532519564114026730332781693877984686758680) }},
|
||||
{{ SC_(-8.5), SC_(12.566370614359172953850573533118011536788677597500423283899778369231265625144835994512139301368468271928592346053) /*Pi * 4*/, SC_(-0.257086543428224355151772807588810984369026142375675714560864) }},
|
||||
}};
|
||||
do_test_cyl_bessel_j<T>(jv_data, name, "Bessel J: Mathworld Data");
|
||||
static const boost::array<boost::array<T, 3>, 4> jv_large_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 4> jv_large_data = {{
|
||||
// Bug report https://svn.boost.org/trac/boost/ticket/5560:
|
||||
{{ SC_(-0.5), static_cast<T>(std::ldexp(0.5, -683)), SC_(7.14823099969225685526188875418476476336424046896822867989728e102) }},
|
||||
{{ SC_(-0.5), SC_(1.2458993688871959419388378518880931736878259938089494331010226962863582408064841833232475731084062642684629e-206) /*static_cast<T>(std::ldexp(0.5, -683))*/, SC_(7.14823099969225685526188875418476476336424046896822867989728e102) }},
|
||||
{ { SC_(256.0), SC_(512.0), SC_(0.00671672065717513246956991122723250578101154313313749938944675) } },
|
||||
{ { SC_(-256.0), SC_(8.0), SC_(1.46866142030022704638298523775638527553596432641223316232692e-353) } },
|
||||
{ { SC_(-2.5), SC_(4.0), SC_(-0.0145679476685218007666785535204236327832335803441449596297004) } },
|
||||
}};
|
||||
if(jv_large_data[0][1] != 0)
|
||||
if(static_cast<T>(jv_large_data[0][1]) != 0)
|
||||
do_test_cyl_bessel_j<T>(jv_large_data, name, "Bessel J: Mathworld Data (large values)");
|
||||
|
||||
#include "bessel_j_int_data.ipp"
|
||||
|
||||
@@ -101,59 +101,59 @@ template <class T>
|
||||
void test_bessel(T, const char* name)
|
||||
{
|
||||
// function values calculated on http://functions.wolfram.com/
|
||||
static const boost::array<boost::array<T, 3>, 9> k0_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 9> k0_data = {{
|
||||
{{ SC_(0.0), SC_(1.0), SC_(0.421024438240708333335627379212609036136219748226660472298970) }},
|
||||
{{ SC_(0.0), SC_(2.0), SC_(0.113893872749533435652719574932481832998326624388808882892530) }},
|
||||
{{ SC_(0.0), SC_(4.0), SC_(0.0111596760858530242697451959798334892250090238884743405382553) }},
|
||||
{{ SC_(0.0), SC_(8.0), SC_(0.000146470705222815387096584408698677921967305368833759024089154) }},
|
||||
{{ SC_(0.0), T(std::ldexp(1.0, -15)), SC_(10.5131392267382037062459525561594822400447325776672021972753) }},
|
||||
{{ SC_(0.0), T(std::ldexp(1.0, -30)), SC_(20.9103469324567717360787328239372191382743831365906131108531) }},
|
||||
{{ SC_(0.0), T(std::ldexp(1.0, -60)), SC_(41.7047623492551310138446473188663682295952219631968830346918) }},
|
||||
{{ SC_(0.0), SC_(0.000030517578125) /*T(std::ldexp(1.0, -15))*/, SC_(10.5131392267382037062459525561594822400447325776672021972753) }},
|
||||
{{ SC_(0.0), SC_(9.31322574615478515625e-10) /*T(std::ldexp(1.0, -30))*/, SC_(20.9103469324567717360787328239372191382743831365906131108531) }},
|
||||
{{ SC_(0.0), SC_(8.67361737988403547205962240695953369140625e-19) /*T(std::ldexp(1.0, -60))*/, SC_(41.7047623492551310138446473188663682295952219631968830346918) }},
|
||||
{{ SC_(0.0), SC_(50.0), SC_(3.41016774978949551392067551235295223184502537762334808993276e-23) }},
|
||||
{{ SC_(0.0), SC_(100.0), SC_(4.65662822917590201893900528948388635580753948544211387402671e-45) }},
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 9> k1_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 9> k1_data = {{
|
||||
{{ SC_(1.0), SC_(1.0), SC_(0.601907230197234574737540001535617339261586889968106456017768) }},
|
||||
{{ SC_(1.0), SC_(2.0), SC_(0.139865881816522427284598807035411023887234584841515530384442) }},
|
||||
{{ SC_(1.0), SC_(4.0), SC_(0.0124834988872684314703841799808060684838415849886258457917076) }},
|
||||
{{ SC_(1.0), SC_(8.0), SC_(0.000155369211805001133916862450622474621117065122872616157079566) }},
|
||||
{{ SC_(1.0), T(std::ldexp(1.0, -15)), SC_(32767.9998319528316432647441316539139725104728341577594326513) }},
|
||||
{{ SC_(1.0), T(std::ldexp(1.0, -30)), SC_(1.07374182399999999003003028572687332810353799544215073362305e9) }},
|
||||
{{ SC_(1.0), T(std::ldexp(1.0, -60)), SC_(1.15292150460684697599999999999999998169660198868126604634036e18) }},
|
||||
{{ SC_(1.0), SC_(0.000030517578125) /*T(std::ldexp(1.0, -15))*/, SC_(32767.9998319528316432647441316539139725104728341577594326513) }},
|
||||
{{ SC_(1.0), SC_(9.31322574615478515625e-10) /*T(std::ldexp(1.0, -30))*/, SC_(1.07374182399999999003003028572687332810353799544215073362305e9) }},
|
||||
{{ SC_(1.0), SC_(8.67361737988403547205962240695953369140625e-19) /*T(std::ldexp(1.0, -60))*/, SC_(1.15292150460684697599999999999999998169660198868126604634036e18) }},
|
||||
{{ SC_(1.0), SC_(50.0), SC_(3.44410222671755561259185303591267155099677251348256880221927e-23) }},
|
||||
{{ SC_(1.0), SC_(100.0), SC_(4.67985373563690928656254424202433530797494354694335352937465e-45) }},
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 9> kn_data = {{
|
||||
{{ SC_(2.0), T(std::ldexp(1.0, -30)), SC_(2.30584300921369395150000000000000000234841952009593636868109e18) }},
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 9> kn_data = {{
|
||||
{{ SC_(2.0), SC_(9.31322574615478515625e-10) /*T(std::ldexp(1.0, -30))*/, SC_(2.30584300921369395150000000000000000234841952009593636868109e18) }},
|
||||
{{ SC_(5.0), SC_(10.0), SC_(0.0000575418499853122792763740236992723196597629124356739596921536) }},
|
||||
{{ SC_(-5.0), SC_(100.0), SC_(5.27325611329294989461777188449044716451716555009882448801072e-45) }},
|
||||
{{ SC_(10.0), SC_(10.0), SC_(0.00161425530039067002345725193091329085443750382929208307802221) }},
|
||||
{{ SC_(10.0), T(std::ldexp(1.0, -30)), SC_(3.78470202927236255215249281534478864916684072926050665209083e98) }},
|
||||
{{ SC_(10.0), SC_(9.31322574615478515625e-10) /*T(std::ldexp(1.0, -30))*/, SC_(3.78470202927236255215249281534478864916684072926050665209083e98) }},
|
||||
{{ SC_(-10.0), SC_(1.0), SC_(1.80713289901029454691597861302340015908245782948536080022119e8) }},
|
||||
{{ SC_(100.0), SC_(5.0), SC_(7.03986019306167654653386616796116726248616158936088056952477e115) }},
|
||||
{{ SC_(100.0), SC_(80.0), SC_(8.39287107246490782848985384895907681748152272748337807033319e-12) }},
|
||||
{{ SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) }},
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 11> kv_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 11> kv_data = {{
|
||||
{{ SC_(0.5), SC_(0.875), SC_(0.558532231646608646115729767013630967055657943463362504577189) }},
|
||||
{{ SC_(0.5), SC_(1.125), SC_(0.383621010650189547146769320487006220295290256657827220786527) }},
|
||||
{{ SC_(2.25), T(std::ldexp(1.0, -30)), SC_(5.62397392719283271332307799146649700147907612095185712015604e20) }},
|
||||
{{ SC_(5.5), T(3217)/1024, SC_(1.30623288775012596319554857587765179889689223531159532808379) }},
|
||||
{{ SC_(2.25), SC_(9.31322574615478515625e-10) /*T(std::ldexp(1.0, -30))*/, SC_(5.62397392719283271332307799146649700147907612095185712015604e20) }},
|
||||
{{ SC_(5.5), SC_(3.1416015625) /*3217/1024*/, SC_(1.30623288775012596319554857587765179889689223531159532808379) }},
|
||||
{{ SC_(-5.5), SC_(10.0), SC_(0.0000733045300798502164644836879577484533096239574909573072142667) }},
|
||||
{{ SC_(-5.5), SC_(100.0), SC_(5.41274555306792267322084448693957747924412508020839543293369e-45) }},
|
||||
{{ T(10240)/1024, T(1)/1024, SC_(2.35522579263922076203415803966825431039900000000993410734978e38) }},
|
||||
{{ T(10240)/1024, SC_(10.0), SC_(0.00161425530039067002345725193091329085443750382929208307802221) }},
|
||||
{{ T(144793)/1024, SC_(100.0), SC_(1.39565245860302528069481472855619216759142225046370312329416e-6) }},
|
||||
{{ T(144793)/1024, SC_(200.0), SC_(9.11950412043225432171915100042647230802198254567007382956336e-68) }},
|
||||
{{ T(-144793)/1024, SC_(50.0), SC_(1.30185229717525025165362673848737761549946548375142378172956e42) }},
|
||||
{{ SC_(10.0), SC_(0.0009765625) /*1/1024*/, SC_(2.35522579263922076203415803966825431039900000000993410734978e38) }},
|
||||
{{ SC_(10.0), SC_(10.0), SC_(0.00161425530039067002345725193091329085443750382929208307802221) }},
|
||||
{{ SC_(141.3994140625) /*T(144793)/1024)*/, SC_(100.0), SC_(1.39565245860302528069481472855619216759142225046370312329416e-6) }},
|
||||
{{ SC_(141.3994140625) /*T(144793)/1024)*/, SC_(200.0), SC_(9.11950412043225432171915100042647230802198254567007382956336e-68) }},
|
||||
{{ SC_(-141.3994140625) /*T(-144793)/1024*/, SC_(50.0), SC_(1.30185229717525025165362673848737761549946548375142378172956e42) }},
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 5> kv_large_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 5> kv_large_data = {{
|
||||
// Bug report https://svn.boost.org/trac/boost/ticket/5560:
|
||||
{{ SC_(-1.0), static_cast<T>(ldexp(0.5, -512)), SC_(2.68156158598851941991480499964116922549587316411847867554471e154) }},
|
||||
{{ SC_(1.0), static_cast<T>(ldexp(0.5, -512)), SC_(2.68156158598851941991480499964116922549587316411847867554471e154) }},
|
||||
{{ SC_(-1.125), static_cast<T>(ldexp(0.5, -512)), SC_(5.53984048006472105611199242328122729730752165907526178753978e173) }},
|
||||
{{ SC_(1.125), static_cast<T>(ldexp(0.5, -512)), SC_(5.53984048006472105611199242328122729730752165907526178753978e173) }},
|
||||
{{ SC_(0.5), static_cast<T>(ldexp(0.5, -683)), SC_(1.12284149973980088540335945247019177715948513804063794284101e103) }},
|
||||
{{ SC_(-1.0), SC_(3.729170365600103371645482657731466918688235767300203447135759166603139192535059152468087445200213901e-155) /*static_cast<T>(ldexp(0.5, -512))*/, SC_(2.68156158598851941991480499964116922549587316411847867554471e154) }},
|
||||
{{ SC_(1.0), SC_(3.729170365600103371645482657731466918688235767300203447135759166603139192535059152468087445200213901e-155) /*static_cast<T>(ldexp(0.5, -512))*/, SC_(2.68156158598851941991480499964116922549587316411847867554471e154) }},
|
||||
{{ SC_(-1.125), SC_(3.729170365600103371645482657731466918688235767300203447135759166603139192535059152468087445200213901e-155) /*static_cast<T>(ldexp(0.5, -512))*/, SC_(5.53984048006472105611199242328122729730752165907526178753978e173) }},
|
||||
{{ SC_(1.125), SC_(3.729170365600103371645482657731466918688235767300203447135759166603139192535059152468087445200213901e-155) /*static_cast<T>(ldexp(0.5, -512))*/, SC_(5.53984048006472105611199242328122729730752165907526178753978e173) }},
|
||||
{{ SC_(0.5), SC_(1.2458993688871959419388378518880931736878259938089494331010226962863582408064841833232475731084062642684629e-206) /*static_cast<T>(ldexp(0.5, -683))*/, SC_(1.12284149973980088540335945247019177715948513804063794284101e103) }},
|
||||
}};
|
||||
|
||||
do_test_cyl_bessel_k<T>(k0_data, name, "Bessel K0: Mathworld Data");
|
||||
|
||||
@@ -170,29 +170,29 @@ void test_bessel(T, const char* name)
|
||||
{{ SC_(-1e+03), SC_(7e+02), SC_(-1.88753109980945889960843803284345261796244752396992106755091e77) }},
|
||||
{{ SC_(-25.0), SC_(8.0), SC_(3.45113613777297661997458045843868931827873456761831907587263e8) }}
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 11> yv_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 11> yv_data = {{
|
||||
//SC_(2.25), {{ SC_(1.0) / 1024, SC_(-1.01759203636941035147948317764932151601257765988969544340275e7) }},
|
||||
{{ SC_(0.5), T(1) / (1024*1024), SC_(-817.033790261762580469303126467917092806755460418223776544122) }},
|
||||
{{ SC_(0.5), SC_(9.5367431640625e-7) /* 1/(1024*1024)*/, SC_(-817.033790261762580469303126467917092806755460418223776544122) }},
|
||||
{{ SC_(5.5), SC_(3.125), SC_(-2.61489440328417468776474188539366752698192046890955453259866) }},
|
||||
{{ SC_(-5.5), SC_(3.125), SC_(-0.0274994493896489729948109971802244976377957234563871795364056) }},
|
||||
{{ SC_(-5.5), SC_(1e+04), SC_(-0.00759343502722670361395585198154817047185480147294665270646578) }},
|
||||
{{ T(-10486074) / (1024*1024), T(1)/1024, SC_(-1.50382374389531766117868938966858995093408410498915220070230e38) }},
|
||||
{{ T(-10486074) / (1024*1024), SC_(1e+02), SC_(0.0583041891319026009955779707640455341990844522293730214223545) }},
|
||||
{{ SC_(-10.0002994537353515625) /* -10486074 / (1024*1024)*/, SC_(0.0009765625) /*1/1024*/, SC_(-1.50382374389531766117868938966858995093408410498915220070230e38) }},
|
||||
{{ SC_(-10.0002994537353515625) /* -10486074 / (1024*1024)*/, SC_(1e+02), SC_(0.0583041891319026009955779707640455341990844522293730214223545) }},
|
||||
{{ SC_(141.75), SC_(1e+02), SC_(-5.38829231428696507293191118661269920130838607482708483122068e9) }},
|
||||
{{ SC_(141.75), SC_(2e+04), SC_(-0.00376577888677186194728129112270988602876597726657372330194186) }},
|
||||
{{ SC_(-141.75), SC_(1e+02), SC_(-3.81009803444766877495905954105669819951653361036342457919021e9) }},
|
||||
{{ SC_(8.5), boost::math::constants::pi<T>() * 4, SC_(0.257086543428224355151772807588810984369026142375675714560864) }},
|
||||
{{ SC_(-8.5), boost::math::constants::pi<T>() * 4, SC_(0.0436807946352780974532519564114026730332781693877984686758680) }},
|
||||
{{ SC_(8.5), SC_(12.56637061435917295385057353311801153678867759750042328389) /*4Pi*/, SC_(0.257086543428224355151772807588810984369026142375675714560864) }},
|
||||
{{ SC_(-8.5), SC_(12.56637061435917295385057353311801153678867759750042328389) /*4Pi*/, SC_(0.0436807946352780974532519564114026730332781693877984686758680) }},
|
||||
}};
|
||||
static const boost::array<boost::array<T, 3>, 7> yv_large_data = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 7> yv_large_data = {{
|
||||
// Bug report https://svn.boost.org/trac/boost/ticket/5560:
|
||||
{{ SC_(0.5), static_cast<T>(std::ldexp(0.5, -683)), SC_(-7.14823099969225685526188875418476476336424046896822867989728e102) }},
|
||||
{{ SC_(-0.5), static_cast<T>(std::ldexp(0.5, -683)), SC_(8.90597649117647254543282704099383321071493400182381039079219e-104) }},
|
||||
{{ SC_(0.0), static_cast<T>(std::ldexp(1.0, -53)), SC_(-23.4611779112897561252987257324561640034037313549011724328997) }},
|
||||
{{ SC_(1.0), static_cast<T>(std::ldexp(1.0, -53)), SC_(-5.73416113922265864550047623401604244038331542638719289100990e15) }},
|
||||
{{ SC_(2.0), static_cast<T>(std::ldexp(1.0, -53)), SC_(-1.03297463879542177245046832533417970379386617249046560049244e32) }},
|
||||
{{ SC_(3.0), static_cast<T>(std::ldexp(1.0, -53)), SC_(-3.72168335868978735639260528876490232745489151562358712422544e48) }},
|
||||
{{ SC_(10.0), static_cast<T>(std::ldexp(1.0, -53)), SC_(-4.15729476804920974669173904282420477878640623992500096231384e167) }},
|
||||
{{ SC_(0.5), SC_(1.24589936888719594193883785188809317368782599380894e-206) /*static_cast<T>(std::ldexp(0.5, -683))*/, SC_(-7.14823099969225685526188875418476476336424046896822867989728e102) }},
|
||||
{{ SC_(-0.5), SC_(1.24589936888719594193883785188809317368782599380894e-206) /*static_cast<T>(std::ldexp(0.5, -683))*/, SC_(8.90597649117647254543282704099383321071493400182381039079219e-104) }},
|
||||
{{ SC_(0.0), SC_(1.1102230246251565404236316680908203125e-16) /*static_cast<T>(std::ldexp(1.0, -53))*/, SC_(-23.4611779112897561252987257324561640034037313549011724328997) }},
|
||||
{{ SC_(1.0), SC_(1.1102230246251565404236316680908203125e-16) /*static_cast<T>(std::ldexp(1.0, -53))*/, SC_(-5.73416113922265864550047623401604244038331542638719289100990e15) }},
|
||||
{{ SC_(2.0), SC_(1.1102230246251565404236316680908203125e-16) /*static_cast<T>(std::ldexp(1.0, -53))*/, SC_(-1.03297463879542177245046832533417970379386617249046560049244e32) }},
|
||||
{{ SC_(3.0), SC_(1.1102230246251565404236316680908203125e-16) /*static_cast<T>(std::ldexp(1.0, -53))*/, SC_(-3.72168335868978735639260528876490232745489151562358712422544e48) }},
|
||||
{{ SC_(10.0), SC_(1.1102230246251565404236316680908203125e-16) /*static_cast<T>(std::ldexp(1.0, -53))*/, SC_(-4.15729476804920974669173904282420477878640623992500096231384e167) }},
|
||||
}};
|
||||
|
||||
do_test_cyl_neumann_y<T>(y0_data, name, "Y0: Mathworld Data");
|
||||
@@ -202,7 +202,7 @@ void test_bessel(T, const char* name)
|
||||
do_test_cyl_neumann_y_int<T>(y1_data, name, "Y1: Mathworld Data (Integer Version)");
|
||||
do_test_cyl_neumann_y_int<T>(yn_data, name, "Yn: Mathworld Data (Integer Version)");
|
||||
do_test_cyl_neumann_y<T>(yv_data, name, "Yv: Mathworld Data");
|
||||
if(yv_large_data[0][1] != 0)
|
||||
if(static_cast<T>(yv_large_data[0][1]) != 0)
|
||||
do_test_cyl_neumann_y<T>(yv_large_data, name, "Yv: Mathworld Data (large values)");
|
||||
|
||||
#include "bessel_y01_data.ipp"
|
||||
|
||||
@@ -76,22 +76,22 @@ void test_digamma(T, const char* name)
|
||||
|
||||
do_test_digamma<T>(digamma_neg_data, name, "Digamma Function: Negative Values");
|
||||
|
||||
static const boost::array<boost::array<T, 2>, 5> digamma_bugs = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 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) }},
|
||||
{{ SC_(7.888609052210118054117285652827862296732064351090230047702789306640625e-31) /*std::ldexp(1.0, -100)*/, SC_(-1.26765060022822940149670320537657721566490153286060651209008e30) }},
|
||||
{{ SC_(-7.888609052210118054117285652827862296732064351090230047702789306640625e-31) /*-std::ldexp(1.0, -100)*/, SC_(1.26765060022822940149670320537542278433509846713939348790992e30) }},
|
||||
{{ SC_(1.0), SC_(-0.577215664901532860606512090082402431042159335939923598805767) }},
|
||||
{{ SC_(-0.99999904632568359375) /*static_cast<T>(-1) + static_cast<T>(std::ldexp(1.0, -20))*/, SC_(-1.04857557721314249602848739817764518743062133735858753112190e6) }},
|
||||
{{ SC_(-1.00000095367431640625) /*static_cast<T>(-1) - static_cast<T>(std::ldexp(1.0, -20))*/, SC_(1.04857642278181269259522681939281063878220298942888100442172e6) }},
|
||||
}};
|
||||
do_test_digamma<T>(digamma_bugs, name, "Digamma Function: Values near 0");
|
||||
|
||||
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<typename table_type<T>::type, 2>, 40> digamma_integers = { {
|
||||
{ SC_(1.0), SC_(-0.57721566490153286060651209008240243) }, { SC_(2.0), SC_(0.42278433509846713939348790991759757) }, { SC_(3.0), SC_(0.92278433509846713939348790991759757) }, { SC_(4.0), SC_(1.2561176684318004727268212432509309) }, { SC_(5.0), SC_(1.5061176684318004727268212432509309) }, { SC_(6.0), SC_(1.7061176684318004727268212432509309) }, { SC_(7.0), SC_(1.8727843350984671393934879099175976) }, { SC_(8.0), SC_(2.0156414779556099965363450527747404) }, { SC_(9.0), 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) }
|
||||
} };
|
||||
do_test_digamma<T>(digamma_integers, name, "Digamma Function: Integer arguments");
|
||||
|
||||
static const boost::array<boost::array<T, 2>, 41> digamma_half_integers = { {
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 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) }
|
||||
} };
|
||||
do_test_digamma<T>(digamma_half_integers, name, "Digamma Function: Half integer arguments");
|
||||
|
||||
@@ -84,17 +84,17 @@ void test_spots(T, const char* type_name)
|
||||
{
|
||||
// Function values calculated on http://functions.wolfram.com/
|
||||
// Note that Mathematica's EllipticF accepts k^2 as the second parameter.
|
||||
static const boost::array<boost::array<T, 3>, 19> data1 = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 19> data1 = {{
|
||||
{{ SC_(0.0), SC_(0.0), SC_(0.0) }},
|
||||
{{ SC_(-10.0), SC_(0.0), SC_(-10.0) }},
|
||||
{{ SC_(-1.0), SC_(-1.0), SC_(-1.2261911708835170708130609674719067527242483502207) }},
|
||||
{{ SC_(-4.0), SC_(0.875), SC_(-5.3190556182262405182189463092940736859067548232647) }},
|
||||
{{ SC_(8.0), SC_(-0.625), SC_(9.0419973860310100524448893214394562615252527557062) }},
|
||||
{{ SC_(1e-05), SC_(0.875), SC_(0.000010000000000127604166668510945638036143355898993088) }},
|
||||
{{ SC_(1e+05), T(10)/1024, SC_(100002.38431454899771096037307519328741455615271038) }},
|
||||
{{ SC_(1e+05), SC_(0.009765625) /*T(10)/1024*/, SC_(100002.38431454899771096037307519328741455615271038) }},
|
||||
{{ SC_(1e-20), SC_(1.0), SC_(1.0000000000000000000000000000000000000000166666667e-20) }},
|
||||
{{ SC_(1e-20), SC_(1e-20), SC_(1.000000000000000e-20) }},
|
||||
{{ SC_(1e+20), T(400)/1024, SC_(1.0418143796499216839719289963154558027005142709763e20) }},
|
||||
{{ SC_(1e+20), SC_(0.390625) /*T(400)/1024*/, SC_(1.0418143796499216839719289963154558027005142709763e20) }},
|
||||
{{ SC_(1e+50), SC_(0.875), SC_(1.3913251718238765549409892714295358043696028445944e50) }},
|
||||
{{ SC_(2.0), SC_(0.5), SC_(2.1765877052210673672479877957388515321497888026770) }},
|
||||
{{ SC_(4.0), SC_(0.5), SC_(4.2543274975235836861894752787874633017836785640477) }},
|
||||
@@ -114,16 +114,16 @@ void test_spots(T, const char* type_name)
|
||||
|
||||
// Function values calculated on http://functions.wolfram.com/
|
||||
// Note that Mathematica's EllipticK accepts k^2 as the second parameter.
|
||||
static const boost::array<boost::array<T, 2>, 9> data2 = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 2>, 9> data2 = {{
|
||||
{{ SC_(0.0), SC_(1.5707963267948966192313216916397514420985846996876) }},
|
||||
{{ SC_(0.125), SC_(1.5769867712158131421244030532288080803822271060839) }},
|
||||
{{ SC_(0.25), SC_(1.5962422221317835101489690714979498795055744578951) }},
|
||||
{{ T(300)/1024, SC_(1.6062331054696636704261124078746600894998873503208) }},
|
||||
{{ T(400)/1024, SC_(1.6364782007562008756208066125715722889067992997614) }},
|
||||
{{ SC_(0.29296875) /*T(300)/1024*/, SC_(1.6062331054696636704261124078746600894998873503208) }},
|
||||
{{ SC_(0.390625) /*T(400)/1024*/, SC_(1.6364782007562008756208066125715722889067992997614) }},
|
||||
{{ SC_(-0.5), SC_(1.6857503548125960428712036577990769895008008941411) }},
|
||||
{{ SC_(-0.75), SC_(1.9109897807518291965531482187613425592531451316788) }},
|
||||
{{ 1-T(1)/8, SC_(2.185488469278223686913080323730158689730428415766) }},
|
||||
{{ 1-T(1)/1024, SC_(4.5074135978990422666372495313621124487894807327687) }},
|
||||
{{ SC_(0.875) /*1-T(1)/8*/, SC_(2.185488469278223686913080323730158689730428415766) }},
|
||||
{{ SC_(0.9990234375) /*1-T(1)/1024*/, SC_(4.5074135978990422666372495313621124487894807327687) }},
|
||||
}};
|
||||
|
||||
do_test_ellint_k<T>(data2, type_name, "Elliptic Integral K: Mathworld Data");
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -87,7 +87,7 @@ void test_spots(T, const char* type_name)
|
||||
{
|
||||
BOOST_MATH_STD_USING
|
||||
// function values calculated on http://functions.wolfram.com/
|
||||
static const boost::array<boost::array<T, 4>, 65> data1 = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 4>, 65> data1 = {{
|
||||
{{ SC_(1.0), SC_(-1.0), SC_(0.0), SC_(-1.557407724654902230506974807458360173087) }},
|
||||
{{ SC_(0.0), SC_(-4.0), SC_(0.4), SC_(-4.153623371196831087495427530365430979011) }},
|
||||
{{ SC_(0.0), SC_(8.0), SC_(-0.6), SC_(8.935930619078575123490612395578518914416) }},
|
||||
@@ -99,33 +99,38 @@ void test_spots(T, const char* type_name)
|
||||
{{ SC_(0.75), SC_(0.75), SC_(0.0), SC_(0.871827580412760575085768367421866079353646112288567703061975) }},
|
||||
{{ SC_(1.0), SC_(0.25), SC_(0.0), SC_(0.255341921221036266504482236490473678204201638800822621740476) }},
|
||||
{{ SC_(2.0), SC_(0.25), SC_(0.0), SC_(0.261119051639220165094943572468224137699644963125853641716219) }},
|
||||
{{ T(1023)/1024, SC_(1.5), SC_(0.0), SC_(13.2821612239764190363647953338544569682942329604483733197131) }},
|
||||
{{ SC_(0.9990234375) /*T(1023)/1024*/, SC_(1.5), SC_(0.0), SC_(13.2821612239764190363647953338544569682942329604483733197131) }},
|
||||
{{ SC_(0.5), SC_(-1.0), SC_(0.5), SC_(-1.228014414316220642611298946293865487807) }},
|
||||
{{ SC_(0.5), SC_(1e+10), SC_(0.5), SC_(1.536591003599172091573590441336982730551e+10) }},
|
||||
{{ SC_(-1e+05), SC_(10.0), SC_(0.75), SC_(0.0347926099493147087821620459290460547131012904008557007934290) }},
|
||||
{{ SC_(-1e+10), SC_(10.0), SC_(0.875), SC_(0.000109956202759561502329123384755016959364346382187364656768212) }},
|
||||
{{ SC_(-1e+10), SC_(1e+20), SC_(0.875), SC_(1.00000626665567332602765201107198822183913978895904937646809e15) }},
|
||||
{{ SC_(-1e+10), T(1608)/1024, SC_(0.875), SC_(0.0000157080616044072676127333183571107873332593142625043567690379) }},
|
||||
{{ 1-T(1) / 1024, SC_(1e+20), SC_(0.875), SC_(6.43274293944380717581167058274600202023334985100499739678963e21) }},
|
||||
{{ SC_(-1e+10), SC_(1.5703125) /*T(1608)/1024*/, SC_(0.875), SC_(0.0000157080616044072676127333183571107873332593142625043567690379) }},
|
||||
{{ SC_(0.9990234375) /*1-T(1) / 1024*/, SC_(1e+20), SC_(0.875), SC_(6.43274293944380717581167058274600202023334985100499739678963e21) }},
|
||||
{{ SC_(50.0), SC_(0.125), SC_(0.25), SC_(0.196321043776719739372196642514913879497104766409504746018939) }},
|
||||
{{ SC_(1.125), SC_(1.0), SC_(0.25), SC_(1.77299767784815770192352979665283069318388205110727241629752) }},
|
||||
{{ SC_(1.125), SC_(10.0), SC_(0.25), SC_(0.662467818678976949597336360256848770217429434745967677192487) }},
|
||||
{{ SC_(1.125), SC_(3.0), SC_(0.25), SC_(-0.142697285116693775525461312178015106079842313950476205580178) }},
|
||||
{{ T(257)/256, SC_(1.5), SC_(0.125), SC_(22.2699300473528164111357290313578126108398839810535700884237) }},
|
||||
{{ T(257)/256, SC_(21.5), SC_(0.125), SC_(-0.535406081652313940727588125663856894154526187713506526799429) }},
|
||||
{{ SC_(1.00390625) /*T(257)/256*/, SC_(1.5), SC_(0.125), SC_(22.2699300473528164111357290313578126108398839810535700884237) }},
|
||||
{{ SC_(1.00390625) /*T(257)/256*/, SC_(21.5), SC_(0.125), SC_(-0.535406081652313940727588125663856894154526187713506526799429) }},
|
||||
// Bug cases from Rocco Romeo:
|
||||
{ { SC_(-1E-170), boost::math::constants::pi<T>() / 4, SC_(1E-164), SC_(0.785398163397448309615660845819875721049292349843776455243736) } },
|
||||
{ { SC_(-1E-170), boost::math::constants::pi<T>() / 4, SC_(-1E-164), SC_(0.785398163397448309615660845819875721049292349843776455243736) } },
|
||||
{ { -ldexp(T(1.0), -52), boost::math::constants::pi<T>() / 4, SC_(0.9375), SC_(0.866032844934895872810905364370384153285798081574191920571016) } },
|
||||
{ { -ldexp(T(1.0), -52), boost::math::constants::pi<T>() / 4, SC_(-0.9375), SC_(0.866032844934895872810905364370384153285798081574191920571016) } },
|
||||
{ { std::numeric_limits<T>::max_exponent > 600 ? -ldexp(T(1), 604) : T(0), -ldexp(T(1), -816), ldexp(T(1), -510), std::numeric_limits<T>::max_exponent > 600 ? SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) : SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) } },
|
||||
{ { std::numeric_limits<T>::max_exponent > 600 ? -ldexp(T(1), 604) : T(0), -ldexp(T(1), -816), -ldexp(T(1), -510), std::numeric_limits<T>::max_exponent > 600 ? SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) : SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) } },
|
||||
{ { -ldexp(T(1), -622), -ldexp(T(1), -800), ldexp(T(1), -132), SC_(-1.49969681389563095481764443762806535353996169623910829793733e-241) } },
|
||||
{ { -ldexp(T(1), -622), -ldexp(T(1), -800), -ldexp(T(1), -132), SC_(-1.49969681389563095481764443762806535353996169623910829793733e-241) } },
|
||||
{ { -ldexp(T(1), -562), ldexp(T(1), -140), ldexp(T(1), -256), SC_(7.174648137343063403129495466444370592154941142407760751e-43) } },
|
||||
{ { -ldexp(T(1), -562), -ldexp(T(1), -140), ldexp(T(1), -256), SC_(-7.17464813734306340312949546644437059215494114240776075e-43) } },
|
||||
{ { ldexp(T(1), -688), -ldexp(T(1), -243), ldexp(T(1), -193), SC_(-7.07474928033336903711649944600608732865822749854620171e-74) } },
|
||||
{ { -ldexp(T(1), -688), -ldexp(T(1), -243), ldexp(T(1), -193), SC_(-7.07474928033336903711649944600608732865822749854620171e-74) } },
|
||||
{ { SC_(-1E-170), SC_(0.785398163397448309615660845819875721049292349843776455243) /*boost::math::constants::pi<T>() / 4*/, SC_(1E-164), SC_(0.785398163397448309615660845819875721049292349843776455243736) } },
|
||||
{ { SC_(-1E-170), SC_(0.785398163397448309615660845819875721049292349843776455243) /*boost::math::constants::pi<T>() / 4*/, SC_(-1E-164), SC_(0.785398163397448309615660845819875721049292349843776455243736) } },
|
||||
{ { SC_(-2.220446049250313080847263336181640625e-16) /*-ldexp(T(1.0), -52)*/, SC_(0.785398163397448309615660845819875721049292349843776455243) /*boost::math::constants::pi<T>() / 4*/, SC_(0.9375), SC_(0.866032844934895872810905364370384153285798081574191920571016) } },
|
||||
{ { SC_(-2.220446049250313080847263336181640625e-16) /*-ldexp(T(1.0), -52)*/, SC_(0.785398163397448309615660845819875721049292349843776455243) /*boost::math::constants::pi<T>() / 4*/, SC_(-0.9375), SC_(0.866032844934895872810905364370384153285798081574191920571016) } },
|
||||
{ { std::numeric_limits<T>::max_exponent > 600 ? SC_(-6.63922491020958873361985258190585784161991397158789903999305172750504449826065303423953127831536607086111661e181) /*-ldexp(T(1), 604)*/ : SC_(0.0),
|
||||
SC_(-2.2883557340936751629907904626893087059630763187242253081319190179713605588564915508590211920126569156532129e-246) /*-ldexp(T(1), -816)*/,
|
||||
SC_(2.9833362924800826973163861261851735349505886138401627577086073332825113540280473219744699561601711213446046e-154) /*ldexp(T(1), -510)*/, std::numeric_limits<T>::max_exponent > 600 ? SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) : SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) } },
|
||||
{ { std::numeric_limits<T>::max_exponent > 600 ? SC_(-6.63922491020958873361985258190585784161991397158789903999305172750504449826065303423953127831536607086111661e181) /*-ldexp(T(1), 604)*/ : SC_(0.0),
|
||||
SC_(-2.2883557340936751629907904626893087059630763187242253081319190179713605588564915508590211920126569156532129e-246) /*-ldexp(T(1), -816)*/,
|
||||
SC_(-2.9833362924800826973163861261851735349505886138401627577086073332825113540280473219744699561601711213446046e-154) /*-ldexp(T(1), -510)*/,
|
||||
std::numeric_limits<T>::max_exponent > 600 ? SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) : SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) } },
|
||||
{ { SC_(-5.7456966998645880645292998187840197954917072165248345657117366246194931336885953843013801519761445019343718e-188) /*-ldexp(T(1), -622)*/, SC_(-1.4996968138956309548176444376280653535399616962391082979373344476177108558521903027709681283974148362424896e-241) /*-ldexp(T(1), -800)*/, SC_(1.83670992315982423120115083940975887159166493245638675235742454106002696789801120758056640625e-40) /*ldexp(T(1), -132)*/, SC_(-1.49969681389563095481764443762806535353996169623910829793733e-241) } },
|
||||
{ { SC_(-5.7456966998645880645292998187840197954917072165248345657117366246194931336885953843013801519761445019343718e-188) /*-ldexp(T(1), -622)*/, SC_(-1.4996968138956309548176444376280653535399616962391082979373344476177108558521903027709681283974148362424896e-241) /*-ldexp(T(1), -800)*/, SC_(-1.83670992315982423120115083940975887159166493245638675235742454106002696789801120758056640625e-40) /*-ldexp(T(1), -132)*/, SC_(-1.49969681389563095481764443762806535353996169623910829793733e-241) } },
|
||||
{ { SC_(-6.6243372842224761350235742755846980122105019136217468782770353048106301097687150169478930287429355091446506e-170) /*-ldexp(T(1), -562)*/, SC_(7.1746481373430634031294954664443705921549411424077607513961896135157303433516062796115875244140625e-43) /*ldexp(T(1), -140)*/, SC_(8.6361685550944446253863518628003995711160003644362813850237034701685918031624270579715075034722882265605472e-78) /*ldexp(T(1), -256)*/, SC_(7.174648137343063403129495466444370592154941142407760751e-43) } },
|
||||
{ { SC_(-6.6243372842224761350235742755846980122105019136217468782770353048106301097687150169478930287429355091446506e-170) /*-ldexp(T(1), -562)*/, SC_(-7.1746481373430634031294954664443705921549411424077607513961896135157303433516062796115875244140625e-43) /*-ldexp(T(1), -140)*/, SC_(8.6361685550944446253863518628003995711160003644362813850237034701685918031624270579715075034722882265605472e-78) /*ldexp(T(1), -256)*/, SC_(-7.17464813734306340312949546644437059215494114240776075e-43) } },
|
||||
{ { SC_(7.7868710555449746371177365743005823355489124613059339568813918517897390050405261457702973319275391516778931e-208) /*ldexp(T(1), -688)*/, SC_(-7.0747492803333690371164994460060873286582274985462017106114178827621104051506602458902589468444985151984003e-74) /*-ldexp(T(1), -243)*/, SC_(7.9654595556622613851444019888385590279555227759630939303694292669308145075652908047154493736009134297049172e-59) /*ldexp(T(1), -193)*/, SC_(-7.07474928033336903711649944600608732865822749854620171e-74) } },
|
||||
{ { SC_(-7.7868710555449746371177365743005823355489124613059339568813918517897390050405261457702973319275391516778931e-208) /*-ldexp(T(1), -688)*/, SC_(-7.0747492803333690371164994460060873286582274985462017106114178827621104051506602458902589468444985151984003e-74) /*-ldexp(T(1), -243)*/, SC_(7.9654595556622613851444019888385590279555227759630939303694292669308145075652908047154493736009134297049172e-59) /*ldexp(T(1), -193)*/, SC_(-7.07474928033336903711649944600608732865822749854620171e-74) } },
|
||||
// Special cases where k = 0:
|
||||
{ { SC_(0.5), SC_(1.0), SC_(0.0), SC_(1.17881507892743738986863357869566288974084658835353613038547) } },
|
||||
{ { SC_(-0.5), SC_(1.0), SC_(0.0), SC_(0.888286691263535380266337576823783210424994266596287990733270) } },
|
||||
@@ -146,16 +151,16 @@ void test_spots(T, const char* type_name)
|
||||
{ { SC_(1.0), SC_(-0.5), SC_(0.5), SC_(-0.55225234291197632914658859230278152249148960801635386133501) } },
|
||||
{ { SC_(1.0), SC_(2.0), SC_(0.5), SC_(-2.87534521505997989921579168327307068134740792740155171368532) } },
|
||||
{ { SC_(1.0), SC_(-2.0), SC_(0.5), SC_(2.87534521505997989921579168327307068134740792740155171368532) } },
|
||||
{ { SC_(1.0), SC_(2.0), ldexp(T(1), -200), SC_(-2.18503986326151899164330610231368254343201774622766316456295) } },
|
||||
{ { SC_(1.0), SC_(-2.0), ldexp(T(1), -200), SC_(2.18503986326151899164330610231368254343201774622766316456295) } },
|
||||
{ { SC_(1.0), ldexp(T(1.0), -150), ldexp(T(1), -200), SC_(7.006492321624085354618647916449580656401309709382578858e-46) } },
|
||||
{ { SC_(1.0), -ldexp(T(1.0), -150), ldexp(T(1), -200), SC_(-7.006492321624085354618647916449580656401309709382578858e-46) } },
|
||||
{ { SC_(1.0), SC_(2.0), SC_(6.2230152778611417071440640537801242405902521687211671331011166147896988340353834411839448231257136169569665e-61) /*ldexp(T(1), -200)*/, SC_(-2.18503986326151899164330610231368254343201774622766316456295) } },
|
||||
{ { SC_(1.0), SC_(-2.0), SC_(6.2230152778611417071440640537801242405902521687211671331011166147896988340353834411839448231257136169569665e-61) /*ldexp(T(1), -200)*/, SC_(2.18503986326151899164330610231368254343201774622766316456295) } },
|
||||
{ { SC_(1.0), SC_(7.00649232162408535461864791644958065640130970938257885878534141944895541342930300743319094181060791015625e-46) /*ldexp(T(1.0), -150)*/, SC_(6.2230152778611417071440640537801242405902521687211671331011166147896988340353834411839448231257136169569665e-61) /*ldexp(T(1), -200)*/, SC_(7.006492321624085354618647916449580656401309709382578858e-46) } },
|
||||
{ { SC_(1.0), SC_(-7.00649232162408535461864791644958065640130970938257885878534141944895541342930300743319094181060791015625e-46) /*ldexp(T(1.0), -150)*/, SC_(-6.2230152778611417071440640537801242405902521687211671331011166147896988340353834411839448231257136169569665e-61) /*-ldexp(T(1), -200)*/, SC_(-7.006492321624085354618647916449580656401309709382578858e-46) } },
|
||||
// Previously unsupported region with v > 1 and |phi| > PI/2, this is the only region
|
||||
// with high-ish error rates caused by argument reduction by Pi:
|
||||
{ { SC_(20.0), ldexp(T(1647611), -19), SC_(0.5), SC_(0.000975940902692994840122139131147517258405256880370413541280) } },
|
||||
{ { SC_(20.0), -ldexp(T(1647611), -19), SC_(0.5), SC_(-0.000975940902692994840122139131147517258405256880370413541280) } },
|
||||
{ { T(1.0) + ldexp(T(1), -6), ldexp(T(889085), -19), SC_(0.5), SC_(-27.1647225624906589308619292363045712770651414487085887109197) } },
|
||||
{ { T(1.0) + ldexp(T(1), -6), -ldexp(T(889085), -19), SC_(0.5), SC_(27.1647225624906589308619292363045712770651414487085887109197) } },
|
||||
{ { SC_(20.0), SC_(3.1425685882568359375) /*ldexp(T(1647611), -19)*/, SC_(0.5), SC_(0.000975940902692994840122139131147517258405256880370413541280) } },
|
||||
{ { SC_(20.0), SC_(-3.1425685882568359375) /*-ldexp(T(1647611), -19)*/, SC_(0.5), SC_(-0.000975940902692994840122139131147517258405256880370413541280) } },
|
||||
{ { SC_(1.015625) /*T(1.0) + ldexp(T(1), -6)*/, SC_(1.6957950592041015625) /*ldexp(T(889085), -19)*/, SC_(0.5), SC_(-27.1647225624906589308619292363045712770651414487085887109197) } },
|
||||
{ { SC_(1.015625) /*T(1.0) + ldexp(T(1), -6)*/, SC_(-1.6957950592041015625) /*-ldexp(T(889085), -19)*/, SC_(0.5), SC_(27.1647225624906589308619292363045712770651414487085887109197) } },
|
||||
// Phi = 0:
|
||||
{ { SC_(1.0), SC_(0.0), SC_(0.5), SC_(0.0) } },
|
||||
{ { SC_(-1.0), SC_(0.0), SC_(0.5), SC_(0.0) } },
|
||||
@@ -174,7 +179,7 @@ void test_spots(T, const char* type_name)
|
||||
do_test_ellint_pi3<T>(ellint_pi3_large_data, type_name, "Elliptic Integral PI: Large Random Data");
|
||||
|
||||
// function values calculated on http://functions.wolfram.com/
|
||||
static const boost::array<boost::array<T, 3>, 17> data2 = {{
|
||||
static const boost::array<boost::array<typename table_type<T>::type, 3>, 17> data2 = {{
|
||||
{{ SC_(0.0), SC_(0.2), SC_(1.586867847454166237308008033828114192951) }},
|
||||
{{ SC_(0.0), SC_(0.4), SC_(1.639999865864511206865258329748601457626) }},
|
||||
{{ SC_(0.0), SC_(0.0), SC_(1.57079632679489661923132169163975144209858469968755291048747) }},
|
||||
@@ -182,17 +187,17 @@ void test_spots(T, const char* type_name)
|
||||
{{ SC_(-4.0), SC_(0.3), SC_(0.712708870925620061597924858162260293305195624270730660081949) }},
|
||||
{{ SC_(-1e+05), SC_(-0.5), SC_(0.00496944596485066055800109163256108604615568144080386919012831) }},
|
||||
{{ SC_(-1e+10), SC_(-0.75), SC_(0.0000157080225184890546939710019277357161497407143903832703317801) }},
|
||||
{{ T(1) / 1024, SC_(-0.875), SC_(2.18674503176462374414944618968850352696579451638002110619287) }},
|
||||
{{ T(1023)/1024, SC_(-0.875), SC_(101.045289804941384100960063898569538919135722087486350366997) }},
|
||||
{{ SC_(0.0009765625) /*T(1) / 1024*/, SC_(-0.875), SC_(2.18674503176462374414944618968850352696579451638002110619287) }},
|
||||
{{ SC_(0.9990234375) /*T(1023)/1024*/, SC_(-0.875), SC_(101.045289804941384100960063898569538919135722087486350366997) }},
|
||||
// Bug cases from Rocco Romeo:
|
||||
{ { SC_(1e-175), T(0), SC_(1.57079632679489661923132169163975144209858469968755291048747) } },
|
||||
{ { SC_(1e-175), SC_(0.0), SC_(1.57079632679489661923132169163975144209858469968755291048747) } },
|
||||
{ { SC_(1e-170), SC_(1E-164), SC_(1.57079632679489661923132169163975144209858469968755291048747) } },
|
||||
{ { SC_(1e-170), SC_(-1E-164), SC_(1.57079632679489661923132169163975144209858469968755291048747) } },
|
||||
{ { -1.5f * ldexp(T(1), -52), SC_(-0.9375), SC_(2.48840049140103464299631535211815755485846563527849342319632) } },
|
||||
{ { -1.5f * ldexp(T(1), -52), SC_(0.9375), SC_(2.48840049140103464299631535211815755485846563527849342319632) } },
|
||||
{ { ldexp(T(1), -560), ldexp(T(1), -165), SC_(1.57079632679489661923132169163975144209858469968756130722545) } },
|
||||
{ { ldexp(T(1), -560), -ldexp(T(1), -165), SC_(1.57079632679489661923132169163975144209858469968754451374949) } },
|
||||
{ { std::numeric_limits<T>::max_exponent > 600 ? T(-ldexp(T(1), 600)) : 0, SC_(0.5), std::numeric_limits<T>::max_exponent > 600 ? SC_(7.71118598318249916481121898327895181916104121635240801895419e-91) : SC_(1.68575035481259604287120365779907698950080089414108904411995) } },
|
||||
{ { SC_(-3.3306690738754696212708950042724609375e-16) /*-1.5f * ldexp(T(1), -52)*/, SC_(-0.9375), SC_(2.48840049140103464299631535211815755485846563527849342319632) } },
|
||||
{ { SC_(-3.3306690738754696212708950042724609375e-16) /*-1.5f * ldexp(T(1), -52)*/, SC_(0.9375), SC_(2.48840049140103464299631535211815755485846563527849342319632) } },
|
||||
{ { SC_(2.6497349136889904540094297102338792048842007654486987513108141219242520439074860067791572114971742036578602e-169) /*ldexp(T(1), -560)*/, SC_(2.1382117680737565169124291737211855030521575040840389583695499937283189127897042869363986028474755585193634e-50) /*ldexp(T(1), -165)*/, SC_(1.57079632679489661923132169163975144209858469968756130722545) } },
|
||||
{ { SC_(2.6497349136889904540094297102338792048842007654486987513108141219242520439074860067791572114971742036578602e-169) /*ldexp(T(1), -560)*/, SC_(-2.1382117680737565169124291737211855030521575040840389583695499937283189127897042869363986028474755585193634e-50) /*-ldexp(T(1), -165)*/, SC_(1.57079632679489661923132169163975144209858469968754451374949) } },
|
||||
{ { std::numeric_limits<T>::max_exponent > 600 ? SC_(-4.14951556888099295851240786369116115101244623224243689999565732969065281141290814639970704894710379428819788e180) /*T(-ldexp(T(1), 600))*/ : SC_(0.0), SC_(0.5), std::numeric_limits<T>::max_exponent > 600 ? SC_(7.71118598318249916481121898327895181916104121635240801895419e-91) : SC_(1.68575035481259604287120365779907698950080089414108904411995) } },
|
||||
} };
|
||||
|
||||
do_test_ellint_pi2<T>(data2, type_name, "Complete Elliptic Integral PI: Mathworld Data");
|
||||
|
||||
@@ -71,9 +71,9 @@ void test_zeta(T, const char* name)
|
||||
#include "zeta_1_below_data.ipp"
|
||||
do_test_zeta<T>(zeta_1_below_data, name, "Zeta: Values close to and less than 1");
|
||||
|
||||
boost::array<boost::array<T, 2>, 90> integer_data = { {
|
||||
{ 2, SC_(1.6449340668482264364724151666460252) }, { 3, SC_(1.2020569031595942853997381615114500) }, { 4, SC_(1.0823232337111381915160036965411679) }, { 5, SC_(1.0369277551433699263313654864570342) }, { 6, SC_(1.0173430619844491397145179297909205) }, { 7, SC_(1.0083492773819228268397975498497968) }, { 8, SC_(1.0040773561979443393786852385086525) }, { 9, SC_(1.0020083928260822144178527692324121) }, { SC_(10.0), SC_(1.0009945751278180853371459589003190) }, { SC_(11.0), SC_(1.0004941886041194645587022825264699) }, { SC_(12.0), SC_(1.0002460865533080482986379980477397) }, { SC_(13.0), SC_(1.0001227133475784891467518365263574) }, { SC_(14.0), SC_(1.0000612481350587048292585451051353) }, { SC_(15.0), SC_(1.0000305882363070204935517285106451) }, { SC_(16.0), SC_(1.0000152822594086518717325714876367) }, { SC_(17.0), SC_(1.0000076371976378997622736002935630) }, { SC_(18.0), SC_(1.0000038172932649998398564616446219) }, { SC_(19.0), SC_(1.0000019082127165539389256569577951) }, { SC_(20.0), SC_(1.0000009539620338727961131520386834) }, { SC_(21.0), SC_(1.0000004769329867878064631167196044) }, { SC_(22.0), SC_(1.0000002384505027277329900036481868) }, { SC_(23.0), SC_(1.0000001192199259653110730677887189) }, { SC_(24.0), SC_(1.0000000596081890512594796124402079) }, { SC_(25.0), SC_(1.0000000298035035146522801860637051) }, { SC_(26.0), SC_(1.0000000149015548283650412346585066) }, { SC_(27.0), SC_(1.0000000074507117898354294919810042) }, { SC_(28.0), SC_(1.0000000037253340247884570548192040) }, { SC_(29.0), SC_(1.0000000018626597235130490064039099) }, { SC_(30.0), SC_(1.0000000009313274324196681828717647) }, { SC_(31.0), SC_(1.0000000004656629065033784072989233) }, { SC_(32.0), SC_(1.0000000002328311833676505492001456) }, { SC_(33.0), SC_(1.0000000001164155017270051977592974) }, { SC_(34.0), SC_(1.0000000000582077208790270088924369) }, { SC_(35.0), SC_(1.0000000000291038504449709968692943) }, { SC_(36.0), SC_(1.0000000000145519218910419842359296) }, { SC_(37.0), SC_(1.0000000000072759598350574810145209) }, { SC_(38.0), SC_(1.0000000000036379795473786511902372) }, { SC_(39.0), SC_(1.0000000000018189896503070659475848) }, { SC_(40.0), SC_(1.0000000000009094947840263889282533) }, { SC_(41.0), SC_(1.0000000000004547473783042154026799) }, { SC_(42.0), SC_(1.0000000000002273736845824652515227) }, { SC_(43.0), SC_(1.0000000000001136868407680227849349) }, { SC_(44.0), SC_(1.0000000000000568434198762758560928) }, { SC_(45.0), SC_(1.0000000000000284217097688930185546) }, { SC_(46.0), SC_(1.0000000000000142108548280316067698) }, { SC_(47.0), SC_(1.0000000000000071054273952108527129) }, { SC_(48.0), SC_(1.0000000000000035527136913371136733) }, { SC_(49.0), SC_(1.0000000000000017763568435791203275) }, { SC_(50.0), SC_(1.0000000000000008881784210930815903) }, { SC_(51.0), SC_(1.0000000000000004440892103143813364) }, { SC_(52.0), SC_(1.0000000000000002220446050798041984) }, { SC_(53.0), SC_(1.0000000000000001110223025141066134) }, { SC_(54.0), SC_(1.0000000000000000555111512484548124) }, { SC_(55.0), SC_(1.0000000000000000277555756213612417) }, { SC_(56.0), SC_(1.0000000000000000138777878097252328) }, { SC_(57.0), SC_(1.0000000000000000069388939045441537) }, { SC_(58.0), SC_(1.0000000000000000034694469521659226) }, { SC_(59.0), SC_(1.0000000000000000017347234760475766) }, { SC_(60.0), SC_(1.0000000000000000008673617380119934) },
|
||||
{ SC_(-61.0), SC_(-3.3066089876577576725680214670439210e34) }, { SC_(-59.0), SC_(3.5666582095375556109684574608651829e32) }, { SC_(-57.0), SC_(-4.1147288792557978697665486067619336e30) }, { SC_(-55.0), SC_(5.0890659468662289689766332915911925e28) }, { SC_(-53.0), SC_(-6.7645882379292820990945242301798478e26) }, { SC_(-51.0), SC_(9.6899578874635940656497942894654088e24) }, { SC_(-49.0), SC_(-1.5001733492153928733711440151515152e23) }, { SC_(-47.0), SC_(2.5180471921451095697089023320225526e21) }, { SC_(-45.0), SC_(-4.5979888343656503490437943262411348e19) }, { SC_(-43.0), SC_(9.1677436031953307756992753623188406e17) }, { SC_(-41.0), SC_(-2.0040310656516252738108421663238939e16) }, { SC_(-39.0), SC_(4.8241448354850170371581670362158167e14) }, { SC_(-37.0), SC_(-1.2850850499305083333333333333333333e13) }, { SC_(-35.0), SC_(3.8087931125245368811553022079337869e11) }, { SC_(-33.0), SC_(-1.2635724795916666666666666666666667e10) }, { SC_(-31.0), SC_(4.7238486772162990196078431372549020e8) }, { SC_(-29.0), SC_(-2.0052695796688078946143462272494531e7) }, { SC_(-27.0), SC_(974936.82385057471264367816091954023) }, { SC_(-25.0), SC_(-54827.583333333333333333333333333333) }, { SC_(-23.0), SC_(3607.5105463980463980463980463980464) }, { SC_(-21.0), SC_(-281.46014492753623188405797101449275) }, { SC_(-19.0), SC_(26.456212121212121212121212121212121) }, { SC_(-17.0), SC_(-3.0539543302701197438039543302701197) }, { SC_(-15.0), SC_(0.44325980392156862745098039215686275) }, { SC_(-13.0), SC_(-0.083333333333333333333333333333333333) }, { SC_(-11.0), SC_(0.021092796092796092796092796092796093) }, { -9, SC_(-0.0075757575757575757575757575757575758) }, { -7, SC_(0.0041666666666666666666666666666666667) }, { -5, SC_(-0.0039682539682539682539682539682539683) }, { -3, SC_(0.0083333333333333333333333333333333333) }, { -1, SC_(-0.083333333333333333333333333333333333) }
|
||||
boost::array<boost::array<typename table_type<T>::type, 2>, 90> integer_data = { {
|
||||
{ SC_(2.0), SC_(1.6449340668482264364724151666460252) }, { SC_(3.0), SC_(1.2020569031595942853997381615114500) }, { SC_(4.0), SC_(1.0823232337111381915160036965411679) }, { SC_(5.0), SC_(1.0369277551433699263313654864570342) }, { SC_(6.0), SC_(1.0173430619844491397145179297909205) }, { SC_(7.0), SC_(1.0083492773819228268397975498497968) }, { SC_(8.0), SC_(1.0040773561979443393786852385086525) }, { SC_(9.0), SC_(1.0020083928260822144178527692324121) }, { SC_(10.0), SC_(1.0009945751278180853371459589003190) }, { SC_(11.0), SC_(1.0004941886041194645587022825264699) }, { SC_(12.0), SC_(1.0002460865533080482986379980477397) }, { SC_(13.0), SC_(1.0001227133475784891467518365263574) }, { SC_(14.0), SC_(1.0000612481350587048292585451051353) }, { SC_(15.0), SC_(1.0000305882363070204935517285106451) }, { SC_(16.0), SC_(1.0000152822594086518717325714876367) }, { SC_(17.0), SC_(1.0000076371976378997622736002935630) }, { SC_(18.0), SC_(1.0000038172932649998398564616446219) }, { SC_(19.0), SC_(1.0000019082127165539389256569577951) }, { SC_(20.0), SC_(1.0000009539620338727961131520386834) }, { SC_(21.0), SC_(1.0000004769329867878064631167196044) }, { SC_(22.0), SC_(1.0000002384505027277329900036481868) }, { SC_(23.0), SC_(1.0000001192199259653110730677887189) }, { SC_(24.0), SC_(1.0000000596081890512594796124402079) }, { SC_(25.0), SC_(1.0000000298035035146522801860637051) }, { SC_(26.0), SC_(1.0000000149015548283650412346585066) }, { SC_(27.0), SC_(1.0000000074507117898354294919810042) }, { SC_(28.0), SC_(1.0000000037253340247884570548192040) }, { SC_(29.0), SC_(1.0000000018626597235130490064039099) }, { SC_(30.0), SC_(1.0000000009313274324196681828717647) }, { SC_(31.0), SC_(1.0000000004656629065033784072989233) }, { SC_(32.0), SC_(1.0000000002328311833676505492001456) }, { SC_(33.0), SC_(1.0000000001164155017270051977592974) }, { SC_(34.0), SC_(1.0000000000582077208790270088924369) }, { SC_(35.0), SC_(1.0000000000291038504449709968692943) }, { SC_(36.0), SC_(1.0000000000145519218910419842359296) }, { SC_(37.0), SC_(1.0000000000072759598350574810145209) }, { SC_(38.0), SC_(1.0000000000036379795473786511902372) }, { SC_(39.0), SC_(1.0000000000018189896503070659475848) }, { SC_(40.0), SC_(1.0000000000009094947840263889282533) }, { SC_(41.0), SC_(1.0000000000004547473783042154026799) }, { SC_(42.0), SC_(1.0000000000002273736845824652515227) }, { SC_(43.0), SC_(1.0000000000001136868407680227849349) }, { SC_(44.0), SC_(1.0000000000000568434198762758560928) }, { SC_(45.0), SC_(1.0000000000000284217097688930185546) }, { SC_(46.0), SC_(1.0000000000000142108548280316067698) }, { SC_(47.0), SC_(1.0000000000000071054273952108527129) }, { SC_(48.0), SC_(1.0000000000000035527136913371136733) }, { SC_(49.0), SC_(1.0000000000000017763568435791203275) }, { SC_(50.0), SC_(1.0000000000000008881784210930815903) }, { SC_(51.0), SC_(1.0000000000000004440892103143813364) }, { SC_(52.0), SC_(1.0000000000000002220446050798041984) }, { SC_(53.0), SC_(1.0000000000000001110223025141066134) }, { SC_(54.0), SC_(1.0000000000000000555111512484548124) }, { SC_(55.0), SC_(1.0000000000000000277555756213612417) }, { SC_(56.0), SC_(1.0000000000000000138777878097252328) }, { SC_(57.0), SC_(1.0000000000000000069388939045441537) }, { SC_(58.0), SC_(1.0000000000000000034694469521659226) }, { SC_(59.0), SC_(1.0000000000000000017347234760475766) }, { SC_(60.0), SC_(1.0000000000000000008673617380119934) },
|
||||
{ SC_(-61.0), SC_(-3.3066089876577576725680214670439210e34) }, { SC_(-59.0), SC_(3.5666582095375556109684574608651829e32) }, { SC_(-57.0), SC_(-4.1147288792557978697665486067619336e30) }, { SC_(-55.0), SC_(5.0890659468662289689766332915911925e28) }, { SC_(-53.0), SC_(-6.7645882379292820990945242301798478e26) }, { SC_(-51.0), SC_(9.6899578874635940656497942894654088e24) }, { SC_(-49.0), SC_(-1.5001733492153928733711440151515152e23) }, { SC_(-47.0), SC_(2.5180471921451095697089023320225526e21) }, { SC_(-45.0), SC_(-4.5979888343656503490437943262411348e19) }, { SC_(-43.0), SC_(9.1677436031953307756992753623188406e17) }, { SC_(-41.0), SC_(-2.0040310656516252738108421663238939e16) }, { SC_(-39.0), SC_(4.8241448354850170371581670362158167e14) }, { SC_(-37.0), SC_(-1.2850850499305083333333333333333333e13) }, { SC_(-35.0), SC_(3.8087931125245368811553022079337869e11) }, { SC_(-33.0), SC_(-1.2635724795916666666666666666666667e10) }, { SC_(-31.0), SC_(4.7238486772162990196078431372549020e8) }, { SC_(-29.0), SC_(-2.0052695796688078946143462272494531e7) }, { SC_(-27.0), SC_(974936.82385057471264367816091954023) }, { SC_(-25.0), SC_(-54827.583333333333333333333333333333) }, { SC_(-23.0), SC_(3607.5105463980463980463980463980464) }, { SC_(-21.0), SC_(-281.46014492753623188405797101449275) }, { SC_(-19.0), SC_(26.456212121212121212121212121212121) }, { SC_(-17.0), SC_(-3.0539543302701197438039543302701197) }, { SC_(-15.0), SC_(0.44325980392156862745098039215686275) }, { SC_(-13.0), SC_(-0.083333333333333333333333333333333333) }, { SC_(-11.0), SC_(0.021092796092796092796092796092796093) }, { SC_(-9.0), SC_(-0.0075757575757575757575757575757575758) }, { SC_(-7.0), SC_(0.0041666666666666666666666666666666667) }, { SC_(-5.0), SC_(-0.0039682539682539682539682539682539683) }, { SC_(-3.0), SC_(0.0083333333333333333333333333333333333) }, { SC_(-1.0), SC_(-0.083333333333333333333333333333333333) }
|
||||
} };
|
||||
do_test_zeta<T>(integer_data, name, "Zeta: Integer arguments");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user