Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:40:07

0001 //  Copyright John Maddock 2006.
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 // This file implements the asymptotic expansions of the incomplete
0007 // gamma functions P(a, x) and Q(a, x), used when a is large and
0008 // x ~ a.
0009 //
0010 // The primary reference is:
0011 //
0012 // "The Asymptotic Expansion of the Incomplete Gamma Functions"
0013 // N. M. Temme.
0014 // Siam J. Math Anal. Vol 10 No 4, July 1979, p757.
0015 //
0016 // A different way of evaluating these expansions,
0017 // plus a lot of very useful background information is in:
0018 // 
0019 // "A Set of Algorithms For the Incomplete Gamma Functions."
0020 // N. M. Temme.
0021 // Probability in the Engineering and Informational Sciences,
0022 // 8, 1994, 291.
0023 //
0024 // An alternative implementation is in:
0025 //
0026 // "Computation of the Incomplete Gamma Function Ratios and their Inverse."
0027 // A. R. Didonato and A. H. Morris.
0028 // ACM TOMS, Vol 12, No 4, Dec 1986, p377.
0029 //
0030 // There are various versions of the same code below, each accurate
0031 // to a different precision.  To understand the code, refer to Didonato
0032 // and Morris, from Eq 17 and 18 onwards.
0033 //
0034 // The coefficients used here are not taken from Didonato and Morris:
0035 // the domain over which these expansions are used is slightly different
0036 // to theirs, and their constants are not quite accurate enough for
0037 // 128-bit long double's.  Instead the coefficients were calculated
0038 // using the methods described by Temme p762 from Eq 3.8 onwards.
0039 // The values obtained agree with those obtained by Didonato and Morris
0040 // (at least to the first 30 digits that they provide).
0041 // At double precision the degrees of polynomial required for full
0042 // machine precision are close to those recommended to Didonato and Morris,
0043 // but of course many more terms are needed for larger types.
0044 //
0045 #ifndef BOOST_MATH_DETAIL_IGAMMA_LARGE
0046 #define BOOST_MATH_DETAIL_IGAMMA_LARGE
0047 
0048 #ifdef _MSC_VER
0049 #pragma once
0050 #endif
0051 
0052 #if defined(__GNUC__) && defined(BOOST_MATH_USE_FLOAT128)
0053 //
0054 // This is the only way we can avoid
0055 // warning: non-standard suffix on floating constant [-Wpedantic]
0056 // when building with -Wall -pedantic.  Neither __extension__
0057 // nor #pragma diagnostic ignored work :(
0058 //
0059 #pragma GCC system_header
0060 #endif
0061 
0062 namespace boost{ namespace math{ namespace detail{
0063 
0064 // This version will never be called (at runtime), it's a stub used
0065 // when T is unsuitable to be passed to these routines:
0066 //
0067 template <class T, class Policy>
0068 inline T igamma_temme_large(T, T, const Policy& /* pol */, std::integral_constant<int, 0> const *)
0069 {
0070    // stub function, should never actually be called
0071    BOOST_MATH_ASSERT(0);
0072    return 0;
0073 }
0074 //
0075 // This version is accurate for up to 64-bit mantissa's, 
0076 // (80-bit long double, or 10^-20).
0077 //
0078 template <class T, class Policy>
0079 T igamma_temme_large(T a, T x, const Policy& pol, std::integral_constant<int, 64> const *)
0080 {
0081    BOOST_MATH_STD_USING // ADL of std functions
0082    T sigma = (x - a) / a;
0083    T phi = -boost::math::log1pmx(sigma, pol);
0084    T y = a * phi;
0085    T z = sqrt(2 * phi);
0086    if(x < a)
0087       z = -z;
0088 
0089    T workspace[13];
0090 
0091    static const T C0[] = {
0092       BOOST_MATH_BIG_CONSTANT(T, 64, -0.333333333333333333333),
0093       BOOST_MATH_BIG_CONSTANT(T, 64, 0.0833333333333333333333),
0094       BOOST_MATH_BIG_CONSTANT(T, 64, -0.0148148148148148148148),
0095       BOOST_MATH_BIG_CONSTANT(T, 64, 0.00115740740740740740741),
0096       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000352733686067019400353),
0097       BOOST_MATH_BIG_CONSTANT(T, 64, -0.0001787551440329218107),
0098       BOOST_MATH_BIG_CONSTANT(T, 64, 0.39192631785224377817e-4),
0099       BOOST_MATH_BIG_CONSTANT(T, 64, -0.218544851067999216147e-5),
0100       BOOST_MATH_BIG_CONSTANT(T, 64, -0.18540622107151599607e-5),
0101       BOOST_MATH_BIG_CONSTANT(T, 64, 0.829671134095308600502e-6),
0102       BOOST_MATH_BIG_CONSTANT(T, 64, -0.176659527368260793044e-6),
0103       BOOST_MATH_BIG_CONSTANT(T, 64, 0.670785354340149858037e-8),
0104       BOOST_MATH_BIG_CONSTANT(T, 64, 0.102618097842403080426e-7),
0105       BOOST_MATH_BIG_CONSTANT(T, 64, -0.438203601845335318655e-8),
0106       BOOST_MATH_BIG_CONSTANT(T, 64, 0.914769958223679023418e-9),
0107       BOOST_MATH_BIG_CONSTANT(T, 64, -0.255141939949462497669e-10),
0108       BOOST_MATH_BIG_CONSTANT(T, 64, -0.583077213255042506746e-10),
0109       BOOST_MATH_BIG_CONSTANT(T, 64, 0.243619480206674162437e-10),
0110       BOOST_MATH_BIG_CONSTANT(T, 64, -0.502766928011417558909e-11),
0111    };
0112    workspace[0] = tools::evaluate_polynomial(C0, z);
0113 
0114    static const T C1[] = {
0115       BOOST_MATH_BIG_CONSTANT(T, 64, -0.00185185185185185185185),
0116       BOOST_MATH_BIG_CONSTANT(T, 64, -0.00347222222222222222222),
0117       BOOST_MATH_BIG_CONSTANT(T, 64, 0.00264550264550264550265),
0118       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000990226337448559670782),
0119       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000205761316872427983539),
0120       BOOST_MATH_BIG_CONSTANT(T, 64, -0.40187757201646090535e-6),
0121       BOOST_MATH_BIG_CONSTANT(T, 64, -0.18098550334489977837e-4),
0122       BOOST_MATH_BIG_CONSTANT(T, 64, 0.764916091608111008464e-5),
0123       BOOST_MATH_BIG_CONSTANT(T, 64, -0.161209008945634460038e-5),
0124       BOOST_MATH_BIG_CONSTANT(T, 64, 0.464712780280743434226e-8),
0125       BOOST_MATH_BIG_CONSTANT(T, 64, 0.137863344691572095931e-6),
0126       BOOST_MATH_BIG_CONSTANT(T, 64, -0.575254560351770496402e-7),
0127       BOOST_MATH_BIG_CONSTANT(T, 64, 0.119516285997781473243e-7),
0128       BOOST_MATH_BIG_CONSTANT(T, 64, -0.175432417197476476238e-10),
0129       BOOST_MATH_BIG_CONSTANT(T, 64, -0.100915437106004126275e-8),
0130       BOOST_MATH_BIG_CONSTANT(T, 64, 0.416279299184258263623e-9),
0131       BOOST_MATH_BIG_CONSTANT(T, 64, -0.856390702649298063807e-10),
0132    };
0133    workspace[1] = tools::evaluate_polynomial(C1, z);
0134 
0135    static const T C2[] = {
0136       BOOST_MATH_BIG_CONSTANT(T, 64, 0.00413359788359788359788),
0137       BOOST_MATH_BIG_CONSTANT(T, 64, -0.00268132716049382716049),
0138       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000771604938271604938272),
0139       BOOST_MATH_BIG_CONSTANT(T, 64, 0.200938786008230452675e-5),
0140       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000107366532263651605215),
0141       BOOST_MATH_BIG_CONSTANT(T, 64, 0.529234488291201254164e-4),
0142       BOOST_MATH_BIG_CONSTANT(T, 64, -0.127606351886187277134e-4),
0143       BOOST_MATH_BIG_CONSTANT(T, 64, 0.342357873409613807419e-7),
0144       BOOST_MATH_BIG_CONSTANT(T, 64, 0.137219573090629332056e-5),
0145       BOOST_MATH_BIG_CONSTANT(T, 64, -0.629899213838005502291e-6),
0146       BOOST_MATH_BIG_CONSTANT(T, 64, 0.142806142060642417916e-6),
0147       BOOST_MATH_BIG_CONSTANT(T, 64, -0.204770984219908660149e-9),
0148       BOOST_MATH_BIG_CONSTANT(T, 64, -0.140925299108675210533e-7),
0149       BOOST_MATH_BIG_CONSTANT(T, 64, 0.622897408492202203356e-8),
0150       BOOST_MATH_BIG_CONSTANT(T, 64, -0.136704883966171134993e-8),
0151    };
0152    workspace[2] = tools::evaluate_polynomial(C2, z);
0153 
0154    static const T C3[] = {
0155       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000649434156378600823045),
0156       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000229472093621399176955),
0157       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000469189494395255712128),
0158       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000267720632062838852962),
0159       BOOST_MATH_BIG_CONSTANT(T, 64, -0.756180167188397641073e-4),
0160       BOOST_MATH_BIG_CONSTANT(T, 64, -0.239650511386729665193e-6),
0161       BOOST_MATH_BIG_CONSTANT(T, 64, 0.110826541153473023615e-4),
0162       BOOST_MATH_BIG_CONSTANT(T, 64, -0.56749528269915965675e-5),
0163       BOOST_MATH_BIG_CONSTANT(T, 64, 0.142309007324358839146e-5),
0164       BOOST_MATH_BIG_CONSTANT(T, 64, -0.278610802915281422406e-10),
0165       BOOST_MATH_BIG_CONSTANT(T, 64, -0.169584040919302772899e-6),
0166       BOOST_MATH_BIG_CONSTANT(T, 64, 0.809946490538808236335e-7),
0167       BOOST_MATH_BIG_CONSTANT(T, 64, -0.191111684859736540607e-7),
0168    };
0169    workspace[3] = tools::evaluate_polynomial(C3, z);
0170 
0171    static const T C4[] = {
0172       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000861888290916711698605),
0173       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000784039221720066627474),
0174       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000299072480303190179733),
0175       BOOST_MATH_BIG_CONSTANT(T, 64, -0.146384525788434181781e-5),
0176       BOOST_MATH_BIG_CONSTANT(T, 64, 0.664149821546512218666e-4),
0177       BOOST_MATH_BIG_CONSTANT(T, 64, -0.396836504717943466443e-4),
0178       BOOST_MATH_BIG_CONSTANT(T, 64, 0.113757269706784190981e-4),
0179       BOOST_MATH_BIG_CONSTANT(T, 64, 0.250749722623753280165e-9),
0180       BOOST_MATH_BIG_CONSTANT(T, 64, -0.169541495365583060147e-5),
0181       BOOST_MATH_BIG_CONSTANT(T, 64, 0.890750753220530968883e-6),
0182       BOOST_MATH_BIG_CONSTANT(T, 64, -0.229293483400080487057e-6),
0183    };
0184    workspace[4] = tools::evaluate_polynomial(C4, z);
0185 
0186    static const T C5[] = {
0187       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000336798553366358150309),
0188       BOOST_MATH_BIG_CONSTANT(T, 64, -0.697281375836585777429e-4),
0189       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000277275324495939207873),
0190       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000199325705161888477003),
0191       BOOST_MATH_BIG_CONSTANT(T, 64, 0.679778047793720783882e-4),
0192       BOOST_MATH_BIG_CONSTANT(T, 64, 0.141906292064396701483e-6),
0193       BOOST_MATH_BIG_CONSTANT(T, 64, -0.135940481897686932785e-4),
0194       BOOST_MATH_BIG_CONSTANT(T, 64, 0.801847025633420153972e-5),
0195       BOOST_MATH_BIG_CONSTANT(T, 64, -0.229148117650809517038e-5),
0196    };
0197    workspace[5] = tools::evaluate_polynomial(C5, z);
0198 
0199    static const T C6[] = {
0200       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000531307936463992223166),
0201       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000592166437353693882865),
0202       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000270878209671804482771),
0203       BOOST_MATH_BIG_CONSTANT(T, 64, 0.790235323266032787212e-6),
0204       BOOST_MATH_BIG_CONSTANT(T, 64, -0.815396936756196875093e-4),
0205       BOOST_MATH_BIG_CONSTANT(T, 64, 0.561168275310624965004e-4),
0206       BOOST_MATH_BIG_CONSTANT(T, 64, -0.183291165828433755673e-4),
0207       BOOST_MATH_BIG_CONSTANT(T, 64, -0.307961345060330478256e-8),
0208       BOOST_MATH_BIG_CONSTANT(T, 64, 0.346515536880360908674e-5),
0209       BOOST_MATH_BIG_CONSTANT(T, 64, -0.20291327396058603727e-5),
0210       BOOST_MATH_BIG_CONSTANT(T, 64, 0.57887928631490037089e-6),
0211    };
0212    workspace[6] = tools::evaluate_polynomial(C6, z);
0213 
0214    static const T C7[] = {
0215       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000344367606892377671254),
0216       BOOST_MATH_BIG_CONSTANT(T, 64, 0.517179090826059219337e-4),
0217       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000334931610811422363117),
0218       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000281269515476323702274),
0219       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000109765822446847310235),
0220       BOOST_MATH_BIG_CONSTANT(T, 64, -0.127410090954844853795e-6),
0221       BOOST_MATH_BIG_CONSTANT(T, 64, 0.277444515115636441571e-4),
0222       BOOST_MATH_BIG_CONSTANT(T, 64, -0.182634888057113326614e-4),
0223       BOOST_MATH_BIG_CONSTANT(T, 64, 0.578769494973505239894e-5),
0224    };
0225    workspace[7] = tools::evaluate_polynomial(C7, z);
0226 
0227    static const T C8[] = {
0228       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000652623918595309418922),
0229       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000839498720672087279993),
0230       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000438297098541721005061),
0231       BOOST_MATH_BIG_CONSTANT(T, 64, -0.696909145842055197137e-6),
0232       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000166448466420675478374),
0233       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000127835176797692185853),
0234       BOOST_MATH_BIG_CONSTANT(T, 64, 0.462995326369130429061e-4),
0235    };
0236    workspace[8] = tools::evaluate_polynomial(C8, z);
0237 
0238    static const T C9[] = {
0239       BOOST_MATH_BIG_CONSTANT(T, 64, -0.000596761290192746250124),
0240       BOOST_MATH_BIG_CONSTANT(T, 64, -0.720489541602001055909e-4),
0241       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000678230883766732836162),
0242       BOOST_MATH_BIG_CONSTANT(T, 64, -0.0006401475260262758451),
0243       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000277501076343287044992),
0244    };
0245    workspace[9] = tools::evaluate_polynomial(C9, z);
0246 
0247    static const T C10[] = {
0248       BOOST_MATH_BIG_CONSTANT(T, 64, 0.00133244544948006563713),
0249       BOOST_MATH_BIG_CONSTANT(T, 64, -0.0019144384985654775265),
0250       BOOST_MATH_BIG_CONSTANT(T, 64, 0.00110893691345966373396),
0251    };
0252    workspace[10] = tools::evaluate_polynomial(C10, z);
0253 
0254    static const T C11[] = {
0255       BOOST_MATH_BIG_CONSTANT(T, 64, 0.00157972766073083495909),
0256       BOOST_MATH_BIG_CONSTANT(T, 64, 0.000162516262783915816899),
0257       BOOST_MATH_BIG_CONSTANT(T, 64, -0.00206334210355432762645),
0258       BOOST_MATH_BIG_CONSTANT(T, 64, 0.00213896861856890981541),
0259       BOOST_MATH_BIG_CONSTANT(T, 64, -0.00101085593912630031708),
0260    };
0261    workspace[11] = tools::evaluate_polynomial(C11, z);
0262 
0263    static const T C12[] = {
0264       BOOST_MATH_BIG_CONSTANT(T, 64, -0.00407251211951401664727),
0265       BOOST_MATH_BIG_CONSTANT(T, 64, 0.00640336283380806979482),
0266       BOOST_MATH_BIG_CONSTANT(T, 64, -0.00404101610816766177474),
0267    };
0268    workspace[12] = tools::evaluate_polynomial(C12, z);
0269 
0270    T result = tools::evaluate_polynomial<13, T, T>(workspace, 1/a);
0271    result *= exp(-y) / sqrt(2 * constants::pi<T>() * a);
0272    if(x < a)
0273       result = -result;
0274 
0275    result += boost::math::erfc(sqrt(y), pol) / 2;
0276 
0277    return result;
0278 }
0279 //
0280 // This one is accurate for 53-bit mantissa's
0281 // (IEEE double precision or 10^-17).
0282 //
0283 template <class T, class Policy>
0284 T igamma_temme_large(T a, T x, const Policy& pol, std::integral_constant<int, 53> const *)
0285 {
0286    BOOST_MATH_STD_USING // ADL of std functions
0287    T sigma = (x - a) / a;
0288    T phi = -boost::math::log1pmx(sigma, pol);
0289    T y = a * phi;
0290    T z = sqrt(2 * phi);
0291    if(x < a)
0292       z = -z;
0293 
0294    T workspace[10];
0295 
0296    static const T C0[] = {
0297       static_cast<T>(-0.33333333333333333L),
0298       static_cast<T>(0.083333333333333333L),
0299       static_cast<T>(-0.014814814814814815L),
0300       static_cast<T>(0.0011574074074074074L),
0301       static_cast<T>(0.0003527336860670194L),
0302       static_cast<T>(-0.00017875514403292181L),
0303       static_cast<T>(0.39192631785224378e-4L),
0304       static_cast<T>(-0.21854485106799922e-5L),
0305       static_cast<T>(-0.185406221071516e-5L),
0306       static_cast<T>(0.8296711340953086e-6L),
0307       static_cast<T>(-0.17665952736826079e-6L),
0308       static_cast<T>(0.67078535434014986e-8L),
0309       static_cast<T>(0.10261809784240308e-7L),
0310       static_cast<T>(-0.43820360184533532e-8L),
0311       static_cast<T>(0.91476995822367902e-9L),
0312    };
0313    workspace[0] = tools::evaluate_polynomial(C0, z);
0314 
0315    static const T C1[] = {
0316       static_cast<T>(-0.0018518518518518519L),
0317       static_cast<T>(-0.0034722222222222222L),
0318       static_cast<T>(0.0026455026455026455L),
0319       static_cast<T>(-0.00099022633744855967L),
0320       static_cast<T>(0.00020576131687242798L),
0321       static_cast<T>(-0.40187757201646091e-6L),
0322       static_cast<T>(-0.18098550334489978e-4L),
0323       static_cast<T>(0.76491609160811101e-5L),
0324       static_cast<T>(-0.16120900894563446e-5L),
0325       static_cast<T>(0.46471278028074343e-8L),
0326       static_cast<T>(0.1378633446915721e-6L),
0327       static_cast<T>(-0.5752545603517705e-7L),
0328       static_cast<T>(0.11951628599778147e-7L),
0329    };
0330    workspace[1] = tools::evaluate_polynomial(C1, z);
0331 
0332    static const T C2[] = {
0333       static_cast<T>(0.0041335978835978836L),
0334       static_cast<T>(-0.0026813271604938272L),
0335       static_cast<T>(0.00077160493827160494L),
0336       static_cast<T>(0.20093878600823045e-5L),
0337       static_cast<T>(-0.00010736653226365161L),
0338       static_cast<T>(0.52923448829120125e-4L),
0339       static_cast<T>(-0.12760635188618728e-4L),
0340       static_cast<T>(0.34235787340961381e-7L),
0341       static_cast<T>(0.13721957309062933e-5L),
0342       static_cast<T>(-0.6298992138380055e-6L),
0343       static_cast<T>(0.14280614206064242e-6L),
0344    };
0345    workspace[2] = tools::evaluate_polynomial(C2, z);
0346 
0347    static const T C3[] = {
0348       static_cast<T>(0.00064943415637860082L),
0349       static_cast<T>(0.00022947209362139918L),
0350       static_cast<T>(-0.00046918949439525571L),
0351       static_cast<T>(0.00026772063206283885L),
0352       static_cast<T>(-0.75618016718839764e-4L),
0353       static_cast<T>(-0.23965051138672967e-6L),
0354       static_cast<T>(0.11082654115347302e-4L),
0355       static_cast<T>(-0.56749528269915966e-5L),
0356       static_cast<T>(0.14230900732435884e-5L),
0357    };
0358    workspace[3] = tools::evaluate_polynomial(C3, z);
0359 
0360    static const T C4[] = {
0361       static_cast<T>(-0.0008618882909167117L),
0362       static_cast<T>(0.00078403922172006663L),
0363       static_cast<T>(-0.00029907248030319018L),
0364       static_cast<T>(-0.14638452578843418e-5L),
0365       static_cast<T>(0.66414982154651222e-4L),
0366       static_cast<T>(-0.39683650471794347e-4L),
0367       static_cast<T>(0.11375726970678419e-4L),
0368    };
0369    workspace[4] = tools::evaluate_polynomial(C4, z);
0370 
0371    static const T C5[] = {
0372       static_cast<T>(-0.00033679855336635815L),
0373       static_cast<T>(-0.69728137583658578e-4L),
0374       static_cast<T>(0.00027727532449593921L),
0375       static_cast<T>(-0.00019932570516188848L),
0376       static_cast<T>(0.67977804779372078e-4L),
0377       static_cast<T>(0.1419062920643967e-6L),
0378       static_cast<T>(-0.13594048189768693e-4L),
0379       static_cast<T>(0.80184702563342015e-5L),
0380       static_cast<T>(-0.22914811765080952e-5L),
0381    };
0382    workspace[5] = tools::evaluate_polynomial(C5, z);
0383 
0384    static const T C6[] = {
0385       static_cast<T>(0.00053130793646399222L),
0386       static_cast<T>(-0.00059216643735369388L),
0387       static_cast<T>(0.00027087820967180448L),
0388       static_cast<T>(0.79023532326603279e-6L),
0389       static_cast<T>(-0.81539693675619688e-4L),
0390       static_cast<T>(0.56116827531062497e-4L),
0391       static_cast<T>(-0.18329116582843376e-4L),
0392    };
0393    workspace[6] = tools::evaluate_polynomial(C6, z);
0394 
0395    static const T C7[] = {
0396       static_cast<T>(0.00034436760689237767L),
0397       static_cast<T>(0.51717909082605922e-4L),
0398       static_cast<T>(-0.00033493161081142236L),
0399       static_cast<T>(0.0002812695154763237L),
0400       static_cast<T>(-0.00010976582244684731L),
0401    };
0402    workspace[7] = tools::evaluate_polynomial(C7, z);
0403 
0404    static const T C8[] = {
0405       static_cast<T>(-0.00065262391859530942L),
0406       static_cast<T>(0.00083949872067208728L),
0407       static_cast<T>(-0.00043829709854172101L),
0408    };
0409    workspace[8] = tools::evaluate_polynomial(C8, z);
0410    workspace[9] = static_cast<T>(-0.00059676129019274625L);
0411 
0412    T result = tools::evaluate_polynomial<10, T, T>(workspace, 1/a);
0413    result *= exp(-y) / sqrt(2 * constants::pi<T>() * a);
0414    if(x < a)
0415       result = -result;
0416 
0417    result += boost::math::erfc(sqrt(y), pol) / 2;
0418 
0419    return result;
0420 }
0421 //
0422 // This one is accurate for 24-bit mantissa's
0423 // (IEEE float precision, or 10^-8)
0424 //
0425 template <class T, class Policy>
0426 T igamma_temme_large(T a, T x, const Policy& pol, std::integral_constant<int, 24> const *)
0427 {
0428    BOOST_MATH_STD_USING // ADL of std functions
0429    T sigma = (x - a) / a;
0430    T phi = -boost::math::log1pmx(sigma, pol);
0431    T y = a * phi;
0432    T z = sqrt(2 * phi);
0433    if(x < a)
0434       z = -z;
0435 
0436    T workspace[3];
0437 
0438    static const T C0[] = {
0439       static_cast<T>(-0.333333333L),
0440       static_cast<T>(0.0833333333L),
0441       static_cast<T>(-0.0148148148L),
0442       static_cast<T>(0.00115740741L),
0443       static_cast<T>(0.000352733686L),
0444       static_cast<T>(-0.000178755144L),
0445       static_cast<T>(0.391926318e-4L),
0446    };
0447    workspace[0] = tools::evaluate_polynomial(C0, z);
0448 
0449    static const T C1[] = {
0450       static_cast<T>(-0.00185185185L),
0451       static_cast<T>(-0.00347222222L),
0452       static_cast<T>(0.00264550265L),
0453       static_cast<T>(-0.000990226337L),
0454       static_cast<T>(0.000205761317L),
0455    };
0456    workspace[1] = tools::evaluate_polynomial(C1, z);
0457 
0458    static const T C2[] = {
0459       static_cast<T>(0.00413359788L),
0460       static_cast<T>(-0.00268132716L),
0461       static_cast<T>(0.000771604938L),
0462    };
0463    workspace[2] = tools::evaluate_polynomial(C2, z);
0464 
0465    T result = tools::evaluate_polynomial(workspace, 1/a);
0466    result *= exp(-y) / sqrt(2 * constants::pi<T>() * a);
0467    if(x < a)
0468       result = -result;
0469 
0470    result += boost::math::erfc(sqrt(y), pol) / 2;
0471 
0472    return result;
0473 }
0474 //
0475 // And finally, a version for 113-bit mantissa's
0476 // (128-bit long doubles, or 10^-34).
0477 // Note this one has been optimised for a > 200
0478 // It's use for a < 200 is not recommended, that would
0479 // require many more terms in the polynomials.
0480 //
0481 template <class T, class Policy>
0482 T igamma_temme_large(T a, T x, const Policy& pol, std::integral_constant<int, 113> const *)
0483 {
0484    BOOST_MATH_STD_USING // ADL of std functions
0485    T sigma = (x - a) / a;
0486    T phi = -boost::math::log1pmx(sigma, pol);
0487    T y = a * phi;
0488    T z = sqrt(2 * phi);
0489    if(x < a)
0490       z = -z;
0491 
0492    T workspace[14];
0493 
0494    static const T C0[] = {
0495       BOOST_MATH_BIG_CONSTANT(T, 113, -0.333333333333333333333333333333333333),
0496       BOOST_MATH_BIG_CONSTANT(T, 113, 0.0833333333333333333333333333333333333),
0497       BOOST_MATH_BIG_CONSTANT(T, 113, -0.0148148148148148148148148148148148148),
0498       BOOST_MATH_BIG_CONSTANT(T, 113, 0.00115740740740740740740740740740740741),
0499       BOOST_MATH_BIG_CONSTANT(T, 113, 0.0003527336860670194003527336860670194),
0500       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000178755144032921810699588477366255144),
0501       BOOST_MATH_BIG_CONSTANT(T, 113, 0.391926317852243778169704095630021556e-4),
0502       BOOST_MATH_BIG_CONSTANT(T, 113, -0.218544851067999216147364295512443661e-5),
0503       BOOST_MATH_BIG_CONSTANT(T, 113, -0.185406221071515996070179883622956325e-5),
0504       BOOST_MATH_BIG_CONSTANT(T, 113, 0.829671134095308600501624213166443227e-6),
0505       BOOST_MATH_BIG_CONSTANT(T, 113, -0.17665952736826079304360054245742403e-6),
0506       BOOST_MATH_BIG_CONSTANT(T, 113, 0.670785354340149858036939710029613572e-8),
0507       BOOST_MATH_BIG_CONSTANT(T, 113, 0.102618097842403080425739573227252951e-7),
0508       BOOST_MATH_BIG_CONSTANT(T, 113, -0.438203601845335318655297462244719123e-8),
0509       BOOST_MATH_BIG_CONSTANT(T, 113, 0.914769958223679023418248817633113681e-9),
0510       BOOST_MATH_BIG_CONSTANT(T, 113, -0.255141939949462497668779537993887013e-10),
0511       BOOST_MATH_BIG_CONSTANT(T, 113, -0.583077213255042506746408945040035798e-10),
0512       BOOST_MATH_BIG_CONSTANT(T, 113, 0.243619480206674162436940696707789943e-10),
0513       BOOST_MATH_BIG_CONSTANT(T, 113, -0.502766928011417558909054985925744366e-11),
0514       BOOST_MATH_BIG_CONSTANT(T, 113, 0.110043920319561347708374174497293411e-12),
0515       BOOST_MATH_BIG_CONSTANT(T, 113, 0.337176326240098537882769884169200185e-12),
0516       BOOST_MATH_BIG_CONSTANT(T, 113, -0.13923887224181620659193661848957998e-12),
0517       BOOST_MATH_BIG_CONSTANT(T, 113, 0.285348938070474432039669099052828299e-13),
0518       BOOST_MATH_BIG_CONSTANT(T, 113, -0.513911183424257261899064580300494205e-15),
0519       BOOST_MATH_BIG_CONSTANT(T, 113, -0.197522882943494428353962401580710912e-14),
0520       BOOST_MATH_BIG_CONSTANT(T, 113, 0.809952115670456133407115668702575255e-15),
0521       BOOST_MATH_BIG_CONSTANT(T, 113, -0.165225312163981618191514820265351162e-15),
0522       BOOST_MATH_BIG_CONSTANT(T, 113, 0.253054300974788842327061090060267385e-17),
0523       BOOST_MATH_BIG_CONSTANT(T, 113, 0.116869397385595765888230876507793475e-16),
0524       BOOST_MATH_BIG_CONSTANT(T, 113, -0.477003704982048475822167804084816597e-17),
0525       BOOST_MATH_BIG_CONSTANT(T, 113, 0.969912605905623712420709685898585354e-18),
0526    };
0527    workspace[0] = tools::evaluate_polynomial(C0, z);
0528 
0529    static const T C1[] = {
0530       BOOST_MATH_BIG_CONSTANT(T, 113, -0.00185185185185185185185185185185185185),
0531       BOOST_MATH_BIG_CONSTANT(T, 113, -0.00347222222222222222222222222222222222),
0532       BOOST_MATH_BIG_CONSTANT(T, 113, 0.0026455026455026455026455026455026455),
0533       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000990226337448559670781893004115226337),
0534       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000205761316872427983539094650205761317),
0535       BOOST_MATH_BIG_CONSTANT(T, 113, -0.401877572016460905349794238683127572e-6),
0536       BOOST_MATH_BIG_CONSTANT(T, 113, -0.180985503344899778370285914867533523e-4),
0537       BOOST_MATH_BIG_CONSTANT(T, 113, 0.76491609160811100846374214980916921e-5),
0538       BOOST_MATH_BIG_CONSTANT(T, 113, -0.16120900894563446003775221882217767e-5),
0539       BOOST_MATH_BIG_CONSTANT(T, 113, 0.464712780280743434226135033938722401e-8),
0540       BOOST_MATH_BIG_CONSTANT(T, 113, 0.137863344691572095931187533077488877e-6),
0541       BOOST_MATH_BIG_CONSTANT(T, 113, -0.575254560351770496402194531835048307e-7),
0542       BOOST_MATH_BIG_CONSTANT(T, 113, 0.119516285997781473243076536699698169e-7),
0543       BOOST_MATH_BIG_CONSTANT(T, 113, -0.175432417197476476237547551202312502e-10),
0544       BOOST_MATH_BIG_CONSTANT(T, 113, -0.100915437106004126274577504686681675e-8),
0545       BOOST_MATH_BIG_CONSTANT(T, 113, 0.416279299184258263623372347219858628e-9),
0546       BOOST_MATH_BIG_CONSTANT(T, 113, -0.856390702649298063807431562579670208e-10),
0547       BOOST_MATH_BIG_CONSTANT(T, 113, 0.606721510160475861512701762169919581e-13),
0548       BOOST_MATH_BIG_CONSTANT(T, 113, 0.716249896481148539007961017165545733e-11),
0549       BOOST_MATH_BIG_CONSTANT(T, 113, -0.293318664377143711740636683615595403e-11),
0550       BOOST_MATH_BIG_CONSTANT(T, 113, 0.599669636568368872330374527568788909e-12),
0551       BOOST_MATH_BIG_CONSTANT(T, 113, -0.216717865273233141017100472779701734e-15),
0552       BOOST_MATH_BIG_CONSTANT(T, 113, -0.497833997236926164052815522048108548e-13),
0553       BOOST_MATH_BIG_CONSTANT(T, 113, 0.202916288237134247736694804325894226e-13),
0554       BOOST_MATH_BIG_CONSTANT(T, 113, -0.413125571381061004935108332558187111e-14),
0555       BOOST_MATH_BIG_CONSTANT(T, 113, 0.828651623988309644380188591057589316e-18),
0556       BOOST_MATH_BIG_CONSTANT(T, 113, 0.341003088693333279336339355910600992e-15),
0557       BOOST_MATH_BIG_CONSTANT(T, 113, -0.138541953028939715357034547426313703e-15),
0558       BOOST_MATH_BIG_CONSTANT(T, 113, 0.281234665322887466568860332727259483e-16),
0559    };
0560    workspace[1] = tools::evaluate_polynomial(C1, z);
0561 
0562    static const T C2[] = {
0563       BOOST_MATH_BIG_CONSTANT(T, 113, 0.0041335978835978835978835978835978836),
0564       BOOST_MATH_BIG_CONSTANT(T, 113, -0.00268132716049382716049382716049382716),
0565       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000771604938271604938271604938271604938),
0566       BOOST_MATH_BIG_CONSTANT(T, 113, 0.200938786008230452674897119341563786e-5),
0567       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000107366532263651605215391223621676297),
0568       BOOST_MATH_BIG_CONSTANT(T, 113, 0.529234488291201254164217127180090143e-4),
0569       BOOST_MATH_BIG_CONSTANT(T, 113, -0.127606351886187277133779191392360117e-4),
0570       BOOST_MATH_BIG_CONSTANT(T, 113, 0.34235787340961380741902003904747389e-7),
0571       BOOST_MATH_BIG_CONSTANT(T, 113, 0.137219573090629332055943852926020279e-5),
0572       BOOST_MATH_BIG_CONSTANT(T, 113, -0.629899213838005502290672234278391876e-6),
0573       BOOST_MATH_BIG_CONSTANT(T, 113, 0.142806142060642417915846008822771748e-6),
0574       BOOST_MATH_BIG_CONSTANT(T, 113, -0.204770984219908660149195854409200226e-9),
0575       BOOST_MATH_BIG_CONSTANT(T, 113, -0.140925299108675210532930244154315272e-7),
0576       BOOST_MATH_BIG_CONSTANT(T, 113, 0.622897408492202203356394293530327112e-8),
0577       BOOST_MATH_BIG_CONSTANT(T, 113, -0.136704883966171134992724380284402402e-8),
0578       BOOST_MATH_BIG_CONSTANT(T, 113, 0.942835615901467819547711211663208075e-12),
0579       BOOST_MATH_BIG_CONSTANT(T, 113, 0.128722524000893180595479368872770442e-9),
0580       BOOST_MATH_BIG_CONSTANT(T, 113, -0.556459561343633211465414765894951439e-10),
0581       BOOST_MATH_BIG_CONSTANT(T, 113, 0.119759355463669810035898150310311343e-10),
0582       BOOST_MATH_BIG_CONSTANT(T, 113, -0.416897822518386350403836626692480096e-14),
0583       BOOST_MATH_BIG_CONSTANT(T, 113, -0.109406404278845944099299008640802908e-11),
0584       BOOST_MATH_BIG_CONSTANT(T, 113, 0.4662239946390135746326204922464679e-12),
0585       BOOST_MATH_BIG_CONSTANT(T, 113, -0.990510576390690597844122258212382301e-13),
0586       BOOST_MATH_BIG_CONSTANT(T, 113, 0.189318767683735145056885183170630169e-16),
0587       BOOST_MATH_BIG_CONSTANT(T, 113, 0.885922187259112726176031067028740667e-14),
0588       BOOST_MATH_BIG_CONSTANT(T, 113, -0.373782039804640545306560251777191937e-14),
0589       BOOST_MATH_BIG_CONSTANT(T, 113, 0.786883363903515525774088394065960751e-15),
0590    };
0591    workspace[2] = tools::evaluate_polynomial(C2, z);
0592 
0593    static const T C3[] = {
0594       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000649434156378600823045267489711934156),
0595       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000229472093621399176954732510288065844),
0596       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000469189494395255712128140111679206329),
0597       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000267720632062838852962309752433209223),
0598       BOOST_MATH_BIG_CONSTANT(T, 113, -0.756180167188397641072538191879755666e-4),
0599       BOOST_MATH_BIG_CONSTANT(T, 113, -0.239650511386729665193314027333231723e-6),
0600       BOOST_MATH_BIG_CONSTANT(T, 113, 0.110826541153473023614770299726861227e-4),
0601       BOOST_MATH_BIG_CONSTANT(T, 113, -0.567495282699159656749963105701560205e-5),
0602       BOOST_MATH_BIG_CONSTANT(T, 113, 0.14230900732435883914551894470580433e-5),
0603       BOOST_MATH_BIG_CONSTANT(T, 113, -0.278610802915281422405802158211174452e-10),
0604       BOOST_MATH_BIG_CONSTANT(T, 113, -0.16958404091930277289864168795820267e-6),
0605       BOOST_MATH_BIG_CONSTANT(T, 113, 0.809946490538808236335278504852724081e-7),
0606       BOOST_MATH_BIG_CONSTANT(T, 113, -0.191111684859736540606728140872727635e-7),
0607       BOOST_MATH_BIG_CONSTANT(T, 113, 0.239286204398081179686413514022282056e-11),
0608       BOOST_MATH_BIG_CONSTANT(T, 113, 0.206201318154887984369925818486654549e-8),
0609       BOOST_MATH_BIG_CONSTANT(T, 113, -0.946049666185513217375417988510192814e-9),
0610       BOOST_MATH_BIG_CONSTANT(T, 113, 0.215410497757749078380130268468744512e-9),
0611       BOOST_MATH_BIG_CONSTANT(T, 113, -0.138882333681390304603424682490735291e-13),
0612       BOOST_MATH_BIG_CONSTANT(T, 113, -0.218947616819639394064123400466489455e-10),
0613       BOOST_MATH_BIG_CONSTANT(T, 113, 0.979099895117168512568262802255883368e-11),
0614       BOOST_MATH_BIG_CONSTANT(T, 113, -0.217821918801809621153859472011393244e-11),
0615       BOOST_MATH_BIG_CONSTANT(T, 113, 0.62088195734079014258166361684972205e-16),
0616       BOOST_MATH_BIG_CONSTANT(T, 113, 0.212697836327973697696702537114614471e-12),
0617       BOOST_MATH_BIG_CONSTANT(T, 113, -0.934468879151743333127396765626749473e-13),
0618       BOOST_MATH_BIG_CONSTANT(T, 113, 0.204536712267828493249215913063207436e-13),
0619    };
0620    workspace[3] = tools::evaluate_polynomial(C3, z);
0621 
0622    static const T C4[] = {
0623       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000861888290916711698604702719929057378),
0624       BOOST_MATH_BIG_CONSTANT(T, 113, 0.00078403922172006662747403488144228885),
0625       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000299072480303190179733389609932819809),
0626       BOOST_MATH_BIG_CONSTANT(T, 113, -0.146384525788434181781232535690697556e-5),
0627       BOOST_MATH_BIG_CONSTANT(T, 113, 0.664149821546512218665853782451862013e-4),
0628       BOOST_MATH_BIG_CONSTANT(T, 113, -0.396836504717943466443123507595386882e-4),
0629       BOOST_MATH_BIG_CONSTANT(T, 113, 0.113757269706784190980552042885831759e-4),
0630       BOOST_MATH_BIG_CONSTANT(T, 113, 0.250749722623753280165221942390057007e-9),
0631       BOOST_MATH_BIG_CONSTANT(T, 113, -0.169541495365583060147164356781525752e-5),
0632       BOOST_MATH_BIG_CONSTANT(T, 113, 0.890750753220530968882898422505515924e-6),
0633       BOOST_MATH_BIG_CONSTANT(T, 113, -0.229293483400080487057216364891158518e-6),
0634       BOOST_MATH_BIG_CONSTANT(T, 113, 0.295679413754404904696572852500004588e-10),
0635       BOOST_MATH_BIG_CONSTANT(T, 113, 0.288658297427087836297341274604184504e-7),
0636       BOOST_MATH_BIG_CONSTANT(T, 113, -0.141897394378032193894774303903982717e-7),
0637       BOOST_MATH_BIG_CONSTANT(T, 113, 0.344635804994648970659527720474194356e-8),
0638       BOOST_MATH_BIG_CONSTANT(T, 113, -0.230245171745280671320192735850147087e-12),
0639       BOOST_MATH_BIG_CONSTANT(T, 113, -0.394092330280464052750697640085291799e-9),
0640       BOOST_MATH_BIG_CONSTANT(T, 113, 0.186023389685045019134258533045185639e-9),
0641       BOOST_MATH_BIG_CONSTANT(T, 113, -0.435632300505661804380678327446262424e-10),
0642       BOOST_MATH_BIG_CONSTANT(T, 113, 0.127860010162962312660550463349930726e-14),
0643       BOOST_MATH_BIG_CONSTANT(T, 113, 0.467927502665791946200382739991760062e-11),
0644       BOOST_MATH_BIG_CONSTANT(T, 113, -0.214924647061348285410535341910721086e-11),
0645       BOOST_MATH_BIG_CONSTANT(T, 113, 0.490881561480965216323649688463984082e-12),
0646    };
0647    workspace[4] = tools::evaluate_polynomial(C4, z);
0648 
0649    static const T C5[] = {
0650       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000336798553366358150308767592718210002),
0651       BOOST_MATH_BIG_CONSTANT(T, 113, -0.697281375836585777429398828575783308e-4),
0652       BOOST_MATH_BIG_CONSTANT(T, 113, 0.00027727532449593920787336425196507501),
0653       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000199325705161888477003360405280844238),
0654       BOOST_MATH_BIG_CONSTANT(T, 113, 0.679778047793720783881640176604435742e-4),
0655       BOOST_MATH_BIG_CONSTANT(T, 113, 0.141906292064396701483392727105575757e-6),
0656       BOOST_MATH_BIG_CONSTANT(T, 113, -0.135940481897686932784583938837504469e-4),
0657       BOOST_MATH_BIG_CONSTANT(T, 113, 0.80184702563342015397192571980419684e-5),
0658       BOOST_MATH_BIG_CONSTANT(T, 113, -0.229148117650809517038048790128781806e-5),
0659       BOOST_MATH_BIG_CONSTANT(T, 113, -0.325247355129845395166230137750005047e-9),
0660       BOOST_MATH_BIG_CONSTANT(T, 113, 0.346528464910852649559195496827579815e-6),
0661       BOOST_MATH_BIG_CONSTANT(T, 113, -0.184471871911713432765322367374920978e-6),
0662       BOOST_MATH_BIG_CONSTANT(T, 113, 0.482409670378941807563762631738989002e-7),
0663       BOOST_MATH_BIG_CONSTANT(T, 113, -0.179894667217435153025754291716644314e-13),
0664       BOOST_MATH_BIG_CONSTANT(T, 113, -0.630619450001352343517516981425944698e-8),
0665       BOOST_MATH_BIG_CONSTANT(T, 113, 0.316241762877456793773762181540969623e-8),
0666       BOOST_MATH_BIG_CONSTANT(T, 113, -0.784092425369742929000839303523267545e-9),
0667    };
0668    workspace[5] = tools::evaluate_polynomial(C5, z);
0669 
0670    static const T C6[] = {
0671       BOOST_MATH_BIG_CONSTANT(T, 113, 0.00053130793646399222316574854297762391),
0672       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000592166437353693882864836225604401187),
0673       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000270878209671804482771279183488328692),
0674       BOOST_MATH_BIG_CONSTANT(T, 113, 0.790235323266032787212032944390816666e-6),
0675       BOOST_MATH_BIG_CONSTANT(T, 113, -0.815396936756196875092890088464682624e-4),
0676       BOOST_MATH_BIG_CONSTANT(T, 113, 0.561168275310624965003775619041471695e-4),
0677       BOOST_MATH_BIG_CONSTANT(T, 113, -0.183291165828433755673259749374098313e-4),
0678       BOOST_MATH_BIG_CONSTANT(T, 113, -0.307961345060330478256414192546677006e-8),
0679       BOOST_MATH_BIG_CONSTANT(T, 113, 0.346515536880360908673728529745376913e-5),
0680       BOOST_MATH_BIG_CONSTANT(T, 113, -0.202913273960586037269527254582695285e-5),
0681       BOOST_MATH_BIG_CONSTANT(T, 113, 0.578879286314900370889997586203187687e-6),
0682       BOOST_MATH_BIG_CONSTANT(T, 113, 0.233863067382665698933480579231637609e-12),
0683       BOOST_MATH_BIG_CONSTANT(T, 113, -0.88286007463304835250508524317926246e-7),
0684       BOOST_MATH_BIG_CONSTANT(T, 113, 0.474359588804081278032150770595852426e-7),
0685       BOOST_MATH_BIG_CONSTANT(T, 113, -0.125454150207103824457130611214783073e-7),
0686    };
0687    workspace[6] = tools::evaluate_polynomial(C6, z);
0688 
0689    static const T C7[] = {
0690       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000344367606892377671254279625108523655),
0691       BOOST_MATH_BIG_CONSTANT(T, 113, 0.517179090826059219337057843002058823e-4),
0692       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000334931610811422363116635090580012327),
0693       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000281269515476323702273722110707777978),
0694       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000109765822446847310235396824500789005),
0695       BOOST_MATH_BIG_CONSTANT(T, 113, -0.127410090954844853794579954588107623e-6),
0696       BOOST_MATH_BIG_CONSTANT(T, 113, 0.277444515115636441570715073933712622e-4),
0697       BOOST_MATH_BIG_CONSTANT(T, 113, -0.182634888057113326614324442681892723e-4),
0698       BOOST_MATH_BIG_CONSTANT(T, 113, 0.578769494973505239894178121070843383e-5),
0699       BOOST_MATH_BIG_CONSTANT(T, 113, 0.493875893393627039981813418398565502e-9),
0700       BOOST_MATH_BIG_CONSTANT(T, 113, -0.105953670140260427338098566209633945e-5),
0701       BOOST_MATH_BIG_CONSTANT(T, 113, 0.616671437611040747858836254004890765e-6),
0702       BOOST_MATH_BIG_CONSTANT(T, 113, -0.175629733590604619378669693914265388e-6),
0703    };
0704    workspace[7] = tools::evaluate_polynomial(C7, z);
0705 
0706    static const T C8[] = {
0707       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000652623918595309418922034919726622692),
0708       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000839498720672087279993357516764983445),
0709       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000438297098541721005061087953050560377),
0710       BOOST_MATH_BIG_CONSTANT(T, 113, -0.696909145842055197136911097362072702e-6),
0711       BOOST_MATH_BIG_CONSTANT(T, 113, 0.00016644846642067547837384572662326101),
0712       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000127835176797692185853344001461664247),
0713       BOOST_MATH_BIG_CONSTANT(T, 113, 0.462995326369130429061361032704489636e-4),
0714       BOOST_MATH_BIG_CONSTANT(T, 113, 0.455790986792270771162749294232219616e-8),
0715       BOOST_MATH_BIG_CONSTANT(T, 113, -0.105952711258051954718238500312872328e-4),
0716       BOOST_MATH_BIG_CONSTANT(T, 113, 0.678334290486516662273073740749269432e-5),
0717       BOOST_MATH_BIG_CONSTANT(T, 113, -0.210754766662588042469972680229376445e-5),
0718    };
0719    workspace[8] = tools::evaluate_polynomial(C8, z);
0720 
0721    static const T C9[] = {
0722       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000596761290192746250124390067179459605),
0723       BOOST_MATH_BIG_CONSTANT(T, 113, -0.720489541602001055908571930225015052e-4),
0724       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000678230883766732836161951166000673426),
0725       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000640147526026275845100045652582354779),
0726       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000277501076343287044992374518205845463),
0727       BOOST_MATH_BIG_CONSTANT(T, 113, 0.181970083804651510461686554030325202e-6),
0728       BOOST_MATH_BIG_CONSTANT(T, 113, -0.847950711706850318239732559632810086e-4),
0729       BOOST_MATH_BIG_CONSTANT(T, 113, 0.610519208250153101764709122740859458e-4),
0730       BOOST_MATH_BIG_CONSTANT(T, 113, -0.210739201834048624082975255893773306e-4),
0731    };
0732    workspace[9] = tools::evaluate_polynomial(C9, z);
0733 
0734    static const T C10[] = {
0735       BOOST_MATH_BIG_CONSTANT(T, 113, 0.00133244544948006563712694993432717968),
0736       BOOST_MATH_BIG_CONSTANT(T, 113, -0.00191443849856547752650089885832852254),
0737       BOOST_MATH_BIG_CONSTANT(T, 113, 0.0011089369134596637339607446329267522),
0738       BOOST_MATH_BIG_CONSTANT(T, 113, 0.993240412264229896742295262075817566e-6),
0739       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000508745012930931989848393025305956774),
0740       BOOST_MATH_BIG_CONSTANT(T, 113, 0.00042735056665392884328432271160040444),
0741       BOOST_MATH_BIG_CONSTANT(T, 113, -0.000168588537679107988033552814662382059),
0742    };
0743    workspace[10] = tools::evaluate_polynomial(C10, z);
0744 
0745    static const T C11[] = {
0746       BOOST_MATH_BIG_CONSTANT(T, 113, 0.00157972766073083495908785631307733022),
0747       BOOST_MATH_BIG_CONSTANT(T, 113, 0.000162516262783915816898635123980270998),
0748       BOOST_MATH_BIG_CONSTANT(T, 113, -0.00206334210355432762645284467690276817),
0749       BOOST_MATH_BIG_CONSTANT(T, 113, 0.00213896861856890981541061922797693947),
0750       BOOST_MATH_BIG_CONSTANT(T, 113, -0.00101085593912630031708085801712479376),
0751    };
0752    workspace[11] = tools::evaluate_polynomial(C11, z);
0753 
0754    static const T C12[] = {
0755       BOOST_MATH_BIG_CONSTANT(T, 113, -0.00407251211951401664727281097914544601),
0756       BOOST_MATH_BIG_CONSTANT(T, 113, 0.00640336283380806979482363809026579583),
0757       BOOST_MATH_BIG_CONSTANT(T, 113, -0.00404101610816766177473974858518094879),
0758    };
0759    workspace[12] = tools::evaluate_polynomial(C12, z);
0760    workspace[13] = -0.0059475779383993002845382844736066323L;
0761 
0762    T result = tools::evaluate_polynomial(workspace, T(1/a));
0763    result *= exp(-y) / sqrt(2 * constants::pi<T>() * a);
0764    if(x < a)
0765       result = -result;
0766 
0767    result += boost::math::erfc(sqrt(y), pol) / 2;
0768 
0769    return result;
0770 }
0771 
0772 }  // namespace detail
0773 }  // namespace math
0774 }  // namespace math
0775 
0776 
0777 #endif // BOOST_MATH_DETAIL_IGAMMA_LARGE
0778