Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80065 - in trunk: boost/math/distributions boost/math/special_functions libs/math/test
From: john_at_[hidden]
Date: 2012-08-17 07:18:21


Author: johnmaddock
Date: 2012-08-17 07:18:18 EDT (Fri, 17 Aug 2012)
New Revision: 80065
URL: http://svn.boost.org/trac/boost/changeset/80065

Log:
Fix numerical stability problem in incomplete beta: ibeta_fraction2 sometimes has catastrophic cancellation errors when a and b are large and x is near 1.
Change non central t series termination conditions to check for divergent series.
Update tests with new larger test values.
Added:
   trunk/libs/math/test/nct_asym.ipp (contents, props changed)
Text files modified:
   trunk/boost/math/distributions/non_central_t.hpp | 12 ++
   trunk/boost/math/special_functions/beta.hpp | 10 +-
   trunk/libs/math/test/nct_small_delta.ipp | 133 ++++++++++++++++++++++++---------------
   trunk/libs/math/test/test_nc_t.cpp | 14 +++
   4 files changed, 107 insertions(+), 62 deletions(-)

Modified: trunk/boost/math/distributions/non_central_t.hpp
==============================================================================
--- trunk/boost/math/distributions/non_central_t.hpp (original)
+++ trunk/boost/math/distributions/non_central_t.hpp 2012-08-17 07:18:18 EDT (Fri, 17 Aug 2012)
@@ -68,18 +68,21 @@
             // direction for recursion:
             //
             boost::uintmax_t count = 0;
+ T last_term = 0;
             for(int i = k; i >= 0; --i)
             {
                T term = beta * pois;
                sum += term;
                // Don't terminate on first term in case we "fixed" k above:
- if((i != k) && fabs(term/sum) < errtol)
+ if((fabs(last_term) > fabs(term)) && fabs(term/sum) < errtol)
                   break;
+ last_term = term;
                pois *= (i + 0.5f) / d2;
                beta += xterm;
                xterm *= (i) / (x * (n / 2 + i - 1));
                ++count;
             }
+ last_term = 0;
             for(int i = k + 1; ; ++i)
             {
                poisf *= d2 / (i + 0.5f);
@@ -87,8 +90,9 @@
                betaf -= xtermf;
                T term = poisf * betaf;
                sum += term;
- if(fabs(term/sum) < errtol)
+ if((fabs(last_term) > fabs(term)) && (fabs(term/sum) < errtol))
                   break;
+ last_term = term;
                ++count;
                if(count > max_iter)
                {
@@ -166,6 +170,7 @@
             // Fused forward and backwards recursion:
             //
             boost::uintmax_t count = 0;
+ T last_term = 0;
             for(int i = k + 1, j = k; ; ++i, --j)
             {
                poisf *= d2 / (i + 0.5f);
@@ -183,8 +188,9 @@
 
                sum += term;
                // Don't terminate on first term in case we "fixed" the value of k above:
- if((j != k) && fabs(term/sum) < errtol)
+ if((fabs(last_term) > fabs(term)) && fabs(term/sum) < errtol)
                   break;
+ last_term = term;
                if(count > max_iter)
                {
                   return policies::raise_evaluation_error(

Modified: trunk/boost/math/special_functions/beta.hpp
==============================================================================
--- trunk/boost/math/special_functions/beta.hpp (original)
+++ trunk/boost/math/special_functions/beta.hpp 2012-08-17 07:18:18 EDT (Fri, 17 Aug 2012)
@@ -597,7 +597,7 @@
 {
    typedef std::pair<T, T> result_type;
 
- ibeta_fraction2_t(T a_, T b_, T x_) : a(a_), b(b_), x(x_), m(0) {}
+ ibeta_fraction2_t(T a_, T b_, T x_, T y_) : a(a_), b(b_), x(x_), y(y_), m(0) {}
 
    result_type operator()()
    {
@@ -607,7 +607,7 @@
 
       T bN = m;
       bN += (m * (b - m) * x) / (a + 2*m - 1);
- bN += ((a + m) * (a - (a + b) * x + 1 + m *(2 - x))) / (a + 2*m + 1);
+ bN += ((a + m) * (a * y - b * x + 1 + m *(2 - x))) / (a + 2*m + 1);
 
       ++m;
 
@@ -615,7 +615,7 @@
    }
 
 private:
- T a, b, x;
+ T a, b, x, y;
    int m;
 };
 //
@@ -635,8 +635,10 @@
    if(result == 0)
       return result;
 
- ibeta_fraction2_t<T> f(a, b, x);
+ ibeta_fraction2_t<T> f(a, b, x, y);
    T fract = boost::math::tools::continued_fraction_b(f, boost::math::policies::get_epsilon<T, Policy>());
+ BOOST_MATH_INSTRUMENT_VARIABLE(fract);
+ BOOST_MATH_INSTRUMENT_VARIABLE(result);
    return result / fract;
 }
 //

Added: trunk/libs/math/test/nct_asym.ipp
==============================================================================
--- (empty file)
+++ trunk/libs/math/test/nct_asym.ipp 2012-08-17 07:18:18 EDT (Fri, 17 Aug 2012)
@@ -0,0 +1,33 @@
+#ifndef SC_
+# define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
+#endif
+ static const boost::array<boost::array<T, 5>, 26> nct_asym = {{
+ { SC_(4536808851374080), SC_(0.45368087291717529296875), SC_(-0.481173217296600341796875), SC_(0.1749317497754352460810908541491372795891542325487), SC_(0.8250682502245647539189091458508627204108457674513) },
+ { SC_(4536808851374080), SC_(0.45368087291717529296875), SC_(1.3978519439697265625), SC_(0.82745888213761221622777144575509830758765026825781), SC_(0.17254111786238778377222855424490169241234973174219) },
+ { SC_(5677385198338048), SC_(0.56773853302001953125), SC_(-0.5258305072784423828125), SC_(0.13707201688604064907083148328658590547016675560101), SC_(0.86292798311395935092916851671341409452983324439899) },
+ { SC_(5677385198338048), SC_(0.56773853302001953125), SC_(0.708383023738861083984375), SC_(0.55592460048261968604418681822217801676118984510485), SC_(0.44407539951738031395581318177782198323881015489515) },
+ { SC_(19057916648620032), SC_(1.905791759490966796875), SC_(3.123167514801025390625), SC_(0.88826935840310006680843037482396692978657176631796), SC_(0.11173064159689993319156962517603307021342823368204) },
+ { SC_(19057916648620032), SC_(1.905791759490966796875), SC_(3.3844356536865234375), SC_(0.93038224262142835995452986318222481740507172432515), SC_(0.069617757378571640045470136817775182594928275674854) },
+ { SC_(36700173421772800), SC_(3.670017242431640625), SC_(4.6750431060791015625), SC_(0.84255780194329132905115240305424746317298104246855), SC_(0.15744219805670867094884759694575253682701895753145) },
+ { SC_(36700173421772800), SC_(3.670017242431640625), SC_(5.042537689208984375), SC_(0.91504926091817108755289153804799207257503305462555), SC_(0.084950739081828912447108461952007927424966945374453) },
+ { SC_(45079461342740480), SC_(4.507946014404296875), SC_(3.3889064788818359375), SC_(0.13156163646802619543156433884136170088487556815931), SC_(0.86843836353197380456843566115863829911512443184069) },
+ { SC_(45079461342740480), SC_(4.507946014404296875), SC_(5.9973297119140625), SC_(0.93180682050435927369046460493686411555287073533266), SC_(0.068193179495640726309535395063135884447129264667335) },
+ { SC_(157509421545553920), SC_(15.750942230224609375), SC_(17.14560699462890625), SC_(0.91844152246389020936377208106238904518645300898785), SC_(0.081558477536109790636227918937610954813546991012154) },
+ { SC_(157509421545553920), SC_(15.750942230224609375), SC_(17.1575450897216796875), SC_(0.92022740765138483503818882082673489052943410104556), SC_(0.079772592348615164961811179173265109470565898954439) },
+ { SC_(306140114898124800), SC_(30.614013671875), SC_(31.8541412353515625), SC_(0.89253589230213680868361632253582462638850083853234), SC_(0.10746410769786319131638367746417537361149916146766) },
+ { SC_(306140114898124800), SC_(30.614013671875), SC_(32.01709747314453125), SC_(0.91970407450026572598532504589599032507374844769296), SC_(0.080295925499734274014674954104009674926251552307043) },
+ { SC_(390730904542117888), SC_(39.073089599609375), SC_(38.045928955078125), SC_(0.15217241315852103004776349323469720103276253578469), SC_(0.84782758684147896995223650676530279896723746421531) },
+ { SC_(390730904542117888), SC_(39.073089599609375), SC_(38.2361907958984375), SC_(0.20132472643110592660423913551748708698902279471476), SC_(0.79867527356889407339576086448251291301097720528524) },
+ { SC_(1044709769224388608), SC_(104.470977783203125), SC_(104.8680572509765625), SC_(0.65434556985043816570960826185482905142969403857975), SC_(0.34565443014956183429039173814517094857030596142025) },
+ { SC_(1044709769224388608), SC_(104.470977783203125), SC_(105.14849090576171875), SC_(0.75095977650749132960934905238656630719173158415557), SC_(0.24904022349250867039065094761343369280826841584443) },
+ { SC_(1674453679643557888), SC_(167.44537353515625), SC_(166.869873046875), SC_(0.28247643026063070467278298745564297946418695359089), SC_(0.71752356973936929532721701254435702053581304640911) },
+ { SC_(1674453679643557888), SC_(167.44537353515625), SC_(168.857147216796875), SC_(0.92099169494016061238522995952802645037178736022794), SC_(0.079008305059839387614770040471973549628212639772055) },
+ { SC_(2809703283612975104), SC_(280.9703369140625), SC_(279.762969970703125), SC_(0.11364543011784098836896955307019184576823123795544), SC_(0.88635456988215901163103044692980815423176876204456) },
+ { SC_(2809703283612975104), SC_(280.9703369140625), SC_(282.413665771484375), SC_(0.92553607281289461499104965729721028764390548597727), SC_(0.074463927187105385008950342702789712356094514022729) },
+ { SC_(7921767423114477568), SC_(792.1767578125), SC_(792.31842041015625), SC_(0.5563267401667033086322021527186481547238720682263), SC_(0.4436732598332966913677978472813518452761279317737) },
+ { SC_(7921767423114477568), SC_(792.1767578125), SC_(793.54827880859375), SC_(0.91489369852628004292795662749916567238372650186026), SC_(0.085106301473719957072043372500834327616273498139738) },
+ { SC_(13091821180254420992), SC_(1309.18212890625), SC_(1308.01171875), SC_(0.12091797523015676375913420093212297337117969426545), SC_(0.87908202476984323624086579906787702662882030573455) },
+ { SC_(13091821180254420992), SC_(1309.18212890625), SC_(1308.517578125), SC_(0.25316892936238242974380182772830364755920164172871), SC_(0.74683107063761757025619817227169635244079835827129) }
+ }};
+//#undef SC_
+

Modified: trunk/libs/math/test/nct_small_delta.ipp
==============================================================================
--- trunk/libs/math/test/nct_small_delta.ipp (original)
+++ trunk/libs/math/test/nct_small_delta.ipp 2012-08-17 07:18:18 EDT (Fri, 17 Aug 2012)
@@ -1,59 +1,86 @@
 #ifndef SC_
 # define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
 #endif
- static const boost::array<boost::array<T, 5>, 52> nct_small_delta = {{
- { SC_(528154.0625), SC_(0.5281540482737767661092220805585384368896484375e-10), SC_(-0.0438658893108367919921875), SC_(0.48250566102131993419090032097993141749629366237354), SC_(0.51749433897868006580909967902006858250370633762646) },
- { SC_(528154.0625), SC_(0.5281540482737767661092220805585384368896484375e-10), SC_(0.944180071353912353515625), SC_(0.82746096542548677580028882735723708488758715357832), SC_(0.17253903457451322419971117264276291511241284642168) },
- { SC_(660934.625), SC_(0.6609346403507743161753751337528228759765625e-10), SC_(-1.09356248378753662109375), SC_(0.13707365461620354384117941652933126383612908392123), SC_(0.86292634538379645615882058347066873616387091607877) },
- { SC_(660934.625), SC_(0.6609346403507743161753751337528228759765625e-10), SC_(0.8943269252777099609375), SC_(0.81442633822735887388224244171117444649106453395369), SC_(0.18557366177264112611775755828882555350893546604631) },
- { SC_(2218633.5), SC_(0.221863361016261251279502175748348236083984375e-9), SC_(0.900856673717498779296875), SC_(0.81616768606164643627773468420573729773227964864232), SC_(0.18383231393835356372226531579426270226772035135768) },
- { SC_(2218633.5), SC_(0.221863361016261251279502175748348236083984375e-9), SC_(1.2173912525177001953125), SC_(0.88827224039054756935944165341219624193195834170515), SC_(0.11172775960945243064055834658780375806804165829485) },
- { SC_(4272462.5), SC_(0.427246238388079291325993835926055908203125e-9), SC_(-0.608891189098358154296875), SC_(0.27129829842994003638790396047987351547260466368909), SC_(0.72870170157005996361209603952012648452739533631091) },
- { SC_(4272462.5), SC_(0.427246238388079291325993835926055908203125e-9), SC_(1.00504648685455322265625), SC_(0.84256273846140526398141847027259437264491990536997), SC_(0.15743726153859473601858152972740562735508009463003) },
- { SC_(5247940), SC_(0.524793986045324345468543469905853271484375e-9), SC_(-1.11901676654815673828125), SC_(0.13156651861218774164823859585016794860626893918254), SC_(0.86843348138781225835176140414983205139373106081746) },
- { SC_(5247940), SC_(0.524793986045324345468543469905853271484375e-9), SC_(-1.0743181705474853515625), SC_(0.14134007648961033259203628094925336577210835950473), SC_(0.85865992351038966740796371905074663422789164049527) },
- { SC_(18336510), SC_(0.1833651008809056293102912604808807373046875e-8), SC_(-1.48560678958892822265625), SC_(0.068691587407182335464773960988799828434588100829723), SC_(0.93130841259281766453522603901120017156541189917028) },
- { SC_(18336510), SC_(0.1833651008809056293102912604808807373046875e-8), SC_(1.40664613246917724609375), SC_(0.92023381810537925932116820364336353453322062034513), SC_(0.079766181894620740678831796356636465466779379654875) },
- { SC_(35639400), SC_(0.3563940254025510512292385101318359375e-8), SC_(-0.2346564829349517822265625), SC_(0.40723768241459441841438282814230236027330099372549), SC_(0.59276231758540558158561717185769763972669900627451) },
- { SC_(35639400), SC_(0.3563940254025510512292385101318359375e-8), SC_(1.24018728733062744140625), SC_(0.89254693057186762829174224773340895165093032749745), SC_(0.10745306942813237170825775226659104834906967250255) },
- { SC_(45487064), SC_(0.4548706300511184963397681713104248046875e-8), SC_(-1.162539005279541015625), SC_(0.12250829730838957792258003981798522875055846989729), SC_(0.87749170269161042207741996018201477124944153010271) },
- { SC_(45487064), SC_(0.4548706300511184963397681713104248046875e-8), SC_(-0.8368303775787353515625), SC_(0.20134396068806204684905953847272082011338589718573), SC_(0.79865603931193795315094046152727917988661410281427) },
- { SC_(121620224), SC_(0.12162022500206148833967745304107666015625e-7), SC_(0.39718806743621826171875), SC_(0.6543856047457196617262494109772647455321658941725), SC_(0.3456143952542803382737505890227352544678341058275) },
- { SC_(121620224), SC_(0.12162022500206148833967745304107666015625e-7), SC_(1.24731695652008056640625), SC_(0.89385934536068351965787494087690986211211985166153), SC_(0.10614065463931648034212505912309013788788014833847) },
- { SC_(194932064), SC_(0.1949320704852652852423489093780517578125e-7), SC_(-0.575359284877777099609375), SC_(0.28252416082756836234341731346566281326700494104297), SC_(0.71747583917243163765658268653433718673299505895703) },
- { SC_(194932064), SC_(0.1949320704852652852423489093780517578125e-7), SC_(0.4194296896457672119140625), SC_(0.66254892777524155315670363767975247199405361778407), SC_(0.33745107222475844684329636232024752800594638221593) },
- { SC_(327092512), SC_(0.327092521956728887744247913360595703125e-7), SC_(-1.2071979045867919921875), SC_(0.11367796276232027931825008133662930047269775407393), SC_(0.88632203723767972068174991866337069952730224592607) },
- { SC_(327092512), SC_(0.327092521956728887744247913360595703125e-7), SC_(0.876802742481231689453125), SC_(0.80970309616765211535813735932417404262765601883988), SC_(0.19029690383234788464186264067582595737234398116012) },
- { SC_(922215104), SC_(0.922215122045599855482578277587890625e-7), SC_(0.141965448856353759765625), SC_(0.55644631504480191279462370740448518366492417190403), SC_(0.44355368495519808720537629259551481633507582809597) },
- { SC_(922215104), SC_(0.922215122045599855482578277587890625e-7), SC_(1.13559567928314208984375), SC_(0.87193707155023294863968629343839663906062875149397), SC_(0.12806292844976705136031370656160336093937124850603) },
- { SC_(1524088576), SC_(0.15240885886669275350868701934814453125e-6), SC_(-0.664114892482757568359375), SC_(0.25330834087624892647434930428222142994198568419577), SC_(0.74669165912375107352565069571777857005801431580423) },
- { SC_(1524088576), SC_(0.15240885886669275350868701934814453125e-6), SC_(1.37886774539947509765625), SC_(0.91603220911482167517950113163803628076090836350073), SC_(0.083967790885178324820498868361963719239091636499269) },
- { SC_(2833322752), SC_(0.2833322696460527367889881134033203125e-6), SC_(-0.934321820735931396484375), SC_(0.1750688828424918771805411797628815067286394341076), SC_(0.8249311171575081228194588202371184932713605658924) },
- { SC_(2833322752), SC_(0.2833322696460527367889881134033203125e-6), SC_(0.01152040623128414154052734375), SC_(0.50459576244612621592734255378527979154430257136497), SC_(0.49540423755387378407265744621472020845569742863503) },
- { SC_(7376104448), SC_(0.737610434953239746391773223876953125e-6), SC_(0.14150333404541015625), SC_(0.55626354548618560623653714942035371801766096231359), SC_(0.44373645451381439376346285057964628198233903768641) },
- { SC_(7376104448), SC_(0.737610434953239746391773223876953125e-6), SC_(0.46808087825775146484375), SC_(0.68013635973699279491605645205785045329423814366365), SC_(0.31986364026300720508394354794214954670576185633635) },
- { SC_(19005597696), SC_(0.190055970961111597716808319091796875e-5), SC_(0.89516448974609375), SC_(0.81464991000540683634213811269861642939018294670759), SC_(0.18535008999459316365786188730138357060981705329241) },
- { SC_(19005597696), SC_(0.190055970961111597716808319091796875e-5), SC_(1.48002254962921142578125), SC_(0.93056613193114394805618686943760965268036694876176), SC_(0.069433868068856051943813130562390347319633051238245) },
- { SC_(37336477696), SC_(0.37336476452765055000782012939453125e-5), SC_(-1.39093267917633056640625), SC_(0.08212235488316398659317034137786838544688552825868), SC_(0.91787764511683601340682965862213161455311447174132) },
- { SC_(37336477696), SC_(0.37336476452765055000782012939453125e-5), SC_(1.37445271015167236328125), SC_(0.91534882988245816934090108875322008488528628081311), SC_(0.084651170117541830659098911246779915114713719186888) },
- { SC_(76158959616), SC_(0.7615895810886286199092864990234375e-5), SC_(-0.4133583009243011474609375), SC_(0.33966927100300125337615080987310920514534610032036), SC_(0.66033072899699874662384919012689079485465389967964) },
- { SC_(76158959616), SC_(0.7615895810886286199092864990234375e-5), SC_(1.4921436309814453125), SC_(0.93216825396603974510969367870165246570825488483101), SC_(0.067831746033960254890306321298347534291745115168994) },
- { SC_(149909094400), SC_(0.149909101310186088085174560546875e-4), SC_(1.0512597560882568359375), SC_(0.85342690591562485295243723515889796180107709178638), SC_(0.14657309408437514704756276484110203819892290821362) },
- { SC_(149909094400), SC_(0.149909101310186088085174560546875e-4), SC_(1.39853727817535400390625), SC_(0.91902185764013358458014118954726949359893649842036), SC_(0.080978142359866415419858810452730506401063501579643) },
- { SC_(300246401024), SC_(0.300246392725966870784759521484375e-4), SC_(-0.858747541904449462890625), SC_(0.19523162330012228777050408978728209345121805498577), SC_(0.80476837669987771222949591021271790654878194501423) },
- { SC_(300246401024), SC_(0.300246392725966870784759521484375e-4), SC_(1.40856420993804931640625), SC_(0.92051352414116507572847602921599610498310359056324), SC_(0.079486475858834924271523970784003895016896409436761) },
- { SC_(353275379712), SC_(0.3532753908075392246246337890625e-4), SC_(-1.0212171077728271484375), SC_(0.15356742764115001237771940686359565408937029456416), SC_(0.84643257235884998762228059313640434591062970543584) },
- { SC_(353275379712), SC_(0.3532753908075392246246337890625e-4), SC_(1.30792331695556640625), SC_(0.90454434807153994552344182822189877220821074884107), SC_(0.09545565192846005447655817177810122779178925115893) },
- { SC_(0.105336832e13), SC_(0.0001053368323482573032379150390625), SC_(0.554341971874237060546875), SC_(0.71029154537084727662513596094978928595259300760913), SC_(0.28970845462915272337486403905021071404740699239087) },
- { SC_(0.105336832e13), SC_(0.0001053368323482573032379150390625), SC_(0.68778026103973388671875), SC_(0.75417124280258349801796658501621988164110540869668), SC_(0.24582875719741650198203341498378011835889459130332) },
- { SC_(2405508317184), SC_(0.0002405508421361446380615234375), SC_(0.5517151355743408203125), SC_(0.70934580778979545712784947970550407070754829519999), SC_(0.29065419221020454287215052029449592929245170480001) },
- { SC_(2405508317184), SC_(0.0002405508421361446380615234375), SC_(1.42728817462921142578125), SC_(0.92321691603357102065464321251307839682832539201822), SC_(0.076783083966428979345356787486921603171674607981778) },
- { SC_(4836693114880), SC_(0.000483669340610504150390625), SC_(-0.2817919254302978515625), SC_(0.38886609876734874792671065039736370377189209526496), SC_(0.61113390123265125207328934960263629622810790473504) },
- { SC_(4836693114880), SC_(0.000483669340610504150390625), SC_(1.46532154083251953125), SC_(0.92851742167955783637755823728448115497442142134004), SC_(0.071482578320442163622441762715518845025578578659958) },
- { SC_(9556477345792), SC_(0.000955647788941860198974609375), SC_(0.804133951663970947265625), SC_(0.78906415810449876562078794471829514693427758064696), SC_(0.21093584189550123437921205528170485306572241935304) },
- { SC_(9556477345792), SC_(0.000955647788941860198974609375), SC_(1.4024145603179931640625), SC_(0.91946155703754481352479238346787859905335082869119), SC_(0.080538442962455186475207616532121400946649171308807) },
- { SC_(10838489432064), SC_(0.00108384899795055389404296875), SC_(-1.13749277591705322265625), SC_(0.12743989126870304346542317478912987226157104995751), SC_(0.87256010873129695653457682521087012773842895004249) },
- { SC_(10838489432064), SC_(0.00108384899795055389404296875), SC_(0.75486361980438232421875), SC_(0.77450926357298223779984584559741400272890293481015), SC_(0.22549073642701776220015415440258599727109706518985) }
+ static const boost::array<boost::array<T, 5>, 78> nct_small_delta = {{
+ { SC_(528154.0625), SC_(0.5281540482737767661092220805585384368896484375e-10), SC_(-0.043873153626918792724609375), SC_(0.48250276576722336046483816401534117826515884583867), SC_(0.51749723423277663953516183598465882173484115416133) },
+ { SC_(528154.0625), SC_(0.5281540482737767661092220805585384368896484375e-10), SC_(0.729398787021636962890625), SC_(0.76712095847007040756161950500140014007502095546645), SC_(0.23287904152992959243838049499859985992497904453355) },
+ { SC_(528154.0625), SC_(0.5281540482737767661092220805585384368896484375e-10), SC_(0.944172799587249755859375), SC_(0.82745910775138122060234718854881274437593644597231), SC_(0.17254089224861877939765281145118725562406355402769) },
+ { SC_(660934.625), SC_(0.6609346403507743161753751337528228759765625e-10), SC_(-1.09357059001922607421875), SC_(0.13707187615241828790447496643413251920933193961981), SC_(0.86292812384758171209552503356586748079066806038019) },
+ { SC_(660934.625), SC_(0.6609346403507743161753751337528228759765625e-10), SC_(-0.075724057853221893310546875), SC_(0.46981932920499526656408951192932529155640100686028), SC_(0.53018067079500473343591048807067470844359899313972) },
+ { SC_(660934.625), SC_(0.6609346403507743161753751337528228759765625e-10), SC_(0.894318759441375732421875), SC_(0.8144241543253204424707276799726958127232605442998), SC_(0.1855758456746795575292723200273041872767394557002) },
+ { SC_(2218633.5), SC_(0.221863361016261251279502175748348236083984375e-9), SC_(-0.32331907749176025390625), SC_(0.37322681889304995092918136348422956501557638199648), SC_(0.62677318110695004907081863651577043498442361800352) },
+ { SC_(2218633.5), SC_(0.221863361016261251279502175748348236083984375e-9), SC_(0.900841772556304931640625), SC_(0.81616372411403034488699018804029514822710817134975), SC_(0.18383627588596965511300981195970485177289182865025) },
+ { SC_(2218633.5), SC_(0.221863361016261251279502175748348236083984375e-9), SC_(1.21737635135650634765625), SC_(0.88826940695840047354018486823128837280979546898275), SC_(0.11173059304159952645981513176871162719020453101725) },
+ { SC_(4272462.5), SC_(0.427246238388079291325993835926055908203125e-9), SC_(-0.608911812305450439453125), SC_(0.27129146314707937854382467984874644387201484012076), SC_(0.72870853685292062145617532015125355612798515987924) },
+ { SC_(4272462.5), SC_(0.427246238388079291325993835926055908203125e-9), SC_(-0.233737051486968994140625), SC_(0.40759456615456790965120565572754800087372105257581), SC_(0.59240543384543209034879434427245199912627894742419) },
+ { SC_(4272462.5), SC_(0.427246238388079291325993835926055908203125e-9), SC_(1.0050258636474609375), SC_(0.84255777338099392090018173116713612691826495532429), SC_(0.15744222661900607909981826883286387308173504467571) },
+ { SC_(5247940), SC_(0.524793986045324345468543469905853271484375e-9), SC_(-1.11903965473175048828125), SC_(0.13156163653841524718807085637540033587741857268684), SC_(0.86843836346158475281192914362459966412258142731316) },
+ { SC_(5247940), SC_(0.524793986045324345468543469905853271484375e-9), SC_(-1.0743410587310791015625), SC_(0.14133494913380490957172969254766861098247075035799), SC_(0.85866505086619509042827030745233138901752924964201) },
+ { SC_(5247940), SC_(0.524793986045324345468543469905853271484375e-9), SC_(0.466433703899383544921875), SC_(0.67954744448251303029682738870296370754546775710788), SC_(0.32045255551748696970317261129703629245453224289212) },
+ { SC_(18336510), SC_(0.1833651008809056293102912604808807373046875e-8), SC_(-1.485649585723876953125), SC_(0.068685924351077450776106805057666756267354379116941), SC_(0.93131407564892254922389319494233324373264562088306) },
+ { SC_(18336510), SC_(0.1833651008809056293102912604808807373046875e-8), SC_(-0.978404521942138671875), SC_(0.1639371522987393851111295873413950142583525211773), SC_(0.8360628477012606148888704126586049857416474788227) },
+ { SC_(18336510), SC_(0.1833651008809056293102912604808807373046875e-8), SC_(1.406603336334228515625), SC_(0.92022746964275550779312032818254511021364287700111), SC_(0.079772530357244492206879671817454889786357122998891) },
+ { SC_(35639400), SC_(0.3563940254025510512292385101318359375e-8), SC_(-0.9864399433135986328125), SC_(0.16195863866320448164806483040777245446296140149356), SC_(0.83804136133679551835193516959222754553703859850644) },
+ { SC_(35639400), SC_(0.3563940254025510512292385101318359375e-8), SC_(-0.2347161769866943359375), SC_(0.40721451480880048322798573509892024502193304263547), SC_(0.59278548519119951677201426490107975497806695736453) },
+ { SC_(35639400), SC_(0.3563940254025510512292385101318359375e-8), SC_(1.2401275634765625), SC_(0.89253588756079690951410755269677773042628883005293), SC_(0.10746411243920309048589244730322226957371116994707) },
+ { SC_(45487064), SC_(0.4548706300511184963397681713104248046875e-8), SC_(-1.1626064777374267578125), SC_(0.12249460282273418971343108523190852402322477087166), SC_(0.87750539717726581028656891476809147597677522912834) },
+ { SC_(45487064), SC_(0.4548706300511184963397681713104248046875e-8), SC_(-0.83689785003662109375), SC_(0.20132499540381076102236383246070664744644381565087), SC_(0.79867500459618923897763616753929335255355618434913) },
+ { SC_(45487064), SC_(0.4548706300511184963397681713104248046875e-8), SC_(-0.594260692596435546875), SC_(0.27616888228432564767719590034089174423793663334908), SC_(0.72383111771567435232280409965910825576206336665092) },
+ { SC_(121620224), SC_(0.12162022500206148833967745304107666015625e-7), SC_(0.3970777988433837890625), SC_(0.65434494968481063069505183722213499438179132868887), SC_(0.34565505031518936930494816277786500561820867131113) },
+ { SC_(121620224), SC_(0.12162022500206148833967745304107666015625e-7), SC_(0.61813831329345703125), SC_(0.73175791107603006961198160308845586981919324758164), SC_(0.26824208892396993038801839691154413018080675241836) },
+ { SC_(121620224), SC_(0.12162022500206148833967745304107666015625e-7), SC_(1.24720668792724609375), SC_(0.8938391359252750533876681559850381133400744586929), SC_(0.1061608640747249466123318440149618866599255413071) },
+ { SC_(194932064), SC_(0.1949320704852652852423489093780517578125e-7), SC_(-0.575498878955841064453125), SC_(0.28247696804790908448299598525508816339233446215666), SC_(0.71752303195209091551700401474491183660766553784334) },
+ { SC_(194932064), SC_(0.1949320704852652852423489093780517578125e-7), SC_(0.4192900955677032470703125), SC_(0.66249792556950493924206051736760665840039674490309), SC_(0.33750207443049506075793948263239334159960325509691) },
+ { SC_(194932064), SC_(0.1949320704852652852423489093780517578125e-7), SC_(0.891839683055877685546875), SC_(0.81376056011022270595841292021652342060820308429614), SC_(0.18623943988977729404158707978347657939179691570386) },
+ { SC_(327092512), SC_(0.327092521956728887744247913360595703125e-7), SC_(-1.404501438140869140625), SC_(0.080084787472122488844415495242012312453561424134301), SC_(0.9199152125278775111555845047579876875464385758657) },
+ { SC_(327092512), SC_(0.327092521956728887744247913360595703125e-7), SC_(-1.20737874507904052734375), SC_(0.11364315277765295082194817827847616199631048415041), SC_(0.88635684722234704917805182172152383800368951584959) },
+ { SC_(327092512), SC_(0.327092521956728887744247913360595703125e-7), SC_(0.8766219615936279296875), SC_(0.80965398752936883769527309841930163032620924932467), SC_(0.19034601247063116230472690158069836967379075067533) },
+ { SC_(922215104), SC_(0.922215122045599855482578277587890625e-7), SC_(-0.550348579883575439453125), SC_(0.29104012336625227702044178467603355057145302194928), SC_(0.70895987663374772297955821532396644942854697805072) },
+ { SC_(922215104), SC_(0.922215122045599855482578277587890625e-7), SC_(0.1416618525981903076171875), SC_(0.55632640945989957068387202865702682448619885466383), SC_(0.44367359054010042931612797134297317551380114533617) },
+ { SC_(922215104), SC_(0.922215122045599855482578277587890625e-7), SC_(1.13529217243194580078125), SC_(0.87187352013277999854694556458228781398877720084173), SC_(0.12812647986722000145305443541771218601122279915827) },
+ { SC_(1524088576), SC_(0.15240885886669275350868701934814453125e-6), SC_(-0.669230878353118896484375), SC_(0.25167405732584667576513293514194252242977450905894), SC_(0.74832594267415332423486706485805747757022549094106) },
+ { SC_(1524088576), SC_(0.15240885886669275350868701934814453125e-6), SC_(-0.66450512409210205078125), SC_(0.25318348652085408643723791160561950141473919546181), SC_(0.74681651347914591356276208839438049858526080453819) },
+ { SC_(1524088576), SC_(0.15240885886669275350868701934814453125e-6), SC_(1.37847745418548583984375), SC_(0.9159720143264452800722709073773563686088927059612), SC_(0.084027985673554719927729092622643631391107294038796) },
+ { SC_(2833322752), SC_(0.2833322696460527367889881134033203125e-6), SC_(-0.9348537921905517578125), SC_(0.17493175360129918436210468793967574035560766123375), SC_(0.82506824639870081563789531206032425964439233876625) },
+ { SC_(2833322752), SC_(0.2833322696460527367889881134033203125e-6), SC_(0.01098839938640594482421875), SC_(0.50438353586498884681723519205661827951453610911603), SC_(0.49561646413501115318276480794338172048546389088397) },
+ { SC_(2833322752), SC_(0.2833322696460527367889881134033203125e-6), SC_(1.11728668212890625), SC_(0.86806405541813070462577859975991426774401640081913), SC_(0.13193594458186929537422140024008573225598359918087) },
+ { SC_(7376104448), SC_(0.737610434953239746391773223876953125e-6), SC_(-1.36148512363433837890625), SC_(0.086680099352107115152692238918143641020516123095345), SC_(0.91331990064789288484730776108185635897948387690466) },
+ { SC_(7376104448), SC_(0.737610434953239746391773223876953125e-6), SC_(0.1406452357769012451171875), SC_(0.55592460342263048867879490949555684169178196778873), SC_(0.44407539657736951132120509050444315830821803221127) },
+ { SC_(7376104448), SC_(0.737610434953239746391773223876953125e-6), SC_(0.4672227799892425537109375), SC_(0.6798294875609898291245772837764000326600691290926), SC_(0.3201705124390101708754227162235999673399308709074) },
+ { SC_(19005597696), SC_(0.190055970961111597716808319091796875e-5), SC_(-1.0526561737060546875), SC_(0.14624886521046919412989626895906939222407293206212), SC_(0.85375113478953080587010373104093060777592706793788) },
+ { SC_(19005597696), SC_(0.190055970961111597716808319091796875e-5), SC_(0.893787801265716552734375), SC_(0.81428177283808104910080873651678647035668255855401), SC_(0.18571822716191895089919126348321352964331744144599) },
+ { SC_(19005597696), SC_(0.190055970961111597716808319091796875e-5), SC_(1.478645801544189453125), SC_(0.9303822435208431945428692571159084817569960338472), SC_(0.069617756479156805457130742884091518243003966152798) },
+ { SC_(37336477696), SC_(0.37336476452765055000782012939453125e-5), SC_(-1.39286124706268310546875), SC_(0.081830311952030386950958528699491776784138181119043), SC_(0.91816968804796961304904147130050822321586181888096) },
+ { SC_(37336477696), SC_(0.37336476452765055000782012939453125e-5), SC_(-1.2086009979248046875), SC_(0.11340736887699187293262662688976277518450464408822), SC_(0.88659263112300812706737337311023722481549535591178) },
+ { SC_(37336477696), SC_(0.37336476452765055000782012939453125e-5), SC_(1.37252414226531982421875), SC_(0.91504925497864847245117739324928896561477482544626), SC_(0.084950745021351527548822606750711034385225174553738) },
+ { SC_(76158959616), SC_(0.7615895810886286199092864990234375e-5), SC_(-0.4161103665828704833984375), SC_(0.33866183595792209794153109645293698407273819046339), SC_(0.66133816404207790205846890354706301592726180953661) },
+ { SC_(76158959616), SC_(0.7615895810886286199092864990234375e-5), SC_(1.48221313953399658203125), SC_(0.93085719135108164633155760685918105899871704889272), SC_(0.069142808648918353668442393140818941001282951107282) },
+ { SC_(76158959616), SC_(0.7615895810886286199092864990234375e-5), SC_(1.4893915653228759765625), SC_(0.93180685365187513633521575127608504580804034566387), SC_(0.068193146348124863664784248723914954191959654336133) },
+ { SC_(149909094400), SC_(0.149909101310186088085174560546875e-4), SC_(0.97038853168487548828125), SC_(0.83406983375988250630225384732975974640680046980811), SC_(0.16593016624011749369774615267024025359319953019189) },
+ { SC_(149909094400), SC_(0.149909101310186088085174560546875e-4), SC_(1.04740297794342041015625), SC_(0.85253966501367083089932755397065936180784831841043), SC_(0.14746033498632916910067244602934063819215168158957) },
+ { SC_(149909094400), SC_(0.149909101310186088085174560546875e-4), SC_(1.394680500030517578125), SC_(0.91844163480163429797669181827603427319262632792639), SC_(0.08155836519836570202330818172396572680737367207361) },
+ { SC_(300246401024), SC_(0.300246392725966870784759521484375e-4), SC_(-0.864196956157684326171875), SC_(0.19373160667651853950263712162705732018958798823552), SC_(0.80626839332348146049736287837294267981041201176448) },
+ { SC_(300246401024), SC_(0.300246392725966870784759521484375e-4), SC_(0.965739905834197998046875), SC_(0.83290531317191357846564987870102532533516215684712), SC_(0.16709468682808642153435012129897467466483784315288) },
+ { SC_(300246401024), SC_(0.300246392725966870784759521484375e-4), SC_(1.403114795684814453125), SC_(0.91970421907553442085361472793817522857066471337247), SC_(0.080295780924465579146385272061824771429335286627532) },
+ { SC_(353275379712), SC_(0.3532753908075392246246337890625e-4), SC_(-1.02712547779083251953125), SC_(0.15217237530683021166365655887378113611916101492035), SC_(0.84782762469316978833634344112621886388083898507965) },
+ { SC_(353275379712), SC_(0.3532753908075392246246337890625e-4), SC_(0.584521234035491943359375), SC_(0.72055327773828199091011436164660463547526546920033), SC_(0.27944672226171800908988563835339536452473453079967) },
+ { SC_(353275379712), SC_(0.3532753908075392246246337890625e-4), SC_(1.30201494693756103515625), SC_(0.90353832363228799912881142113287687617562615688939), SC_(0.096461676367712000871188578867123123824373843110611) },
+ { SC_(0.105336832e13), SC_(0.0001053368323482573032379150390625), SC_(-1.12434637546539306640625), SC_(0.13041072232576106505759370992705369062839357686989), SC_(0.86958927767423893494240629007294630937160642313011) },
+ { SC_(0.105336832e13), SC_(0.0001053368323482573032379150390625), SC_(0.544183909893035888671875), SC_(0.70680629772915567856214841102838580323130470572332), SC_(0.29319370227084432143785158897161419676869529427668) },
+ { SC_(0.105336832e13), SC_(0.0001053368323482573032379150390625), SC_(0.67762219905853271484375), SC_(0.75096096245833210774398163041302339076159056835009), SC_(0.24903903754166789225601836958697660923840943164991) },
+ { SC_(2405508317184), SC_(0.0002405508421361446380615234375), SC_(-0.54846096038818359375), SC_(0.29160515445821290109615211658532752777534929659883), SC_(0.70839484554178709890384788341467247222465070340117) },
+ { SC_(2405508317184), SC_(0.0002405508421361446380615234375), SC_(0.53644597530364990234375), SC_(0.70409170751851223796496285006888224216192038796279), SC_(0.29590829248148776203503714993111775783807961203721) },
+ { SC_(2405508317184), SC_(0.0002405508421361446380615234375), SC_(1.4120190143585205078125), SC_(0.92099239916220010887823964338845316029716642789693), SC_(0.079007600837799891121760356611546839702833572103074) },
+ { SC_(4836693114880), SC_(0.000483669340610504150390625), SC_(-0.30330073833465576171875), SC_(0.38064607328786833329129434720920126565403722909458), SC_(0.61935392671213166670870565279079873434596277090542) },
+ { SC_(4836693114880), SC_(0.000483669340610504150390625), SC_(0.79173374176025390625), SC_(0.78560096142991773065052672400091405076291446132892), SC_(0.21439903857008226934947327599908594923708553867108) },
+ { SC_(4836693114880), SC_(0.000483669340610504150390625), SC_(1.44381272792816162109375), SC_(0.92553610113350895085593676928879838003706656547384), SC_(0.074463898866491049144063230711201619962933434526164) },
+ { SC_(9556477345792), SC_(0.000955647788941860198974609375), SC_(0.774176061153411865234375), SC_(0.78030402643947053525294588392940945045026100828356), SC_(0.21969597356052946474705411607059054954973899171644) },
+ { SC_(9556477345792), SC_(0.000955647788941860198974609375), SC_(1.35162198543548583984375), SC_(0.91159882995045713756961834701249644548104352714108), SC_(0.088401170049542862430381652987503554518956472858921) },
+ { SC_(9556477345792), SC_(0.000955647788941860198974609375), SC_(1.37245666980743408203125), SC_(0.91489058742913963764590136168317114106740895702093), SC_(0.085109412570860362354098638316828858932591042979068) },
+ { SC_(10838489432064), SC_(0.00108384899795055389404296875), SC_(-1.1693308353424072265625), SC_(0.12091706455667160284074085853324054976433257083915), SC_(0.87908293544332839715925914146675945023566742916085) },
+ { SC_(10838489432064), SC_(0.00108384899795055389404296875), SC_(-0.02714899368584156036376953125), SC_(0.48873822149228296214357093419224183546582949284801), SC_(0.51126177850771703785642906580775816453417050715199) },
+ { SC_(10838489432064), SC_(0.00108384899795055389404296875), SC_(0.723025619983673095703125), SC_(0.76483486081732755088858031522414884241973724382194), SC_(0.23516513918267244911141968477585115758026275617806) }
    }};
 //#undef SC_
 
+

Modified: trunk/libs/math/test/test_nc_t.cpp
==============================================================================
--- trunk/libs/math/test/test_nc_t.cpp (original)
+++ trunk/libs/math/test/test_nc_t.cpp 2012-08-17 07:18:18 EDT (Fri, 17 Aug 2012)
@@ -99,6 +99,13 @@
       "[^|]*", // stdlib
       "[^|]*", // platform
       largest_type, // test type(s)
+ "[^|]*large[^|]*", // test data group
+ "[^|]*", 1500, 300); // test function
+ add_expected_result(
+ "[^|]*", // compiler
+ "[^|]*", // stdlib
+ "[^|]*", // platform
+ largest_type, // test type(s)
       "[^|]*", // test data group
       "[^|]*", 250, 50); // test function
 
@@ -497,8 +504,11 @@
        // without numeric_limits and lanczos support:
        //
 #include "nct_small_delta.ipp"
- do_test_nc_t<T>(nct_small_delta, type_name, "Non Central T (large parameters)");
- quantile_sanity_check<T>(nct_small_delta, type_name, "Non Central T (large parameters)");
+ do_test_nc_t<T>(nct_small_delta, type_name, "Non Central T (small non-centrality)");
+ quantile_sanity_check<T>(nct_small_delta, type_name, "Non Central T (small non-centrality)");
+#include "nct_asym.ipp"
+ do_test_nc_t<T>(nct_asym, type_name, "Non Central T (large parameters)");
+ quantile_sanity_check<T>(nct_asym, type_name, "Non Central T (large parameters)");
     }
 }
 


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk