Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r75831 - sandbox/math_constants/boost/math/constants
From: pbristow_at_[hidden]
Date: 2011-12-06 13:04:49


Author: pbristow
Date: 2011-12-06 13:04:48 EST (Tue, 06 Dec 2011)
New Revision: 75831
URL: http://svn.boost.org/trac/boost/changeset/75831

Log:
Major Update with more text and 60 constants.
Text files modified:
   sandbox/math_constants/boost/math/constants/calculate_constants.hpp | 433 ++++++++++++++++++++++++++++++++++++++++
   sandbox/math_constants/boost/math/constants/constants.hpp | 90 ++++++--
   sandbox/math_constants/boost/math/constants/info.hpp | 45 +++
   3 files changed, 540 insertions(+), 28 deletions(-)

Modified: sandbox/math_constants/boost/math/constants/calculate_constants.hpp
==============================================================================
--- sandbox/math_constants/boost/math/constants/calculate_constants.hpp (original)
+++ sandbox/math_constants/boost/math/constants/calculate_constants.hpp 2011-12-06 13:04:48 EST (Tue, 06 Dec 2011)
@@ -1,4 +1,6 @@
 // Copyright John Maddock 2010.
+// Copyright Paul A. Bristow 2011.
+
 // Use, modification and distribution are subject to the
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@@ -159,6 +161,14 @@
    return sqrt(static_cast<T>(2));
 }
 
+
+template <class T, int N>
+inline T calculate_root_three(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return sqrt(static_cast<T>(3));
+}
+
 template <class T, int N>
 inline T calculate_half_root_two(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
 {
@@ -200,6 +210,20 @@
 }
 
 template <class T, int N>
+inline T calculate_two_thirds(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(2) / static_cast<T>(3);
+}
+
+template <class T, int N>
+inline T calculate_three_quarters(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(3) / static_cast<T>(4);
+}
+
+template <class T, int N>
 inline T calculate_pi_minus_three(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
 {
    return pi<T, policies::policy<policies::digits2<N> > >() - static_cast<T>(3);
@@ -225,6 +249,7 @@
    return exp(static_cast<T>(-0.5));
 }
 
+// Pi
 template <class T, int N>
 inline T calculate_one_div_root_two(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
 {
@@ -232,11 +257,419 @@
 }
 
 template <class T, int N>
+inline T calculate_one_div_root_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ return static_cast<T>(1) / root_pi<T, policies::policy<policies::digits2<N> > >();
+}
+
+template <class T, int N>
 inline T calculate_one_div_root_two_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
 {
    return static_cast<T>(1) / root_two_pi<T, policies::policy<policies::digits2<N> > >();
 }
 
+template <class T, int N>
+inline T calculate_root_one_div_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ return sqrt(static_cast<T>(1) / pi<T, policies::policy<policies::digits2<N> > >());
+}
+
+
+template <class T, int N>
+inline T calculate_four_thirds_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() * static_cast<T>(4) / static_cast<T>(3);
+}
+
+template <class T, int N>
+inline T calculate_half_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() / static_cast<T>(2);
+}
+
+
+template <class T, int N>
+inline T calculate_third_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() / static_cast<T>(3);
+}
+
+template <class T, int N>
+inline T calculate_sixth_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() / static_cast<T>(6);
+}
+
+template <class T, int N>
+inline T calculate_two_thirds_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() * static_cast<T>(2) / static_cast<T>(3);
+}
+
+template <class T, int N>
+inline T calculate_three_quarters_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >() * static_cast<T>(3) / static_cast<T>(4);
+}
+
+template <class T, int N>
+inline T calculate_pi_pow_e(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pow(pi<T, policies::policy<policies::digits2<N> > >(), e<T, policies::policy<policies::digits2<N> > >()); //
+}
+
+template <class T, int N>
+inline T calculate_pi_sqr(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >() ; //
+}
+
+template <class T, int N>
+inline T calculate_pi_sqr_div_six(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >()
+ / static_cast<T>(6); //
+}
+
+
+template <class T, int N>
+inline T calculate_pi_cubed(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >()
+ ; //
+}
+
+template <class T, int N>
+inline T calculate_cbrt_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pow(pi<T, policies::policy<policies::digits2<N> > >(), static_cast<T>(-3));
+}
+
+template <class T, int N>
+inline T calculate_one_div_cbrt_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(1)
+ / pow(pi<T, policies::policy<policies::digits2<N> > >(), static_cast<T>(-3));
+}
+
+// Euler's e
+
+template <class T, int N>
+inline T calculate_e_pow_pi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pow(e<T, policies::policy<policies::digits2<N> > >(), pi<T, policies::policy<policies::digits2<N> > >()); //
+}
+
+template <class T, int N>
+inline T calculate_root_e(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return sqrt(e<T, policies::policy<policies::digits2<N> > >());
+}
+
+template <class T, int N>
+inline T calculate_log10_e(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return log10(e<T, policies::policy<policies::digits2<N> > >());
+}
+
+template <class T, int N>
+inline T calculate_one_div_log10_e(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(1) /
+ log10(e<T, policies::policy<policies::digits2<N> > >());
+}
+
+// Trigonometric
+
+template <class T, int N>
+inline T calculate_degree(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return pi<T, policies::policy<policies::digits2<N> > >()
+ / static_cast<T>(180)
+ ; //
+}
+
+template <class T, int N>
+inline T calculate_radian(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(180)
+ / pi<T, policies::policy<policies::digits2<N> > >()
+ ; //
+}
+
+template <class T, int N>
+inline T calculate_sin_one(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return sin(static_cast<T>(1)) ; //
+}
+
+template <class T, int N>
+inline T calculate_cos_one(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return cos(static_cast<T>(1)) ; //
+}
+
+template <class T, int N>
+inline T calculate_sinh_one(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return sinh(static_cast<T>(1)) ; //
+}
+
+template <class T, int N>
+inline T calculate_cosh_one(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return cosh(static_cast<T>(1)) ; //
+}
+
+template <class T, int N>
+inline T calculate_phi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return (static_cast<T>(1) + sqrt(static_cast<T>(5)) )/static_cast<T>(2) ; //
+}
+
+template <class T, int N>
+inline T calculate_log_phi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ //return log(phi<T, policies::policy<policies::digits2<N> > >()); // ???
+ return log((static_cast<T>(1) + sqrt(static_cast<T>(5)) )/static_cast<T>(2) );
+}
+template <class T, int N>
+inline T calculate_one_div_log_phi(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ return static_cast<T>(1) /
+ log((static_cast<T>(1) + sqrt(static_cast<T>(5)) )/static_cast<T>(2) );
+}
+
+// Euler-Mascheroni's Gamma Constant
+
+//http://en.wikipedia.org/wiki/Euler%E2%80%93Mascheroni_constant
+
+//http://en.wikipedia.org/wiki/Gamma_function
+
+template <class T, int N>
+inline T calculate_gamma(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ // 1000 digits from http://www.wolframalpha.com
+ T gamma(
+ "0.577215664901532860606512090082402431042159335939923598805767234884867726"
+ "777664670936947063291746749514631447249807082480960504014486542836224173"
+ "997644923536253500333742937337737673942792595258247094916008735203948165"
+ "670853233151776611528621199501507984793745085705740029921354786146694029"
+ "604325421519058775535267331399254012967420513754139549111685102807984234"
+ "877587205038431093997361372553060889331267600172479537836759271351577226"
+ "102734929139407984301034177717780881549570661075010161916633401522789358"
+ "679654972520362128792265559536696281763887927268013243101047650596370394"
+ "739495763890657296792960100901512519595092224350140934987122824794974719"
+ "564697631850667612906381105182419744486783638086174945516989279230187739"
+ "107294578155431600500218284409605377243420328547836701517739439870030237"
+ "033951832869000155819398804270741154222781971652301107356583396734871765"
+ "049194181230004065469314299929777956930310050308630341856980323108369164"
+ "0025892970890985486825777364288253954925873629596133298574739302"
+);
+ // T gamma("0.57721566490153286060651209008240243104215933593992");
+ return gamma;
+}
+
+template <class T, int N>
+inline T calculate_one_div_gamma(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+
+ return static_cast<T>(1)
+ / gamma<T, policies::policy<policies::digits2<N> > >();
+}
+
+
+template <class T, int N>
+inline T calculate_gamma_sqr(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+
+ return gamma<T, policies::policy<policies::digits2<N> > >()
+ * gamma<T, policies::policy<policies::digits2<N> > >();
+}
+
+// Continued fraction
+template <class T, int N>
+inline T calculate_cf10(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+ T cf10("1.030640834100712935881776094116936840925");
+ return cf10;
+}
+
+//Zeta
+
+template <class T, int N>
+inline T calculate_zeta_two(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ BOOST_MATH_STD_USING
+
+ return pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >()
+ /static_cast<T>(6);
+}
+
+template <class T, int N>
+inline T calculate_zeta_three(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{
+ // http://oeis.org/A002117/constant
+ T zeta3("1.20205690315959428539973816151144999076"
+ "4986292340498881792271555341838205786313"
+ "09018645587360933525814619915");
+ return zeta3;
+}
+
+template <class T, int N>
+inline T calculate_catalan(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{ // http://oeis.org/A006752/constant
+ T c("0.915965594177219015054603514932384110774"
+ "1493742816721342664981196217630197762547"
+ "69479356512926115106248574");
+ return c;
+}
+
+
+template <class T, int N>
+inline T calculate_khinchin(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{ // from e_float constants.cpp
+ T k( "2.6854520010653064453097148354817956938203822939944629530511523455572188595371520028011411749318476979"
+"9515346590528809008289767771641096305179253348325966838185231542133211949962603932852204481940961806"
+"8664166428930847788062036073705350103367263357728904990427070272345170262523702354581068631850103237"
+"4655803775026442524852869468234189949157306618987207994137235500057935736698933950879021244642075289"
+"7414591476930184490506017934993852254704042033779856398310157090222339100002207725096513324604444391"
+"9169146085968234821283246228292710126906974182348477675457348986254203392662351862086778136650969658"
+"3146995271837448054012195366666049648269890827548115254721177330319675947383719393578106059230401890"
+"7113496246737068412217946810740608918276695667117166837405904739368809534504899970471763904513432323"
+"7715103219651503824698888324870935399469608264781812056634946712578436664579740977848366204977774868"
+"2765697087163192938512899314199518611673792654620563505951385713761697126872299805327673278710513763"
+"9563719023145289003058136910904799672757571385043565050641590820999623402779053834180985121278529455");
+ return k;
+}
+
+template <class T, int N>
+inline T calculate_extreme_value_skewness(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{ // from e_float constants.cpp
+ // Mathematica: N[12 Sqrt[6] Zeta[3]/Pi^3, 1101]
+
+T ev(
+"1.1395470994046486574927930193898461120875997958365518247216557100852480077060706857071875468869385150"
+"1894272048688553376986765366075828644841024041679714157616857834895702411080704529137366329462558680"
+"2015498788776135705587959418756809080074611906006528647805347822929577145038743873949415294942796280"
+"0895597703063466053535550338267721294164578901640163603544404938283861127819804918174973533694090594"
+"3094963822672055237678432023017824416203652657301470473548274848068762500300316769691474974950757965"
+"8640779777748741897542093874605477776538884083378029488863880220988107155275203245233994097178778984"
+"3488995668362387892097897322246698071290011857605809901090220903955815127463328974447572119951192970"
+"3684453635456559086126406960279692862247058250100678008419431185138019869693206366891639436908462809"
+"9756051372711251054914491837034685476095423926553367264355374652153595857163724698198860485357368964"
+"3807049634423621246870868566707915720704996296083373077647528285782964567312903914752617978405994377"
+"9064157147206717895272199736902453130842229559980076472936976287378945035706933650987259357729800315");
+
+return ev;
+}
+
+template <class T, int N>
+inline T calculate_glaisher(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{ // from http://mpmath.googlecode.com/svn/data/glaisher.txt
+ // 20,000 digits of the Glaisher-Kinkelin constant A = exp(1/2 - zeta'(-1))
+ // Computed using A = exp((6 (-zeta'(2))/pi^2 + log 2 pi + gamma)/12)
+ // with Euler-Maclaurin summation for zeta'(2).
+
+ T g(
+"1.282427129100622636875342568869791727767688927325001192063740021740406308858826"
+"46112973649195820237439420646120399000748933157791362775280404159072573861727522"
+"14334327143439787335067915257366856907876561146686449997784962754518174312394652"
+"76128213808180219264516851546143919901083573730703504903888123418813674978133050"
+"93770833682222494115874837348064399978830070125567001286994157705432053927585405"
+"81731588155481762970384743250467775147374600031616023046613296342991558095879293"
+"36343887288701988953460725233184702489001091776941712153569193674967261270398013"
+"52652668868978218897401729375840750167472114895288815996668743164513890306962645"
+"59870469543740253099606800842447417554061490189444139386196089129682173528798629"
+"88434220366989900606980888785849587494085307347117090132667567503310523405221054"
+"14176776156308191919997185237047761312315374135304725819814797451761027540834943"
+"14384965234139453373065832325673954957601692256427736926358821692159870775858274"
+"69575162841550648585890834128227556209547002918593263079373376942077522290940187");
+
+ return g;
+}
+
+template <class T, int N>
+inline T calculate_rayleigh_skewness(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{ // From e_float
+ // 1100 digits of the Rayleigh distribution skewness
+ // Mathematica: N[2 Sqrt[Pi] (Pi - 3)/((4 - Pi)^(3/2)), 1100]
+
+
+T rs(
+ "0.6311106578189371381918993515442277798440422031347194976580945856929268196174737254599050270325373067"
+ "9440004726436754739597525250317640394102954301685809920213808351450851396781817932734836994829371322"
+ "5797376021347531983451654130317032832308462278373358624120822253764532674177325950686466133508511968"
+ "2389168716630349407238090652663422922072397393006683401992961569208109477307776249225072042971818671"
+ "4058887072693437217879039875871765635655476241624825389439481561152126886932506682176611183750503553"
+ "1218982627032068396407180216351425758181396562859085306247387212297187006230007438534686340210168288"
+ "8956816965453815849613622117088096547521391672977226658826566757207615552041767516828171274858145957"
+ "6137539156656005855905288420585194082284972984285863898582313048515484073396332610565441264220790791"
+ "0194897267890422924599776483890102027823328602965235306539844007677157873140562950510028206251529523"
+ "7428049693650605954398446899724157486062545281504433364675815915402937209673727753199567661561209251"
+ "4695589950526053470201635372590001578503476490223746511106018091907936826431407434894024396366284848"); ;
+ return rs;
+}
+
+template <class T, int N>
+inline T calculate_rayleigh_kurtosis_excess(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{ // - (6 Pi^2 - 24 Pi + 16)/((Pi - 4)^2)
+ return - (((static_cast<T>(6) * pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >())
+ - (static_cast<T>(24) * pi<T, policies::policy<policies::digits2<N> > >()) + static_cast<T>(16) )
+ /
+ ((pi<T, policies::policy<policies::digits2<N> > >() - static_cast<T>(4))
+ * (pi<T, policies::policy<policies::digits2<N> > >() - static_cast<T>(4)))
+ );
+}
+
+template <class T, int N>
+inline T calculate_rayleigh_kurtosis(const mpl::int_<N>&BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(T))
+{ // 3 - (6 Pi^2 - 24 Pi + 16)/((Pi - 4)^2)
+ return static_cast<T>(3) - (((static_cast<T>(6) * pi<T, policies::policy<policies::digits2<N> > >()
+ * pi<T, policies::policy<policies::digits2<N> > >())
+ - (static_cast<T>(24) * pi<T, policies::policy<policies::digits2<N> > >()) + static_cast<T>(16) )
+ /
+ ((pi<T, policies::policy<policies::digits2<N> > >() - static_cast<T>(4))
+ * (pi<T, policies::policy<policies::digits2<N> > >() - static_cast<T>(4)))
+ );
+}
+
+
 }}}} // namespaces
 
 #endif // BOOST_MATH_CALCULATE_CONSTANTS_CONSTANTS_INCLUDED

Modified: sandbox/math_constants/boost/math/constants/constants.hpp
==============================================================================
--- sandbox/math_constants/boost/math/constants/constants.hpp (original)
+++ sandbox/math_constants/boost/math/constants/constants.hpp 2011-12-06 13:04:48 EST (Tue, 06 Dec 2011)
@@ -207,34 +207,80 @@
    namespace long_double_constants{ static const long double name = BOOST_JOIN(BOOST_JOIN(x, BOOST_JOIN(e, exp)), L); }\
    namespace constants{
 
-BOOST_DEFINE_MATH_CONSTANT(pi, 3.141592653589793238462643383279502884, 1971693993751058209749445923078164062862089986280348253421170679821480865, 0);
-BOOST_DEFINE_MATH_CONSTANT(two_pi, 6.283185307179586476925286766559005768, 394338798750211641949889184615632812572417997256069650684234135964296173, 0);
-BOOST_DEFINE_MATH_CONSTANT(one_div_two_pi, 1.591549430918953357688837633725143620, 3445964574045644874766734405889679763422653509011380276625308595607284273, -1);
-BOOST_DEFINE_MATH_CONSTANT(root_pi, 1.772453850905516027298167483341145182, 7975494561223871282138077898529112845910321813749506567385446654162268236, 0);
-BOOST_DEFINE_MATH_CONSTANT(root_half_pi, 1.253314137315500251207882642405522626, 5034933703049691583149617881711468273039209874732979191890286330580049863, 0);
-BOOST_DEFINE_MATH_CONSTANT(root_two_pi, 2.506628274631000502415765284811045253,0069867406099383166299235763422936546078419749465958383780572661160099727, 0);
-BOOST_DEFINE_MATH_CONSTANT(root_ln_four, 1.177410022515474691011569326459699637, 7473856893858205385225257565000265885469849268084181383687708110674715786, 0);
-BOOST_DEFINE_MATH_CONSTANT(e, 2.718281828459045235360287471352662497, 7572470936999595749669676277240766303535475945713821785251664274274663919, 0);
-BOOST_DEFINE_MATH_CONSTANT(euler, 5.772156649015328606065120900824024310, 4215933593992359880576723488486772677766467093694706329174674951463144725, -1);
-BOOST_DEFINE_MATH_CONSTANT(root_two, 1.414213562373095048801688724209698078, 5696718753769480731766797379907324784621070388503875343276415727350138462, 0);
-BOOST_DEFINE_MATH_CONSTANT(half_root_two, 7.071067811865475244008443621048490392, 8483593768847403658833986899536623923105351942519376716382078636750692312, -1);
-BOOST_DEFINE_MATH_CONSTANT(ln_two, 6.931471805599453094172321214581765680, 7550013436025525412068000949339362196969471560586332699641868754200148102, -1);
-BOOST_DEFINE_MATH_CONSTANT(ln_ln_two, -3.665129205816643270124391582326694694, 5426344783710526305367771367056161531935273854945582285669890835830252305, -1);
-BOOST_DEFINE_MATH_CONSTANT(third, 3.333333333333333333333333333333333333, 3333333333333333333333333333333333333333333333333333333333333333333333333, -1);
-BOOST_DEFINE_MATH_CONSTANT(twothirds, 6.666666666666666666666666666666666666, 6666666666666666666666666666666666666666666666666666666666666666666666667, -1);
-BOOST_DEFINE_MATH_CONSTANT(pi_minus_three, 1.415926535897932384626433832795028841, 9716939937510582097494459230781640628620899862803482534211706798214808651, -1);
-BOOST_DEFINE_MATH_CONSTANT(four_minus_pi, 8.584073464102067615373566167204971158, 0283060062489417902505540769218359371379100137196517465788293201785191349, -1);
-BOOST_DEFINE_MATH_CONSTANT(pow23_four_minus_pi, 7.953167673715975443483953350568065807, 2763917332771320544530223438885626826751818759075800688860082843683980018, -1);
-BOOST_DEFINE_MATH_CONSTANT(exp_minus_half, 6.065306597126334236037995349911804534, 4191813548718695568289215873505651941374842399864761150798945602642378979, -1);
-BOOST_DEFINE_MATH_CONSTANT(half, 5.000000000000000000, 0000, -1);
+ BOOST_DEFINE_MATH_CONSTANT(half, 5.000000000000000000000000000000000000, 00000000000000000000000000000000000000000000000000000000000000000000000000, -01);
+ BOOST_DEFINE_MATH_CONSTANT(third, 3.333333333333333333333333333333333333, 33333333333333333333333333333333333333333333333333333333333333333333333333, -01);
+ BOOST_DEFINE_MATH_CONSTANT(twothirds, 6.666666666666666666666666666666666666, 66666666666666666666666666666666666666666666666666666666666666666666666667, -01);
+ BOOST_DEFINE_MATH_CONSTANT(two_thirds, 6.666666666666666666666666666666666666, 66666666666666666666666666666666666666666666666666666666666666666666666667, -01);
+ BOOST_DEFINE_MATH_CONSTANT(three_quarters, 7.500000000000000000000000000000000000, 00000000000000000000000000000000000000000000000000000000000000000000000000, -01);
+ BOOST_DEFINE_MATH_CONSTANT(root_two, 1.414213562373095048801688724209698078, 56967187537694807317667973799073247846210703885038753432764157273501384623, +00);
+ BOOST_DEFINE_MATH_CONSTANT(root_three, 1.732050807568877293527446341505872366, 94280525381038062805580697945193301690880003708114618675724857567562614142, +00);
+ BOOST_DEFINE_MATH_CONSTANT(half_root_two, 7.071067811865475244008443621048490392, 84835937688474036588339868995366239231053519425193767163820786367506923115, -01);
+ BOOST_DEFINE_MATH_CONSTANT(ln_two, 6.931471805599453094172321214581765680, 75500134360255254120680009493393621969694715605863326996418687542001481021, -01);
+ BOOST_DEFINE_MATH_CONSTANT(ln_ln_two, -3.665129205816643270124391582326694694, 54263447837105263053677713670561615319352738549455822856698908358302523045, -01);
+ BOOST_DEFINE_MATH_CONSTANT(root_ln_four, 1.177410022515474691011569326459699637, 74738568938582053852252575650002658854698492680841813836877081106747157858, +00);
+ BOOST_DEFINE_MATH_CONSTANT(one_div_root_two, 7.071067811865475244008443621048490392, 84835937688474036588339868995366239231053519425193767163820786367506923115, -01);
+ BOOST_DEFINE_MATH_CONSTANT(pi, 3.141592653589793238462643383279502884, 19716939937510582097494459230781640628620899862803482534211706798214808651, +00);
+ BOOST_DEFINE_MATH_CONSTANT(half_pi, 1.570796326794896619231321691639751442, 09858469968755291048747229615390820314310449931401741267105853399107404326, +00);
+ BOOST_DEFINE_MATH_CONSTANT(third_pi, 1.047197551196597746154214461093167628, 06572313312503527365831486410260546876206966620934494178070568932738269550, +00);
+ BOOST_DEFINE_MATH_CONSTANT(sixth_pi, 5.235987755982988730771072305465838140, 32861566562517636829157432051302734381034833104672470890352844663691347752, -01);
+ BOOST_DEFINE_MATH_CONSTANT(two_pi, 6.283185307179586476925286766559005768, 39433879875021164194988918461563281257241799725606965068423413596429617303, +00);
+ BOOST_DEFINE_MATH_CONSTANT(two_thirds_pi, 2.094395102393195492308428922186335256, 13144626625007054731662972820521093752413933241868988356141137865476539101, +00);
+ BOOST_DEFINE_MATH_CONSTANT(three_quarters_pi, 2.356194490192344928846982537459627163, 14787704953132936573120844423086230471465674897102611900658780098661106488, +00);
+ BOOST_DEFINE_MATH_CONSTANT(four_thirds_pi, 4.188790204786390984616857844372670512, 26289253250014109463325945641042187504827866483737976712282275730953078202, +00);
+ BOOST_DEFINE_MATH_CONSTANT(one_div_two_pi, 1.591549430918953357688837633725143620, 34459645740456448747667344058896797634226535090113802766253085956072842727, -01);
+ BOOST_DEFINE_MATH_CONSTANT(one_div_root_two_pi, 3.989422804014326779399460599343818684, 75858631164934657665925829670657925899301838501252333907306936430302558863, -01);
+ BOOST_DEFINE_MATH_CONSTANT(root_pi, 1.772453850905516027298167483341145182, 79754945612238712821380778985291128459103218137495065673854466541622682362, +00);
+ BOOST_DEFINE_MATH_CONSTANT(root_half_pi, 1.253314137315500251207882642405522626, 50349337030496915831496178817114682730392098747329791918902863305800498633, +00);
+ BOOST_DEFINE_MATH_CONSTANT(root_two_pi, 2.506628274631000502415765284811045253, 00698674060993831662992357634229365460784197494659583837805726611600997267, +00);
+ BOOST_DEFINE_MATH_CONSTANT(one_div_root_pi, 5.641895835477562869480794515607725858, 44050629328998856844085721710642468441493414486743660202107363443028347906, -01);
+ BOOST_DEFINE_MATH_CONSTANT(root_one_div_pi, 5.641895835477562869480794515607725858, 44050629328998856844085721710642468441493414486743660202107363443028347906, -01);
+ BOOST_DEFINE_MATH_CONSTANT(pi_minus_three, 1.415926535897932384626433832795028841, 97169399375105820974944592307816406286208998628034825342117067982148086513, -01);
+ BOOST_DEFINE_MATH_CONSTANT(four_minus_pi, 8.584073464102067615373566167204971158, 02830600624894179025055407692183593713791001371965174657882932017851913487, -01);
+ BOOST_DEFINE_MATH_CONSTANT(pow23_four_minus_pi, 7.953167673715975443483953350568065807, 27639173327713205445302234388856268267518187590758006888600828436839800178, -01);
+ BOOST_DEFINE_MATH_CONSTANT(pi_pow_e, 2.245915771836104547342715220454373502, 75893151339966922492030025540669260403991179123185197527271430315314500731, +01);
+ BOOST_DEFINE_MATH_CONSTANT(pi_sqr, 9.869604401089358618834490999876151135, 31369940724079062641334937622004482241920524300177340371855223182402591377, +00);
+ BOOST_DEFINE_MATH_CONSTANT(pi_sqr_div_six, 1.644934066848226436472415166646025189, 21894990120679843773555822937000747040320087383362890061975870530400431896, +00);
+ BOOST_DEFINE_MATH_CONSTANT(pi_cubed, 3.100627668029982017547631506710139520, 22252885658851076941445381038063949174657060375667010326028861930301219616, +01);
+ BOOST_DEFINE_MATH_CONSTANT(cbrt_pi, 3.225153443319948918442205268856368859, 30633361474780767345817222155840617944954895382254148095655200372649757346, -02);
+ BOOST_DEFINE_MATH_CONSTANT(one_div_cbrt_pi, 3.100627668029982017547631506710139520, 22252885658851076941445381038063949174657060375667010326028861930301219616, +01);
+ BOOST_DEFINE_MATH_CONSTANT(e, 2.718281828459045235360287471352662497, 75724709369995957496696762772407663035354759457138217852516642742746639193, +00);
+ BOOST_DEFINE_MATH_CONSTANT(euler, 5.772156649015328606065120900824024310, 42159335939923598805767234884867726777664670936947063291746749514631447250, -01);
+ BOOST_DEFINE_MATH_CONSTANT(exp_minus_half, 6.065306597126334236037995349911804534, 41918135487186955682892158735056519413748423998647611507989456026423789794, -01);
+ BOOST_DEFINE_MATH_CONSTANT(e_pow_pi, 2.314069263277926900572908636794854738, 02661062426002119934450464095243423506904527835169719970675492196759527048, +01);
+ BOOST_DEFINE_MATH_CONSTANT(root_e, 1.648721270700128146848650787814163571, 65377610071014801157507931164066102119421560863277652005636664300286663776, +00);
+ BOOST_DEFINE_MATH_CONSTANT(log10_e, 4.342944819032518276511289189166050822, 94397005803666566114453783165864649208870774729224949338431748318706106745, -01);
+ BOOST_DEFINE_MATH_CONSTANT(one_div_log10_e, 2.302585092994045684017991454684364207, 60110148862877297603332790096757260967735248023599720508959829834196778404, +00);
+ BOOST_DEFINE_MATH_CONSTANT(degree, 1.745329251994329576923690768488612713, 44287188854172545609719144017100911460344944368224156963450948221230449251, -02);
+ BOOST_DEFINE_MATH_CONSTANT(radian, 5.729577951308232087679815481410517033, 24054724665643215491602438612028471483215526324409689958511109441862233816, +01);
+ BOOST_DEFINE_MATH_CONSTANT(sin_one, 8.414709848078965066525023216302989996, 22563060798371065672751709991910404391239668948639743543052695854349037908, -01);
+ BOOST_DEFINE_MATH_CONSTANT(cos_one, 5.403023058681397174009366074429766037, 32310420617922227670097255381100394774471764517951856087183089343571731160, -01);
+ BOOST_DEFINE_MATH_CONSTANT(sinh_one, 1.175201193643801456882381850595600815, 15571798133409587022956541301330756730432389560711745208962339184041953333, +00);
+ BOOST_DEFINE_MATH_CONSTANT(cosh_one, 1.543080634815243778477905620757061682, 60152911236586370473740221471076906304922369896426472643554303558704685860, +00);
+ BOOST_DEFINE_MATH_CONSTANT(phi, 1.618033988749894848204586834365638117, 72030917980576286213544862270526046281890244970720720418939113748475408808, +00);
+ BOOST_DEFINE_MATH_CONSTANT(log_phi, 4.812118250596034474977589134243684231, 35184334385660519661018168840163867608221774412009429122723474997231839958, -01);
+ BOOST_DEFINE_MATH_CONSTANT(one_div_log_phi, 2.078086921235027537601322606117795767, 74219226778328348027813992191974386928553540901445615414453604821933918634, +00);
+ BOOST_DEFINE_MATH_CONSTANT(gamma, 5.772156649015328606065120900824024310, 42159335939923598805767234884867726777664670936947063291746749514631447250, -01);
+ BOOST_DEFINE_MATH_CONSTANT(one_div_gamma, 1.732454714600633473583025315860829681, 15577655226680502204843613287065531408655243008832840219409928068072365714, +00);
+ BOOST_DEFINE_MATH_CONSTANT(gamma_sqr, 3.331779238077186743183761363552442266, 59417140249629743150833338002265793695756669661263268631715977303039565603, -01);
+ BOOST_DEFINE_MATH_CONSTANT(cf10, 1.030640834100712935881776094116936840, 92500000000000000000000000000000000000000000000000000000000000000000000000, +00);
+ BOOST_DEFINE_MATH_CONSTANT(zeta_two, 1.644934066848226436472415166646025189, 21894990120679843773555822937000747040320087383362890061975870530400431896, +00);
+ BOOST_DEFINE_MATH_CONSTANT(zeta_three, 1.202056903159594285399738161511449990, 76498629234049888179227155534183820578631309018645587360933525814619915000, +00);
+ BOOST_DEFINE_MATH_CONSTANT(catalan, 9.159655941772190150546035149323841107, 74149374281672134266498119621763019776254769479356512926115106248574000000, -01);
+ BOOST_DEFINE_MATH_CONSTANT(khinchin, 2.685452001065306445309714835481795693, 82038229399446295305115234555721885953715200280114117493184769799515346591, +00);
+ BOOST_DEFINE_MATH_CONSTANT(glaisher, 1.282427129100622636875342568869791727, 76768892732500119206374002174040630885882646112973649195820237439420646120, +00);
+ BOOST_DEFINE_MATH_CONSTANT(extreme_value_skewness, 1.139547099404648657492793019389846112, 08759979583655182472165571008524800770607068570718754688693851501894272049, +00);
+ BOOST_DEFINE_MATH_CONSTANT(rayleigh_skewness, 6.311106578189371381918993515442277798, 44042203134719497658094585692926819617473725459905027032537306794400047264, -01);
+ BOOST_DEFINE_MATH_CONSTANT(rayleigh_kurtosis, 3.245089300687638062848660410619754415, 41706673178920936177133764493367904540874159051490619368679348977426462633, +00);
+ BOOST_DEFINE_MATH_CONSTANT(rayleigh_kurtosis_excess, 2.450893006876380628486604106197544154, 17066731789209361771337644933679045408741590514906193686793489774264626328, -01);
+
 
 } // namespace constants
 } // namespace math
 } // namespace boost
 
 //
-// We deliberately include this after all the declarations above,
-// that way the calculation routines can call on other constants:
+// We deliberately include this *after* all the declarations above,
+// that way the calculation routines can call on other constants above:
 //
 #include <boost/math/constants/calculate_constants.hpp>
 

Modified: sandbox/math_constants/boost/math/constants/info.hpp
==============================================================================
--- sandbox/math_constants/boost/math/constants/info.hpp (original)
+++ sandbox/math_constants/boost/math/constants/info.hpp 2011-12-06 13:04:48 EST (Tue, 06 Dec 2011)
@@ -3,6 +3,10 @@
 // Boost Software License, Version 1.0. (See accompanying file
 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
+#ifdef _MSC_VER
+# pragma once
+#endif
+
 #ifndef BOOST_MATH_CONSTANTS_INFO_INCLUDED
 #define BOOST_MATH_CONSTANTS_INFO_INCLUDED
 
@@ -11,7 +15,7 @@
 #include <iomanip>
 #include <typeinfo>
 
-namespace boost{ namespace math{ namespace constants{
+namespace boost{ namespace math{ namespace constants{
 
    namespace detail{
 
@@ -46,7 +50,7 @@
 #pragma warning(push)
 #pragma warning(disable:4127)
 #endif
- os <<
+ os <<
       "Information on the Implementation and Handling of \n"
       "Mathematical Constants for Type " << nameof<T>() <<
       "\n\n"
@@ -55,21 +59,50 @@
    if(std::numeric_limits<T>::is_specialized)
    {
       os <<
+ "std::numeric_limits<" << nameof<T>() << ">::digits reports that the radix is " << std::numeric_limits<T>::radix << ".\n";
+ if (std::numeric_limits<T>::radix == 2)
+ {
+ os <<
          "std::numeric_limits<" << nameof<T>() << ">::digits reports that the precision is \n" << std::numeric_limits<T>::digits << " binary digits.\n";
+ }
+ else if (std::numeric_limits<T>::radix == 10)
+ {
+ os <<
+ "std::numeric_limits<" << nameof<T>() << ">::digits reports that the precision is \n" << std::numeric_limits<T>::digits10 << " decimal digits.\n";
+ os <<
+ "std::numeric_limits<" << nameof<T>() << ">::digits reports that the precision is \n"
+ << std::numeric_limits<T>::digits * 1000L /301L << " binary digits.\n"; // divide by log2(10) - about 3 bits per decimal digit.
+ }
+ else
+ {
+ os << "Unknown radix = " << std::numeric_limits<T>::radix << "\n";
+ }
    }
    typedef typename boost::math::policies::precision<T, Policy>::type precision_type;
    if(precision_type::value)
    {
- os <<
- "boost::math::policies::precision<" << nameof<T>() << ", Policy> reports that the compile time precision is \n" << precision_type::value << " binary digits.\n";
+ if (std::numeric_limits<T>::radix == 2)
+ {
+ os <<
+ "boost::math::policies::precision<" << nameof<T>() << ", " << nameof<Policy>() << " reports that the compile time precision is \n" << precision_type::value << " binary digits.\n";
+ }
+ else if (std::numeric_limits<T>::radix == 10)
+ {
+ os <<
+ "boost::math::policies::precision<" << nameof<T>() << ", " << nameof<Policy>() << " reports that the compile time precision is \n" << precision_type::value << " binary digits.\n";
+ }
+ else
+ {
+ os << "Unknown radix = " << std::numeric_limits<T>::radix << "\n";
+ }
    }
    else
    {
       os <<
          "boost::math::policies::precision<" << nameof<T>() << ", Policy> \n"
- "reports that there is no compile type precision available.\n"
+ "reports that there is no compile type precision available.\n"
          "boost::math::tools::digits<" << nameof<T>() << ">() \n"
- "reports that the current runtime precision is \n" <<
+ "reports that the current runtime precision is \n" <<
          boost::math::tools::digits<T>() << " binary digits.\n";
    }
 


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