Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:39:30

0001 //  (C) Copyright John Maddock 2006-8.
0002 //  Use, modification and distribution are subject to the
0003 //  Boost Software License, Version 1.0. (See accompanying file
0004 //  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0005 
0006 #ifndef BOOST_MATH_NTL_DIGAMMA
0007 #define BOOST_MATH_NTL_DIGAMMA
0008 
0009 #include <boost/math/tools/rational.hpp>
0010 #include <boost/math/tools/config.hpp>
0011 #include <boost/math/policies/error_handling.hpp>
0012 #include <boost/math/constants/constants.hpp>
0013 #include <boost/math/tools/big_constant.hpp>
0014 
0015 namespace boost{ namespace math{ namespace detail{
0016 
0017 template <class T>
0018 T big_digamma_helper(T x)
0019 {
0020       static const T P[61] = {
0021          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6660133691143982067148122682345055274952e81),
0022          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6365271516829242456324234577164675383137e81),
0023          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2991038873096202943405966144203628966976e81),
0024          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9211116495503170498076013367421231351115e80),
0025          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2090792764676090716286400360584443891749e80),
0026          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3730037777359591428226035156377978092809e79),
0027          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5446396536956682043376492370432031543834e78),
0028          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6692523966335177847425047827449069256345e77),
0029          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7062543624100864681625612653756619116848e76),
0030          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6499914905966283735005256964443226879158e75),
0031          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5280364564853225211197557708655426736091e74),
0032          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3823205608981176913075543599005095206953e73),
0033          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2486733714214237704739129972671154532415e72),
0034          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1462562139602039577983434547171318011675e71),
0035          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7821169065036815012381267259559910324285e69),
0036          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3820552182348155468636157988764435365078e68),
0037          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1711618296983598244658239925535632505062e67),
0038          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7056661618357643731419080738521475204245e65),
0039          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2685246896473614017356264531791459936036e64),
0040          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9455168125599643085283071944864977592391e62),
0041          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3087541626972538362237309145177486236219e61),
0042          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9367928873352980208052601301625005737407e59),
0043          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2645306130689794942883818547314327466007e58),
0044          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6961815141171454309161007351079576190079e56),
0045          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1709637824471794552313802669803885946843e55),
0046          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3921553258481531526663112728778759311158e53),
0047          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.8409006354449988687714450897575728228696e51),
0048          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1686755204461325935742097669030363344927e50),
0049          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3166653542877070999007425197729038754254e48),
0050          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5566029092358215049069560272835654229637e46),
0051          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9161766287916328133080586672953875116242e44),
0052          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1412317772330871298317974693514430627922000),
0053          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 20387991986727877473732570146112459874790),
0054          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 275557928713904105182512535678580359839.3),
0055          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3485719851040516559072031256589598330.723),
0056          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 41247046743564028399938106707656877.40859),
0057          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 456274078125709314602601667471879.0147312),
0058          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 4714450683242899367025707077155.310613012),
0059          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 45453933537925041680009544258.75073849996),
0060          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 408437900487067278846361972.302331241052),
0061          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3415719344386166273085838.705771571751035),
0062          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 26541502879185876562320.93134691487351145),
0063          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 191261415065918713661.1571433274648417668),
0064          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1275349770108718421.645275944284937551702),
0065          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 7849171120971773.318910987434906905704272),
0066          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 44455946386549.80866460312682983576538056),
0067          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 230920362395.3198137186361608905136598046),
0068          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1095700096.240863858624279930600654130254),
0069          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 4727085.467506050153744334085516289728134),
0070          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 18440.75118859447173303252421991479005424),
0071          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 64.62515887799460295677071749181651317052),
0072          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.201851568864688406206528472883512147547),
0073          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.0005565091674187978029138500039504078098143),
0074          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1338097668312907986354698683493366559613e-5),
0075          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.276308225077464312820179030238305271638e-8),
0076          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4801582970473168520375942100071070575043e-11),
0077          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6829184144212920949740376186058541800175e-14),
0078          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7634080076358511276617829524639455399182e-17),
0079          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6290035083727140966418512608156646142409e-20),
0080          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.339652245667538733044036638506893821352e-23),
0081          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9017518064256388530773585529891677854909e-27)
0082       };
0083       static const T Q[61] = {
0084          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0),
0085          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1386831185456898357379390197203894063459e81),
0086          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6467076379487574703291056110838151259438e81),
0087          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1394967823848615838336194279565285465161e82),
0088          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1872927317344192945218570366455046340458e82),
0089          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1772461045338946243584650759986310355937e82),
0090          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1267294892200258648315971144069595555118e82),
0091          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7157764838362416821508872117623058626589e81),
0092          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.329447266909948668265277828268378274513e81),
0093          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1264376077317689779509250183194342571207e81),
0094          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4118230304191980787640446056583623228873e80),
0095          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1154393529762694616405952270558316515261e80),
0096          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.281655612889423906125295485693696744275e79),
0097          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6037483524928743102724159846414025482077e78),
0098          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1145927995397835468123576831800276999614e78),
0099          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1938624296151985600348534009382865995154e77),
0100          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.293980925856227626211879961219188406675e76),
0101          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4015574518216966910319562902099567437832e75),
0102          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4961475457509727343545565970423431880907e74),
0103          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5565482348278933960215521991000378896338e73),
0104          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5686112924615820754631098622770303094938e72),
0105          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5305988545844796293285410303747469932856e71),
0106          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4533363413802585060568537458067343491358e70),
0107          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3553932059473516064068322757331575565718e69),
0108          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2561198565218704414618802902533972354203e68),
0109          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1699519313292900324098102065697454295572e67),
0110          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1039830160862334505389615281373574959236e66),
0111          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5873082967977428281000961954715372504986e64),
0112          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3065255179030575882202133042549783442446e63),
0113          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1479494813481364701208655943688307245459e62),
0114          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6608150467921598615495180659808895663164e60),
0115          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2732535313770902021791888953487787496976e59),
0116          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1046402297662493314531194338414508049069e58),
0117          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3711375077192882936085049147920021549622e56),
0118          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1219154482883895482637944309702972234576e55),
0119          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3708359374149458741391374452286837880162e53),
0120          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1044095509971707189716913168889769471468e52),
0121          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.271951506225063286130946773813524945052e50),
0122          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6548016291215163843464133978454065823866e48),
0123          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1456062447610542135403751730809295219344e47),
0124          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2986690175077969760978388356833006028929e45),
0125          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 5643149706574013350061247429006443326844000),
0126          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 98047545414467090421964387960743688053480),
0127          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1563378767746846395507385099301468978550),
0128          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 22823360528584500077862274918382796495),
0129          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 304215527004115213046601295970388750),
0130          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3690289075895685793844344966820325),
0131          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 40584512015702371433911456606050),
0132          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 402834190897282802772754873905),
0133          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3589522158493606918146495750),
0134          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 28530557707503483723634725),
0135          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 200714561335055753000730),
0136          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1237953783437761888641),
0137          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 6614698701445762950),
0138          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 30155495647727505),
0139          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 114953256021450),
0140          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 356398020013),
0141          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 863113950),
0142          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1531345),
0143          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1770),
0144          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1)
0145       };
0146       static const T PD[60] = {
0147          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6365271516829242456324234577164675383137e81),
0148          2*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2991038873096202943405966144203628966976e81),
0149          3*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9211116495503170498076013367421231351115e80),
0150          4*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2090792764676090716286400360584443891749e80),
0151          5*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3730037777359591428226035156377978092809e79),
0152          6*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5446396536956682043376492370432031543834e78),
0153          7*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6692523966335177847425047827449069256345e77),
0154          8*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7062543624100864681625612653756619116848e76),
0155          9*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6499914905966283735005256964443226879158e75),
0156          10*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5280364564853225211197557708655426736091e74),
0157          11*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3823205608981176913075543599005095206953e73),
0158          12*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2486733714214237704739129972671154532415e72),
0159          13*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1462562139602039577983434547171318011675e71),
0160          14*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7821169065036815012381267259559910324285e69),
0161          15*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3820552182348155468636157988764435365078e68),
0162          16*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1711618296983598244658239925535632505062e67),
0163          17*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7056661618357643731419080738521475204245e65),
0164          18*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2685246896473614017356264531791459936036e64),
0165          19*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9455168125599643085283071944864977592391e62),
0166          20*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3087541626972538362237309145177486236219e61),
0167          21*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9367928873352980208052601301625005737407e59),
0168          22*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2645306130689794942883818547314327466007e58),
0169          23*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6961815141171454309161007351079576190079e56),
0170          24*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1709637824471794552313802669803885946843e55),
0171          25*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3921553258481531526663112728778759311158e53),
0172          26*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.8409006354449988687714450897575728228696e51),
0173          27*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1686755204461325935742097669030363344927e50),
0174          28*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3166653542877070999007425197729038754254e48),
0175          29*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5566029092358215049069560272835654229637e46),
0176          30*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9161766287916328133080586672953875116242e44),
0177          31*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1412317772330871298317974693514430627922000),
0178          32*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 20387991986727877473732570146112459874790),
0179          33*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 275557928713904105182512535678580359839.3),
0180          34*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3485719851040516559072031256589598330.723),
0181          35*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 41247046743564028399938106707656877.40859),
0182          36*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 456274078125709314602601667471879.0147312),
0183          37*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 4714450683242899367025707077155.310613012),
0184          38*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 45453933537925041680009544258.75073849996),
0185          39*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 408437900487067278846361972.302331241052),
0186          40*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3415719344386166273085838.705771571751035),
0187          41*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 26541502879185876562320.93134691487351145),
0188          42*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 191261415065918713661.1571433274648417668),
0189          43*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1275349770108718421.645275944284937551702),
0190          44*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 7849171120971773.318910987434906905704272),
0191          45*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 44455946386549.80866460312682983576538056),
0192          46*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 230920362395.3198137186361608905136598046),
0193          47*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1095700096.240863858624279930600654130254),
0194          48*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 4727085.467506050153744334085516289728134),
0195          49*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 18440.75118859447173303252421991479005424),
0196          50*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 64.62515887799460295677071749181651317052),
0197          51*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.201851568864688406206528472883512147547),
0198          52*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.0005565091674187978029138500039504078098143),
0199          53*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1338097668312907986354698683493366559613e-5),
0200          54*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.276308225077464312820179030238305271638e-8),
0201          55*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4801582970473168520375942100071070575043e-11),
0202          56*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6829184144212920949740376186058541800175e-14),
0203          57*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7634080076358511276617829524639455399182e-17),
0204          58*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6290035083727140966418512608156646142409e-20),
0205          59*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.339652245667538733044036638506893821352e-23),
0206          60*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.9017518064256388530773585529891677854909e-27)
0207       };
0208       static const T QD[60] = {
0209          BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1386831185456898357379390197203894063459e81),
0210          2*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6467076379487574703291056110838151259438e81),
0211          3*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1394967823848615838336194279565285465161e82),
0212          4*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1872927317344192945218570366455046340458e82),
0213          5*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1772461045338946243584650759986310355937e82),
0214          6*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1267294892200258648315971144069595555118e82),
0215          7*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.7157764838362416821508872117623058626589e81),
0216          8*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.329447266909948668265277828268378274513e81),
0217          9*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1264376077317689779509250183194342571207e81),
0218          10*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4118230304191980787640446056583623228873e80),
0219          11*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1154393529762694616405952270558316515261e80),
0220          12*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.281655612889423906125295485693696744275e79),
0221          13*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6037483524928743102724159846414025482077e78),
0222          14*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1145927995397835468123576831800276999614e78),
0223          15*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1938624296151985600348534009382865995154e77),
0224          16*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.293980925856227626211879961219188406675e76),
0225          17*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4015574518216966910319562902099567437832e75),
0226          18*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4961475457509727343545565970423431880907e74),
0227          19*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5565482348278933960215521991000378896338e73),
0228          20*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5686112924615820754631098622770303094938e72),
0229          21*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5305988545844796293285410303747469932856e71),
0230          22*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.4533363413802585060568537458067343491358e70),
0231          23*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3553932059473516064068322757331575565718e69),
0232          24*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2561198565218704414618802902533972354203e68),
0233          25*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1699519313292900324098102065697454295572e67),
0234          26*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1039830160862334505389615281373574959236e66),
0235          27*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.5873082967977428281000961954715372504986e64),
0236          28*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3065255179030575882202133042549783442446e63),
0237          29*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1479494813481364701208655943688307245459e62),
0238          30*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6608150467921598615495180659808895663164e60),
0239          31*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2732535313770902021791888953487787496976e59),
0240          32*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1046402297662493314531194338414508049069e58),
0241          33*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3711375077192882936085049147920021549622e56),
0242          34*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1219154482883895482637944309702972234576e55),
0243          35*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.3708359374149458741391374452286837880162e53),
0244          36*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1044095509971707189716913168889769471468e52),
0245          37*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.271951506225063286130946773813524945052e50),
0246          38*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.6548016291215163843464133978454065823866e48),
0247          39*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.1456062447610542135403751730809295219344e47),
0248          40*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 0.2986690175077969760978388356833006028929e45),
0249          41*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 5643149706574013350061247429006443326844000),
0250          42*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 98047545414467090421964387960743688053480),
0251          43*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1563378767746846395507385099301468978550),
0252          44*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 22823360528584500077862274918382796495),
0253          45*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 304215527004115213046601295970388750),
0254          46*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3690289075895685793844344966820325),
0255          47*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 40584512015702371433911456606050),
0256          48*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 402834190897282802772754873905),
0257          49*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 3589522158493606918146495750),
0258          50*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 28530557707503483723634725),
0259          51*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 200714561335055753000730),
0260          52*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1237953783437761888641),
0261          53*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 6614698701445762950),
0262          54*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 30155495647727505),
0263          55*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 114953256021450),
0264          56*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 356398020013),
0265          57*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 863113950),
0266          58*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1531345),
0267          59*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1770),
0268          60*BOOST_MATH_BIG_CONSTANT(T, boost::math::tools::numeric_traits<T>::digits, 1)
0269       };
0270    static const double g = 63.192152;
0271 
0272    T zgh = x + g - 0.5;
0273 
0274    T result = (x - 0.5) / zgh;
0275    result += log(zgh);
0276    result += tools::evaluate_polynomial(PD, x) / tools::evaluate_polynomial(P, x);
0277    result -= tools::evaluate_polynomial(QD, x) / tools::evaluate_polynomial(Q, x);
0278    result -= 1;
0279 
0280    return result;
0281 }
0282 
0283 template <class T>
0284 T big_digamma(T x)
0285 {
0286    BOOST_MATH_STD_USING
0287 
0288    if(x < 0)
0289    {
0290       return big_digamma_helper(static_cast<T>(1-x)) + constants::pi<T>() / tan(constants::pi<T>() * (1-x));
0291    }
0292    return big_digamma_helper(x);
0293 }
0294 
0295 }}}
0296 
0297 #endif // include guard