update boost

This commit is contained in:
2023-11-24 12:56:13 -06:00
parent cfc99971af
commit 19d727037a
9260 changed files with 849256 additions and 299957 deletions

View File

@@ -7,9 +7,10 @@
#define BOOST_MATH_NTL_DIGAMMA
#include <boost/math/tools/rational.hpp>
#include <boost/math/tools/config.hpp>
#include <boost/math/policies/error_handling.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/math/tools/big_constant.hpp>
namespace boost{ namespace math{ namespace detail{
@@ -17,254 +18,254 @@ template <class T>
T big_digamma_helper(T x)
{
static const T P[61] = {
boost::lexical_cast<T>("0.6660133691143982067148122682345055274952e81"),
boost::lexical_cast<T>("0.6365271516829242456324234577164675383137e81"),
boost::lexical_cast<T>("0.2991038873096202943405966144203628966976e81"),
boost::lexical_cast<T>("0.9211116495503170498076013367421231351115e80"),
boost::lexical_cast<T>("0.2090792764676090716286400360584443891749e80"),
boost::lexical_cast<T>("0.3730037777359591428226035156377978092809e79"),
boost::lexical_cast<T>("0.5446396536956682043376492370432031543834e78"),
boost::lexical_cast<T>("0.6692523966335177847425047827449069256345e77"),
boost::lexical_cast<T>("0.7062543624100864681625612653756619116848e76"),
boost::lexical_cast<T>("0.6499914905966283735005256964443226879158e75"),
boost::lexical_cast<T>("0.5280364564853225211197557708655426736091e74"),
boost::lexical_cast<T>("0.3823205608981176913075543599005095206953e73"),
boost::lexical_cast<T>("0.2486733714214237704739129972671154532415e72"),
boost::lexical_cast<T>("0.1462562139602039577983434547171318011675e71"),
boost::lexical_cast<T>("0.7821169065036815012381267259559910324285e69"),
boost::lexical_cast<T>("0.3820552182348155468636157988764435365078e68"),
boost::lexical_cast<T>("0.1711618296983598244658239925535632505062e67"),
boost::lexical_cast<T>("0.7056661618357643731419080738521475204245e65"),
boost::lexical_cast<T>("0.2685246896473614017356264531791459936036e64"),
boost::lexical_cast<T>("0.9455168125599643085283071944864977592391e62"),
boost::lexical_cast<T>("0.3087541626972538362237309145177486236219e61"),
boost::lexical_cast<T>("0.9367928873352980208052601301625005737407e59"),
boost::lexical_cast<T>("0.2645306130689794942883818547314327466007e58"),
boost::lexical_cast<T>("0.6961815141171454309161007351079576190079e56"),
boost::lexical_cast<T>("0.1709637824471794552313802669803885946843e55"),
boost::lexical_cast<T>("0.3921553258481531526663112728778759311158e53"),
boost::lexical_cast<T>("0.8409006354449988687714450897575728228696e51"),
boost::lexical_cast<T>("0.1686755204461325935742097669030363344927e50"),
boost::lexical_cast<T>("0.3166653542877070999007425197729038754254e48"),
boost::lexical_cast<T>("0.5566029092358215049069560272835654229637e46"),
boost::lexical_cast<T>("0.9161766287916328133080586672953875116242e44"),
boost::lexical_cast<T>("1412317772330871298317974693514430627922000"),
boost::lexical_cast<T>("20387991986727877473732570146112459874790"),
boost::lexical_cast<T>("275557928713904105182512535678580359839.3"),
boost::lexical_cast<T>("3485719851040516559072031256589598330.723"),
boost::lexical_cast<T>("41247046743564028399938106707656877.40859"),
boost::lexical_cast<T>("456274078125709314602601667471879.0147312"),
boost::lexical_cast<T>("4714450683242899367025707077155.310613012"),
boost::lexical_cast<T>("45453933537925041680009544258.75073849996"),
boost::lexical_cast<T>("408437900487067278846361972.302331241052"),
boost::lexical_cast<T>("3415719344386166273085838.705771571751035"),
boost::lexical_cast<T>("26541502879185876562320.93134691487351145"),
boost::lexical_cast<T>("191261415065918713661.1571433274648417668"),
boost::lexical_cast<T>("1275349770108718421.645275944284937551702"),
boost::lexical_cast<T>("7849171120971773.318910987434906905704272"),
boost::lexical_cast<T>("44455946386549.80866460312682983576538056"),
boost::lexical_cast<T>("230920362395.3198137186361608905136598046"),
boost::lexical_cast<T>("1095700096.240863858624279930600654130254"),
boost::lexical_cast<T>("4727085.467506050153744334085516289728134"),
boost::lexical_cast<T>("18440.75118859447173303252421991479005424"),
boost::lexical_cast<T>("64.62515887799460295677071749181651317052"),
boost::lexical_cast<T>("0.201851568864688406206528472883512147547"),
boost::lexical_cast<T>("0.0005565091674187978029138500039504078098143"),
boost::lexical_cast<T>("0.1338097668312907986354698683493366559613e-5"),
boost::lexical_cast<T>("0.276308225077464312820179030238305271638e-8"),
boost::lexical_cast<T>("0.4801582970473168520375942100071070575043e-11"),
boost::lexical_cast<T>("0.6829184144212920949740376186058541800175e-14"),
boost::lexical_cast<T>("0.7634080076358511276617829524639455399182e-17"),
boost::lexical_cast<T>("0.6290035083727140966418512608156646142409e-20"),
boost::lexical_cast<T>("0.339652245667538733044036638506893821352e-23"),
boost::lexical_cast<T>("0.9017518064256388530773585529891677854909e-27")
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6660133691143982067148122682345055274952e81),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6365271516829242456324234577164675383137e81),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2991038873096202943405966144203628966976e81),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9211116495503170498076013367421231351115e80),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2090792764676090716286400360584443891749e80),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3730037777359591428226035156377978092809e79),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5446396536956682043376492370432031543834e78),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6692523966335177847425047827449069256345e77),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7062543624100864681625612653756619116848e76),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6499914905966283735005256964443226879158e75),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5280364564853225211197557708655426736091e74),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3823205608981176913075543599005095206953e73),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2486733714214237704739129972671154532415e72),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1462562139602039577983434547171318011675e71),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7821169065036815012381267259559910324285e69),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3820552182348155468636157988764435365078e68),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1711618296983598244658239925535632505062e67),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7056661618357643731419080738521475204245e65),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2685246896473614017356264531791459936036e64),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9455168125599643085283071944864977592391e62),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3087541626972538362237309145177486236219e61),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9367928873352980208052601301625005737407e59),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2645306130689794942883818547314327466007e58),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6961815141171454309161007351079576190079e56),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1709637824471794552313802669803885946843e55),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3921553258481531526663112728778759311158e53),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.8409006354449988687714450897575728228696e51),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1686755204461325935742097669030363344927e50),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3166653542877070999007425197729038754254e48),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5566029092358215049069560272835654229637e46),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9161766287916328133080586672953875116242e44),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1412317772330871298317974693514430627922000),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 20387991986727877473732570146112459874790),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 275557928713904105182512535678580359839.3),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3485719851040516559072031256589598330.723),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 41247046743564028399938106707656877.40859),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 456274078125709314602601667471879.0147312),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 4714450683242899367025707077155.310613012),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 45453933537925041680009544258.75073849996),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 408437900487067278846361972.302331241052),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3415719344386166273085838.705771571751035),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 26541502879185876562320.93134691487351145),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 191261415065918713661.1571433274648417668),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1275349770108718421.645275944284937551702),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 7849171120971773.318910987434906905704272),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 44455946386549.80866460312682983576538056),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 230920362395.3198137186361608905136598046),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1095700096.240863858624279930600654130254),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 4727085.467506050153744334085516289728134),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 18440.75118859447173303252421991479005424),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 64.62515887799460295677071749181651317052),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.201851568864688406206528472883512147547),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.0005565091674187978029138500039504078098143),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1338097668312907986354698683493366559613e-5),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.276308225077464312820179030238305271638e-8),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4801582970473168520375942100071070575043e-11),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6829184144212920949740376186058541800175e-14),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7634080076358511276617829524639455399182e-17),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6290035083727140966418512608156646142409e-20),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.339652245667538733044036638506893821352e-23),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9017518064256388530773585529891677854909e-27)
};
static const T Q[61] = {
boost::lexical_cast<T>("0"),
boost::lexical_cast<T>("0.1386831185456898357379390197203894063459e81"),
boost::lexical_cast<T>("0.6467076379487574703291056110838151259438e81"),
boost::lexical_cast<T>("0.1394967823848615838336194279565285465161e82"),
boost::lexical_cast<T>("0.1872927317344192945218570366455046340458e82"),
boost::lexical_cast<T>("0.1772461045338946243584650759986310355937e82"),
boost::lexical_cast<T>("0.1267294892200258648315971144069595555118e82"),
boost::lexical_cast<T>("0.7157764838362416821508872117623058626589e81"),
boost::lexical_cast<T>("0.329447266909948668265277828268378274513e81"),
boost::lexical_cast<T>("0.1264376077317689779509250183194342571207e81"),
boost::lexical_cast<T>("0.4118230304191980787640446056583623228873e80"),
boost::lexical_cast<T>("0.1154393529762694616405952270558316515261e80"),
boost::lexical_cast<T>("0.281655612889423906125295485693696744275e79"),
boost::lexical_cast<T>("0.6037483524928743102724159846414025482077e78"),
boost::lexical_cast<T>("0.1145927995397835468123576831800276999614e78"),
boost::lexical_cast<T>("0.1938624296151985600348534009382865995154e77"),
boost::lexical_cast<T>("0.293980925856227626211879961219188406675e76"),
boost::lexical_cast<T>("0.4015574518216966910319562902099567437832e75"),
boost::lexical_cast<T>("0.4961475457509727343545565970423431880907e74"),
boost::lexical_cast<T>("0.5565482348278933960215521991000378896338e73"),
boost::lexical_cast<T>("0.5686112924615820754631098622770303094938e72"),
boost::lexical_cast<T>("0.5305988545844796293285410303747469932856e71"),
boost::lexical_cast<T>("0.4533363413802585060568537458067343491358e70"),
boost::lexical_cast<T>("0.3553932059473516064068322757331575565718e69"),
boost::lexical_cast<T>("0.2561198565218704414618802902533972354203e68"),
boost::lexical_cast<T>("0.1699519313292900324098102065697454295572e67"),
boost::lexical_cast<T>("0.1039830160862334505389615281373574959236e66"),
boost::lexical_cast<T>("0.5873082967977428281000961954715372504986e64"),
boost::lexical_cast<T>("0.3065255179030575882202133042549783442446e63"),
boost::lexical_cast<T>("0.1479494813481364701208655943688307245459e62"),
boost::lexical_cast<T>("0.6608150467921598615495180659808895663164e60"),
boost::lexical_cast<T>("0.2732535313770902021791888953487787496976e59"),
boost::lexical_cast<T>("0.1046402297662493314531194338414508049069e58"),
boost::lexical_cast<T>("0.3711375077192882936085049147920021549622e56"),
boost::lexical_cast<T>("0.1219154482883895482637944309702972234576e55"),
boost::lexical_cast<T>("0.3708359374149458741391374452286837880162e53"),
boost::lexical_cast<T>("0.1044095509971707189716913168889769471468e52"),
boost::lexical_cast<T>("0.271951506225063286130946773813524945052e50"),
boost::lexical_cast<T>("0.6548016291215163843464133978454065823866e48"),
boost::lexical_cast<T>("0.1456062447610542135403751730809295219344e47"),
boost::lexical_cast<T>("0.2986690175077969760978388356833006028929e45"),
boost::lexical_cast<T>("5643149706574013350061247429006443326844000"),
boost::lexical_cast<T>("98047545414467090421964387960743688053480"),
boost::lexical_cast<T>("1563378767746846395507385099301468978550"),
boost::lexical_cast<T>("22823360528584500077862274918382796495"),
boost::lexical_cast<T>("304215527004115213046601295970388750"),
boost::lexical_cast<T>("3690289075895685793844344966820325"),
boost::lexical_cast<T>("40584512015702371433911456606050"),
boost::lexical_cast<T>("402834190897282802772754873905"),
boost::lexical_cast<T>("3589522158493606918146495750"),
boost::lexical_cast<T>("28530557707503483723634725"),
boost::lexical_cast<T>("200714561335055753000730"),
boost::lexical_cast<T>("1237953783437761888641"),
boost::lexical_cast<T>("6614698701445762950"),
boost::lexical_cast<T>("30155495647727505"),
boost::lexical_cast<T>("114953256021450"),
boost::lexical_cast<T>("356398020013"),
boost::lexical_cast<T>("863113950"),
boost::lexical_cast<T>("1531345"),
boost::lexical_cast<T>("1770"),
boost::lexical_cast<T>("1")
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1386831185456898357379390197203894063459e81),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6467076379487574703291056110838151259438e81),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1394967823848615838336194279565285465161e82),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1872927317344192945218570366455046340458e82),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1772461045338946243584650759986310355937e82),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1267294892200258648315971144069595555118e82),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7157764838362416821508872117623058626589e81),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.329447266909948668265277828268378274513e81),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1264376077317689779509250183194342571207e81),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4118230304191980787640446056583623228873e80),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1154393529762694616405952270558316515261e80),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.281655612889423906125295485693696744275e79),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6037483524928743102724159846414025482077e78),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1145927995397835468123576831800276999614e78),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1938624296151985600348534009382865995154e77),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.293980925856227626211879961219188406675e76),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4015574518216966910319562902099567437832e75),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4961475457509727343545565970423431880907e74),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5565482348278933960215521991000378896338e73),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5686112924615820754631098622770303094938e72),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5305988545844796293285410303747469932856e71),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4533363413802585060568537458067343491358e70),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3553932059473516064068322757331575565718e69),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2561198565218704414618802902533972354203e68),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1699519313292900324098102065697454295572e67),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1039830160862334505389615281373574959236e66),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5873082967977428281000961954715372504986e64),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3065255179030575882202133042549783442446e63),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1479494813481364701208655943688307245459e62),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6608150467921598615495180659808895663164e60),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2732535313770902021791888953487787496976e59),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1046402297662493314531194338414508049069e58),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3711375077192882936085049147920021549622e56),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1219154482883895482637944309702972234576e55),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3708359374149458741391374452286837880162e53),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1044095509971707189716913168889769471468e52),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.271951506225063286130946773813524945052e50),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6548016291215163843464133978454065823866e48),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1456062447610542135403751730809295219344e47),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2986690175077969760978388356833006028929e45),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 5643149706574013350061247429006443326844000),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 98047545414467090421964387960743688053480),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1563378767746846395507385099301468978550),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 22823360528584500077862274918382796495),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 304215527004115213046601295970388750),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3690289075895685793844344966820325),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 40584512015702371433911456606050),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 402834190897282802772754873905),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3589522158493606918146495750),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 28530557707503483723634725),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 200714561335055753000730),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1237953783437761888641),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 6614698701445762950),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 30155495647727505),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 114953256021450),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 356398020013),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 863113950),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1531345),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1770),
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1)
};
static const T PD[60] = {
boost::lexical_cast<T>("0.6365271516829242456324234577164675383137e81"),
2*boost::lexical_cast<T>("0.2991038873096202943405966144203628966976e81"),
3*boost::lexical_cast<T>("0.9211116495503170498076013367421231351115e80"),
4*boost::lexical_cast<T>("0.2090792764676090716286400360584443891749e80"),
5*boost::lexical_cast<T>("0.3730037777359591428226035156377978092809e79"),
6*boost::lexical_cast<T>("0.5446396536956682043376492370432031543834e78"),
7*boost::lexical_cast<T>("0.6692523966335177847425047827449069256345e77"),
8*boost::lexical_cast<T>("0.7062543624100864681625612653756619116848e76"),
9*boost::lexical_cast<T>("0.6499914905966283735005256964443226879158e75"),
10*boost::lexical_cast<T>("0.5280364564853225211197557708655426736091e74"),
11*boost::lexical_cast<T>("0.3823205608981176913075543599005095206953e73"),
12*boost::lexical_cast<T>("0.2486733714214237704739129972671154532415e72"),
13*boost::lexical_cast<T>("0.1462562139602039577983434547171318011675e71"),
14*boost::lexical_cast<T>("0.7821169065036815012381267259559910324285e69"),
15*boost::lexical_cast<T>("0.3820552182348155468636157988764435365078e68"),
16*boost::lexical_cast<T>("0.1711618296983598244658239925535632505062e67"),
17*boost::lexical_cast<T>("0.7056661618357643731419080738521475204245e65"),
18*boost::lexical_cast<T>("0.2685246896473614017356264531791459936036e64"),
19*boost::lexical_cast<T>("0.9455168125599643085283071944864977592391e62"),
20*boost::lexical_cast<T>("0.3087541626972538362237309145177486236219e61"),
21*boost::lexical_cast<T>("0.9367928873352980208052601301625005737407e59"),
22*boost::lexical_cast<T>("0.2645306130689794942883818547314327466007e58"),
23*boost::lexical_cast<T>("0.6961815141171454309161007351079576190079e56"),
24*boost::lexical_cast<T>("0.1709637824471794552313802669803885946843e55"),
25*boost::lexical_cast<T>("0.3921553258481531526663112728778759311158e53"),
26*boost::lexical_cast<T>("0.8409006354449988687714450897575728228696e51"),
27*boost::lexical_cast<T>("0.1686755204461325935742097669030363344927e50"),
28*boost::lexical_cast<T>("0.3166653542877070999007425197729038754254e48"),
29*boost::lexical_cast<T>("0.5566029092358215049069560272835654229637e46"),
30*boost::lexical_cast<T>("0.9161766287916328133080586672953875116242e44"),
31*boost::lexical_cast<T>("1412317772330871298317974693514430627922000"),
32*boost::lexical_cast<T>("20387991986727877473732570146112459874790"),
33*boost::lexical_cast<T>("275557928713904105182512535678580359839.3"),
34*boost::lexical_cast<T>("3485719851040516559072031256589598330.723"),
35*boost::lexical_cast<T>("41247046743564028399938106707656877.40859"),
36*boost::lexical_cast<T>("456274078125709314602601667471879.0147312"),
37*boost::lexical_cast<T>("4714450683242899367025707077155.310613012"),
38*boost::lexical_cast<T>("45453933537925041680009544258.75073849996"),
39*boost::lexical_cast<T>("408437900487067278846361972.302331241052"),
40*boost::lexical_cast<T>("3415719344386166273085838.705771571751035"),
41*boost::lexical_cast<T>("26541502879185876562320.93134691487351145"),
42*boost::lexical_cast<T>("191261415065918713661.1571433274648417668"),
43*boost::lexical_cast<T>("1275349770108718421.645275944284937551702"),
44*boost::lexical_cast<T>("7849171120971773.318910987434906905704272"),
45*boost::lexical_cast<T>("44455946386549.80866460312682983576538056"),
46*boost::lexical_cast<T>("230920362395.3198137186361608905136598046"),
47*boost::lexical_cast<T>("1095700096.240863858624279930600654130254"),
48*boost::lexical_cast<T>("4727085.467506050153744334085516289728134"),
49*boost::lexical_cast<T>("18440.75118859447173303252421991479005424"),
50*boost::lexical_cast<T>("64.62515887799460295677071749181651317052"),
51*boost::lexical_cast<T>("0.201851568864688406206528472883512147547"),
52*boost::lexical_cast<T>("0.0005565091674187978029138500039504078098143"),
53*boost::lexical_cast<T>("0.1338097668312907986354698683493366559613e-5"),
54*boost::lexical_cast<T>("0.276308225077464312820179030238305271638e-8"),
55*boost::lexical_cast<T>("0.4801582970473168520375942100071070575043e-11"),
56*boost::lexical_cast<T>("0.6829184144212920949740376186058541800175e-14"),
57*boost::lexical_cast<T>("0.7634080076358511276617829524639455399182e-17"),
58*boost::lexical_cast<T>("0.6290035083727140966418512608156646142409e-20"),
59*boost::lexical_cast<T>("0.339652245667538733044036638506893821352e-23"),
60*boost::lexical_cast<T>("0.9017518064256388530773585529891677854909e-27")
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6365271516829242456324234577164675383137e81),
2*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2991038873096202943405966144203628966976e81),
3*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9211116495503170498076013367421231351115e80),
4*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2090792764676090716286400360584443891749e80),
5*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3730037777359591428226035156377978092809e79),
6*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5446396536956682043376492370432031543834e78),
7*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6692523966335177847425047827449069256345e77),
8*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7062543624100864681625612653756619116848e76),
9*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6499914905966283735005256964443226879158e75),
10*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5280364564853225211197557708655426736091e74),
11*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3823205608981176913075543599005095206953e73),
12*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2486733714214237704739129972671154532415e72),
13*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1462562139602039577983434547171318011675e71),
14*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7821169065036815012381267259559910324285e69),
15*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3820552182348155468636157988764435365078e68),
16*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1711618296983598244658239925535632505062e67),
17*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7056661618357643731419080738521475204245e65),
18*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2685246896473614017356264531791459936036e64),
19*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9455168125599643085283071944864977592391e62),
20*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3087541626972538362237309145177486236219e61),
21*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9367928873352980208052601301625005737407e59),
22*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2645306130689794942883818547314327466007e58),
23*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6961815141171454309161007351079576190079e56),
24*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1709637824471794552313802669803885946843e55),
25*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3921553258481531526663112728778759311158e53),
26*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.8409006354449988687714450897575728228696e51),
27*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1686755204461325935742097669030363344927e50),
28*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3166653542877070999007425197729038754254e48),
29*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5566029092358215049069560272835654229637e46),
30*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9161766287916328133080586672953875116242e44),
31*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1412317772330871298317974693514430627922000),
32*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 20387991986727877473732570146112459874790),
33*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 275557928713904105182512535678580359839.3),
34*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3485719851040516559072031256589598330.723),
35*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 41247046743564028399938106707656877.40859),
36*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 456274078125709314602601667471879.0147312),
37*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 4714450683242899367025707077155.310613012),
38*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 45453933537925041680009544258.75073849996),
39*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 408437900487067278846361972.302331241052),
40*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3415719344386166273085838.705771571751035),
41*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 26541502879185876562320.93134691487351145),
42*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 191261415065918713661.1571433274648417668),
43*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1275349770108718421.645275944284937551702),
44*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 7849171120971773.318910987434906905704272),
45*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 44455946386549.80866460312682983576538056),
46*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 230920362395.3198137186361608905136598046),
47*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1095700096.240863858624279930600654130254),
48*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 4727085.467506050153744334085516289728134),
49*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 18440.75118859447173303252421991479005424),
50*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 64.62515887799460295677071749181651317052),
51*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.201851568864688406206528472883512147547),
52*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.0005565091674187978029138500039504078098143),
53*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1338097668312907986354698683493366559613e-5),
54*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.276308225077464312820179030238305271638e-8),
55*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4801582970473168520375942100071070575043e-11),
56*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6829184144212920949740376186058541800175e-14),
57*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7634080076358511276617829524639455399182e-17),
58*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6290035083727140966418512608156646142409e-20),
59*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.339652245667538733044036638506893821352e-23),
60*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9017518064256388530773585529891677854909e-27)
};
static const T QD[60] = {
boost::lexical_cast<T>("0.1386831185456898357379390197203894063459e81"),
2*boost::lexical_cast<T>("0.6467076379487574703291056110838151259438e81"),
3*boost::lexical_cast<T>("0.1394967823848615838336194279565285465161e82"),
4*boost::lexical_cast<T>("0.1872927317344192945218570366455046340458e82"),
5*boost::lexical_cast<T>("0.1772461045338946243584650759986310355937e82"),
6*boost::lexical_cast<T>("0.1267294892200258648315971144069595555118e82"),
7*boost::lexical_cast<T>("0.7157764838362416821508872117623058626589e81"),
8*boost::lexical_cast<T>("0.329447266909948668265277828268378274513e81"),
9*boost::lexical_cast<T>("0.1264376077317689779509250183194342571207e81"),
10*boost::lexical_cast<T>("0.4118230304191980787640446056583623228873e80"),
11*boost::lexical_cast<T>("0.1154393529762694616405952270558316515261e80"),
12*boost::lexical_cast<T>("0.281655612889423906125295485693696744275e79"),
13*boost::lexical_cast<T>("0.6037483524928743102724159846414025482077e78"),
14*boost::lexical_cast<T>("0.1145927995397835468123576831800276999614e78"),
15*boost::lexical_cast<T>("0.1938624296151985600348534009382865995154e77"),
16*boost::lexical_cast<T>("0.293980925856227626211879961219188406675e76"),
17*boost::lexical_cast<T>("0.4015574518216966910319562902099567437832e75"),
18*boost::lexical_cast<T>("0.4961475457509727343545565970423431880907e74"),
19*boost::lexical_cast<T>("0.5565482348278933960215521991000378896338e73"),
20*boost::lexical_cast<T>("0.5686112924615820754631098622770303094938e72"),
21*boost::lexical_cast<T>("0.5305988545844796293285410303747469932856e71"),
22*boost::lexical_cast<T>("0.4533363413802585060568537458067343491358e70"),
23*boost::lexical_cast<T>("0.3553932059473516064068322757331575565718e69"),
24*boost::lexical_cast<T>("0.2561198565218704414618802902533972354203e68"),
25*boost::lexical_cast<T>("0.1699519313292900324098102065697454295572e67"),
26*boost::lexical_cast<T>("0.1039830160862334505389615281373574959236e66"),
27*boost::lexical_cast<T>("0.5873082967977428281000961954715372504986e64"),
28*boost::lexical_cast<T>("0.3065255179030575882202133042549783442446e63"),
29*boost::lexical_cast<T>("0.1479494813481364701208655943688307245459e62"),
30*boost::lexical_cast<T>("0.6608150467921598615495180659808895663164e60"),
31*boost::lexical_cast<T>("0.2732535313770902021791888953487787496976e59"),
32*boost::lexical_cast<T>("0.1046402297662493314531194338414508049069e58"),
33*boost::lexical_cast<T>("0.3711375077192882936085049147920021549622e56"),
34*boost::lexical_cast<T>("0.1219154482883895482637944309702972234576e55"),
35*boost::lexical_cast<T>("0.3708359374149458741391374452286837880162e53"),
36*boost::lexical_cast<T>("0.1044095509971707189716913168889769471468e52"),
37*boost::lexical_cast<T>("0.271951506225063286130946773813524945052e50"),
38*boost::lexical_cast<T>("0.6548016291215163843464133978454065823866e48"),
39*boost::lexical_cast<T>("0.1456062447610542135403751730809295219344e47"),
40*boost::lexical_cast<T>("0.2986690175077969760978388356833006028929e45"),
41*boost::lexical_cast<T>("5643149706574013350061247429006443326844000"),
42*boost::lexical_cast<T>("98047545414467090421964387960743688053480"),
43*boost::lexical_cast<T>("1563378767746846395507385099301468978550"),
44*boost::lexical_cast<T>("22823360528584500077862274918382796495"),
45*boost::lexical_cast<T>("304215527004115213046601295970388750"),
46*boost::lexical_cast<T>("3690289075895685793844344966820325"),
47*boost::lexical_cast<T>("40584512015702371433911456606050"),
48*boost::lexical_cast<T>("402834190897282802772754873905"),
49*boost::lexical_cast<T>("3589522158493606918146495750"),
50*boost::lexical_cast<T>("28530557707503483723634725"),
51*boost::lexical_cast<T>("200714561335055753000730"),
52*boost::lexical_cast<T>("1237953783437761888641"),
53*boost::lexical_cast<T>("6614698701445762950"),
54*boost::lexical_cast<T>("30155495647727505"),
55*boost::lexical_cast<T>("114953256021450"),
56*boost::lexical_cast<T>("356398020013"),
57*boost::lexical_cast<T>("863113950"),
58*boost::lexical_cast<T>("1531345"),
59*boost::lexical_cast<T>("1770"),
60*boost::lexical_cast<T>("1")
BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1386831185456898357379390197203894063459e81),
2*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6467076379487574703291056110838151259438e81),
3*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1394967823848615838336194279565285465161e82),
4*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1872927317344192945218570366455046340458e82),
5*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1772461045338946243584650759986310355937e82),
6*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1267294892200258648315971144069595555118e82),
7*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7157764838362416821508872117623058626589e81),
8*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.329447266909948668265277828268378274513e81),
9*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1264376077317689779509250183194342571207e81),
10*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4118230304191980787640446056583623228873e80),
11*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1154393529762694616405952270558316515261e80),
12*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.281655612889423906125295485693696744275e79),
13*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6037483524928743102724159846414025482077e78),
14*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1145927995397835468123576831800276999614e78),
15*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1938624296151985600348534009382865995154e77),
16*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.293980925856227626211879961219188406675e76),
17*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4015574518216966910319562902099567437832e75),
18*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4961475457509727343545565970423431880907e74),
19*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5565482348278933960215521991000378896338e73),
20*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5686112924615820754631098622770303094938e72),
21*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5305988545844796293285410303747469932856e71),
22*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4533363413802585060568537458067343491358e70),
23*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3553932059473516064068322757331575565718e69),
24*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2561198565218704414618802902533972354203e68),
25*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1699519313292900324098102065697454295572e67),
26*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1039830160862334505389615281373574959236e66),
27*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5873082967977428281000961954715372504986e64),
28*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3065255179030575882202133042549783442446e63),
29*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1479494813481364701208655943688307245459e62),
30*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6608150467921598615495180659808895663164e60),
31*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2732535313770902021791888953487787496976e59),
32*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1046402297662493314531194338414508049069e58),
33*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3711375077192882936085049147920021549622e56),
34*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1219154482883895482637944309702972234576e55),
35*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3708359374149458741391374452286837880162e53),
36*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1044095509971707189716913168889769471468e52),
37*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.271951506225063286130946773813524945052e50),
38*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6548016291215163843464133978454065823866e48),
39*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1456062447610542135403751730809295219344e47),
40*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2986690175077969760978388356833006028929e45),
41*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 5643149706574013350061247429006443326844000),
42*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 98047545414467090421964387960743688053480),
43*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1563378767746846395507385099301468978550),
44*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 22823360528584500077862274918382796495),
45*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 304215527004115213046601295970388750),
46*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3690289075895685793844344966820325),
47*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 40584512015702371433911456606050),
48*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 402834190897282802772754873905),
49*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3589522158493606918146495750),
50*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 28530557707503483723634725),
51*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 200714561335055753000730),
52*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1237953783437761888641),
53*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 6614698701445762950),
54*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 30155495647727505),
55*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 114953256021450),
56*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 356398020013),
57*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 863113950),
58*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1531345),
59*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1770),
60*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1)
};
static const double g = 63.192152;
@@ -283,6 +284,7 @@ template <class T>
T big_digamma(T x)
{
BOOST_MATH_STD_USING
if(x < 0)
{
return big_digamma_helper(static_cast<T>(1-x)) + constants::pi<T>() / tan(constants::pi<T>() * (1-x));

View File

@@ -12,17 +12,17 @@ namespace boost{ namespace math{ namespace lanczos{
//
// Lanczos Coefficients for N=13 G=13.144565
// Max experimental error (with arbitary precision arithmetic) 9.2213e-23
// Max experimental error (with arbitrary precision arithmetic) 9.2213e-23
// Generated with compiler: Microsoft Visual C++ version 8.0 on Win32 at Mar 23 2006
//
typedef lanczos13 lanczos13UDT;
//
// Lanczos Coefficients for N=22 G=22.61891
// Max experimental error (with arbitary precision arithmetic) 2.9524e-38
// Max experimental error (with arbitrary precision arithmetic) 2.9524e-38
// Generated with compiler: Microsoft Visual C++ version 8.0 on Win32 at Mar 23 2006
//
struct lanczos22UDT : public mpl::int_<120>
struct lanczos22UDT : public std::integral_constant<int, 120>
{
//
// Produces slightly better than 128-bit long-double precision when
@@ -213,7 +213,7 @@ struct lanczos22UDT : public mpl::int_<120>
};
//
// Lanczos Coefficients for N=31 G=32.08067
// Max experimental error (with arbitary precision arithmetic) 0.162e-52
// Max experimental error (with arbitrary precision arithmetic) 0.162e-52
// Generated with compiler: Microsoft Visual C++ version 8.0 on Win32 at May 9 2006
//
struct lanczos31UDT

View File

@@ -1,809 +0,0 @@
// Copyright John Maddock 2008.
// 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)
//
// Wrapper that works with mpfr_class defined in gmpfrxx.h
// See http://math.berkeley.edu/~wilken/code/gmpfrxx/
// Also requires the gmp and mpfr libraries.
//
#ifndef BOOST_MATH_E_FLOAT_BINDINGS_HPP
#define BOOST_MATH_E_FLOAT_BINDINGS_HPP
#include <boost/config.hpp>
#include <e_float/e_float.h>
#include <functions/functions.h>
#include <boost/math/tools/precision.hpp>
#include <boost/math/tools/real_cast.hpp>
#include <boost/math/policies/policy.hpp>
#include <boost/math/distributions/fwd.hpp>
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/bindings/detail/big_digamma.hpp>
#include <boost/math/bindings/detail/big_lanczos.hpp>
#include <boost/lexical_cast.hpp>
namespace boost{ namespace math{ namespace ef{
class e_float
{
public:
// Constructors:
e_float() {}
e_float(const ::e_float& c) : m_value(c){}
e_float(char c)
{
m_value = ::e_float(c);
}
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
e_float(wchar_t c)
{
m_value = ::e_float(c);
}
#endif
e_float(unsigned char c)
{
m_value = ::e_float(c);
}
e_float(signed char c)
{
m_value = ::e_float(c);
}
e_float(unsigned short c)
{
m_value = ::e_float(c);
}
e_float(short c)
{
m_value = ::e_float(c);
}
e_float(unsigned int c)
{
m_value = ::e_float(c);
}
e_float(int c)
{
m_value = ::e_float(c);
}
e_float(unsigned long c)
{
m_value = ::e_float((UINT64)c);
}
e_float(long c)
{
m_value = ::e_float((INT64)c);
}
#ifdef BOOST_HAS_LONG_LONG
e_float(boost::ulong_long_type c)
{
m_value = ::e_float(c);
}
e_float(boost::long_long_type c)
{
m_value = ::e_float(c);
}
#endif
e_float(float c)
{
assign_large_real(c);
}
e_float(double c)
{
assign_large_real(c);
}
e_float(long double c)
{
assign_large_real(c);
}
// Assignment:
e_float& operator=(char c) { m_value = ::e_float(c); return *this; }
e_float& operator=(unsigned char c) { m_value = ::e_float(c); return *this; }
e_float& operator=(signed char c) { m_value = ::e_float(c); return *this; }
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
e_float& operator=(wchar_t c) { m_value = ::e_float(c); return *this; }
#endif
e_float& operator=(short c) { m_value = ::e_float(c); return *this; }
e_float& operator=(unsigned short c) { m_value = ::e_float(c); return *this; }
e_float& operator=(int c) { m_value = ::e_float(c); return *this; }
e_float& operator=(unsigned int c) { m_value = ::e_float(c); return *this; }
e_float& operator=(long c) { m_value = ::e_float((INT64)c); return *this; }
e_float& operator=(unsigned long c) { m_value = ::e_float((UINT64)c); return *this; }
#ifdef BOOST_HAS_LONG_LONG
e_float& operator=(boost::long_long_type c) { m_value = ::e_float(c); return *this; }
e_float& operator=(boost::ulong_long_type c) { m_value = ::e_float(c); return *this; }
#endif
e_float& operator=(float c) { assign_large_real(c); return *this; }
e_float& operator=(double c) { assign_large_real(c); return *this; }
e_float& operator=(long double c) { assign_large_real(c); return *this; }
// Access:
::e_float& value(){ return m_value; }
::e_float const& value()const{ return m_value; }
// Member arithmetic:
e_float& operator+=(const e_float& other)
{ m_value += other.value(); return *this; }
e_float& operator-=(const e_float& other)
{ m_value -= other.value(); return *this; }
e_float& operator*=(const e_float& other)
{ m_value *= other.value(); return *this; }
e_float& operator/=(const e_float& other)
{ m_value /= other.value(); return *this; }
e_float operator-()const
{ return -m_value; }
e_float const& operator+()const
{ return *this; }
private:
::e_float m_value;
template <class V>
void assign_large_real(const V& a)
{
using std::frexp;
using std::ldexp;
using std::floor;
if (a == 0) {
m_value = ::ef::zero();
return;
}
if (a == 1) {
m_value = ::ef::one();
return;
}
if ((boost::math::isinf)(a))
{
m_value = a > 0 ? m_value.my_value_inf() : -m_value.my_value_inf();
return;
}
if((boost::math::isnan)(a))
{
m_value = m_value.my_value_nan();
return;
}
int e;
long double f, term;
::e_float t;
m_value = ::ef::zero();
f = frexp(a, &e);
::e_float shift = ::ef::pow2(30);
while(f)
{
// extract 30 bits from f:
f = ldexp(f, 30);
term = floor(f);
e -= 30;
m_value *= shift;
m_value += ::e_float(static_cast<INT64>(term));
f -= term;
}
m_value *= ::ef::pow2(e);
}
};
// Non-member arithmetic:
inline e_float operator+(const e_float& a, const e_float& b)
{
e_float result(a);
result += b;
return result;
}
inline e_float operator-(const e_float& a, const e_float& b)
{
e_float result(a);
result -= b;
return result;
}
inline e_float operator*(const e_float& a, const e_float& b)
{
e_float result(a);
result *= b;
return result;
}
inline e_float operator/(const e_float& a, const e_float& b)
{
e_float result(a);
result /= b;
return result;
}
// Comparison:
inline bool operator == (const e_float& a, const e_float& b)
{ return a.value() == b.value() ? true : false; }
inline bool operator != (const e_float& a, const e_float& b)
{ return a.value() != b.value() ? true : false;}
inline bool operator < (const e_float& a, const e_float& b)
{ return a.value() < b.value() ? true : false; }
inline bool operator <= (const e_float& a, const e_float& b)
{ return a.value() <= b.value() ? true : false; }
inline bool operator > (const e_float& a, const e_float& b)
{ return a.value() > b.value() ? true : false; }
inline bool operator >= (const e_float& a, const e_float& b)
{ return a.value() >= b.value() ? true : false; }
std::istream& operator >> (std::istream& is, e_float& f)
{
return is >> f.value();
}
std::ostream& operator << (std::ostream& os, const e_float& f)
{
return os << f.value();
}
inline e_float fabs(const e_float& v)
{
return ::ef::fabs(v.value());
}
inline e_float abs(const e_float& v)
{
return ::ef::fabs(v.value());
}
inline e_float floor(const e_float& v)
{
return ::ef::floor(v.value());
}
inline e_float ceil(const e_float& v)
{
return ::ef::ceil(v.value());
}
inline e_float pow(const e_float& v, const e_float& w)
{
return ::ef::pow(v.value(), w.value());
}
inline e_float pow(const e_float& v, int i)
{
return ::ef::pow(v.value(), ::e_float(i));
}
inline e_float exp(const e_float& v)
{
return ::ef::exp(v.value());
}
inline e_float log(const e_float& v)
{
return ::ef::log(v.value());
}
inline e_float sqrt(const e_float& v)
{
return ::ef::sqrt(v.value());
}
inline e_float sin(const e_float& v)
{
return ::ef::sin(v.value());
}
inline e_float cos(const e_float& v)
{
return ::ef::cos(v.value());
}
inline e_float tan(const e_float& v)
{
return ::ef::tan(v.value());
}
inline e_float acos(const e_float& v)
{
return ::ef::acos(v.value());
}
inline e_float asin(const e_float& v)
{
return ::ef::asin(v.value());
}
inline e_float atan(const e_float& v)
{
return ::ef::atan(v.value());
}
inline e_float atan2(const e_float& v, const e_float& u)
{
return ::ef::atan2(v.value(), u.value());
}
inline e_float ldexp(const e_float& v, int e)
{
return v.value() * ::ef::pow2(e);
}
inline e_float frexp(const e_float& v, int* expon)
{
double d;
INT64 i;
v.value().extract_parts(d, i);
*expon = static_cast<int>(i);
return v.value() * ::ef::pow2(-i);
}
inline e_float sinh (const e_float& x)
{
return ::ef::sinh(x.value());
}
inline e_float cosh (const e_float& x)
{
return ::ef::cosh(x.value());
}
inline e_float tanh (const e_float& x)
{
return ::ef::tanh(x.value());
}
inline e_float asinh (const e_float& x)
{
return ::ef::asinh(x.value());
}
inline e_float acosh (const e_float& x)
{
return ::ef::acosh(x.value());
}
inline e_float atanh (const e_float& x)
{
return ::ef::atanh(x.value());
}
e_float fmod(const e_float& v1, const e_float& v2)
{
e_float n;
if(v1 < 0)
n = ceil(v1 / v2);
else
n = floor(v1 / v2);
return v1 - n * v2;
}
} namespace detail{
template <>
inline int fpclassify_imp< boost::math::ef::e_float> BOOST_NO_MACRO_EXPAND(boost::math::ef::e_float x, const generic_tag<true>&)
{
if(x.value().isnan())
return FP_NAN;
if(x.value().isinf())
return FP_INFINITE;
if(x == 0)
return FP_ZERO;
return FP_NORMAL;
}
} namespace ef{
template <class Policy>
inline int itrunc(const e_float& v, const Policy& pol)
{
BOOST_MATH_STD_USING
e_float r = boost::math::trunc(v, pol);
if(fabs(r) > (std::numeric_limits<int>::max)())
return static_cast<int>(policies::raise_rounding_error("boost::math::itrunc<%1%>(%1%)", 0, 0, v, pol));
return static_cast<int>(r.value().extract_int64());
}
template <class Policy>
inline long ltrunc(const e_float& v, const Policy& pol)
{
BOOST_MATH_STD_USING
e_float r = boost::math::trunc(v, pol);
if(fabs(r) > (std::numeric_limits<long>::max)())
return static_cast<long>(policies::raise_rounding_error("boost::math::ltrunc<%1%>(%1%)", 0, 0L, v, pol));
return static_cast<long>(r.value().extract_int64());
}
#ifdef BOOST_HAS_LONG_LONG
template <class Policy>
inline boost::long_long_type lltrunc(const e_float& v, const Policy& pol)
{
BOOST_MATH_STD_USING
e_float r = boost::math::trunc(v, pol);
if(fabs(r) > (std::numeric_limits<boost::long_long_type>::max)())
return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::lltrunc<%1%>(%1%)", 0, v, 0LL, pol).value().extract_int64());
return static_cast<boost::long_long_type>(r.value().extract_int64());
}
#endif
template <class Policy>
inline int iround(const e_float& v, const Policy& pol)
{
BOOST_MATH_STD_USING
e_float r = boost::math::round(v, pol);
if(fabs(r) > (std::numeric_limits<int>::max)())
return static_cast<int>(policies::raise_rounding_error("boost::math::iround<%1%>(%1%)", 0, v, 0, pol).value().extract_int64());
return static_cast<int>(r.value().extract_int64());
}
template <class Policy>
inline long lround(const e_float& v, const Policy& pol)
{
BOOST_MATH_STD_USING
e_float r = boost::math::round(v, pol);
if(fabs(r) > (std::numeric_limits<long>::max)())
return static_cast<long int>(policies::raise_rounding_error("boost::math::lround<%1%>(%1%)", 0, v, 0L, pol).value().extract_int64());
return static_cast<long int>(r.value().extract_int64());
}
#ifdef BOOST_HAS_LONG_LONG
template <class Policy>
inline boost::long_long_type llround(const e_float& v, const Policy& pol)
{
BOOST_MATH_STD_USING
e_float r = boost::math::round(v, pol);
if(fabs(r) > (std::numeric_limits<boost::long_long_type>::max)())
return static_cast<boost::long_long_type>(policies::raise_rounding_error("boost::math::llround<%1%>(%1%)", 0, v, 0LL, pol).value().extract_int64());
return static_cast<boost::long_long_type>(r.value().extract_int64());
}
#endif
}}}
namespace std{
template<>
class numeric_limits< ::boost::math::ef::e_float> : public numeric_limits< ::e_float>
{
public:
static const ::boost::math::ef::e_float (min) (void)
{
return (numeric_limits< ::e_float>::min)();
}
static const ::boost::math::ef::e_float (max) (void)
{
return (numeric_limits< ::e_float>::max)();
}
static const ::boost::math::ef::e_float epsilon (void)
{
return (numeric_limits< ::e_float>::epsilon)();
}
static const ::boost::math::ef::e_float round_error(void)
{
return (numeric_limits< ::e_float>::round_error)();
}
static const ::boost::math::ef::e_float infinity (void)
{
return (numeric_limits< ::e_float>::infinity)();
}
static const ::boost::math::ef::e_float quiet_NaN (void)
{
return (numeric_limits< ::e_float>::quiet_NaN)();
}
//
// e_float's supplied digits member is wrong
// - it should be same the same as digits 10
// - given that radix is 10.
//
static const int digits = digits10;
};
} // namespace std
namespace boost{ namespace math{
namespace policies{
template <class Policy>
struct precision< ::boost::math::ef::e_float, Policy>
{
typedef typename Policy::precision_type precision_type;
typedef digits2<((::std::numeric_limits< ::boost::math::ef::e_float>::digits10 + 1) * 1000L) / 301L> digits_2;
typedef typename mpl::if_c<
((digits_2::value <= precision_type::value)
|| (Policy::precision_type::value <= 0)),
// Default case, full precision for RealType:
digits_2,
// User customised precision:
precision_type
>::type type;
};
}
namespace tools{
template <>
inline int digits< ::boost::math::ef::e_float>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC( ::boost::math::ef::e_float))
{
return ((::std::numeric_limits< ::boost::math::ef::e_float>::digits10 + 1) * 1000L) / 301L;
}
template <>
inline ::boost::math::ef::e_float root_epsilon< ::boost::math::ef::e_float>()
{
return detail::root_epsilon_imp(static_cast< ::boost::math::ef::e_float const*>(0), mpl::int_<0>());
}
template <>
inline ::boost::math::ef::e_float forth_root_epsilon< ::boost::math::ef::e_float>()
{
return detail::forth_root_epsilon_imp(static_cast< ::boost::math::ef::e_float const*>(0), mpl::int_<0>());
}
}
namespace lanczos{
template<class Policy>
struct lanczos<boost::math::ef::e_float, Policy>
{
typedef typename mpl::if_c<
std::numeric_limits< ::e_float>::digits10 < 22,
lanczos13UDT,
typename mpl::if_c<
std::numeric_limits< ::e_float>::digits10 < 36,
lanczos22UDT,
typename mpl::if_c<
std::numeric_limits< ::e_float>::digits10 < 50,
lanczos31UDT,
typename mpl::if_c<
std::numeric_limits< ::e_float>::digits10 < 110,
lanczos61UDT,
undefined_lanczos
>::type
>::type
>::type
>::type type;
};
} // namespace lanczos
template <class Policy>
inline boost::math::ef::e_float skewness(const extreme_value_distribution<boost::math::ef::e_float, Policy>& /*dist*/)
{
//
// This is 12 * sqrt(6) * zeta(3) / pi^3:
// See http://mathworld.wolfram.com/ExtremeValueDistribution.html
//
return boost::lexical_cast<boost::math::ef::e_float>("1.1395470994046486574927930193898461120875997958366");
}
template <class Policy>
inline boost::math::ef::e_float skewness(const rayleigh_distribution<boost::math::ef::e_float, Policy>& /*dist*/)
{
// using namespace boost::math::constants;
return boost::lexical_cast<boost::math::ef::e_float>("0.63111065781893713819189935154422777984404221106391");
// Computed using NTL at 150 bit, about 50 decimal digits.
// return 2 * root_pi<RealType>() * pi_minus_three<RealType>() / pow23_four_minus_pi<RealType>();
}
template <class Policy>
inline boost::math::ef::e_float kurtosis(const rayleigh_distribution<boost::math::ef::e_float, Policy>& /*dist*/)
{
// using namespace boost::math::constants;
return boost::lexical_cast<boost::math::ef::e_float>("3.2450893006876380628486604106197544154170667057995");
// Computed using NTL at 150 bit, about 50 decimal digits.
// return 3 - (6 * pi<RealType>() * pi<RealType>() - 24 * pi<RealType>() + 16) /
// (four_minus_pi<RealType>() * four_minus_pi<RealType>());
}
template <class Policy>
inline boost::math::ef::e_float kurtosis_excess(const rayleigh_distribution<boost::math::ef::e_float, Policy>& /*dist*/)
{
//using namespace boost::math::constants;
// Computed using NTL at 150 bit, about 50 decimal digits.
return boost::lexical_cast<boost::math::ef::e_float>("0.2450893006876380628486604106197544154170667057995");
// return -(6 * pi<RealType>() * pi<RealType>() - 24 * pi<RealType>() + 16) /
// (four_minus_pi<RealType>() * four_minus_pi<RealType>());
} // kurtosis
namespace detail{
//
// Version of Digamma accurate to ~100 decimal digits.
//
template <class Policy>
boost::math::ef::e_float digamma_imp(boost::math::ef::e_float x, const mpl::int_<0>* , const Policy& pol)
{
//
// This handles reflection of negative arguments, and all our
// eboost::math::ef::e_floator handling, then forwards to the T-specific approximation.
//
BOOST_MATH_STD_USING // ADL of std functions.
boost::math::ef::e_float result = 0;
//
// Check for negative arguments and use reflection:
//
if(x < 0)
{
// Reflect:
x = 1 - x;
// Argument reduction for tan:
boost::math::ef::e_float remainder = x - floor(x);
// Shift to negative if > 0.5:
if(remainder > 0.5)
{
remainder -= 1;
}
//
// check for evaluation at a negative pole:
//
if(remainder == 0)
{
return policies::raise_pole_error<boost::math::ef::e_float>("boost::math::digamma<%1%>(%1%)", 0, (1-x), pol);
}
result = constants::pi<boost::math::ef::e_float>() / tan(constants::pi<boost::math::ef::e_float>() * remainder);
}
result += big_digamma(x);
return result;
}
boost::math::ef::e_float bessel_i0(boost::math::ef::e_float x)
{
static const boost::math::ef::e_float P1[] = {
boost::lexical_cast<boost::math::ef::e_float>("-2.2335582639474375249e+15"),
boost::lexical_cast<boost::math::ef::e_float>("-5.5050369673018427753e+14"),
boost::lexical_cast<boost::math::ef::e_float>("-3.2940087627407749166e+13"),
boost::lexical_cast<boost::math::ef::e_float>("-8.4925101247114157499e+11"),
boost::lexical_cast<boost::math::ef::e_float>("-1.1912746104985237192e+10"),
boost::lexical_cast<boost::math::ef::e_float>("-1.0313066708737980747e+08"),
boost::lexical_cast<boost::math::ef::e_float>("-5.9545626019847898221e+05"),
boost::lexical_cast<boost::math::ef::e_float>("-2.4125195876041896775e+03"),
boost::lexical_cast<boost::math::ef::e_float>("-7.0935347449210549190e+00"),
boost::lexical_cast<boost::math::ef::e_float>("-1.5453977791786851041e-02"),
boost::lexical_cast<boost::math::ef::e_float>("-2.5172644670688975051e-05"),
boost::lexical_cast<boost::math::ef::e_float>("-3.0517226450451067446e-08"),
boost::lexical_cast<boost::math::ef::e_float>("-2.6843448573468483278e-11"),
boost::lexical_cast<boost::math::ef::e_float>("-1.5982226675653184646e-14"),
boost::lexical_cast<boost::math::ef::e_float>("-5.2487866627945699800e-18"),
};
static const boost::math::ef::e_float Q1[] = {
boost::lexical_cast<boost::math::ef::e_float>("-2.2335582639474375245e+15"),
boost::lexical_cast<boost::math::ef::e_float>("7.8858692566751002988e+12"),
boost::lexical_cast<boost::math::ef::e_float>("-1.2207067397808979846e+10"),
boost::lexical_cast<boost::math::ef::e_float>("1.0377081058062166144e+07"),
boost::lexical_cast<boost::math::ef::e_float>("-4.8527560179962773045e+03"),
boost::lexical_cast<boost::math::ef::e_float>("1.0"),
};
static const boost::math::ef::e_float P2[] = {
boost::lexical_cast<boost::math::ef::e_float>("-2.2210262233306573296e-04"),
boost::lexical_cast<boost::math::ef::e_float>("1.3067392038106924055e-02"),
boost::lexical_cast<boost::math::ef::e_float>("-4.4700805721174453923e-01"),
boost::lexical_cast<boost::math::ef::e_float>("5.5674518371240761397e+00"),
boost::lexical_cast<boost::math::ef::e_float>("-2.3517945679239481621e+01"),
boost::lexical_cast<boost::math::ef::e_float>("3.1611322818701131207e+01"),
boost::lexical_cast<boost::math::ef::e_float>("-9.6090021968656180000e+00"),
};
static const boost::math::ef::e_float Q2[] = {
boost::lexical_cast<boost::math::ef::e_float>("-5.5194330231005480228e-04"),
boost::lexical_cast<boost::math::ef::e_float>("3.2547697594819615062e-02"),
boost::lexical_cast<boost::math::ef::e_float>("-1.1151759188741312645e+00"),
boost::lexical_cast<boost::math::ef::e_float>("1.3982595353892851542e+01"),
boost::lexical_cast<boost::math::ef::e_float>("-6.0228002066743340583e+01"),
boost::lexical_cast<boost::math::ef::e_float>("8.5539563258012929600e+01"),
boost::lexical_cast<boost::math::ef::e_float>("-3.1446690275135491500e+01"),
boost::lexical_cast<boost::math::ef::e_float>("1.0"),
};
boost::math::ef::e_float value, factor, r;
BOOST_MATH_STD_USING
using namespace boost::math::tools;
if (x < 0)
{
x = -x; // even function
}
if (x == 0)
{
return static_cast<boost::math::ef::e_float>(1);
}
if (x <= 15) // x in (0, 15]
{
boost::math::ef::e_float y = x * x;
value = evaluate_polynomial(P1, y) / evaluate_polynomial(Q1, y);
}
else // x in (15, \infty)
{
boost::math::ef::e_float y = 1 / x - boost::math::ef::e_float(1) / 15;
r = evaluate_polynomial(P2, y) / evaluate_polynomial(Q2, y);
factor = exp(x) / sqrt(x);
value = factor * r;
}
return value;
}
boost::math::ef::e_float bessel_i1(boost::math::ef::e_float x)
{
static const boost::math::ef::e_float P1[] = {
lexical_cast<boost::math::ef::e_float>("-1.4577180278143463643e+15"),
lexical_cast<boost::math::ef::e_float>("-1.7732037840791591320e+14"),
lexical_cast<boost::math::ef::e_float>("-6.9876779648010090070e+12"),
lexical_cast<boost::math::ef::e_float>("-1.3357437682275493024e+11"),
lexical_cast<boost::math::ef::e_float>("-1.4828267606612366099e+09"),
lexical_cast<boost::math::ef::e_float>("-1.0588550724769347106e+07"),
lexical_cast<boost::math::ef::e_float>("-5.1894091982308017540e+04"),
lexical_cast<boost::math::ef::e_float>("-1.8225946631657315931e+02"),
lexical_cast<boost::math::ef::e_float>("-4.7207090827310162436e-01"),
lexical_cast<boost::math::ef::e_float>("-9.1746443287817501309e-04"),
lexical_cast<boost::math::ef::e_float>("-1.3466829827635152875e-06"),
lexical_cast<boost::math::ef::e_float>("-1.4831904935994647675e-09"),
lexical_cast<boost::math::ef::e_float>("-1.1928788903603238754e-12"),
lexical_cast<boost::math::ef::e_float>("-6.5245515583151902910e-16"),
lexical_cast<boost::math::ef::e_float>("-1.9705291802535139930e-19"),
};
static const boost::math::ef::e_float Q1[] = {
lexical_cast<boost::math::ef::e_float>("-2.9154360556286927285e+15"),
lexical_cast<boost::math::ef::e_float>("9.7887501377547640438e+12"),
lexical_cast<boost::math::ef::e_float>("-1.4386907088588283434e+10"),
lexical_cast<boost::math::ef::e_float>("1.1594225856856884006e+07"),
lexical_cast<boost::math::ef::e_float>("-5.1326864679904189920e+03"),
lexical_cast<boost::math::ef::e_float>("1.0"),
};
static const boost::math::ef::e_float P2[] = {
lexical_cast<boost::math::ef::e_float>("1.4582087408985668208e-05"),
lexical_cast<boost::math::ef::e_float>("-8.9359825138577646443e-04"),
lexical_cast<boost::math::ef::e_float>("2.9204895411257790122e-02"),
lexical_cast<boost::math::ef::e_float>("-3.4198728018058047439e-01"),
lexical_cast<boost::math::ef::e_float>("1.3960118277609544334e+00"),
lexical_cast<boost::math::ef::e_float>("-1.9746376087200685843e+00"),
lexical_cast<boost::math::ef::e_float>("8.5591872901933459000e-01"),
lexical_cast<boost::math::ef::e_float>("-6.0437159056137599999e-02"),
};
static const boost::math::ef::e_float Q2[] = {
lexical_cast<boost::math::ef::e_float>("3.7510433111922824643e-05"),
lexical_cast<boost::math::ef::e_float>("-2.2835624489492512649e-03"),
lexical_cast<boost::math::ef::e_float>("7.4212010813186530069e-02"),
lexical_cast<boost::math::ef::e_float>("-8.5017476463217924408e-01"),
lexical_cast<boost::math::ef::e_float>("3.2593714889036996297e+00"),
lexical_cast<boost::math::ef::e_float>("-3.8806586721556593450e+00"),
lexical_cast<boost::math::ef::e_float>("1.0"),
};
boost::math::ef::e_float value, factor, r, w;
BOOST_MATH_STD_USING
using namespace boost::math::tools;
w = abs(x);
if (x == 0)
{
return static_cast<boost::math::ef::e_float>(0);
}
if (w <= 15) // w in (0, 15]
{
boost::math::ef::e_float y = x * x;
r = evaluate_polynomial(P1, y) / evaluate_polynomial(Q1, y);
factor = w;
value = factor * r;
}
else // w in (15, \infty)
{
boost::math::ef::e_float y = 1 / w - boost::math::ef::e_float(1) / 15;
r = evaluate_polynomial(P2, y) / evaluate_polynomial(Q2, y);
factor = exp(w) / sqrt(w);
value = factor * r;
}
if (x < 0)
{
value *= -value; // odd function
}
return value;
}
} // namespace detail
}}
#endif // BOOST_MATH_E_FLOAT_BINDINGS_HPP

View File

@@ -11,12 +11,11 @@
#ifndef BOOST_MATH_MPLFR_BINDINGS_HPP
#define BOOST_MATH_MPLFR_BINDINGS_HPP
#include <boost/config.hpp>
#include <boost/lexical_cast.hpp>
#include <type_traits>
#ifdef BOOST_MSVC
#ifdef _MSC_VER
//
// We get a lot of warnings from the gmp, mpfr and gmpfrxx headers,
// We get a lot of warnings from the gmp, mpfr and gmpfrxx headers,
// disable them here, so we only see warnings from *our* code:
//
#pragma warning(push)
@@ -25,7 +24,7 @@
#include <gmpfrxx.h>
#ifdef BOOST_MSVC
#ifdef _MSC_VER
#pragma warning(pop)
#endif
@@ -37,6 +36,7 @@
#include <boost/math/bindings/detail/big_digamma.hpp>
#include <boost/math/bindings/detail/big_lanczos.hpp>
#include <boost/math/tools/big_constant.hpp>
#include <boost/math/tools/config.hpp>
inline mpfr_class fabs(const mpfr_class& v)
{
@@ -181,12 +181,12 @@ inline long long lltrunc(__gmp_expr<T,U> const& x, const Policy& pol)
return lltrunc(static_cast<mpfr_class>(x), pol);
}
namespace boost{
namespace boost{
#ifdef BOOST_MATH_USE_FLOAT128
template<> struct is_convertible<BOOST_MATH_FLOAT128_TYPE, mpfr_class> : public boost::integral_constant<bool, false>{};
template<> struct std::is_convertible<BOOST_MATH_FLOAT128_TYPE, mpfr_class> : public std::integral_constant<bool, false>{};
#endif
template<> struct is_convertible<long long, mpfr_class> : public boost::integral_constant<bool, false>{};
template<> struct std::is_convertible<long long, mpfr_class> : public std::integral_constant<bool, false>{};
namespace math{
@@ -253,7 +253,7 @@ struct mpfr_lanczos
return lanczos61UDT::lanczos_sum_near_2(z);
}
static mpfr_class g()
{
{
unsigned long p = mpfr_class::get_dprec();
if(p <= 72)
return lanczos13UDT::g();
@@ -282,7 +282,7 @@ struct construction_traits;
template <class Policy>
struct construction_traits<mpfr_class, Policy>
{
typedef mpl::int_<0> type;
typedef std::integral_constant<int, 0> type;
};
}
@@ -297,7 +297,7 @@ struct promote_arg<__gmp_expr<T,U> >
};
template<>
inline int digits<mpfr_class>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpfr_class)) BOOST_NOEXCEPT
inline int digits<mpfr_class>(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(mpfr_class)) noexcept
{
return mpfr_class::get_dprec();
}
@@ -335,7 +335,7 @@ inline mpfr_class real_cast<mpfr_class, long long>(long long t)
}
while(t)
{
result += ldexp((double)(t & 0xffffL), expon);
result += ldexp(static_cast<double>(t & 0xffffL), expon);
expon += 32;
t >>= 32;
}
@@ -455,14 +455,22 @@ inline mpfr_class skewness(const extreme_value_distribution<mpfr_class, Policy>&
// This is 12 * sqrt(6) * zeta(3) / pi^3:
// See http://mathworld.wolfram.com/ExtremeValueDistribution.html
//
return boost::lexical_cast<mpfr_class>("1.1395470994046486574927930193898461120875997958366");
#ifdef BOOST_MATH_STANDALONE
static_assert(sizeof(Policy) == 0, "mpfr skewness can not be calculated in standalone mode");
#endif
return static_cast<mpfr_class>("1.1395470994046486574927930193898461120875997958366");
}
template <class Policy>
inline mpfr_class skewness(const rayleigh_distribution<mpfr_class, Policy>& /*dist*/)
{
// using namespace boost::math::constants;
return boost::lexical_cast<mpfr_class>("0.63111065781893713819189935154422777984404221106391");
#ifdef BOOST_MATH_STANDALONE
static_assert(sizeof(Policy) == 0, "mpfr skewness can not be calculated in standalone mode");
#endif
return static_cast<mpfr_class>("0.63111065781893713819189935154422777984404221106391");
// Computed using NTL at 150 bit, about 50 decimal digits.
// return 2 * root_pi<RealType>() * pi_minus_three<RealType>() / pow23_four_minus_pi<RealType>();
}
@@ -471,7 +479,11 @@ template <class Policy>
inline mpfr_class kurtosis(const rayleigh_distribution<mpfr_class, Policy>& /*dist*/)
{
// using namespace boost::math::constants;
return boost::lexical_cast<mpfr_class>("3.2450893006876380628486604106197544154170667057995");
#ifdef BOOST_MATH_STANDALONE
static_assert(sizeof(Policy) == 0, "mpfr kurtosis can not be calculated in standalone mode");
#endif
return static_cast<mpfr_class>("3.2450893006876380628486604106197544154170667057995");
// Computed using NTL at 150 bit, about 50 decimal digits.
// return 3 - (6 * pi<RealType>() * pi<RealType>() - 24 * pi<RealType>() + 16) /
// (four_minus_pi<RealType>() * four_minus_pi<RealType>());
@@ -482,7 +494,11 @@ inline mpfr_class kurtosis_excess(const rayleigh_distribution<mpfr_class, Policy
{
//using namespace boost::math::constants;
// Computed using NTL at 150 bit, about 50 decimal digits.
return boost::lexical_cast<mpfr_class>("0.2450893006876380628486604106197544154170667057995");
#ifdef BOOST_MATH_STANDALONE
static_assert(sizeof(Policy) == 0, "mpfr excess kurtosis can not be calculated in standalone mode");
#endif
return static_cast<mpfr_class>("0.2450893006876380628486604106197544154170667057995");
// return -(6 * pi<RealType>() * pi<RealType>() - 24 * pi<RealType>() + 16) /
// (four_minus_pi<RealType>() * four_minus_pi<RealType>());
} // kurtosis
@@ -493,7 +509,7 @@ namespace detail{
// Version of Digamma accurate to ~100 decimal digits.
//
template <class Policy>
mpfr_class digamma_imp(mpfr_class x, const mpl::int_<0>* , const Policy& pol)
mpfr_class digamma_imp(mpfr_class x, const std::integral_constant<int, 0>* , const Policy& pol)
{
//
// This handles reflection of negative arguments, and all our
@@ -521,7 +537,7 @@ mpfr_class digamma_imp(mpfr_class x, const mpl::int_<0>* , const Policy& pol)
//
if(remainder == 0)
{
return policies::raise_pole_error<mpfr_class>("boost::math::digamma<%1%>(%1%)", 0, (1-x), pol);
return policies::raise_pole_error<mpfr_class>("boost::math::digamma<%1%>(%1%)", nullptr, (1-x), pol);
}
result = constants::pi<mpfr_class>() / tan(constants::pi<mpfr_class>() * remainder);
}
@@ -533,12 +549,12 @@ mpfr_class digamma_imp(mpfr_class x, const mpl::int_<0>* , const Policy& pol)
// starting guess for Halley iteration:
//
template <class Policy>
inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Policy&, const boost::mpl::int_<64>*)
inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Policy&, const std::integral_constant<int, 64>*)
{
BOOST_MATH_STD_USING // for ADL of std names.
mpfr_class result = 0;
if(p <= 0.5)
{
//
@@ -554,7 +570,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
// Maximum Deviation Found (actual empfr_classor term at infinite precision) 8.030e-21
//
static const float Y = 0.0891314744949340820313f;
static const mpfr_class P[] = {
static const mpfr_class P[] = {
-0.000508781949658280665617,
-0.00836874819741736770379,
0.0334806625409744615033,
@@ -564,7 +580,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
0.00822687874676915743155,
-0.00538772965071242932965
};
static const mpfr_class Q[] = {
static const mpfr_class Q[] = {
1,
-0.970005043303290640362,
-1.56574558234175846809,
@@ -595,7 +611,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
// Maximum Deviation Found (empfr_classor term) 4.811e-20
//
static const float Y = 2.249481201171875f;
static const mpfr_class P[] = {
static const mpfr_class P[] = {
-0.202433508355938759655,
0.105264680699391713268,
8.37050328343119927838,
@@ -606,7 +622,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
21.1294655448340526258,
-3.67192254707729348546
};
static const mpfr_class Q[] = {
static const mpfr_class Q[] = {
1,
6.24264124854247537712,
3.9713437953343869095,
@@ -634,7 +650,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
//
// x(Y+R(x-B))
//
// where Y is a constant, B is the lowest value of x for which
// where Y is a constant, B is the lowest value of x for which
// the approximation is valid, and R(x-B) is optimised for a low
// absolute empfr_classor compared to Y.
//
@@ -648,7 +664,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
{
// Max empfr_classor found: 1.089051e-20
static const float Y = 0.807220458984375f;
static const mpfr_class P[] = {
static const mpfr_class P[] = {
-0.131102781679951906451,
-0.163794047193317060787,
0.117030156341995252019,
@@ -661,7 +677,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
0.285225331782217055858e-7,
-0.681149956853776992068e-9
};
static const mpfr_class Q[] = {
static const mpfr_class Q[] = {
1,
3.46625407242567245975,
5.38168345707006855425,
@@ -679,7 +695,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
{
// Max empfr_classor found: 8.389174e-21
static const float Y = 0.93995571136474609375f;
static const mpfr_class P[] = {
static const mpfr_class P[] = {
-0.0350353787183177984712,
-0.00222426529213447927281,
0.0185573306514231072324,
@@ -690,7 +706,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
-0.230404776911882601748e-9,
0.266339227425782031962e-11
};
static const mpfr_class Q[] = {
static const mpfr_class Q[] = {
1,
1.3653349817554063097,
0.762059164553623404043,
@@ -707,7 +723,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
{
// Max empfr_classor found: 1.481312e-19
static const float Y = 0.98362827301025390625f;
static const mpfr_class P[] = {
static const mpfr_class P[] = {
-0.0167431005076633737133,
-0.00112951438745580278863,
0.00105628862152492910091,
@@ -718,7 +734,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
-0.281128735628831791805e-13,
0.99055709973310326855e-16
};
static const mpfr_class Q[] = {
static const mpfr_class Q[] = {
1,
0.591429344886417493481,
0.138151865749083321638,
@@ -735,7 +751,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
{
// Max empfr_classor found: 5.697761e-20
static const float Y = 0.99714565277099609375f;
static const mpfr_class P[] = {
static const mpfr_class P[] = {
-0.0024978212791898131227,
-0.779190719229053954292e-5,
0.254723037413027451751e-4,
@@ -745,7 +761,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
0.145596286718675035587e-11,
-0.116765012397184275695e-17
};
static const mpfr_class Q[] = {
static const mpfr_class Q[] = {
1,
0.207123112214422517181,
0.0169410838120975906478,
@@ -762,7 +778,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
{
// Max empfr_classor found: 1.279746e-20
static const float Y = 0.99941349029541015625f;
static const mpfr_class P[] = {
static const mpfr_class P[] = {
-0.000539042911019078575891,
-0.28398759004727721098e-6,
0.899465114892291446442e-6,
@@ -772,7 +788,7 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
0.135880130108924861008e-14,
-0.348890393399948882918e-21
};
static const mpfr_class Q[] = {
static const mpfr_class Q[] = {
1,
0.0845746234001899436914,
0.00282092984726264681981,
@@ -791,49 +807,53 @@ inline mpfr_class erf_inv_imp(const mpfr_class& p, const mpfr_class& q, const Po
inline mpfr_class bessel_i0(mpfr_class x)
{
#ifdef BOOST_MATH_STANDALONE
static_assert(sizeof(x) == 0, "mpfr bessel_i0 can not be calculated in standalone mode");
#endif
static const mpfr_class P1[] = {
boost::lexical_cast<mpfr_class>("-2.2335582639474375249e+15"),
boost::lexical_cast<mpfr_class>("-5.5050369673018427753e+14"),
boost::lexical_cast<mpfr_class>("-3.2940087627407749166e+13"),
boost::lexical_cast<mpfr_class>("-8.4925101247114157499e+11"),
boost::lexical_cast<mpfr_class>("-1.1912746104985237192e+10"),
boost::lexical_cast<mpfr_class>("-1.0313066708737980747e+08"),
boost::lexical_cast<mpfr_class>("-5.9545626019847898221e+05"),
boost::lexical_cast<mpfr_class>("-2.4125195876041896775e+03"),
boost::lexical_cast<mpfr_class>("-7.0935347449210549190e+00"),
boost::lexical_cast<mpfr_class>("-1.5453977791786851041e-02"),
boost::lexical_cast<mpfr_class>("-2.5172644670688975051e-05"),
boost::lexical_cast<mpfr_class>("-3.0517226450451067446e-08"),
boost::lexical_cast<mpfr_class>("-2.6843448573468483278e-11"),
boost::lexical_cast<mpfr_class>("-1.5982226675653184646e-14"),
boost::lexical_cast<mpfr_class>("-5.2487866627945699800e-18"),
static_cast<mpfr_class>("-2.2335582639474375249e+15"),
static_cast<mpfr_class>("-5.5050369673018427753e+14"),
static_cast<mpfr_class>("-3.2940087627407749166e+13"),
static_cast<mpfr_class>("-8.4925101247114157499e+11"),
static_cast<mpfr_class>("-1.1912746104985237192e+10"),
static_cast<mpfr_class>("-1.0313066708737980747e+08"),
static_cast<mpfr_class>("-5.9545626019847898221e+05"),
static_cast<mpfr_class>("-2.4125195876041896775e+03"),
static_cast<mpfr_class>("-7.0935347449210549190e+00"),
static_cast<mpfr_class>("-1.5453977791786851041e-02"),
static_cast<mpfr_class>("-2.5172644670688975051e-05"),
static_cast<mpfr_class>("-3.0517226450451067446e-08"),
static_cast<mpfr_class>("-2.6843448573468483278e-11"),
static_cast<mpfr_class>("-1.5982226675653184646e-14"),
static_cast<mpfr_class>("-5.2487866627945699800e-18"),
};
static const mpfr_class Q1[] = {
boost::lexical_cast<mpfr_class>("-2.2335582639474375245e+15"),
boost::lexical_cast<mpfr_class>("7.8858692566751002988e+12"),
boost::lexical_cast<mpfr_class>("-1.2207067397808979846e+10"),
boost::lexical_cast<mpfr_class>("1.0377081058062166144e+07"),
boost::lexical_cast<mpfr_class>("-4.8527560179962773045e+03"),
boost::lexical_cast<mpfr_class>("1.0"),
static_cast<mpfr_class>("-2.2335582639474375245e+15"),
static_cast<mpfr_class>("7.8858692566751002988e+12"),
static_cast<mpfr_class>("-1.2207067397808979846e+10"),
static_cast<mpfr_class>("1.0377081058062166144e+07"),
static_cast<mpfr_class>("-4.8527560179962773045e+03"),
static_cast<mpfr_class>("1.0"),
};
static const mpfr_class P2[] = {
boost::lexical_cast<mpfr_class>("-2.2210262233306573296e-04"),
boost::lexical_cast<mpfr_class>("1.3067392038106924055e-02"),
boost::lexical_cast<mpfr_class>("-4.4700805721174453923e-01"),
boost::lexical_cast<mpfr_class>("5.5674518371240761397e+00"),
boost::lexical_cast<mpfr_class>("-2.3517945679239481621e+01"),
boost::lexical_cast<mpfr_class>("3.1611322818701131207e+01"),
boost::lexical_cast<mpfr_class>("-9.6090021968656180000e+00"),
static_cast<mpfr_class>("-2.2210262233306573296e-04"),
static_cast<mpfr_class>("1.3067392038106924055e-02"),
static_cast<mpfr_class>("-4.4700805721174453923e-01"),
static_cast<mpfr_class>("5.5674518371240761397e+00"),
static_cast<mpfr_class>("-2.3517945679239481621e+01"),
static_cast<mpfr_class>("3.1611322818701131207e+01"),
static_cast<mpfr_class>("-9.6090021968656180000e+00"),
};
static const mpfr_class Q2[] = {
boost::lexical_cast<mpfr_class>("-5.5194330231005480228e-04"),
boost::lexical_cast<mpfr_class>("3.2547697594819615062e-02"),
boost::lexical_cast<mpfr_class>("-1.1151759188741312645e+00"),
boost::lexical_cast<mpfr_class>("1.3982595353892851542e+01"),
boost::lexical_cast<mpfr_class>("-6.0228002066743340583e+01"),
boost::lexical_cast<mpfr_class>("8.5539563258012929600e+01"),
boost::lexical_cast<mpfr_class>("-3.1446690275135491500e+01"),
boost::lexical_cast<mpfr_class>("1.0"),
static_cast<mpfr_class>("-5.5194330231005480228e-04"),
static_cast<mpfr_class>("3.2547697594819615062e-02"),
static_cast<mpfr_class>("-1.1151759188741312645e+00"),
static_cast<mpfr_class>("1.3982595353892851542e+01"),
static_cast<mpfr_class>("-6.0228002066743340583e+01"),
static_cast<mpfr_class>("8.5539563258012929600e+01"),
static_cast<mpfr_class>("-3.1446690275135491500e+01"),
static_cast<mpfr_class>("1.0"),
};
mpfr_class value, factor, r;
@@ -946,7 +966,7 @@ inline mpfr_class bessel_i1(mpfr_class x)
}
template<> struct is_convertible<long double, mpfr_class> : public mpl::false_{};
template<> struct std::is_convertible<long double, mpfr_class> : public std::false_type{};
}

View File

@@ -11,12 +11,11 @@
#ifndef BOOST_MATH_MPREAL_BINDINGS_HPP
#define BOOST_MATH_MPREAL_BINDINGS_HPP
#include <boost/config.hpp>
#include <boost/lexical_cast.hpp>
#include <type_traits>
#ifdef BOOST_MSVC
#ifdef _MSC_VER
//
// We get a lot of warnings from the gmp, mpfr and gmpfrxx headers,
// We get a lot of warnings from the gmp, mpfr and gmpfrxx headers,
// disable them here, so we only see warnings from *our* code:
//
#pragma warning(push)
@@ -25,7 +24,7 @@
#include <mpreal.h>
#ifdef BOOST_MSVC
#ifdef _MSC_VER
#pragma warning(pop)
#endif
@@ -36,6 +35,10 @@
#include <boost/math/special_functions/math_fwd.hpp>
#include <boost/math/bindings/detail/big_digamma.hpp>
#include <boost/math/bindings/detail/big_lanczos.hpp>
#include <boost/math/tools/config.hpp>
#ifndef BOOST_MATH_STANDALONE
#include <boost/lexical_cast.hpp>
#endif
namespace mpfr{
@@ -229,7 +232,7 @@ struct mpreal_lanczos
return lanczos61UDT::lanczos_sum_near_2(z);
}
static mpfr::mpreal g()
{
{
unsigned long p = mpfr::mpreal::get_default_prec();
if(p <= 72)
return lanczos13UDT::g();
@@ -292,7 +295,7 @@ inline mpfr::mpreal real_cast<mpfr::mpreal, long long>(long long t)
}
while(t)
{
result += ldexp((double)(t & 0xffffL), expon);
result += ldexp(static_cast<double>(t & 0xffffL), expon);
expon += 32;
t >>= 32;
}
@@ -402,6 +405,10 @@ inline mpfr::mpreal skewness(const extreme_value_distribution<mpfr::mpreal, Poli
// This is 12 * sqrt(6) * zeta(3) / pi^3:
// See http://mathworld.wolfram.com/ExtremeValueDistribution.html
//
#ifdef BOOST_MATH_STANDALONE
static_assert(sizeof(Policy) == 0, "mpreal skewness can not be calculated in standalone mode");
#endif
return boost::lexical_cast<mpfr::mpreal>("1.1395470994046486574927930193898461120875997958366");
}
@@ -409,6 +416,10 @@ template <class Policy>
inline mpfr::mpreal skewness(const rayleigh_distribution<mpfr::mpreal, Policy>& /*dist*/)
{
// using namespace boost::math::constants;
#ifdef BOOST_MATH_STANDALONE
static_assert(sizeof(Policy) == 0, "mpreal skewness can not be calculated in standalone mode");
#endif
return boost::lexical_cast<mpfr::mpreal>("0.63111065781893713819189935154422777984404221106391");
// Computed using NTL at 150 bit, about 50 decimal digits.
// return 2 * root_pi<RealType>() * pi_minus_three<RealType>() / pow23_four_minus_pi<RealType>();
@@ -418,6 +429,10 @@ template <class Policy>
inline mpfr::mpreal kurtosis(const rayleigh_distribution<mpfr::mpreal, Policy>& /*dist*/)
{
// using namespace boost::math::constants;
#ifdef BOOST_MATH_STANDALONE
static_assert(sizeof(Policy) == 0, "mpreal kurtosis can not be calculated in standalone mode");
#endif
return boost::lexical_cast<mpfr::mpreal>("3.2450893006876380628486604106197544154170667057995");
// Computed using NTL at 150 bit, about 50 decimal digits.
// return 3 - (6 * pi<RealType>() * pi<RealType>() - 24 * pi<RealType>() + 16) /
@@ -429,6 +444,10 @@ inline mpfr::mpreal kurtosis_excess(const rayleigh_distribution<mpfr::mpreal, Po
{
//using namespace boost::math::constants;
// Computed using NTL at 150 bit, about 50 decimal digits.
#ifdef BOOST_MATH_STANDALONE
static_assert(sizeof(Policy) == 0, "mpreal excess kurtosis can not be calculated in standalone mode");
#endif
return boost::lexical_cast<mpfr::mpreal>("0.2450893006876380628486604106197544154170667057995");
// return -(6 * pi<RealType>() * pi<RealType>() - 24 * pi<RealType>() + 16) /
// (four_minus_pi<RealType>() * four_minus_pi<RealType>());
@@ -440,7 +459,7 @@ namespace detail{
// Version of Digamma accurate to ~100 decimal digits.
//
template <class Policy>
mpfr::mpreal digamma_imp(mpfr::mpreal x, const mpl::int_<0>* , const Policy& pol)
mpfr::mpreal digamma_imp(mpfr::mpreal x, const std::integral_constant<int, 0>* , const Policy& pol)
{
//
// This handles reflection of negative arguments, and all our
@@ -468,7 +487,7 @@ mpfr::mpreal digamma_imp(mpfr::mpreal x, const mpl::int_<0>* , const Policy& pol
//
if(remainder == 0)
{
return policies::raise_pole_error<mpfr::mpreal>("boost::math::digamma<%1%>(%1%)", 0, (1-x), pol);
return policies::raise_pole_error<mpfr::mpreal>("boost::math::digamma<%1%>(%1%)", nullptr, (1-x), pol);
}
result = constants::pi<mpfr::mpreal>() / tan(constants::pi<mpfr::mpreal>() * remainder);
}
@@ -480,12 +499,12 @@ mpfr::mpreal digamma_imp(mpfr::mpreal x, const mpl::int_<0>* , const Policy& pol
// starting guess for Halley iteration:
//
template <class Policy>
mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Policy&, const boost::mpl::int_<64>*)
mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Policy&, const std::integral_constant<int, 64>*)
{
BOOST_MATH_STD_USING // for ADL of std names.
mpfr::mpreal result = 0;
if(p <= 0.5)
{
//
@@ -501,7 +520,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
// Maximum Deviation Found (actual empfr_classor term at infinite precision) 8.030e-21
//
static const float Y = 0.0891314744949340820313f;
static const mpfr::mpreal P[] = {
static const mpfr::mpreal P[] = {
-0.000508781949658280665617,
-0.00836874819741736770379,
0.0334806625409744615033,
@@ -511,7 +530,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
0.00822687874676915743155,
-0.00538772965071242932965
};
static const mpfr::mpreal Q[] = {
static const mpfr::mpreal Q[] = {
1,
-0.970005043303290640362,
-1.56574558234175846809,
@@ -542,7 +561,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
// Maximum Deviation Found (empfr_classor term) 4.811e-20
//
static const float Y = 2.249481201171875f;
static const mpfr::mpreal P[] = {
static const mpfr::mpreal P[] = {
-0.202433508355938759655,
0.105264680699391713268,
8.37050328343119927838,
@@ -553,7 +572,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
21.1294655448340526258,
-3.67192254707729348546
};
static const mpfr::mpreal Q[] = {
static const mpfr::mpreal Q[] = {
1,
6.24264124854247537712,
3.9713437953343869095,
@@ -581,7 +600,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
//
// x(Y+R(x-B))
//
// where Y is a constant, B is the lowest value of x for which
// where Y is a constant, B is the lowest value of x for which
// the approximation is valid, and R(x-B) is optimised for a low
// absolute empfr_classor compared to Y.
//
@@ -595,7 +614,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
{
// Max empfr_classor found: 1.089051e-20
static const float Y = 0.807220458984375f;
static const mpfr::mpreal P[] = {
static const mpfr::mpreal P[] = {
-0.131102781679951906451,
-0.163794047193317060787,
0.117030156341995252019,
@@ -608,7 +627,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
0.285225331782217055858e-7,
-0.681149956853776992068e-9
};
static const mpfr::mpreal Q[] = {
static const mpfr::mpreal Q[] = {
1,
3.46625407242567245975,
5.38168345707006855425,
@@ -626,7 +645,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
{
// Max empfr_classor found: 8.389174e-21
static const float Y = 0.93995571136474609375f;
static const mpfr::mpreal P[] = {
static const mpfr::mpreal P[] = {
-0.0350353787183177984712,
-0.00222426529213447927281,
0.0185573306514231072324,
@@ -637,7 +656,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
-0.230404776911882601748e-9,
0.266339227425782031962e-11
};
static const mpfr::mpreal Q[] = {
static const mpfr::mpreal Q[] = {
1,
1.3653349817554063097,
0.762059164553623404043,
@@ -654,7 +673,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
{
// Max empfr_classor found: 1.481312e-19
static const float Y = 0.98362827301025390625f;
static const mpfr::mpreal P[] = {
static const mpfr::mpreal P[] = {
-0.0167431005076633737133,
-0.00112951438745580278863,
0.00105628862152492910091,
@@ -665,7 +684,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
-0.281128735628831791805e-13,
0.99055709973310326855e-16
};
static const mpfr::mpreal Q[] = {
static const mpfr::mpreal Q[] = {
1,
0.591429344886417493481,
0.138151865749083321638,
@@ -682,7 +701,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
{
// Max empfr_classor found: 5.697761e-20
static const float Y = 0.99714565277099609375f;
static const mpfr::mpreal P[] = {
static const mpfr::mpreal P[] = {
-0.0024978212791898131227,
-0.779190719229053954292e-5,
0.254723037413027451751e-4,
@@ -692,7 +711,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
0.145596286718675035587e-11,
-0.116765012397184275695e-17
};
static const mpfr::mpreal Q[] = {
static const mpfr::mpreal Q[] = {
1,
0.207123112214422517181,
0.0169410838120975906478,
@@ -709,7 +728,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
{
// Max empfr_classor found: 1.279746e-20
static const float Y = 0.99941349029541015625f;
static const mpfr::mpreal P[] = {
static const mpfr::mpreal P[] = {
-0.000539042911019078575891,
-0.28398759004727721098e-6,
0.899465114892291446442e-6,
@@ -719,7 +738,7 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
0.135880130108924861008e-14,
-0.348890393399948882918e-21
};
static const mpfr::mpreal Q[] = {
static const mpfr::mpreal Q[] = {
1,
0.0845746234001899436914,
0.00282092984726264681981,
@@ -738,6 +757,10 @@ mpfr::mpreal erf_inv_imp(const mpfr::mpreal& p, const mpfr::mpreal& q, const Pol
inline mpfr::mpreal bessel_i0(mpfr::mpreal x)
{
#ifdef BOOST_MATH_STANDALONE
static_assert(sizeof(x) == 0, "mpreal bessel_i0 can not be calculated in standalone mode");
#endif
static const mpfr::mpreal P1[] = {
boost::lexical_cast<mpfr::mpreal>("-2.2335582639474375249e+15"),
boost::lexical_cast<mpfr::mpreal>("-5.5050369673018427753e+14"),

View File

@@ -6,19 +6,19 @@
#ifndef BOOST_MATH_NTL_RR_HPP
#define BOOST_MATH_NTL_RR_HPP
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/math/tools/real_cast.hpp>
#include <boost/math/tools/precision.hpp>
#include <boost/math/tools/config.hpp>
#include <boost/math/constants/constants.hpp>
#include <boost/math/tools/roots.hpp>
#include <boost/math/special_functions/fpclassify.hpp>
#include <boost/math/bindings/detail/big_digamma.hpp>
#include <boost/math/bindings/detail/big_lanczos.hpp>
#include <stdexcept>
#include <ostream>
#include <istream>
#include <boost/config/no_tr1/cmath.hpp>
#include <cmath>
#include <limits>
#include <NTL/RR.h>
namespace boost{ namespace math{
@@ -41,12 +41,10 @@ public:
{
m_value = c;
}
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
RR(wchar_t c)
{
m_value = c;
}
#endif
RR(unsigned char c)
{
m_value = c;
@@ -79,16 +77,14 @@ public:
{
assign_large_int(c);
}
#ifdef BOOST_HAS_LONG_LONG
RR(boost::ulong_long_type c)
RR(unsigned long long c)
{
assign_large_int(c);
}
RR(boost::long_long_type c)
RR(long long c)
{
assign_large_int(c);
}
#endif
RR(float c)
{
m_value = c;
@@ -106,19 +102,15 @@ public:
RR& operator=(char c) { m_value = c; return *this; }
RR& operator=(unsigned char c) { m_value = c; return *this; }
RR& operator=(signed char c) { m_value = c; return *this; }
#ifndef BOOST_NO_INTRINSIC_WCHAR_T
RR& operator=(wchar_t c) { m_value = c; return *this; }
#endif
RR& operator=(short c) { m_value = c; return *this; }
RR& operator=(unsigned short c) { m_value = c; return *this; }
RR& operator=(int c) { assign_large_int(c); return *this; }
RR& operator=(unsigned int c) { assign_large_int(c); return *this; }
RR& operator=(long c) { assign_large_int(c); return *this; }
RR& operator=(unsigned long c) { assign_large_int(c); return *this; }
#ifdef BOOST_HAS_LONG_LONG
RR& operator=(boost::long_long_type c) { assign_large_int(c); return *this; }
RR& operator=(boost::ulong_long_type c) { assign_large_int(c); return *this; }
#endif
RR& operator=(long long c) { assign_large_int(c); return *this; }
RR& operator=(unsigned long long c) { assign_large_int(c); return *this; }
RR& operator=(float c) { m_value = c; return *this; }
RR& operator=(double c) { m_value = c; return *this; }
RR& operator=(long double c) { assign_large_real(c); return *this; }
@@ -141,7 +133,7 @@ public:
RR const& operator+()const
{ return *this; }
// RR compatibity:
// RR compatibility:
const ::NTL::ZZ& mantissa() const
{ return m_value.mantissa(); }
long exponent() const
@@ -206,7 +198,7 @@ private:
template <class V>
void assign_large_int(V a)
{
#ifdef BOOST_MSVC
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable:4146)
#endif
@@ -214,7 +206,7 @@ private:
int exp = 0;
NTL::RR t;
bool neg = a < V(0) ? true : false;
if(neg)
if(neg)
a = -a;
while(a)
{
@@ -225,7 +217,7 @@ private:
}
if(neg)
m_value = -m_value;
#ifdef BOOST_MSVC
#ifdef _MSC_VER
#pragma warning(pop)
#endif
}
@@ -395,8 +387,8 @@ inline RR tanh(RR a)
*exp -= 1;
r.value().e += 1;
}
BOOST_ASSERT(r < 1);
BOOST_ASSERT(r >= 0.5);
BOOST_MATH_ASSERT(r < 1);
BOOST_MATH_ASSERT(r >= 0.5);
return r;
}
inline RR ldexp(RR r, int exp)
@@ -475,7 +467,7 @@ struct ntl_lanczos
return lanczos61UDT::lanczos_sum_near_2(z);
}
static ntl::RR g()
{
{
unsigned long p = ntl::RR::precision();
if(p <= 72)
return lanczos13UDT::g();
@@ -699,8 +691,8 @@ namespace ntl{
double r;
conv(r, z.value());
return boost::math::tools::halley_iterate(
asin_root(z),
RR(std::asin(r)),
asin_root(z),
RR(std::asin(r)),
RR(-boost::math::constants::pi<RR>()/2),
RR(boost::math::constants::pi<RR>()/2),
NTL::RR::precision());
@@ -727,8 +719,8 @@ namespace ntl{
double r;
conv(r, z.value());
return boost::math::tools::halley_iterate(
acos_root(z),
RR(std::acos(r)),
acos_root(z),
RR(std::acos(r)),
RR(-boost::math::constants::pi<RR>()/2),
RR(boost::math::constants::pi<RR>()/2),
NTL::RR::precision());
@@ -756,8 +748,8 @@ namespace ntl{
double r;
conv(r, z.value());
return boost::math::tools::halley_iterate(
atan_root(z),
RR(std::atan(r)),
atan_root(z),
RR(std::atan(r)),
-boost::math::constants::pi<RR>()/2,
boost::math::constants::pi<RR>()/2,
NTL::RR::precision());
@@ -838,7 +830,7 @@ namespace ntl{
namespace detail{
template <class Policy>
ntl::RR digamma_imp(ntl::RR x, const mpl::int_<0>* , const Policy& pol)
ntl::RR digamma_imp(ntl::RR x, const std::integral_constant<int, 0>* , const Policy& pol)
{
//
// This handles reflection of negative arguments, and all our
@@ -866,7 +858,7 @@ ntl::RR digamma_imp(ntl::RR x, const mpl::int_<0>* , const Policy& pol)
//
if(remainder == 0)
{
return policies::raise_pole_error<ntl::RR>("boost::math::digamma<%1%>(%1%)", 0, (1-x), pol);
return policies::raise_pole_error<ntl::RR>("boost::math::digamma<%1%>(%1%)", nullptr, (1-x), pol);
}
result = constants::pi<ntl::RR>() / tan(constants::pi<ntl::RR>() * remainder);
}