From 1312c462e0ddc28f6eed3c8f8647c02d9ec0d85d Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Tue, 16 Jul 2024 03:24:02 +0900 Subject: [PATCH 001/399] Add map-airy distribution --- include/boost/math/distributions/mapairy.hpp | 4140 ++++++++++++++++++ test/test_mapairy.cpp | 822 ++++ 2 files changed, 4962 insertions(+) create mode 100644 include/boost/math/distributions/mapairy.hpp create mode 100644 test/test_mapairy.cpp diff --git a/include/boost/math/distributions/mapairy.hpp b/include/boost/math/distributions/mapairy.hpp new file mode 100644 index 0000000000..d7d56ed77f --- /dev/null +++ b/include/boost/math/distributions/mapairy.hpp @@ -0,0 +1,4140 @@ +// Copyright Takuma Yoshimura 2024. +// 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) + +#ifndef BOOST_STATS_MAPAIRY_HPP +#define BOOST_STATS_MAPAIRY_HPP + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4127) // conditional expression is constant +#endif + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace math { +template +class mapairy_distribution; + +namespace detail { + +template +inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral_constant&) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 1) { + // Rational Approximation + // Maximum Relative Error: 3.7591e-18 + static const RealType P[8] = { + static_cast(1.97516171847191855610e-1), + static_cast(3.67488253628465083737e-2), + static_cast(-9.73242224038828612673e-4), + static_cast(2.32207514136635673061e-3), + static_cast(5.69067907423210669037e-5), + static_cast(-6.02637387141524535193e-5), + static_cast(1.04960324426666933327e-5), + static_cast(-6.58470237954242016920e-7), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(7.09464351647314165710e-1), + static_cast(3.66413036246461392316e-1), + static_cast(1.10947882302862241488e-1), + static_cast(2.65928486676817177159e-2), + static_cast(3.75507284977386290874e-3), + static_cast(4.03789594641339005785e-4), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 1.5996e-20 + static const RealType P[8] = { + static_cast(1.06251243013238748252e-1), + static_cast(1.38178831205785069108e-2), + static_cast(4.19280374368049006206e-3), + static_cast(8.54607219684690930289e-4), + static_cast(-7.46881084120928210702e-5), + static_cast(1.47110856483345063335e-5), + static_cast(-1.30090180307471994500e-6), + static_cast(5.24801123304330014713e-8), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(8.10853683888611687140e-1), + static_cast(3.89361261627717143905e-1), + static_cast(1.15124062681082170577e-1), + static_cast(2.38803416611949902468e-2), + static_cast(3.08616898814509065071e-3), + static_cast(2.43760043942846261876e-4), + static_cast(1.34538901435238836768e-6), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 1.1592e-17 + static const RealType P[9] = { + static_cast(5.33842514891989443409e-2), + static_cast(1.23301980674903270971e-2), + static_cast(3.45717831433988631923e-3), + static_cast(3.27034449923176875761e-4), + static_cast(1.20406794831890291348e-5), + static_cast(5.77489170397965604669e-7), + static_cast(-1.15255267205685159063e-7), + static_cast(9.15896323073109992939e-9), + static_cast(-3.14068002815368247985e-10), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(9.08772985520393226044e-1), + static_cast(4.26418573702560818267e-1), + static_cast(1.22033746594868893316e-1), + static_cast(2.27934009200310243172e-2), + static_cast(2.60658999011198623962e-3), + static_cast(1.54461660261435227768e-4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 9.2228e-17 + static const RealType P[8] = { + static_cast(1.58950538583133457384e-2), + static_cast(7.47835440063141601948e-3), + static_cast(1.81137244353261478410e-3), + static_cast(2.26935565382135588558e-4), + static_cast(1.43877113825683795505e-5), + static_cast(2.08242747557417233626e-7), + static_cast(-1.54976465724771282989e-9), + static_cast(1.30762989300333026019e-11), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(9.95505437381674174441e-1), + static_cast(4.58882737262511297099e-1), + static_cast(1.25031310192148865496e-1), + static_cast(2.15727229249904102247e-2), + static_cast(2.33597081566665672569e-3), + static_cast(1.45198998318300328562e-4), + static_cast(3.87962234445835345676e-6), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 1.0257e-17 + static const RealType P[8] = { + static_cast(3.22517551525042172428e-3), + static_cast(1.12822806030796339659e-3), + static_cast(1.54489389961322571031e-4), + static_cast(9.28479992527909796427e-6), + static_cast(2.06168350199745832262e-7), + static_cast(9.05110751997021418539e-10), + static_cast(-2.15498112371756202097e-12), + static_cast(6.41838355699777435924e-15), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(6.53390465399680164234e-1), + static_cast(1.82759048270449018482e-1), + static_cast(2.80407546367978533849e-2), + static_cast(2.50853443923476718145e-3), + static_cast(1.27671852825846245421e-4), + static_cast(3.28380135691060279203e-6), + static_cast(3.06545317089055335742e-8), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 6.0510e-17 + static const RealType P[8] = { + static_cast(5.82527663232857270992e-4), + static_cast(6.89502117025124630567e-5), + static_cast(2.24909795087265741433e-6), + static_cast(2.18576787334972903790e-8), + static_cast(3.39014723444178274435e-11), + static_cast(-9.74481309265612390297e-15), + static_cast(-1.13308546492906818388e-16), + static_cast(5.32472028720777735712e-19), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(2.74018883667663396766e-1), + static_cast(2.95901195665990089660e-2), + static_cast(1.57901733512147920251e-3), + static_cast(4.24965124147621236633e-5), + static_cast(5.17522027193205842016e-7), + static_cast(2.00522219276570039934e-9), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 7.3294e-18 + static const RealType P[8] = { + static_cast(1.03264853379349880039e-4), + static_cast(5.35256306644392405447e-6), + static_cast(9.00657716972118816692e-8), + static_cast(5.34913574042209793720e-10), + static_cast(6.70752605041678779380e-13), + static_cast(-5.30089923101856817552e-16), + static_cast(7.28133811621687143754e-19), + static_cast(-7.38047553655951666420e-22), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.29920843258164337377e-1), + static_cast(6.75018577147646502386e-3), + static_cast(1.77694968039695671819e-4), + static_cast(2.46428299911920942946e-6), + static_cast(1.67165053157990942546e-8), + static_cast(4.19496974141131087116e-11), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType t = 1 / sqrt(x * x * x); + + // Rational Approximation + // Maximum Relative Error: 5.6693e-20 + static const RealType P[5] = { + static_cast(5.98413420602149016910e-1), + static_cast(3.14584075817417883086e-5), + static_cast(1.62977928311793051895e1), + static_cast(-4.12903117172994371875e-4), + static_cast(-1.06404478702135751872e2), + }; + static const RealType Q[3] = { + static_cast(1), + static_cast(5.25696892802060720079e-5), + static_cast(4.03600055498020483920e1), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t / x; + } + + return result; +} + + +template +inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral_constant&) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 1) { + // Rational Approximation + // Maximum Relative Error: 7.8308e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.97516171847191855609649452292217911973e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17531822787252717270400174744562144891e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.85115358761409188259685286269086053296e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18029395189535552537870932989876189597e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.77412874842522285996566741532939343827e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.77992070255086842672551073580133785334e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.54573264286260796576738952968288691782e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.94764012694602906119831079380500255557e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.97596258932025712802674070104281981323e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.45466169112247379589927514614067756956e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.99760415118300349769641418430273526815e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43150486566834492207695241913522311930e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.46130347604880355784938321408765318948e-13), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11845869711743584628289654085905424438e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.80391154854347711297249357734993136108e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.75628443538173255184583966965162835227e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41016303833742742212624596040074202424e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.19142300833563644046500846364541891138e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.02421707708633106515934651956262614532e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.03973732602338507411104824853671547615e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.35206168908201402570766383018708660819e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.38602606623008690327520130558254165564e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.53740175911385378188372963739884519312e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.27513004715414297729539702862351044344e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.54510493017251997793679126704007098265e-8), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 3.0723e-35 + static const RealType P[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06251243013238748252181151646220197947e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.92438638323563234519452281479338921158e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.83335793178622701784730867677919844599e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.84159075203218824591724451142550478306e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.04213732090358859917896442076931334722e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.72388220651785798237487005913708387756e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.36099324022668533012286817710272936865e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.74483270731217433628720245792741986795e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.56461597064783966758904403291149549559e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.28590608939674970691948223694855264817e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.81756745849477762773082030302943341729e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.65915115243311285178083515017249358853e-12), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33250387018216706082200927591739589024e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.71707718560216685629188467984384070512e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.81316277289673837399162302797006618384e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.78475951599121894570443981591530879087e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.16167801098514576400689883575304687623e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19167794366424137722223009369062644830e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.20831082064982892777497773490792080382e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.27196399162146247210036306870401328410e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.79335434374966775903734846875100087590e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.30825409557870847168672662674521614782e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.97296173230649275943984471731360073540e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.48943057909563158917114503727080517958e-9), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 4.0903e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.33842514891989443409465171800884519331e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.53264053296761245408991932692426094424e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.23210520807186629205810670362048049836e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.71104271443590027208545022968625306496e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.98781446716778138729774954595209697813e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.98895829308616657174932023565302947632e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.25993639218721804661037829873135732687e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.64669776700609853276056375742089715662e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.11846243382610611156151291892877027869e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.74830086064868141326053648144496072795e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.07549997153431643849551871367000763445e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.10030596535721362628619523622308581344e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19376016170255697546854583591494809062e-13), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52686177278870816414637961315363468426e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19872083945442288336636376283295310445e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.26633866969676511944680471882188527224e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.41261867539396133951024374504099977090e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.18852182132645783844766153200510014113e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70152126044106007357033814742158353948e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.23810508827493234517751339979902448944e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.96161313274648769113605163816403306967e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.06693316156193327359541953619174255726e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.79366356086062616343285660797389238271e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.14585835815353770175366834099001313472e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.05314631662369743547568064896403143693e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.90325380271096603676911761784650800378e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.36933359079566550212098911224675011839e-12), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 6.5015e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.58950538583133457383574346194006716984e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.25447644411503971725638816502617490834e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47605882774114100209665040117276675598e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.12224864838900383464124716266085521485e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.79164249640537972514574059182421325541e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.89668438166714230032406615413991628135e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.44410389750700463263686630222653669837e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.14788978994687095829140113472609739982e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.79821680629333600844514042061772236495e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.49636960435731257154960798035854124639e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.70554745768928821263556963261516872171e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.42293994855343109617040824208078534205e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.37599287094703195312894833570340165019e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.35248179978735448062307216459232932068e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.53569375838863862590910010617140120876e-18), + }; + static const RealType Q[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.94337325681904859647161946168957959628e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.77120402023938328899162557073347121463e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01644685191130734907530007424741314392e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.12479655123720440909164080517207084404e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.25556010526357752360439314019567992245e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.96143273204038192262150849394970544022e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.50612932318889495209230176354364299236e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.12160918304376427109905628326638480473e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.47696044292604039527013647985997661762e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.64067652576843720823459199100800335854e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.00745166063635113130434111509648306420e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.05398901239421768403763864060147286105e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05698259572340563109985785513355912114e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19362835269415404005406782719825077472e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.15444386779802728200716489787161419304e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.02452666470008756043350040893761339083e-16), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 2.0995e-35 + static const RealType P[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.22517551525042172427941302520759668293e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.86576974828476461442549217748945498966e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18419822818191546598384139622512477000e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.98396184944524020019688823190946146641e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.06686400532599396487775148973665625687e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.05680178109228687159829475615095925679e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.17554487015345146749705505971350254902e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.14774751685364429557883242232797329274e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33266124509168360207594600356349282805e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.76332756800842989348756910429214676252e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.60639771339252642992277508068105926919e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.41859490403554144799385471141184829903e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.77177795293424055655391515546880774987e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.76106923344461402353501262620681801053e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.68829978902134103249656805130103045021e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.42496376687241918803028631991083570963e-26), + }; + static const RealType Q[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19213376162053391168605415200906099633e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.65578261958732385181558047087365997878e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30046653564394292929001223763106276016e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.48388301731958697028701215596777178117e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.50873786049439122933188684993719288258e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23255654647151798865208394342856435797e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.20861791399969402003082323686080041040e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.96882049090731653763684812243275884213e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.98669985741073085290012296575736698103e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.03383311816835346577432387682379226740e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.87320682938150375144724980774245810905e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.13573468677076838075146150847170057373e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34526045003716422620879156626237175127e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.35681579117696161282979297336282783473e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.92944288060269290125987728528698476197e-18), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 2.0937e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.82527663232857270992129793621400616909e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.41696401156754081476312871174198295322e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.42036620449365724707919875710197564857e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.67076745288708619632303078677641380627e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.14278954094278648593125010577441869646e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.40092485054621853149602511539550254471e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.17755660009065973828053533035808718033e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.23871371557251644837598540542648782066e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04069998646037977439620128812310273053e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.94055978349016208777803296823455779097e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.29866428982892883091537921429389750973e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.06056281963023929277728535486590256573e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.57963857545037466186123981516026589992e-24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.81390322233700529779563477285232205886e-28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.52190981930441828041102818178755246228e-31), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.70564782441895707961338319466546005093e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47770566490107388849474183308889339231e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.29364672385303439788399215507370006639e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.37279274083988250795581105436675097881e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.72124151284421794872333348562536468054e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.96970247774973902625712414297788402746e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.38395055453444011915661055983937917120e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.19605460410208704830882138883730331113e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.76945301389475508747530234950023648137e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.33624384932503964160642677987886086890e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.01155130710615988897664213446593907596e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.03959317021567084067518847978890548086e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.78213669817351488671519066803835958715e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.75492332026736176991870807903277324902e-22), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 1.5856e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.03264853379349880038687006045193401399e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.79539964604630527636184900467871907171e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34840369549460790638336121351837912308e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.73087351972154879439617719914590729748e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.51775493325347153520115736204545037264e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.60104651860674451546102708885530128768e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.90233449697112559539826150932808197444e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06978852724410115655105118663137681992e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.00399855296672416041126220131900937128e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.18139748830278263202087699889457673035e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.43070756487288399784700274808326343543e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.70126687893706466023887757573369648552e-27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.29405234560873665664952418690159194840e-30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.69069082510020066864633718082941688708e-34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.33468198065176301137949068264633336529e-37), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.51951069241510130465691156908893803280e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.84647597299970149588010858770320631739e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.90239396588176334117512714878489376365e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.35551585337774834346900776840459179841e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.53375746264539501168763602838029023222e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.42421935941736734247914078641324315900e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.23835501607741697737129504173606231513e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.79603272375172813955236187874231935324e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.44624821303153251954931367754173356213e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.10635081308984534416704147448323126303e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.14627867347129520510628554651739571006e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43792928765659831045040802615903432044e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.79856365207259871336606847582889916798e-25), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType t = 1 / sqrt(x * x * x); + + // Rational Approximation + // Maximum Relative Error: 3.5081e-36 + static const RealType P[8] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.98413420602149016909919089901572802714e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.30303835860684077803651094768293625633e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.89097726237252419724261295392691855545e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.12696604472230480273239741428914666511e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.84517621403071494824886152940942995151e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.67577378292168927009421205756730205227e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.16343347002845084264982358165052437094e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.59558963351172885545760841064831356701e3), + }; + static const RealType Q[7] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.51965956124978480521462518750569617550e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.61700833299761977287211297600922591853e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.94988298508869748383898344668918510537e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.52494213749069142804725453333400335525e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.20093079283917759611690534481918040882e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.82564796242972192725215815897475246715e4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t / x; + } + + return result; +} + +template +inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integral_constant&) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x >= -1) { + RealType t = x + 1; + + // Rational Approximation + // Maximum Relative Error: 3.7525e-17 + static const RealType P[8] = { + static_cast(2.76859868856746781256e-1), + static_cast(1.10489814676299003241e-1), + static_cast(-6.25690643488236678667e-3), + static_cast(-1.17905420222527577236e-3), + static_cast(1.27188963720084274122e-3), + static_cast(-7.20575105181207907889e-5), + static_cast(-2.22575633858411851032e-5), + static_cast(2.94270091008508492304e-6), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(4.98673671503410894284e-1), + static_cast(3.15907666864554716291e-1), + static_cast(8.34463558393629855977e-2), + static_cast(2.71804643993972494173e-2), + static_cast(3.52187050938036578406e-3), + static_cast(7.03072974279509263844e-4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -2) { + RealType t = x + 2; + + // Rational Approximation + // Maximum Relative Error: 4.0995e-17 + static const RealType P[8] = { + static_cast(2.14483832832989822788e-1), + static_cast(3.72789690317712876663e-1), + static_cast(1.86473650057086284496e-1), + static_cast(1.31182724166379598907e-2), + static_cast(-9.00695064809774432392e-3), + static_cast(3.46884420664996747052e-4), + static_cast(4.88651392754189961173e-4), + static_cast(-6.13516242712196835055e-5), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(1.06478618107122200489e0), + static_cast(4.08809060854459518663e-1), + static_cast(2.66617598099501800866e-1), + static_cast(4.53526315786051807494e-2), + static_cast(2.44078693689626940834e-2), + static_cast(1.52822572478697831870e-3), + static_cast(8.69480001029742502197e-4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType s = exp(2 * x * x * x / 27) * sqrt(-x); + + if (x >= -4) { + RealType t = -x - 2; + + // Rational Approximation + // Maximum Relative Error: 2.4768e-18 + static const RealType P[8] = { + static_cast(2.74308494787955998605e-1), + static_cast(4.87765991440983416392e-1), + static_cast(3.84524365110270427617e-1), + static_cast(1.77409497505926097339e-1), + static_cast(5.25612864287310961520e-2), + static_cast(1.01528615034079765421e-2), + static_cast(1.20417225696161842090e-3), + static_cast(6.97462693097107007719e-5), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(1.81256903248465876424e0), + static_cast(1.43959302060852067876e0), + static_cast(6.65882284117861804351e-1), + static_cast(1.97537712781845593211e-1), + static_cast(3.81732970028510912201e-2), + static_cast(4.52767489928026542226e-3), + static_cast(2.62240194911920120003e-4), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -8) { + RealType t = -x - 4; + + // Rational Approximation + // Maximum Relative Error: 1.5741e-17 + static const RealType P[8] = { + static_cast(2.67391547707456587286e-1), + static_cast(3.39319035621314371924e-1), + static_cast(1.85434799940724207230e-1), + static_cast(5.63667456320679857693e-2), + static_cast(1.01231164548944177474e-2), + static_cast(1.02501575174439362864e-3), + static_cast(4.60769537123286016400e-5), + static_cast(-4.92754650783224582641e-13), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.27271216837333318516e0), + static_cast(6.96551952883867277759e-1), + static_cast(2.11871363524516350422e-1), + static_cast(3.80622887806509632537e-2), + static_cast(3.85400280812991562328e-3), + static_cast(1.73246593953823694311e-4), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -16) { + RealType t = -x - 8; + + // Rational Approximation + // Maximum Relative Error: 4.6579e-17 + static const RealType P[6] = { + static_cast(2.66153901932100301337e-1), + static_cast(1.65767350677458230714e-1), + static_cast(4.19801402197670061146e-2), + static_cast(5.39337995172784579558e-3), + static_cast(3.50811247702301287586e-4), + static_cast(9.21758454778883157515e-6), + }; + static const RealType Q[6] = { + static_cast(1), + static_cast(6.23092941554668369107e-1), + static_cast(1.57829914506366827914e-1), + static_cast(2.02787979758160988615e-2), + static_cast(1.31903008994475216511e-3), + static_cast(3.46575870637847438219e-5), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -32) { + RealType t = -x - 16; + + // Rational Approximation + // Maximum Relative Error: 5.2014e-17 + static const RealType P[5] = { + static_cast(2.65985830928929730672e-1), + static_cast(7.19655029633308583205e-2), + static_cast(7.26293125679558421946e-3), + static_cast(3.24276402295343802262e-4), + static_cast(5.40508013573989841127e-6), + }; + static const RealType Q[5] = { + static_cast(1), + static_cast(2.70578525590448009961e-1), + static_cast(2.73082032706004833847e-2), + static_cast(1.21926059813954504560e-3), + static_cast(2.03227900426552177849e-5), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + result = 0; + } + } + + return result; +} + +template +inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integral_constant&) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x >= -1) { + RealType t = x + 1; + + // Rational Approximation + // Maximum Relative Error: 5.2870e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.76859868856746781256050397658493368372e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.13037642242224438972685982606987140111e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.93206268361082760254653961897373271146e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.12844418906916902333116398594921450782e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.36889326770180267250286619759335338794e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.95272615884641416804001553871108995422e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.53808638264746233799776679481568171506e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.92177790427881393122479399837010657693e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.93492737815019893169693306410980499366e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.87510085148730083683110532987841223544e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.28469424017979299382094276157986775969e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.83693904015623816528442886551032709693e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.77632857558257155545506847333166147492e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00448215148716947837105979735199471601e-11), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.69069814466926608209872727645156315374e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.89657828158127300370734997707096744077e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.62713433978940724622996782534485162816e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.91600878366366974062522408704458777166e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.89144035500328704769924414014440238441e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.35263616916053275381069097012458200491e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49136684724986851824746531490006769036e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.65912003138912073317982729161392623277e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.65931144405541620572732754508534372034e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.40193555853535182510951061797573338442e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.43625211359756249232841566256877823039e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.33207781577559817130740123609636060998e-8), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -2) { + RealType t = x + 2; + + // Rational Approximation + // Maximum Relative Error: 1.1977e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.14483832832989822788477500521594411868e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.75657192307644021285091474845448102656e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.40437358470633234235031852091608646844e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.66609942512054705023295445270747546208e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.54563774151184610728476161049657676321e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.51479057544157089574005315379453615537e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.59853789372610909788599341307719626846e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.76919062715142378209907670793921883406e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.58572738466179822770103948740437237476e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.66618046393835590932491510543557226290e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.26253044828460469263564567571249315188e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11130363073235247786909976446790746902e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.49023728251751416730708805268921994420e-10), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.11919889346080886194925406930280687022e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.99082771425048574611745923487528183522e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.99525320878512488641033584061027063035e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.20775109959302182467696345673111724657e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.67505804311611026128557007926613964162e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.77854913919309273628222660024596583623e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.91661599559554233157812211199256222756e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.83924945472605861063053622956144354568e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.84286353909650034923710426843028632590e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.57737060659799463556626420070111210218e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.76047305116625604109657617040360402976e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.86975509621224474718728318687795215895e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.71646204381423826495116781730719271111e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30359141441663007574346497273327240071e-9), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType s = exp(2 * x * x * x / 27) * sqrt(-x); + + if (x >= -4) { + RealType t = -x - 2; + + // Rational Approximation + // Maximum Relative Error: 5.4547e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.74308494787955998605105974174143750745e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.56767876568276519015214709629156760546e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23402577465454790961498400214198520261e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.09577559351834952074671208183548972395e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.76209118910349927892265971592071407626e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.09368637728788364895148841703533651597e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.09003822946777310058789032386408519829e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.02362804210869367995322279203786166303e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.67210045349462046966360849113168808620e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17170437120510484976042000272825166724e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.62068279517157268391045945672600042900e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.72238125522303876741011786930129571553e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33906175951716762094473406744654874848e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.88118741063309731598638313174835288433e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.78908322579081615215057968216358892954e-9), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.15777668058369565739250784347385217839e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.58275582332060589146223977924181161908e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.08890987062755381429904193744273374370e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.53062680969750921573862970262146744660e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15983695707064161504470525373678920004e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.09120624447001177857109399158887656977e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.13566107440776375294261717406754395407e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.50716565210262652091950832287627406780e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.40417354541359829249609883808591989082e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.09285589734746898623782466689035549135e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.47580156629757526370271002425784456931e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.03479533688660179064728081632921439825e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.58728676819719406366664644282113323077e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.72685000369623096389026353785111272994e-9), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -8) { + RealType t = -x - 4; + + // Rational Approximation + // Maximum Relative Error: 1.8813e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.67391547707456587286086623414017962238e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.69944730920904699720804320295067934914e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.80384452804523880914883464295008532437e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.74832028145199140240423863864148009059e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.71728522451977382202061046054643165624e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.91023495084678296967637417245526177858e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.57730498044529764612538979048001166775e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.31940820074475947691746555183209863058e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.54175805821840981842505041345112198286e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.31350452337838677820161124238784043790e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.52175993144502511705213771924810467309e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.85684239411667243910736588216628677445e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.27124210379062272403030391492854565008e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17645475312219452046348851569796494059e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06306499345515479193219487228315566344e-11), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.13521398369589479131299586715604029947e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.17680254721938920978999949995837883884e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.40693619288419980101309080614788657638e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.44930162913500531579305526795523256972e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.22044272115074113804712893993125987243e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.92745159832354238503828226333417152767e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.24766164774700476810039401793119553409e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.08325637569571782180723187639357833929e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.74954547353553788519997212700557196088e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.82800744682204649977844278025855329390e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.20210992299988298543034791887173754015e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.22996819257926038785424888617824130286e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.42340212199922656577943251139931264313e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.75700556749505163188370496864513941614e-11), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -16) { + RealType t = -x - 8; + + // Rational Approximation + // Maximum Relative Error: 3.7501e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.66153901932100301337118653561328446399e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.52542079386371212946566450189144670788e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.17560936304516198261138159102435548430e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.26792904240601626330507068992045446428e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.15418212265160879313643948347460896640e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.05247220687656529725024232836519908641e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.64228534097787946289779529645800775231e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.85634097697132464418223150629017524118e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.49585420710073223183176764488210189671e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.48871040740917898530270248991342594461e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.42577266655992039477272273926475476183e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19214263302271253341410568192952269518e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.36635313919771528255819112450043338510e-12), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32484755553196872705775494679365596205e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.17714315014480774542066462899317631393e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.10789882607024692577764888497624620277e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.09821963157449764169644456445120769215e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52354198870000121894280965999352991441e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.12133327236256081067100384182795121111e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.20187894923874357333806454001674518211e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.69039238999927049119096278882765161803e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.35737444680219098802811205475695127060e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.54403624143647064402264521374546365073e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.24233005893817070145949404296998119469e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.89735152971223120087721392400123727326e-12), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -32) { + RealType t = -x - 16; + + // Rational Approximation + // Maximum Relative Error: 9.2696e-36 + static const RealType P[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.65985830928929730672052407058361701971e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.80409998734303497641108024806388734755e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.49286120625421787109350223436127409819e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.89160491404149422833016337592047445082e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16725811789351893632348469796802834008e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.43438517439595919021069131504449842238e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.29058184637190638359623120253986595623e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.03288592271246432030980385908922413497e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.12286831076824535034975676306286388291e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.64563161552001551475186730009447111173e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.13183856815615371136129883169639301710e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.02405342795439598418033139109649640085e-35), + }; + static const RealType Q[11] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.78286317363568496229516074305435186276e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06519013547074134846431611115576250187e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.71907733798006110542919988654989891098e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.38874744033460851257697736304200953873e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.54724289412996188575775800547576856966e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.98922099980447626797646560786207812928e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.64352676367403443733555974471752023206e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.92616898324742524009679754162620171773e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.87471345773127482399498877510153906820e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.92954174836731254818376396170511443820e-12), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -64) { + RealType t = -x - 32; + + // Rational Approximation + // Maximum Relative Error: 2.3524e-35 + static const RealType P[10] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.65964563346442080104568381680822923977e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.77958685324702990033291591478515962894e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.56419338083136866686699803771820491401e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.82465178504003399087279098324316458608e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.92402911374159755476910533154145918079e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.91224450962405933321548581824712789516e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.84063939469145970625490205194192347630e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.15300528698702940691774461674788639801e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.85553643603397817535280932672322232325e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.46207029637607033398822620480584537642e-38), + }; + static const RealType Q[9] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.54906717312241693103173902792310528801e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.84408124581401290943345932332007045483e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.81403744024723164669745491417804917709e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.23423244618880845765135047598258754409e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.84697524433421334697753031272973192290e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.94803525968789587050040294764458613062e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.68948879514200831687856703804327184420e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07366525547027105672618224029122809899e-12), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + result = 0; + } + } + + return result; +} + +template +inline RealType mapairy_pdf_imp_prec(const RealType& x, const std::integral_constant &tag) { + if (x >= 0) { + return mapairy_pdf_plus_imp_prec(x, tag); + } + else if (x <= 0) { + return mapairy_pdf_minus_imp_prec(x, tag); + } + else { + return std::numeric_limits::quiet_NaN(); + } +} + +template +inline RealType mapairy_pdf_imp_prec(const RealType& x, const std::integral_constant& tag) { + if (x >= 0) { + return mapairy_pdf_plus_imp_prec(x, tag); + } + else if (x <= 0) { + return mapairy_pdf_minus_imp_prec(x, tag); + } + else { + return std::numeric_limits::quiet_NaN(); + } +} + +template +inline RealType mapairy_pdf_imp(const mapairy_distribution& dist, const RealType& x) { + // + // This calculates the pdf of the Map-Airy distribution and/or its complement. + // + + BOOST_MATH_STD_USING // for ADL of std functions + static const char* function = "boost::math::pdf(mapairy<%1%>&, %1%)"; + RealType result = 0; + RealType location = dist.location(); + RealType scale = dist.scale(); + + if (false == detail::check_location(function, location, &result, Policy())) + { + return result; + } + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + if (false == detail::check_x(function, x, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + RealType u = (x - location) / scale; + + result = mapairy_pdf_imp_prec(u, tag_type()) / scale; + + return result; +} + +template +inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 1) { + // Rational Approximation + // Maximum Relative Error: 2.9194e-17 + static const RealType P[7] = { + static_cast(3.33333333333333333333e-1), + static_cast(7.49532137610545010591e-2), + static_cast(9.25326921848155048716e-3), + static_cast(6.59133092365796208900e-3), + static_cast(-5.21942678326323374113e-4), + static_cast(8.22766804917461941348e-5), + static_cast(-3.97941251650023182117e-6), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(8.17408156824742736411e-1), + static_cast(3.57041011418415988268e-1), + static_cast(1.04580353775369716002e-1), + static_cast(1.87521616934129432292e-2), + static_cast(2.33232161135637085535e-3), + static_cast(7.31285352607895467310e-5), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 3.1531e-17 + static const RealType P[7] = { + static_cast(1.84196970581015939888e-1), + static_cast(-1.19398028299089933853e-3), + static_cast(1.21954054797949597854e-2), + static_cast(-9.37912675685073154845e-4), + static_cast(1.66651954077980453212e-4), + static_cast(-1.33271812303025233648e-5), + static_cast(5.35982226125013888796e-7), + }; + static const RealType Q[6] = { + static_cast(1), + static_cast(5.70352826101668448273e-1), + static_cast(1.98852010141232271304e-1), + static_cast(3.64864882318453496161e-2), + static_cast(4.22173125405065522298e-3), + static_cast(1.20079284386796600356e-4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 1.8348e-17 + static const RealType P[8] = { + static_cast(1.07409273397524124098e-1), + static_cast(3.83900318969331880402e-2), + static_cast(1.17926652359826576790e-2), + static_cast(1.52181625871479030046e-3), + static_cast(1.50703424417132565662e-4), + static_cast(2.10117959279448106308e-6), + static_cast(1.97360985832285866640e-8), + static_cast(-1.06076300080048408251e-9), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(8.54435380513870673497e-1), + static_cast(3.66021233157880878411e-1), + static_cast(9.42985570806905160687e-2), + static_cast(1.54122343653998564507e-2), + static_cast(1.49849056258932455548e-3), + static_cast(6.94290406268856211707e-5), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 2.6624e-18 + static const RealType P[8] = { + static_cast(4.70720199535228802538e-2), + static_cast(2.67200763833749070079e-2), + static_cast(7.37400551855064729769e-3), + static_cast(1.10592441765001623699e-3), + static_cast(9.15846028547400212588e-5), + static_cast(3.17801522553862136789e-6), + static_cast(2.03102753319827713542e-8), + static_cast(-5.16172854149066643529e-11), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(9.05317644829451086870e-1), + static_cast(3.73713496637025562492e-1), + static_cast(8.94434672792094976627e-2), + static_cast(1.31846542255347106087e-2), + static_cast(1.16680596342421447100e-3), + static_cast(5.44719256441278863300e-5), + static_cast(8.73131209154185067287e-7), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 2.6243e-17 + static const RealType P[8] = { + static_cast(1.74847564444513000450e-2), + static_cast(6.00209162595027323742e-3), + static_cast(7.86550260761375576075e-4), + static_cast(4.46682547335758521734e-5), + static_cast(9.51329761417139273391e-7), + static_cast(4.10313065114362712333e-9), + static_cast(-9.81286503831545640189e-12), + static_cast(2.98763969872672156104e-14), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(5.27732094554221674504e-1), + static_cast(1.14330643482604301178e-1), + static_cast(1.27722341942374066265e-2), + static_cast(7.54563340152441778517e-4), + static_cast(2.13377039814057925832e-5), + static_cast(2.09670987094350618690e-7), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 5.4684e-17 + static const RealType P[8] = { + static_cast(6.22684103170563193015e-3), + static_cast(1.34714356588780958096e-3), + static_cast(9.51289465377874891896e-5), + static_cast(2.64918464474843134081e-6), + static_cast(2.66703857491046795285e-8), + static_cast(5.42037888457985833156e-11), + static_cast(-6.18017115447736427379e-14), + static_cast(9.11626234402148561268e-17), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(3.09895694991285975774e-1), + static_cast(3.69874670435930773471e-2), + static_cast(2.15708854325146400153e-3), + static_cast(6.35345408451056881884e-5), + static_cast(8.65722805575670770555e-7), + static_cast(4.03153189557220023202e-9), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 6.5947e-17 + static const RealType P[7] = { + static_cast(2.20357145727036120652e-3), + static_cast(1.45412555771401325111e-4), + static_cast(3.27819006009093198652e-6), + static_cast(2.96786786716623870006e-8), + static_cast(9.54192199129339742308e-11), + static_cast(5.71421706870777687254e-14), + static_cast(-1.48321866072033823195e-17), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.12851983233980279746e-1), + static_cast(4.94650928817638043712e-3), + static_cast(1.05447405092956497114e-4), + static_cast(1.11578464291338271178e-6), + static_cast(5.27522295397347842625e-9), + static_cast(7.95786524903707645399e-12), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType x_cube = x * x * x; + RealType t = isnormal(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3); + + // Rational Approximation + // Maximum Relative Error: 6.2709e-17 + static const RealType P[4] = { + static_cast(3.98942280401432677940e-1), + static_cast(2.89752186412133782995e-2), + static_cast(4.67360459917040710474e0), + static_cast(-1.26770824563800250704e-1), + }; + static const RealType Q[3] = { + static_cast(1), + static_cast(7.26301023103568827709e-2), + static_cast(1.60899894281099149848e1), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t; + } + + return result; +} + + +template +inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 1) { + // Rational Approximation + // Maximum Relative Error: 4.7720e-37 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.33333333333333333333333333333333333333e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.38519736580901276671338330967060054188e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.07012342772403725079487012557507575976e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70163612228825567572185033570526547856e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.16393313438726572630782132625753922397e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.92141312947853945617138019222992750592e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16513062047959961711747864068554379374e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.08850391017085844154857927364247623649e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07060872491334153829857156707699441084e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.56961733740920438026573722084839596926e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.93626747947476815631021107726714283086e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32967164823609209711923411113824666288e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.23420723211833268177898025846064230665e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.13807083548358335699029971528179486964e-13), + }; + static const RealType Q[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00810772528427939684296334977783425582e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.24383652800043768524894854013745098654e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.64696616559657052516796844068580626381e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.62288747679271039067363492752820355369e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19311779292286492714550084942827207241e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.48436879303839576521077892946281025894e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.28665316157256311138787387605249076674e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.36350302380845433472593647100484547496e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.05835458213330488018147374864403662878e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.13919959493955187399856105325181806876e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30960533107704070411766556906543316310e-8), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 1.6297e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.84196970581015939887507434989936103587e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23864910443500344832158256856064580005e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.72066675347648126090497588433854314742e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.81712740200456564860442639192891089515e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.39091197181834765859741334477680768031e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.03759464781707198959689175957603165395e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15298069568149410830642785868857309358e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18910514301176322829267019223946392192e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.16851691488007921400221017970691227149e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.82031940093536875619655849638573432722e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.30042143299959913519747484877532997335e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.19848671456872291336347012756651759817e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.00479393063394570750334218362674723065e-13), + }; + static const RealType Q[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.24929390929112144560152115661603117364e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.34853762543033883106055186520573363290e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.73783624941936412984356492130276742707e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23224734370942016023173307854505597524e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.11116448823067697039703254343621931158e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.12490054037308798338231679733816982120e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.38701607014856856812627276285445001885e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.10075199231657382435402462616587005087e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.43662615015322880941108094510531477066e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.37981396630189761210639158952200945512e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.55820444854396304928946970937054949160e-8), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 2.8103e-36 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07409273397524124098315500450332255837e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.98373054365213259465522536994638631699e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.30851284606709136235419547406278197945e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.92686617543233900289721448026065555990e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.18056394312484073294780140350522772329e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07058343449035366484618967963264380933e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.71636108080692802684712497501670425230e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.13155853034615230731719317488499751231e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.00070273388376168880473457782396672044e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.35528857373910910704625837069445190727e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.99897218751541535347315078577172104436e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.35092090729912631973050415647154137571e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.72220647682193638971237255396233171508e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.45008884108655511268690849420714428764e-15), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.42652074703683973183213296310906006173e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.03479786698331153607905223548719296572e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.95556520914240562719970700900964416000e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.73127917601685318803655745157828471269e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.63007065833918179119250623000791647836e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.70652732923091039268400927316918354628e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.60880782675229297981880241245777122866e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.09979261868403910549978204036056659380e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.12085610111710889118562321318284539217e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59811533082647193392924345081953134304e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.37211668706684650035086116219257276925e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.62479830409039340826066305367893543134e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.22039803134898937546371285610102850458e-11), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 7.5930e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.70720199535228802537946089633331273434e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.85220706158476482443562698303252970927e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.55090221054465759649629178911450010833e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.70398047783095186291450019612979853708e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.11846661331973171721224034349719801691e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.83195024406409870789088752469490824640e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.23908312140480103249294791529383548724e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.40765128885655152415228193255890859830e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.14294523267278070539100529759317560119e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.26815059429007745850376987481747435820e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.28142945635159623618312928455133399240e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.77079683180868753715374495747422819326e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.73710011278079325323578951018770847628e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.70140037580287364298206334732060874507e-16), + }; + static const RealType Q[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36848014038411798213992770858203510748e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.15373052017549822413011375404872359177e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.92705544967513282963463451395766172671e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19899290805598090502434290420047460406e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.74002906913724742582773116667380578990e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.80632456977494447641985312297971970632e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.53381530665983535467406445749348183915e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.86606180756179817016240556949228031340e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.49594666942152749850479792402078560469e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.25231012522695972983928740617341887334e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34987086926725472733984045599487947378e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.58286136970918021841189712851698747417e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.12238357666199366902936267515573231037e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.82464168044335183356132979380360583444e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.40073718480172265670072434562833527076e-17), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 7.3609e-35 + static const RealType P[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74847564444513000450056174922427854591e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.56842503159303803254436983444304764079e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.48504629497687889354406208309334148575e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.62327083507366120871877936416427790391e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.72062210557023828776202679230979309963e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.19153025667221102770398900522196418041e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.66248482185063262034022017727375829162e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.57390218395059632327421809878050974588e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.45520328522839835737631604118833792570e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.76327978880339919462910339138428389322e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.99700625463451418394515481232159889297e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.82943476668680389338853032002472541164e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19415284760817575957617090798914089413e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17080879333540200065368097274334363537e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.09912208206107606750610288716869139753e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.98451733054622166748935243139556132704e-26), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.08148065380582488495702136465010348576e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.42385352331252779422725444021027377277e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.66510412535270623169792008730183916611e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.47952712144801508762945315513819636452e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.20703092334999244212988997416711617790e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.71658889250345012472529115544710926154e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.63905601023452497974798277091285373919e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.76730409484335386334980429532443217982e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19139408077753398896224794522985050607e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.58025872548387600940275201648443410419e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.11369336267349152895272975096509109414e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.56182954522937999103610817174373785571e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.35452907177197742692545044913125982311e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23587924912460218189929226092439805175e-17), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 9.7192e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.22684103170563193014558918295924551173e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.55222688816852408105912768186300290291e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.60747505331765587662432023547517953629e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.80463770266821887100086895337451846880e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.19190824169154471000496746227725070963e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.40646301571395681364881852739555404287e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.15408836734496798091749932018121879724e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.13676779930022341958128426888835497781e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.02435098103190516418351075792372986932e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.82018920071479061978244972592746216377e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.26435061215428679536159320644587957335e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.05298407883178633891153989998582851270e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.61156860101928352010449210760843428372e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.02156808288545876198121127510075217184e-27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.65549196385656698597261688277898043367e-30), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.03426141030409708635168766288764563749e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.13808987755928828118915442251025992769e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52253239792170999949444502938290297674e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33720936468171204432499390745432338841e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.08713980159883984886576124842631646880e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.43652846144339754840998823540656399165e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.02849693617024492825330133490278326951e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.14110017452008167954262319462808192536e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.01462578814695350559338360744897649915e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.73495817568046489613308117490508832084e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47445372925844096612021093857581987132e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.08200002287534174751275097848899176785e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.15305756373406702253187385797525419287e-21), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 9.7799e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.20357145727036120652264700679701054983e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.95712324967981162396595365933255312698e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.08619492652809635942960438372427086939e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.37140224583881547818087260161723208444e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.83073777522092069988595553041062506001e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.00473542739040742110568810201412321512e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.47447289601822506789553624164171452120e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.70913574957198131397471307249294758738e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.36538119628489354953085829178695645929e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00763343664814257170332492241110173166e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.62297585950798764290583627210836077239e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15780217054514513493147192853488153246e-24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.31961589164397397724611386366339562789e-28), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.26440207646105117747875545474828367516e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.27872879091838733280518786463281413334e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34256572873114675776148923422025029494e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.13595637397535037957995766856628205747e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33745879863685053883024090247009549434e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.41792226523670940279016788831933559977e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.03966147662273388060545199475024100492e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.62177951640260313354050335795080248910e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.50650165210517365082118441264513277196e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.48413283257020741389298806290302772976e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16439276222123152748426700489921412654e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.24969602890963356175782126478237865639e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.08681155203261739689727004641345513984e-26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.28282024196484688479115133027874255367e-30), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType x_cube = x * x * x; + RealType t = isnormal(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3); + + // Rational Approximation + // Maximum Relative Error: 3.5865e-37 + static const RealType P[8] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.98942280401432677939946059934381868476e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.12426566605292130233061857505057433291e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.91574528280329492283287073127040983832e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.69914217884224943794012165979483573091e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30178902028403564086640591437738216288e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96515490341559353794378324810127583810e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.44343825578434751356083230369361399507e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.07224810408790092272497403739984510394e2), + }; + static const RealType Q[7] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.32474438135610721926278423612948794250e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.27594461167587027771303292526448542806e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.49207539478843628626934249487055017677e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.75094412095634602055738687636893575929e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.51642534474780515366628648516673270623e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.05977615003758056284424652420774587813e4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t; + } + + return result; +} + +template +inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x >= -1) { + RealType t = x + 1; + + // Rational Approximation + // Maximum Relative Error: 1.6964e-18 + static const RealType P[8] = { + static_cast(4.23238998449671083670e-1), + static_cast(4.95353582976475183891e-1), + static_cast(2.45823281826037784270e-1), + static_cast(7.29726507468813920788e-2), + static_cast(1.63332856186819713346e-2), + static_cast(2.82514634871307516142e-3), + static_cast(2.66220579589280704089e-4), + static_cast(3.09442180091323751049e-6), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(5.16241922223786900600e-1), + static_cast(2.75690727171711638879e-1), + static_cast(7.18707184893542884080e-2), + static_cast(1.87136800286819336797e-2), + static_cast(2.38383441176345054929e-3), + static_cast(3.23509126477812051983e-4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -2) { + RealType t = x + 2; + + // Rational Approximation + // Maximum Relative Error: 5.8303e-17 + static const RealType P[8] = { + static_cast(1.62598955251978523175e-1), + static_cast(2.30154661502402196205e-1), + static_cast(1.29233975368291684522e-1), + static_cast(3.80919553916980965587e-2), + static_cast(8.17724414618808505948e-3), + static_cast(1.95816800210481122544e-3), + static_cast(3.35259917978421935141e-4), + static_cast(1.22071311320012805777e-5), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(9.63771793313770952352e-2), + static_cast(2.23602260938227310054e-1), + static_cast(9.21944797677283179038e-3), + static_cast(1.82181136341939651516e-2), + static_cast(1.11216849284965970458e-4), + static_cast(5.57446347676836375810e-4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType s = exp(2 * x * x * x / 27) / sqrt(-x * x * x); + + if (x >= -4) { + RealType t = -x - 2; + + // Rational Approximation + // Maximum Relative Error: 3.6017e-18 + static const RealType P[8] = { + static_cast(8.31806744221966404520e-1), + static_cast(1.34481067378012055850e0), + static_cast(9.12139427469494995264e-1), + static_cast(3.59706159222491124928e-1), + static_cast(9.48836332725688279299e-2), + static_cast(1.68259594978853951234e-2), + static_cast(1.89700733471520162946e-3), + static_cast(1.13854052826846329787e-4), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(1.29694286517571741097e0), + static_cast(7.99686735441213882518e-1), + static_cast(3.08198207583883597188e-1), + static_cast(7.97230139795658588972e-2), + static_cast(1.40742142048849462162e-2), + static_cast(1.58411440546277691506e-3), + static_cast(9.51560785730564046338e-5), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -8) { + RealType t = -x - 4; + + // Rational Approximation + // Maximum Relative Error: 1.3504e-17 + static const RealType P[8] = { + static_cast(1.10294551528734705946e0), + static_cast(1.26696377028973554615e0), + static_cast(6.63115985833429688941e-1), + static_cast(2.06289793717379095832e-1), + static_cast(4.11977615717846276227e-2), + static_cast(5.28620928618550859827e-3), + static_cast(4.04328442334023561279e-4), + static_cast(1.42364413902075896503e-5), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(1.09709853682665798542e0), + static_cast(5.63687797989627787500e-1), + static_cast(1.73604358560002859604e-1), + static_cast(3.44985744385890794044e-2), + static_cast(4.41683993064797272821e-3), + static_cast(3.37834206192286709492e-4), + static_cast(1.18951465786445720729e-5), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -16) { + RealType t = -x - 8; + + // Rational Approximation + // Maximum Relative Error: 8.8272e-18 + static const RealType P[7] = { + static_cast(1.18246847255744057280e0), + static_cast(8.41320657699741240497e-1), + static_cast(2.55093097377551881478e-1), + static_cast(4.21261576802732715976e-2), + static_cast(3.98805044659990523312e-3), + static_cast(2.04688276265993954527e-4), + static_cast(4.43354791268634655473e-6), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(7.07103973315808077783e-1), + static_cast(2.13664682181055450396e-1), + static_cast(3.52218225168465984709e-2), + static_cast(3.33218664347896435919e-3), + static_cast(1.71025807471868853268e-4), + static_cast(3.70441884597642042665e-6), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -32) { + RealType t = -x - 16; + + // Rational Approximation + // Maximum Relative Error: 2.6236e-18 + static const RealType P[6] = { + static_cast(1.19497306481411168356e0), + static_cast(3.90497195765498241356e-1), + static_cast(5.13120330037626853257e-2), + static_cast(3.38574023921119491471e-3), + static_cast(1.12075935888344736993e-4), + static_cast(1.48743616420183584738e-6), + }; + static const RealType Q[6] = { + static_cast(1), + static_cast(3.26493785348088598123e-1), + static_cast(4.28813205161574223713e-2), + static_cast(2.82893073845390254969e-3), + static_cast(9.36442365966638579335e-5), + static_cast(1.24281651532469125315e-6), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + result = 0; + } + } + + return result; +} + +template +inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x >= -1) { + RealType t = x + 1; + + // Rational Approximation + // Maximum Relative Error: 1.0688e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.23238998449671083670041452413316011920e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.14900991369455846775267187236501987891e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.19132787054572299485638029221977944555e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.87295743700300806662745209398368996653e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.41994520703802035725356673887766112213e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.78782099629586443747968633412271291734e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.05200546520666366552864974572901349343e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.51453477916196630939702866688348310208e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15461354910584918402088506199099270742e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43371674256124419899137414410592359185e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.35849788347057186916350200082990102088e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.50359296597872967493549820191745700442e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.21838020977580479741299141050400953125e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.46723648594704078875476888175530463986e-12), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.98700317671474659677458220091101276158e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.00405631175818416028878082789095587658e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.04189939150805562128632256692765842568e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.03621065280443734565418469521814125946e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.85722257874304617269018116436650330070e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.24191409213079401989695901900760076094e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.64269032641964601932953114106294883156e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19289631274036494326058240677240511431e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41389309719775603006897751176159931569e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.42000309062533491486426399210996541477e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.02436961569668743353755318268149636644e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.50130875023154569442119099173406269991e-9), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -2) { + RealType t = x + 2; + + // Rational Approximation + // Maximum Relative Error: 5.1815e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.62598955251978523174755901843430986522e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.08127698872954954678270473317137288772e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.70144997468767751317246482211703706086e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49486603823046766249106014234315835102e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.07186495389828596786579668258622667573e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.98334953533562948674335281457057445421e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.44119017374895211020429143034854620303e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.27080759819117162456137826659721634882e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.53892796920597912362370019918933112349e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.30530442651657077016130554430933607143e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.04837779538527662990102489150650534390e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.94354615171320374997141684442120888127e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.30746545799073289786965697800049892311e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.41870129065056783732691371215602982173e-9), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.75919235734607601884356783586727272494e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.57656678936617227532275100649989944452e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.72617552401870454676736869003112018648e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.59238104942208254162102314312757621047e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06040513359343987972917295603514840777e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.26922840063034349024167652148593396307e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.25628506630180107357627955876231943531e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.81600387497542714853225329159728694926e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.08210973846891324886779444820838563800e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.68632477858150229792523037059221563861e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.43542789104866782087701759971538600076e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.70594730517167328271953424328890849790e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.30162314557860623869079601905904538470e-9), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType s = exp(2 * x * x * x / 27) / sqrt(-x * x * x); + + if (x >= -4) { + RealType t = -x - 2; + + // Rational Approximation + // Maximum Relative Error: 6.4678e-36 + static const RealType P[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.31806744221966404520449104514474066823e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.50292887071777664663197915067642779665e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.45140067157601150721516139901304901854e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.93227973605511286112712730820664209900e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74259108933048973391560053531348126900e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.77677252890665602191818487592154553094e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.71843197238558832510595724454548089268e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.62811778285151415483649897138119310816e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74127763877120261698596916683136227034e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.24832552591462216226478550702845438540e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.93381036027487259940171548523889481080e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.02261328789519398745019578211081412570e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.75409238451885381267277435341417474231e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.09526311389365895099871581844304449319e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96371756262605118060185816854433322493e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.88472819535099746216179119978362211227e-10), + }; + static const RealType Q[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.68923525157720774962908922391133419863e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.40714902096062779527207435671907059131e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.73120596883364361220343183559076165363e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.56331267512666685349409906638266569733e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.80956276267438042306216894159447642323e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.34213468750936211385520570062547991332e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.50081600968590616549654807511166706919e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47297208240850928379158677132220746750e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.73392976579560287571141938466202325901e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.13858821123741335782695407397784840241e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.04103497389656828224053882850778186433e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.81040189127998139689091455192659191796e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.42176283104790992634826374270801565123e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.64077137545614380065714904794220228239e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.08139724991616322332901357866680220241e-10), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -8) { + RealType t = -x - 4; + + // Rational Approximation + // Maximum Relative Error: 3.5975e-36 + static const RealType P[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.10294551528734705945662709421382590676e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.26135857114883288617323671166863478751e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.23504465936865651893193560109437792738e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41598983788870071301270649341678962009e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.43871304031224174103636568402522086316e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.22745720458050596514499383658714367529e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.05976431838299244997805790000128175545e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32087500190238014890030606301748111874e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.32754445514451500968404092049839985196e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.31866016448921762610690552586049011375e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.80197257671079297305525087998125408939e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.44212088947602969374978384512149432847e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.38857170416924025226203571589937286465e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.20239999218390467567339789443070294182e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.93965060142992479149039624149602039394e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.36407983918582149239548869529460234702e-12), + }; + static const RealType Q[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.99867960957804580209868321228347067213e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.94236623527818880544030470097296139679e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21644866845440678050425616384656052588e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.48653919287388803523090727546630060490e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.88696531788490258477870877792341909659e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.11157356307921406032115084386689196255e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11071149696069503480091810333521267753e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.95274844731679437274609760294652465905e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.77971280158253322431071249000491659536e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.18092258028773913076132483326275839950e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.87773088535057996947643657676843842076e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.99609277781492599950063871899582711550e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00465660598924300723542908245498229301e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.29174652982710100418474261697035968379e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.31746082236506935340972706820707017875e-12), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -16) { + RealType t = -x - 8; + + // Rational Approximation + // Maximum Relative Error: 2.6792e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18246847255744057280356900905660312795e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.77955886026107125189834586992142580148e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.24948425302263641813107623611637262126e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.42593662659560333324287312162818766556e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.62714138002904073145045478360748042164e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.56008984285541289474850396553042124777e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.84858048549330525583286373950733005244e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.30578460156038467943968005946143934751e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.93974868941529258700281962314167648967e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.95086664204515648622431580749060079100e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.57811968176644056830002158465591081929e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.27814751838906948007289825582251221538e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06762893426725920159998333647896590440e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.15388861641344998301210173677051088515e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.83956842740198388242245209024484381888e-29), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.50056124032615852703112365430040751173e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05112559537845833793684655693572118348e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.55609497026127521043140534271852131858e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36430652394614121156238070755223942728e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.98167215021940993097697777547641188697e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.89418831310297071347013983522734394061e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.10980717618462843498917526227524790487e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.80119618735773019675212434416594954984e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.13748676086657187580746476165248613583e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.15424395860921826755718081823964568760e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.75228896859720124469916340725146705309e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.72759238269315282789451836388878919387e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.79966603543593799412565926418879689461e-12), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -32) { + RealType t = -x - 16; + + // Rational Approximation + // Maximum Relative Error: 2.1744e-36 + static const RealType P[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19497306481411168355692832231058399132e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.15593166681833539521403250736661720488e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.54020260738207743315755235213180652303e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.76467972857585566189917087631621063058e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.97922795572348613358915532172847895070e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.26998967192207380100354278434037095729e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.32827180395699855050424881575240362199e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.50587178182571637802022891868380669565e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.78252548290929962236994183546354358888e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01519297007773622283120166415145520855e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29602226691665918537895803270497291716e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.53666531487585211574942518181922132884e-14), + }; + static const RealType Q[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.82230649578130958108098853863277631065e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.12412482738973738235656376802445565005e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.98320116955422615960870363549721494683e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.99756654189000467678223166815845628725e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.40414942475279981724792023159180203408e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.78118445466942812088955228016254912391e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.25827002637577602812624580692342616301e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.99604467789028963216078448884632489822e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.48237134334492289420105516726562561260e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.08288201960155447241423587030002372229e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.29720612489952110448407063201146274502e-14), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x >= -64) { + RealType t = -x - 32; + + // Rational Approximation + // Maximum Relative Error: 3.4699e-36 + static const RealType P[10] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19659414007358083585943280640656311534e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.36969140730640253987817932335415532846e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.21946928005759888612066397569236165853e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.08341720579009422518863704766395201498e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.44908614491286780138818989614277172709e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.54172482866925057749338312942859761961e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.49281630950104861570255344237175124548e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.27586759709416364899010676712546639820e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00054716479138657682306851175059678989e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.48798342894235412426464893852098239746e-14), + }; + static const RealType Q[10] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.81588658109851219975949691772676519853e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.52583331848892383968186924120872369151e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.57644670426430994363913234422346706991e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21080164634428298820141591419770346977e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.79484074949580980980061103238709314326e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.93167250146504946763386377338487557826e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06604193118724797924138056151582242604e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.35999937789324222934257460080153249173e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.91435929481043135336094426837156247599e-14), + }; + + result = s * tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + result = 0; + } + } + + return result; +} + +template +inline RealType mapairy_cdf_imp_prec(const RealType& x, bool complement, const std::integral_constant& tag) { + if (x >= 0) { + return complement ? mapairy_cdf_plus_imp_prec(x, tag) : 1 - mapairy_cdf_plus_imp_prec(x, tag); + } + else if (x <= 0) { + return complement ? 1 - mapairy_cdf_minus_imp_prec(x, tag) : mapairy_cdf_minus_imp_prec(x, tag); + } + else { + return std::numeric_limits::quiet_NaN(); + } +} + +template +inline RealType mapairy_cdf_imp_prec(const RealType& x, bool complement, const std::integral_constant& tag) { + if (x >= 0) { + return complement ? mapairy_cdf_plus_imp_prec(x, tag) : 1 - mapairy_cdf_plus_imp_prec(x, tag); + } + else if (x <= 0) { + return complement ? 1 - mapairy_cdf_minus_imp_prec(x, tag) : mapairy_cdf_minus_imp_prec(x, tag); + } + else { + return std::numeric_limits::quiet_NaN(); + } +} + +template +inline RealType mapairy_cdf_imp(const mapairy_distribution& dist, const RealType& x, bool complement) { + // + // This calculates the cdf of the Map-Airy distribution and/or its complement. + // + + BOOST_MATH_STD_USING // for ADL of std functions + static const char* function = "boost::math::cdf(mapairy<%1%>&, %1%)"; + RealType result = 0; + RealType location = dist.location(); + RealType scale = dist.scale(); + + if (false == detail::check_location(function, location, &result, Policy())) + { + return result; + } + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + if (false == detail::check_x(function, x, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + RealType u = (x - location) / scale; + + result = mapairy_cdf_imp_prec(u, complement, tag_type()); + + return result; +} + +template +inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (p >= 0.375) { + RealType t = p - 0.375; + + // Rational Approximation + // Maximum Relative Error: 1.5488e-18 + static const RealType P[7] = { + static_cast(-1.17326074020471664075e0), + static_cast(1.51461298154568349598e0), + static_cast(1.19979368094343490487e1), + static_cast(-5.94882121521324108164e0), + static_cast(-2.20619749774447254528e1), + static_cast(7.17766543775229176131e0), + static_cast(4.79284243496552841508e0), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.76268072706610602584e0), + static_cast(-4.88492535243404839734e0), + static_cast(-5.67524172432687656881e0), + static_cast(6.83327389947131710596e0), + static_cast(2.91338085774159042709e0), + static_cast(-1.41108918944159283950e0), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (p >= 0.25) { + RealType t = p - 0.25; + + // Rational Approximation + // Maximum Relative Error: 7.5181e-17 + static const RealType P[7] = { + static_cast(-1.63281240925531302762e0), + static_cast(-4.92351310795930780147e0), + static_cast(1.43448529253101759409e1), + static_cast(3.33182629948094299473e1), + static_cast(-3.06679026539368582747e1), + static_cast(-2.87298447423841965301e1), + static_cast(1.31575930750093554120e1), + }; + static const RealType Q[6] = { + static_cast(1), + static_cast(5.38761652244702318296e0), + static_cast(2.40932080746189543284e0), + static_cast(-1.69465870062123632126e1), + static_cast(-6.39998944283654848809e0), + static_cast(1.27168434054332272391e1), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (p >= 0.125) { + RealType t = p - 0.125; + + // Rational Approximation + // Maximum Relative Error: 2.3028e-18 + static const RealType P[8] = { + static_cast(-2.18765177572396469657e0), + static_cast(-3.65752788934974426531e1), + static_cast(-1.81144810822028903904e2), + static_cast(-1.22434531262312950288e2), + static_cast(8.99451018491165823831e2), + static_cast(9.11333307522308410858e2), + static_cast(-8.76285742384616909177e2), + static_cast(-2.33786726970025938837e2), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(1.91797638291395345792e1), + static_cast(1.24293724082506952768e2), + static_cast(2.82393116012902543276e2), + static_cast(-1.80472369158936285558e1), + static_cast(-5.31764390192922827093e2), + static_cast(-5.60586018315854885788e1), + static_cast(1.21284324755968033098e2), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -4) { + RealType t = -log2(ldexp(p, 3)); + + // Rational Approximation + // Maximum Relative Error: 6.1147e-18 + static const RealType P[6] = { + static_cast(-2.18765177572396470773e0), + static_cast(-2.19887766409334094428e0), + static_cast(-7.77080107207360785208e-1), + static_cast(-1.15551765136654549650e-1), + static_cast(-6.64711321022529990367e-3), + static_cast(-9.74212491048543799073e-5), + }; + static const RealType Q[6] = { + static_cast(1), + static_cast(7.91919722132624625590e-1), + static_cast(2.17415447268626558639e-1), + static_cast(2.41474762519410575392e-2), + static_cast(9.41084107182696904714e-4), + static_cast(6.65754108797614202364e-6), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -8) { + RealType t = -log2(ldexp(p, 4)); + + // Rational Approximation + // Maximum Relative Error: 2.0508e-17 + static const RealType P[8] = { + static_cast(-2.59822399410385085335e0), + static_cast(-2.24306757759003016244e0), + static_cast(-7.36208578161752060979e-1), + static_cast(-1.15130762650287391576e-1), + static_cast(-8.77652386123688618995e-3), + static_cast(-2.96358888256575251437e-4), + static_cast(-3.33661282483762192446e-6), + static_cast(-4.19292241201527861927e-9), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(7.23065798041556418844e-1), + static_cast(1.96731305131315877264e-1), + static_cast(2.49952034298034383781e-2), + static_cast(1.49149568322111062242e-3), + static_cast(3.66010398525593921460e-5), + static_cast(2.46857713549279930857e-7), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -16) { + RealType t = -log2(ldexp(p, 8)); + + // Rational Approximation + // Maximum Relative Error: 2.1997e-17 + static const RealType P[8] = { + static_cast(-3.67354365380697580447e0), + static_cast(-1.52181685844845957618e0), + static_cast(-2.40883948836320845233e-1), + static_cast(-1.82424079258401987512e-2), + static_cast(-6.75844978572417703979e-4), + static_cast(-1.11273358356809152121e-5), + static_cast(-6.12797605223700996671e-8), + static_cast(-3.78061321691170114390e-11), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(3.57770840766081587688e-1), + static_cast(4.81290550545412209056e-2), + static_cast(3.02079969075162071807e-3), + static_cast(8.89589626547135423615e-5), + static_cast(1.07618717290978464257e-6), + static_cast(3.57383804712249921193e-9), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -32) { + RealType t = -log2(ldexp(p, 16)); + + // Rational Approximation + // Maximum Relative Error: 2.4331e-17 + static const RealType P[8] = { + static_cast(-4.92187819510636697128e0), + static_cast(-9.94924018698264727979e-1), + static_cast(-7.69914962772717316098e-2), + static_cast(-2.85558010159310978248e-3), + static_cast(-5.19022578720207406789e-5), + static_cast(-4.19975546950263453259e-7), + static_cast(-1.13886013623971006760e-9), + static_cast(-3.46758191090170732580e-13), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.77270673840643360017e-1), + static_cast(1.18099604045834575786e-2), + static_cast(3.66889581757166584963e-4), + static_cast(5.34484782554469770841e-6), + static_cast(3.19694601727035291809e-8), + static_cast(5.24649233511937214948e-11), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -64) { + RealType t = -log2(ldexp(p, 32)); + + // Rational Approximation + // Maximum Relative Error: 2.7742e-17 + static const RealType P[8] = { + static_cast(-6.41443550638291133784e0), + static_cast(-6.38369359780748328332e-1), + static_cast(-2.43420704406734621618e-2), + static_cast(-4.45274771094277987075e-4), + static_cast(-3.99529078051262843241e-6), + static_cast(-1.59758677464731620413e-8), + static_cast(-2.14338367751477432622e-11), + static_cast(-3.23343844538964435927e-15), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(8.79845511272943785289e-2), + static_cast(2.90839059356197474893e-3), + static_cast(4.48172838083912540123e-5), + static_cast(3.23770691025690100895e-7), + static_cast(9.60156044379859908674e-10), + static_cast(7.81134095049301988435e-13), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -128) { + RealType t = -log2(ldexp(p, 64)); + + // Rational Approximation + // Maximum Relative Error: 3.2451e-17 + static const RealType P[8] = { + static_cast(-8.23500806363233610938e0), + static_cast(-4.05652655284908839003e-1), + static_cast(-7.65978833819859622912e-3), + static_cast(-6.94194676058731901672e-5), + static_cast(-3.08771646223818451436e-7), + static_cast(-6.12443207313641110962e-10), + static_cast(-4.07882839359528825925e-13), + static_cast(-3.05720104049292610799e-17), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(4.37395212065018405474e-2), + static_cast(7.18654254114820140590e-4), + static_cast(5.50371158026951899491e-6), + static_cast(1.97583864365011234715e-8), + static_cast(2.91169706068202431036e-11), + static_cast(1.17716830382540977039e-14), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -256) { + RealType t = -log2(ldexp(p, 128)); + + // Rational Approximation + // Maximum Relative Error: 3.8732e-17 + static const RealType P[8] = { + static_cast(-1.04845570631944023913e1), + static_cast(-2.56502856165700644836e-1), + static_cast(-2.40615394566347412600e-3), + static_cast(-1.08364601171893250764e-5), + static_cast(-2.39603255140022514289e-8), + static_cast(-2.36344017673944676435e-11), + static_cast(-7.83146284114485675414e-15), + static_cast(-2.92218240202835807955e-19), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(2.17740414929742679904e-2), + static_cast(1.78084231709097280884e-4), + static_cast(6.78870668961146609668e-7), + static_cast(1.21313439060489363960e-9), + static_cast(8.89917934953781122884e-13), + static_cast(1.79115540847944524599e-16), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -512) { + RealType t = -log2(ldexp(p, 256)); + + // Rational Approximation + // Maximum Relative Error: 4.6946e-17 + static const RealType P[8] = { + static_cast(-1.32865827226175698181e1), + static_cast(-1.61802434199627472010e-1), + static_cast(-7.55642602577784211259e-4), + static_cast(-1.69457608092375302291e-6), + static_cast(-1.86612389867293722402e-9), + static_cast(-9.17015770142364635163e-13), + static_cast(-1.51422473889348610974e-16), + static_cast(-2.81661279271583206526e-21), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.08518414679241420227e-2), + static_cast(4.42335224797004486239e-5), + static_cast(8.40387821972524402121e-8), + static_cast(7.48486746424527560620e-11), + static_cast(2.73676810622938942041e-14), + static_cast(2.74588200481263214866e-18), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -1024) { + RealType t = -log2(ldexp(p, 512)); + + // Rational Approximation + // Maximum Relative Error: 5.7586e-17 + static const RealType P[8] = { + static_cast(-1.67937186583822375593e1), + static_cast(-1.01958138247797604098e-1), + static_cast(-2.37409774265951876695e-4), + static_cast(-2.65483321307104128810e-7), + static_cast(-1.45803536947907216594e-10), + static_cast(-3.57375116523338994342e-14), + static_cast(-2.94401318006358820268e-18), + static_cast(-2.73260616170245224789e-23), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(5.41357843707822974161e-3), + static_cast(1.10082540037527566536e-5), + static_cast(1.04338126042963003178e-8), + static_cast(4.63619608458569600346e-12), + static_cast(8.45781310395535984099e-16), + static_cast(4.23432554226506409568e-20), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + result = -std::numeric_limits::infinity(); + } + + return result; +} + + +template +inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (p >= 0.4375) { + RealType t = p - 0.4375; + + // Rational Approximation + // Maximum Relative Error: 4.2901e-35 + static const RealType P[10] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.48344198262277235851026749871350753173e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.18249834490570496537675012473572546187e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.20191368895639224466285643454767208281e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.88388953372157636908236843798588258539e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.59477796311326067051769635858472572709e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.88799146700484120781026039104654730797e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.15708831983930955608517858269193800412e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.01389336086567891484877690859385409842e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.16683694881010716925933071465043323946e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.04356966421177683585461937085598186805e1), + }; + static const RealType Q[11] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.75444066345435020043849341970820565274e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.95105673975812427406540024601734210826e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.20381124524894051002242766595737443257e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.48370658634610329590305283520183480026e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.52213602242009530270284305006282822794e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.91028722773916006242187843372209197705e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.76130245344411748356977700519731978720e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30834721900169773543149860814908904224e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.37863084758381651884340710544840951679e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.46880981703613838666108664771931239970e0), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (p >= 0.375) { + RealType t = p - 0.375; + + // Rational Approximation + // Maximum Relative Error: 2.8433e-36 + static const RealType P[11] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.17326074020471664204142312429732771661e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.23412560010002723970559712941124583385e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.83665111310407767293290698145068379130e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.38459476870110655357485107373883403534e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.28751995328228442619291346921055105808e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.31663592034507247231393516167247241037e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.13629333446941271397790762651183997586e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.80674058829101054663235662701823250421e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.53226182094253065852552393446365315319e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.14713948941614711932063053969010219677e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.62979741122708118776725634304028246971e0), + }; + static const RealType Q[10] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.10550060286464202595779024353437346419e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.15893254630199957990897452211066782021e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.58964066823516762861256609311733069353e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.73352515261971291505497909338586980605e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.64737859211974163695241658186141083513e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.79137714768236053008878088337762178011e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.71851514659301019977259792564627124877e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.37210093190088984630526671624779422232e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06793750951779308425209267821815264457e1), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (p >= 0.25) { + RealType t = p - 0.25; + + // Rational Approximation + // Maximum Relative Error: 5.9072e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.63281240925531315038207673147576291783e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.72733898245766165408685147762489513406e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.48666841594842113608962500631836790675e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.38711336213357101067420572773139678571e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.19536066931882831915715343914510496760e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70911330354860558400876197129777829223e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.46138758869321272507090399082047865434e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.42653825421465476333482312795245170700e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.68040069633027903153088221686431049116e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.63017854949929226947577854802720988740e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.57362168966659376351959631576588023516e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.48386631313725080746815524770260451090e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.03293129698111279047104766073456412318e1), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29511778027351594854005887702013466376e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.66155745848864270109281703659789474448e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.25628362783798417463294553777015370203e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.93162726153946899828589402901015679821e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.51582398149308841534372162372276623400e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.55512400116480727630652657714109740448e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.11949742749256615588470329024257669470e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.28090154738508864776480712360731968283e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.44307717248171941824014971579691790721e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.33595130666758203099507440236958725924e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.76156378002782668186592725145930755636e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.70446647862725980215630194019740606935e0), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (p >= 0.125) { + RealType t = p - 0.125; + + // Rational Approximation + // Maximum Relative Error: 9.9092e-36 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.18765177572396470161180571018467019660e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.16991481696416567893311341049825218287e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.25497491118598918048058751362064598010e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.00259915194411316966036757165146681474e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.20350803730836873687692010728689867756e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.75441278117456011071671644613599089820e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18844967505497310645091822621081741562e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.84771867850847121528386231811667556346e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.78112436422992766542256241612018834150e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.82617957794395420193751983521804760378e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.77260227244465268981198741998181334875e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.61918290776044518321561351472048170874e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.10309368217936941851272359946015001037e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.68917274690585744147547352309416731690e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.96914697182030973966321601422851730384e4), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.98063872144867195074924232601423646991e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.65911346382127464683324945513128779971e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.02451223307009464199634546540152067898e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.12662676019712475980273334769644047369e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.77637305574675655673572303462430608857e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.65900204382557635710258095712789133767e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.61649498173261886264315880770449636676e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.29867325788870863753779283018061152414e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.31375646045453788071216808289409712455e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.91053361331987954531162452163243245571e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30917504462260061766689326034981496723e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.95779171217851232246427282884386844906e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.07234815204245866330282860014624832711e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21353269292094971546479026200435095695e4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -4) { + RealType t = -log2(ldexp(p, 3)); + + // Rational Approximation + // Maximum Relative Error: 3.9653e-35 + static const RealType P[11] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.18765177572396470161180571018467025793e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.94718878144788678915739777385667044494e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.01760622104142726407095836139719210570e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.27585388152893587017559610649258643106e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.26494992809545184138230791849722703452e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.19962820888633928632710264415572027960e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.10249328404135065767844288193594496173e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.94733898567966142295343935527193851633e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.10350856810280579594619259121755788797e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.23852908701349250480831167491889740823e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.61008160195204632725691076288641221707e-10), + }; + static const RealType Q[11] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59109221235949005113322202980300291082e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07119192591092503378838510797916225920e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.97313678065269932508447079892684333156e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.85743007214453288049750256975889151838e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21504290861269099964963866156493713716e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00880286431998922077891394903879512720e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.78806057460269900288838437267359072282e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15390284861815831078443996558014864171e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.09877166004503937701692216421704042881e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.01544823753120969225271131241177003165e-11), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -8) { + RealType t = -log2(ldexp(p, 4)); + + // Rational Approximation + // Maximum Relative Error: 6.7872e-36 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.59822399410385083283727681965013517187e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.30676107401101401386206170152508285083e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.14999782004905950712290914501961213222e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.33941786334132569296061539102765384372e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.67220197146826865151515598496049341734e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.80553562310354708419148501358813792297e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.69365728863553037992854715314245847166e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.66571611322125393586164383361858996769e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.60112572827002965346926427208336150737e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.82368436189138780270310776927920829805e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.53112953085778860983110669544602606343e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.47363651755817041383574210879856850108e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.56959356177318833325064543662295824581e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.16259632533790175212174199386945953139e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.51102540845397821195190063256442894688e-18), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.51733661576324699382035973518172469602e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01435607980568082538278883569729476204e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.93274478117803447229185270863587786287e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.79695020433868416640781960667235896490e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.64179255575983014759473815411232853821e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.88411076775875459504324039642698874213e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47924359965537384942568979646011627522e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.80915944234873904741224397674033111178e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.67530059257263142305079790717032648103e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.59778634436027309520742387952911132163e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.45772841855129835242992919296397034883e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.40356170422999016176996652783329671363e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.31127037096552892520323998665757802862e-16), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -16) { + RealType t = -log2(ldexp(p, 8)); + + // Rational Approximation + // Maximum Relative Error: 7.6679e-36 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.67354365380697578246790709817724831418e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.98681625368564496421038758088088788795e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.07310677200866436332040539417232353673e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.24429836496456823308103613923194387860e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.02985399190977938381625172095575017346e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.76782196972948240235456454778537838123e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.74449002785643398012450514191731166637e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.59599894044461264694825875303563328822e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.25326249969126313897827328136779597159e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.41714701672521323699602179629851858792e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.43197925999694667433180053594831915164e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.84385683045691486021670951412023644809e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.34484740544060627138216383389282372695e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.69717198111130468014375331439613690658e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.54464319402577486444841981479085908190e-22), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.56568169258142086426383908572004868200e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.52144703581828715720555168887427064424e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.87268567039210776554113754014224005739e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.04907480436107533324385788289629535047e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.05063218951887755000006493061952858632e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.88707869862323507236241669797692957827e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.12876335369047582931728838551780783006e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.96657547014655679104867167083078285517e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.05799908632250375607393338998205481867e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.26543514080500125624753383852230043206e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.02102501711063497529014782040893679505e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.91577723105757841509716090936343311518e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.13824283239122976911704652025193325941e-20), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -32) { + RealType t = -log2(ldexp(p, 16)); + + // Rational Approximation + // Maximum Relative Error: 8.6323e-36 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.92187819510636694694450607724165689649e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.97763858433958798529675258052376253402e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.51315096979196319830162238831654165509e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.63462872759639470195664268077372442947e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.42843455093529447002457295994721102683e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.09839699044798405685726233251577671229e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.42918585783783247934440868680748693033e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.39927851612709063686969934343256912856e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.08811978806833318962489621493456773153e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.05790315329766847040100971840989677130e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.45479905512618918078640786598987515012e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.26725031195260767541308143946590024995e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.93921283405116349017396651678347306610e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.46989755992471397407520449698676945629e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.84098833615882764168840211033822541979e-26), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.76933186134913044021577076301874622292e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.25794095712489484166470336696962749356e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.02367257449622569623375613790000874499e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.72422948147678152291655497515112236849e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.54841786738844966378222670550160421679e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.40690766057741905625149753730480294357e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.57722740290698689456097239435447030950e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.12202417878861628530322715231540006386e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.52053248659561670052645118655279630611e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.93156242508301535729374373870786335203e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.40767922796889118151219837068812449420e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.83472702205100162081157644960354192597e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.07575352729625387198150555665307193572e-24), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -64) { + RealType t = -log2(ldexp(p, 32)); + + // Rational Approximation + // Maximum Relative Error: 9.8799e-36 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.41443550638291131009585191506467028820e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.27887396494095561461365753577189254063e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.12752633002089885479040650194288302309e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.79073355729340068320968150408320521772e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.92104558368762745368896313096467732214e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.31521786147036353766882145733055166296e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.69209485282228501578601478546441260206e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.17440286764020598209076590905417295956e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.24323354132100896221825450145208350291e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.53395893728239001663242998169841168859e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.68737623513761169307963299679882178852e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.34293243065056704017609034428511365032e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.16077944943653158589001897848048630079e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.62195354664281744711336666974567406606e-26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.34400562353945663460416286570988365992e-30), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.87838171063584994806998206766890809367e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.55395225505766120991458653457272783334e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.45282436421694718640472363162421055686e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.29570159526914149727970023744213510609e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.75502365627517415214497786524319814617e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.74140267916464056408693097635546173776e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.53554952415602030474322188152855226456e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.25818606585833092910042975933757268581e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.79945579370700383986587672831350689541e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.64188969985517050219881299229805701044e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.59811800080967790439078895802795103852e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.28225402720788909349967839966304553864e-24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.22313199865592821923485268860178384308e-28), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -128) { + RealType t = -log2(ldexp(p, 64)); + + // Rational Approximation + // Maximum Relative Error: 1.1548e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.23500806363233607692361021471929016922e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.16747938711332885952564885548768072606e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.58252672740225210061031286151136185818e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.15477223656783400505701577048140375949e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.51130817987857130928725357067032472382e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.68955185187558206711296837951129048907e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.30418343536824247801373327173028702308e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.96029044368524575193330776540736319950e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.53259926294848786440686413056632823519e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.09476918795964320022985872737468492126e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.20864569882477440934325776445799604204e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.01321468510611172635388570487951907905e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.45079221107904118975166347269173516170e-26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.36559452694774774399884349254686988041e-30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.92396730553947142987611521115040472261e-35), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.36599681872296382199486815169747516110e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.86330544720458446620644055149504593514e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.23793435123936109978741252388806998743e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41867848381419339587560909646887411175e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.46493580168298395584601073832432583371e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.03537470107933172406224278121518518287e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.00375884189083338846655326801486182158e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.62515041281615938158455493618149216047e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.42337949780187570810208014464208536484e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.40196890950995648233637422892711654146e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.11894256193449973803773962108906527772e-24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00900961462911160554915139090711911885e-27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.65825716532665817972751320034032284421e-32), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -256) { + RealType t = -log2(ldexp(p, 128)); + + // Rational Approximation + // Maximum Relative Error: 1.3756e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.04845570631944023525776899386112795330e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.18146685146173151383718092529868406030e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.13255476532916847606354932879190731233e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.44228173780288838603949849889291143631e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.18663599891768480607165516401619315227e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.61193813386433438633008774630150180359e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.54402603714659392010463991032389692959e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.76816632514967325885563032378775486543e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.22774672528068516513970610441705738842e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.47312348271366325243169398780745416279e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.10984325972747808970318612951079014854e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.81620524028936785168005732104270722618e-26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.03443227423068771484783389914203726108e-29), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.02313300749670214384591200940841254958e-34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.40321396496046206171642334628524367374e-39), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.67292043485384876322219919215413286868e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.61652550158809553935603664087740554258e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14722810796821047167211543031044501921e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.78954660078305461714050086730116257387e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.52794892087101750452585357544956835504e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59652255206657812422503741672829368618e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.84914442937017449248597857220675602148e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.23662183613814475007146598734598810102e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.55388618781592901470236982277678753407e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.20418178834057564300014964843066904024e-24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.48606639104883413456676877330419513129e-27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.39845313960416564778273486179935754019e-31), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14538443937605324316706211070799970095e-35), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -512) { + RealType t = -log2(ldexp(p, 256)); + + // Rational Approximation + // Maximum Relative Error: 1.6639e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.32865827226175697711590794217590458484e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.27551166309670994513910580518431041518e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.57161482253140058637495100797888501265e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.26908727392152312216118985392395130974e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.31391169101865809627389212651592902649e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.58926174475498352884244229017384309804e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.97074898765380614681225071978849430802e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.59852103341093122669197704225736036199e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.97287954178083606552531325613580819555e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.57634773176875526612407357244997035312e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.34467233210713881817055138794482883359e-25), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.91236170873875898506577053309622472122e-29), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.12220990075567880730037575497818287435e-33), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.20881889651487527801970182542596258873e-37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.56848486878078288956741060120464349537e-43), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.33267370502089423930888060969568705647e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.39632352029900752622967578086289898150e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.42703739831525305516280300008439396218e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.45767617531685380458878368024246654652e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.40344962756110545138002101382437142038e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.47015258371290492450093115369080460499e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.97280918936580227687603348219414768787e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.40441024286579579491205384492088325576e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.26130000914236204012152918399995098882e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.03893990417552709151955156348527062863e-27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.12687002255767114781771099969545907763e-31), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.74218645918961186861014420578277888513e-35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36897549168687040570349702061165281706e-39), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -1024) { + RealType t = -log2(ldexp(p, 512)); + + // Rational Approximation + // Maximum Relative Error: 2.0360e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.67937186583822375017526293948703697225e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.06681764321003187068904973985967908140e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.12508887240195683379004033347903251977e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.56847823157999127998977939588643284176e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.31281869105767454049413701029676766275e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.01498951390503036399081209706853095793e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.72866867304007090391517734634589972858e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.44819806993104486828983054294866921869e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.91441365806306460165885645136864045231e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.71364347097027340365042558634044496149e-25), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.63601648491144929836375956218857970640e-28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.76948956673676441236280803645598939735e-32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.47367651137203634311843318915161504046e-37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.83187517541957887917067558455828915184e-41), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.21480186561579326423946788448005430367e-47), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16494591376838053609854716130343599036e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.97651667629616309497454026431358820357e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.77741398674456235952879526959641925087e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.39478109667902532743651043316724748827e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.35965905056304225411108295866332882930e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.83206524996481183422082802793852630990e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30320324476590103123012385840054658401e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.30322948189714718819437477682869360798e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.43729790298535728717477691270336818161e-26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.89788697114251966298674871919685298106e-30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.43510901856942238937717065880365530871e-34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.38232043389918216652459244727737381677e-38), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.64599465785019268214108345671361994702e-43), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -2048) { + RealType t = -log2(ldexp(p, 1024)); + + // Rational Approximation + // Maximum Relative Error: 2.5130e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.11959316095291435774375635827672517008e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.30292575371366023255165927527306483022e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.54260157439166096303943109715675142318e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.61232819199170639867079290977704351939e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.74481972848503486840161528924694379655e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.98283577906243441829434029827766571263e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.90691715740583828769850056130458574520e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.31354728925505346732804698899977180508e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.42545288372836698650371589645832759416e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.12901629676328680681102537492164204387e-27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.99690040253176100731314099573187027309e-31), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.07899506956133955785140496937520311210e-35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.88607240095256436460507438213387199067e-40), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.78815984551154095621830792130401294111e-45), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.20516030880916148179297554212609531432e-51), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.81973541224235020744673910266545976833e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49156990107280109344880219729275939242e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.21606730563542176411852745162267260946e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.11449329529433741944366607648360521674e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.35659138507940819452801802756409587220e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.95708516718550485872934856595725983907e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.78871290972777009292563576533612002908e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.60955318960542258732596447917271198307e-25), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.72437581728117963125690670426402194936e-29), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.77473938855958487119889840032590783232e-33), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.66198494713809467076392278745811981500e-37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.34142897042941614778352280692901008538e-42), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.98791658647635156162347063765388728959e-47), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -4096) { + RealType t = -log2(ldexp(p, 2048)); + + // Rational Approximation + // Maximum Relative Error: 3.1220e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.67307564006689676593687414536012112755e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.21005690250741024744367516466433711478e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.11537345869365655126739041291119096558e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.82910297156061391001507891422501792453e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.51574933516708249049824513935386420692e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.56433757960363802088718489136097249753e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.74248235865301086829849817739500215149e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.19151506367084295119369434315371762091e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.98518959000360170320183116510466814569e-26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.21330422702314763225472001861559380186e-30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.44346922987964428874014866468161821471e-34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.59773305152191273570416120169527607421e-39), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.81894412321532723356954669501665983316e-44), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.25766346856943928908756472385992861288e-49), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.44601448994095786447982489957909713982e-55), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.90814053669730896497462224007523900520e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.72450689508305973756255440356759005330e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.76517273086984384225845151573287252506e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.31844251885317815627707511621078762352e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.22689324865113257769413663010725436393e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.27524826460469866934006001123700331335e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.39172850948322201614266822896191911031e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.40343613937272428197414545004329993769e-27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.17936773028976355507339458927541970545e-32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.66512598049860260933817550698863263184e-36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.06432209670481882442649684139775366719e-41), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.10247886333916820534393624270217678968e-46), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.40899321122058714028548211810431871877e-51), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -8192) { + RealType t = -log2(ldexp(p, 4096)); + + // Rational Approximation + // Maximum Relative Error: 3.8974e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.36960987939726803544369406181770745475e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.17239311695985070524235502979761682692e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.51192208811996535244435318068035492922e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.38938553034896173195617671475670860841e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.55156910900732478717648524688116855303e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.14905040433940475292279950923000597280e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.35237464492052939771487320880614968639e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.07937000518607459141766382199896010484e-24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.42797358100745086706362563988598447929e-28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.27871637324128856529004325499921407260e-32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.99553669724530906250814559570819049401e-37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.04272644552406682186928100080598582627e-42), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.70093315570856725077212325128817808000e-47), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.51767319872105260145583037426067406953e-53), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.87159268409640967747617639113346310759e-59), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.45350026842128595165328480395513258721e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.30398532102631290226106936127181928207e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.45242264812189519858570105609209495630e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.22745462510042159972414219082495434039e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.31834645038348794443252730265421155969e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.44590392528760847619123404904356730177e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.08436623062305193311891193246627599030e-25), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.46542554766048266351202730449796918707e-30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.78672067064478133389628198943161640913e-34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.56573050761582685018467077197376031818e-39), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.92145137276530136848088270840255715047e-44), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96933863894082533505471662180541379922e-49), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.92661972206232945959915223259585457082e-55), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -16384) { + RealType t = -log2(ldexp(p, 8192)); + + // Rational Approximation + // Maximum Relative Error: 4.8819e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.24662793339079714510108682543625432532e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.25841960642102016210295419419373971750e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.10589156998251704634852108689102850747e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.18697614924486382142056819421294206504e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.79445222262445726654186491785652765635e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.41847338407338901513049755299049551186e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.44550500540299259432401029904726959214e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.97463434518480676079167684683604645092e-26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.68404349202062958045327516688040625516e-30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.14018837476359778654965300153810397742e-35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.67726222606571327724434861967972555751e-40), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.48082398191886705229604237754446294033e-45), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.28534456209055262678153908192583037946e-51), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.99466700145428173772768099494881455874e-57), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.43473066278196981345209422626769148425e-63), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.26570199429958856038191879713341034013e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.32484776300757286079244074394356908390e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.31234182027812869096733088981702059020e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.13711443044675425837293030288097468867e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.11480036828082409994688474687120865023e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.25592803132287127389756949487347562847e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.45726006695535760451195102271978072855e-28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.13082170504731110487003517418453709982e-32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.48217827031663836930337143509338210426e-37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.47389053144555736191304002865419453269e-42), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.90980968229123572201281013063229644814e-47), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.79448544326289688123648457587797649323e-53), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.56179793347045575604935927245529360950e-59), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + result = -std::numeric_limits::infinity(); + } + + return result; +} + +template +inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (p >= 0.25) { + RealType t = p - 0.25; + + // Rational Approximation + // Maximum Absolute Error: 1.8559e-18 + static const RealType P[8] = { + static_cast(4.81512108276093785320e-1), + static_cast(-2.74296316128959647914e0), + static_cast(-3.29973875964825685757e1), + static_cast(-4.87536980816224603581e1), + static_cast(8.22233203036734027999e1), + static_cast(1.21654607908452130093e2), + static_cast(-6.66681853240657307279e1), + static_cast(-4.28101952511581488588e1), + }; + static const RealType Q[10] = { + static_cast(1), + static_cast(8.20189490825315245036e0), + static_cast(1.63469912146101848441e1), + static_cast(-1.52740920318273920072e1), + static_cast(-5.41684560257839409762e1), + static_cast(6.51733677169299416471e0), + static_cast(3.93092001388102589237e1), + static_cast(-9.59983666140749481195e-1), + static_cast(-9.95648827557655863699e-1), + static_cast(-1.32007124426778083829e0), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (p >= 0.125) { + RealType t = p - 0.125; + + // Rational Approximation + // Maximum Absolute Error: 4.6019e-17 + static const RealType P[7] = { + static_cast(1.70276979914029733585e0), + static_cast(2.09991992116646276165e1), + static_cast(2.26775403775298867998e1), + static_cast(-4.85384304722129472833e2), + static_cast(-1.47107146466495573999e3), + static_cast(-7.08748473959943943929e1), + static_cast(1.54245210917147215257e3), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(2.13092357122115486375e1), + static_cast(1.57318281834689144053e2), + static_cast(4.42261730187813035957e2), + static_cast(2.10814431586717588454e2), + static_cast(-6.36700983439599552504e2), + static_cast(-2.82923881266630617596e2), + static_cast(1.36613971025062750340e2), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -4) { + RealType t = -log2(ldexp(p, 3)); + + // Rational Approximation + // Maximum Relative Error: 1.2193e-19 + static const RealType P[8] = { + static_cast(4.25692449785074345588e-1), + static_cast(3.10963501706596356267e-1), + static_cast(2.91357806215297069863e-2), + static_cast(2.34716342676849303244e-2), + static_cast(5.83137296293361915583e-3), + static_cast(3.71792415497884868748e-4), + static_cast(1.59538372221030642757e-4), + static_cast(4.74040834029330213692e-6), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(4.14801234415100707213e-1), + static_cast(1.04693730144480856638e-1), + static_cast(3.81581484862997435076e-2), + static_cast(8.95334009127358617362e-3), + static_cast(1.43316686981760147226e-3), + static_cast(1.81367766024620080990e-4), + static_cast(1.54779999748286671973e-5), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -8) { + RealType t = -log2(ldexp(p, 4)); + + // Rational Approximation + // Maximum Relative Error: 4.4418e-17 + static const RealType P[11] = { + static_cast(5.07341098045260541890e-1), + static_cast(3.11771145411143166935e-1), + static_cast(1.74515601081894060888e-1), + static_cast(8.46576990174024231338e-2), + static_cast(2.57510090204322149315e-2), + static_cast(8.26605326867021684811e-3), + static_cast(1.73081423934722046819e-3), + static_cast(3.36314161099011673569e-4), + static_cast(4.50990441180388912803e-5), + static_cast(4.53513191985642134268e-6), + static_cast(2.62304611053075404923e-7), + }; + static const RealType Q[11] = { + static_cast(1), + static_cast(5.28225379952156944029e-1), + static_cast(3.49662079845715371907e-1), + static_cast(1.45408903426879603625e-1), + static_cast(5.06773501409016231879e-2), + static_cast(1.45385556714043243731e-2), + static_cast(3.31235831325018043744e-3), + static_cast(6.06977554525543056050e-4), + static_cast(8.42406730405209749492e-5), + static_cast(8.32337989541696717905e-6), + static_cast(4.84923196546857128337e-7), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -16) { + RealType t = -log2(ldexp(p, 8)); + + // Rational Approximation + // Maximum Relative Error: 5.7932e-17 + static const RealType P[10] = { + static_cast(5.41774626094491510395e-1), + static_cast(4.11060141334529017898e-1), + static_cast(1.48195601801946264526e-1), + static_cast(3.33881552814492855873e-2), + static_cast(5.20893974732203890418e-3), + static_cast(5.84734765774178832854e-4), + static_cast(4.71028150898133935445e-5), + static_cast(2.59185739450631464618e-6), + static_cast(7.77428184258777394627e-8), + static_cast(2.51255632629650930196e-14), + }; + static const RealType Q[9] = { + static_cast(1), + static_cast(7.58341767924960527280e-1), + static_cast(2.73511775500642961539e-1), + static_cast(6.16011987856129890130e-2), + static_cast(9.61296002312356116021e-3), + static_cast(1.07890675777726076554e-3), + static_cast(8.69223632953458271977e-5), + static_cast(4.78248875031756169279e-6), + static_cast(1.43460852065144859304e-7), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -32) { + RealType t = -log2(ldexp(p, 16)); + + // Rational Approximation + // Maximum Relative Error: 9.0396e-17 + static const RealType P[9] = { + static_cast(5.41926067826974905066e-1), + static_cast(4.86926556246548518715e-1), + static_cast(2.11963908288176005856e-1), + static_cast(5.92200639925655576883e-2), + static_cast(1.18859816815542567438e-2), + static_cast(1.76833662992855443754e-3), + static_cast(2.21226152157950219596e-4), + static_cast(1.50444847316426133872e-5), + static_cast(1.87458213915373906356e-6), + }; + static const RealType Q[9] = { + static_cast(1), + static_cast(8.98511036742503939380e-1), + static_cast(3.91130673008184655152e-1), + static_cast(1.09277016228474605069e-1), + static_cast(2.19328471889880028208e-2), + static_cast(3.26305879571349016107e-3), + static_cast(4.08222014684743492069e-4), + static_cast(2.77611385768697969181e-5), + static_cast(3.45911046256304795257e-6), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else { + RealType p_square = p * p; + + if (isnormal(p_square)) { + result = 1 / cbrt(p_square * constants::two_pi()); + } + else if (p > 0) { + result = 1 / (cbrt(p) * cbrt(p) * cbrt(constants::two_pi())); + } + else { + result = std::numeric_limits::infinity(); + } + } + + return result; +} + + +template +inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (p >= 0.375) { + RealType t = p - 0.375; + + // Rational Approximation + // Maximum Absolute Error: 4.0835e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.00474815142578902619056852805926666121e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.56422290947427848191079775267512708223e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.70103710180837859003070678080056933649e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.08521918131449191445864593768320217287e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29340655781369686013042530147130581054e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.24198237124638368989049118891909723118e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.43382878809828906953609389440800537385e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.45564809127564867825118566276365267035e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.75881247317499884393790698530115428373e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.55845932095942777602241134226597158364e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.41328261385867825781522154621962338450e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06758225510372847658316203115073730186e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.10895417312529385966062255102265009972e0), + }; + static const RealType Q[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.88252553879196710256650370298744093367e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.54875259600848880869571364891152935969e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.78589587338618424770295921221996471887e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.15356831947775532414727361010652423453e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.12951532118504570745988981200579372124e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.48163841544376327168780999614703092433e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.56786609618056303930232548304847911521e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.25610739352108840474197350343978451729e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.27063786175330237448255839666252978603e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.11941093895004369510720986032269722254e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.51487618026728514833542002963603231101e1), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (p >= 0.25) { + RealType t = p - 0.25; + + // Rational Approximation + // Maximum Absolute Error: 5.7633e-36 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.81512108276093787175849069715334402323e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.24417080443497141096829831516758083481e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.67006165991083501886186268944009973084e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.74402382755828993223083868408545308340e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.49182541725192134610277727922493871787e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.67273564707254788337557775618297381267e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.73476432616329813096120568871900178919e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.31235376166262024838125198332476698090e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.59379285677781413393733801325840617522e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.38151434050794836595564739176884302539e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.33534676810383673962443893459127818078e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.38110822236764293910895765875742805411e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.42750073722992463087082849671338957023e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.54255748148299874514839812717054396793e2), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.64823387375875361292425741663822893626e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.02973633484731117050245517938177308809e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.71288209768693917630236009171518272534e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.23837527610546426062625864735895938014e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.05056816585729983223036277071927165555e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.48087477651935811184913947280572029967e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04631058325147527913398256133791276127e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.69813394441679590721342220435891453447e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.92323371456465893290687995174952942311e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.68542430563281320943284015587559056621e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.17969051793607842221356465819951568080e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.82773308760283383020168853159163391394e2), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (p >= 0.125) { + RealType t = p - 0.125; + + // Rational Approximation + // Maximum Absolute Error: 2.1140e-36 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70276979914029738186601698003670175907e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.63126762626382548478172664328434577553e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04190225271045202674546813475341133174e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.93523974140998850492859698545966806498e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19814006186501010136822066747124777014e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.55931423620290859807616748030589502039e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.78874021192395317496507459296221703565e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.03860533237347587977439662522389465152e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.77882648875352690605815508748162607271e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.05498612167816258406694194925933958145e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05326361485692298778330190198630232666e7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.85827791876754731187453265804790139032e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.93719378006868242377955041137674308589e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.56839957539576784391036362196229047625e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.95604329277359828898502487252547842378e6), + }; + static const RealType Q[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.79208640567193066236912382037923299779e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.94775812217734059201656828286490832145e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16467934643564936346029555887148320030e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.35525720248600096849901920839060920346e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.69760913594243328874861534307039589127e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.32330501005950982838953061458838040612e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.79610639577090112327353399739315606205e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.43314292923292828425630915931385776182e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.97538885038058371436244702169375622661e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.48431896958634429210349441846613832681e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.93459449030820736960297236799012798749e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.67200014823529787381847745962773726408e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.37035571075060153491151970623824940994e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.22682822001329636071591164177026394518e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.09781406768816062486819491582960840983e4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (ilogb(p) >= -4) { + RealType t = -log2(ldexp(p, 3)); + + // Rational Approximation + // Maximum Relative Error: 1.1409e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.25692449785074345466504245009175450649e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.75679137667345136118441108839649360362e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06171803174020856964914440692439080669e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.87798066278592051163038122952593080648e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.20070543183347459409303407166630392077e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.13457391270614708627745403376469848816e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06743974464224003715510181633693539914e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16870984737226212814217822779976770316e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21845093091651861426944931268861694026e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.85357146081877929591916782097540632519e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.19085800299127898508052519062782284785e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41985644250494046067095909812634573318e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30857042700765443668305406695750760693e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.10466412567107519640190849286913680449e-10), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.31914248618040435028023418981527961171e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.73578090645412656850163531828709850171e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.57329813782272411333511950903192234311e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.62736127875896578315177123764520823372e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.76809643836078823237530990091078867553e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32026948719622983920194944841520771986e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.45051018027743807545734050620973716634e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.58281707210621813556068724127478674938e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.63884527227517358294732620995363921547e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15973602356223075515067915930205826229e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.35069439950884795002182517078104942615e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15454119109586223908613596754794988609e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.55273685376557721039847456564342945576e-10), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -8) { + RealType t = -log2(ldexp(p, 4)); + + // Rational Approximation + // Maximum Relative Error: 1.2521e-35 + static const RealType P[23] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.07341098045260497471001948654506267614e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16518383383878659278973043343250842753e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.10029094208424121908983949243560936013e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.04771840726172284780129819470963100749e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.34173170868011689830672637082451998700e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.41990262178664512140746911398264330173e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.06779488545758366708787010705581103705e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.41892665233583725631482443019441608726e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.20692306716979208762785454648538891867e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.11097906809673639231336894729060830995e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.37476591232600886363441107536706973169e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.02659053066396720145189153810309784416e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.02209877191642023279303996697953314344e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.56663781532392665205516573323950583901e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.95655734237060800145227277584749429063e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.06357695252098035545383649954315685077e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.78759045059235560356343893064681290047e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.95881339136963512103591745337914059651e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.70156441275519927563064848389865812060e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.99745225746277063516394774908346367811e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.45718440382347867317547921045052714102e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.39027665085346558512961348663034579801e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05739751797738770096482688062542436470e-15), + }; + static const RealType Q[23] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43370372582239919321785765900615222895e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.52872159582703775260145036441128318159e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.28243735290178057451806192890274584778e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.93375398009812888642212045868197435998e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.73364866677217419593129631900708646445e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.53645928499107852437053167521160449434e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.74280939589407863107682593092148442428e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.80095449855178765594835180574448729793e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.65924845456946706158946250220103271334e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52170861715436344002253767944763106994e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.87246437551620484806338690322735878649e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.88631873230311653853089809596759382095e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.84478812152918182782333415475103623486e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.47998768403859674841488325856607782853e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.82364683269852480160620586102339743788e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.65854316058742127585142691993199177898e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11358340340462071552670838135645042498e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.22818744671190957896035448856159685984e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11038729491846772238262374112315536796e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.21355801166652957655438257794658921155e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.41278271853370874105923461404291742454e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.95100373579692323015092323646110838623e-15), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -16) { + RealType t = -log2(ldexp(p, 8)); + + // Rational Approximation + // Maximum Relative Error: 2.0703e-35 + static const RealType P[21] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.41774626094491452462664949805613444094e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.96383089261273022706449773421031102175e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.16315295073029174376617863024082371446e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.65377894193914426949840018839915119410e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33210993830236821503160637845009556016e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.69315463529653886947182738378630780083e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.09869947341518160436616160018702590834e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.44331691052908906654005398143769791881e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.13131413925652085071882765653750661678e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.64441840437413591336927030249538399459e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.78393581596372725434038621824715039765e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.50239319821178575427758224587858938204e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.92619647697287767235953207451871137149e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.26901081456833267780600560830367533351e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.12151768312254597726918329997945574766e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.36907507996686107513673694597817437197e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.31699373909892506279113260845246144240e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.11230682511893290562864133995544214588e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.44627067257461788044784631155226503036e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.39869585157420474301450400944478312794e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.82128612844034824876694595066123093042e-27), + }; + static const RealType Q[20] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.65414405277042133067228113526697909557e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32179221250476209346757936207079534440e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.74217392682100275524983756207618144313e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.45810448055940046896534973720645113799e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.81487408603233765436807980794697048675e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49442843848941402948883852684502731460e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.66330842256792791665907478718489013963e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.93285292223845804061941359223505045576e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.87966347754794288681626114849829710697e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.13711644429711675111080150193733607164e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.61758862007482013187806625777101452737e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.55435556106272558989915248980090731639e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.34166571320580242213843747025082914011e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.31411360099525131959755145015018410429e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.21684839228785650625270026640716752452e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.43021096301255274530428188746599779008e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.58831290247776456235908211620983180005e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74309280855806399632683315923592902203e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.58097100528573186098159133443927182780e-18), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -32) { + RealType t = -log2(ldexp(p, 16)); + + // Rational Approximation + // Maximum Relative Error: 3.4124e-35 + static const RealType P[19] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.41926067826974814669251179264786585885e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.21141529920003643675474888047093566280e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59964592861304582755436075901659426485e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.95135112971576806260593571877646426022e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.12322024725362032809787183337883163254e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.96758465518847580191799508363466893068e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.12389553946694902774213055563291192175e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04599236076217479033545023949602272721e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.16143771174487665823565565218797804931e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.38966874413947625866830582082846088427e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.02590325514935982607907975481732376204e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.44376747400143802055827426602151525955e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.82088624006657184426589019067893704020e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.95757210706845964048697237729100056232e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.36096213291559182424937062842308387702e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14362780521873256616533770657488533993e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.73571098395815275003552523759665474105e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47286214854389274681661944885238913581e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.73701196181204039400706651811524874455e-34), + }; + static const RealType Q[18] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.77119890916406072259446489508263892540e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.95177888809731859578167185583119074026e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.29131027214559081111011582466619105016e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.31442657037887347262737789825299661237e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.83928863984637222329515960387531101267e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.07389089078167127136964851949662391744e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.93013847797006474150589676891548600820e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.50600573851533884594030683413819219915e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.94539484213971921794449107859541806317e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.58360895032645281635534287874266252341e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.66414102108217999886628042310332365446e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07411076181287950822375436854492998754e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.61224937285582228022463072515935601355e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.89242339209389981530783624934733098598e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.11030225010379194015550512905872992373e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.20285566539355859922818448335043495666e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.71782855576364068752705740544460766362e-20), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -64) { + RealType t = -log2(ldexp(p, 32)); + + // Rational Approximation + // Maximum Relative Error: 2.1680e-35 + static const RealType P[18] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.41926070139289008206183757488364846894e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.78434820569480998586988738136492447574e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.07939171933509333571821660328723436210e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.92438439347811482522082798370060349739e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.24288918322433485413615362874371441367e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.04437759300344740815274986587186340509e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.74063952231188399929705762263485071234e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.07228849610363181194047955109059900544e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.93120850707001212714821992328252707694e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.40911049607879914351205073608184243057e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.71898232013947717725198847649536278438e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06963706982203753050300400912657068823e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.79849166632277658631839126599110199710e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.74682085785152276503345630444792840850e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.09650236336641219916377836114077389212e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.97326394822836529817663710792553753811e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.26635728806398747570910072594323836441e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.96470010392255781222480229189380065951e-18), + }; + static const RealType Q[18] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.82841492468725267177870050157374330523e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.83703946702662950408034486958999188355e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.09320896703777230915306208582393356690e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.29346630787642344947323515884281464979e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.77242894492599243245354774839232776944e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.05722029871614922850936250945431594997e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.66920224988248720006255827987385374411e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.40887155754772190509572243444386095560e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.44545968319921473942351968892623238920e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.17198676140022989760684932594389017027e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.97376935482567419865730773801543995320e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06997835790265899882151030367297786861e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.06862653266619706928282319356971834957e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.02334307903766790059473763725329176667e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.33174535634931487079630169746402085699e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70989324903345102377898775620363767855e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.47067260145014475572799216996976703615e-18), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else { + RealType p_square = p * p; + + if (isnormal(p_square)) { + result = 1 / cbrt(p_square * constants::two_pi()); + } + else if (p > 0) { + result = 1 / (cbrt(p) * cbrt(p) * cbrt(constants::two_pi())); + } + else { + result = std::numeric_limits::infinity(); + } + } + + return result; +} + +template +inline RealType mapairy_quantile_imp_prec(const RealType& p, bool complement, const std::integral_constant& tag) +{ + if (p > 0.5) { + return mapairy_quantile_imp_prec(1 - p, !complement, tag); + } + + return complement ? mapairy_quantile_upper_imp_prec(p, tag) : mapairy_quantile_lower_imp_prec(p, tag); +} + +template +inline RealType mapairy_quantile_imp_prec(const RealType& p, bool complement, const std::integral_constant& tag) +{ + if (p > 0.5) { + return mapairy_quantile_imp_prec(1 - p, !complement, tag); + } + + return complement ? mapairy_quantile_upper_imp_prec(p, tag) : mapairy_quantile_lower_imp_prec(p, tag); +} + +template +inline RealType mapairy_quantile_imp(const mapairy_distribution& dist, const RealType& p, bool complement) +{ + // This routine implements the quantile for the Map-Airy distribution, + // the value p may be the probability, or its complement if complement=true. + + static const char* function = "boost::math::quantile(mapairy<%1%>&, %1%)"; + BOOST_MATH_STD_USING // for ADL of std functions + + RealType result = 0; + RealType scale = dist.scale(); + RealType location = dist.location(); + + if (false == detail::check_location(function, location, &result, Policy())) + { + return result; + } + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + if (false == detail::check_probability(function, p, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + result = location + scale * mapairy_quantile_imp_prec(p, complement, tag_type()); + + return result; +} + +template +inline RealType mapairy_mode_imp_prec(const std::integral_constant& tag) +{ + return static_cast(-1.16158727113597068525); +} + +template +inline RealType mapairy_mode_imp_prec(const std::integral_constant& tag) +{ + return BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.1615872711359706852500000803029112987); +} + +template +inline RealType mapairy_mode_imp(const mapairy_distribution& dist) +{ + // This implements the mode for the Map-Airy distribution, + + static const char* function = "boost::math::mode(mapairy<%1%>&, %1%)"; + BOOST_MATH_STD_USING // for ADL of std functions + + RealType result = 0; + RealType scale = dist.scale(); + RealType location = dist.location(); + + if (false == detail::check_location(function, location, &result, Policy())) + { + return result; + } + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + result = location + scale * mapairy_mode_imp_prec(tag_type()); + + return result; +} + +template +inline RealType mapairy_median_imp_prec(const std::integral_constant& tag) +{ + return static_cast(-0.71671068545502205332); +} + +template +inline RealType mapairy_median_imp_prec(const std::integral_constant& tag) +{ + return BOOST_MATH_BIG_CONSTANT(RealType, 113, -0.71671068545502205331700196278067230944440); +} + +template +inline RealType mapairy_median_imp(const mapairy_distribution& dist) +{ + // This implements the median for the Map-Airy distribution, + + static const char* function = "boost::math::median(mapairy<%1%>&, %1%)"; + BOOST_MATH_STD_USING // for ADL of std functions + + RealType result = 0; + RealType scale = dist.scale(); + RealType location = dist.location(); + + if (false == detail::check_location(function, location, &result, Policy())) + { + return result; + } + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + result = location + scale * mapairy_median_imp_prec(tag_type()); + + return result; +} + +template +inline RealType mapairy_entropy_imp_prec(const std::integral_constant& tag) +{ + return static_cast(2.00727681841065634600); +} + +template +inline RealType mapairy_entropy_imp_prec(const std::integral_constant& tag) +{ + return BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.0072768184106563460003025875575283708); +} + +template +inline RealType mapairy_entropy_imp(const mapairy_distribution& dist) +{ + // This implements the entropy for the Map-Airy distribution, + + static const char* function = "boost::math::entropy(mapairy<%1%>&, %1%)"; + BOOST_MATH_STD_USING // for ADL of std functions + + RealType result = 0; + RealType scale = dist.scale(); + + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + result = mapairy_entropy_imp_prec(tag_type()) + log(scale); + + return result; +} + +} // detail + +template > +class mapairy_distribution +{ + public: + typedef RealType value_type; + typedef Policy policy_type; + + mapairy_distribution(RealType l_location = 0, RealType l_scale = 1) + : mu(l_location), c(l_scale) + { + static const char* function = "boost::math::mapairy_distribution<%1%>::mapairy_distribution"; + RealType result = 0; + detail::check_location(function, l_location, &result, Policy()); + detail::check_scale(function, l_scale, &result, Policy()); + } // mapairy_distribution + + RealType location()const + { + return mu; + } + RealType scale()const + { + return c; + } + + private: + RealType mu; // The location parameter. + RealType c; // The scale parameter. +}; + +typedef mapairy_distribution mapairy; + +#ifdef __cpp_deduction_guides +template +mapairy_distribution(RealType) -> mapairy_distribution::type>; +template +mapairy_distribution(RealType, RealType) -> mapairy_distribution::type>; +#endif + +template +inline const std::pair range(const mapairy_distribution&) +{ // Range of permissible values for random variable x. + if (std::numeric_limits::has_infinity) + { + return std::pair(-std::numeric_limits::infinity(), std::numeric_limits::infinity()); // - to + infinity. + } + else + { // Can only use max_value. + using boost::math::tools::max_value; + return std::pair(-max_value(), max_value()); // - to + max. + } +} + +template +inline const std::pair support(const mapairy_distribution&) +{ // Range of supported values for random variable x. + // This is range where cdf rises from 0 to 1, and outside it, the pdf is zero. + if (std::numeric_limits::has_infinity) + { + return std::pair(-std::numeric_limits::infinity(), std::numeric_limits::infinity()); // - to + infinity. + } + else + { // Can only use max_value. + using boost::math::tools::max_value; + return std::pair(-tools::max_value(), max_value()); // - to + max. + } +} + +template +inline RealType pdf(const mapairy_distribution& dist, const RealType& x) +{ + return detail::mapairy_pdf_imp(dist, x); +} // pdf + +template +inline RealType cdf(const mapairy_distribution& dist, const RealType& x) +{ + return detail::mapairy_cdf_imp(dist, x, false); +} // cdf + +template +inline RealType quantile(const mapairy_distribution& dist, const RealType& p) +{ + return detail::mapairy_quantile_imp(dist, p, false); +} // quantile + +template +inline RealType cdf(const complemented2_type, RealType>& c) +{ + return detail::mapairy_cdf_imp(c.dist, c.param, true); +} // cdf complement + +template +inline RealType quantile(const complemented2_type, RealType>& c) +{ + return detail::mapairy_quantile_imp(c.dist, c.param, true); +} // quantile complement + +template +inline RealType mean(const mapairy_distribution &dist) +{ + return dist.location(); +} + +template +inline RealType variance(const mapairy_distribution& /*dist*/) +{ + return std::numeric_limits::infinity(); +} + +template +inline RealType mode(const mapairy_distribution& dist) +{ + return detail::mapairy_mode_imp(dist); +} + +template +inline RealType median(const mapairy_distribution& dist) +{ + return detail::mapairy_median_imp(dist); +} + +template +inline RealType skewness(const mapairy_distribution& /*dist*/) +{ + // There is no skewness: + typedef typename Policy::assert_undefined_type assert_type; + static_assert(assert_type::value == 0, "assert type is undefined"); + + return policies::raise_domain_error( + "boost::math::skewness(mapairy<%1%>&)", + "The Map-Airy distribution does not have a skewness: " + "the only possible return value is %1%.", + std::numeric_limits::quiet_NaN(), Policy()); // infinity? +} + +template +inline RealType kurtosis(const mapairy_distribution& /*dist*/) +{ + // There is no kurtosis: + typedef typename Policy::assert_undefined_type assert_type; + static_assert(assert_type::value == 0, "assert type is undefined"); + + return policies::raise_domain_error( + "boost::math::kurtosis(mapairy<%1%>&)", + "The Map-Airy distribution does not have a kurtosis: " + "the only possible return value is %1%.", + std::numeric_limits::quiet_NaN(), Policy()); +} + +template +inline RealType kurtosis_excess(const mapairy_distribution& /*dist*/) +{ + // There is no kurtosis excess: + typedef typename Policy::assert_undefined_type assert_type; + static_assert(assert_type::value == 0, "assert type is undefined"); + + return policies::raise_domain_error( + "boost::math::kurtosis_excess(mapairy<%1%>&)", + "The Map-Airy distribution does not have a kurtosis: " + "the only possible return value is %1%.", + std::numeric_limits::quiet_NaN(), Policy()); +} + +template +inline RealType entropy(const mapairy_distribution& dist) +{ + return detail::mapairy_entropy_imp(dist); +} + +}} // namespaces + + +#endif // BOOST_STATS_MAPAIRY_HPP diff --git a/test/test_mapairy.cpp b/test/test_mapairy.cpp new file mode 100644 index 0000000000..8f5b98d587 --- /dev/null +++ b/test/test_mapairy.cpp @@ -0,0 +1,822 @@ +// Copyright Takuma Yoshimura 2024. +// 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) + +#define BOOST_TEST_MODULE StatsMapAiryTest +#include +#include + +#include +using boost::math::mapairy_distribution; +using boost::multiprecision::cpp_bin_float_quad; + +template +void do_test_mapairy_pdf(){ + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + mapairy_distribution dist(static_cast(0), static_cast(1)); + + // Left tail of MapAiry distribution inherently limits accuracy due to the rapid decay of the function value. + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-52)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.48902525259161778456663373601227358266560067430936e-4524), tolerance * 10000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-48)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.35000261887613150163386664453709286782071190547944e-3558), tolerance * 1000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-44)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.59514743738055878289124765721120558977841779893312e-2741), tolerance * 1000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-40)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.23001358749520957481536587430803343649600724408224e-2059), tolerance * 1000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.91092696891623714443869745182216876382044809172723e-1501), tolerance * 1000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.07670398427978297595825050147335321586451776148320e-1054), tolerance * 1000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.75337241594382145623417946757631570270349308241803e-869), tolerance * 1000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.98271669611043473474221732621841457710581601420544e-707), tolerance * 1000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.16498740545788718692214006589654128484512724342869e-566), tolerance * 1000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.49681712247552092430360122510975673204884714780707e-445), tolerance * 1000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.55053727524864779623317373572781282350111182284876e-343), tolerance * 1000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.19590456107919919197512531538035620765530980528894e-258), tolerance * 1000); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.73694941159984922185033097915349420991674156548250e-188), tolerance * 100); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.81449463353684665334966063303815524281822160159818e-132), tolerance * 100); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.74974309038596237884318081144949974855326622002492e-109), tolerance * 100); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.29136035353058491211769990284207292488489027379633e-89), tolerance * 100); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.01585226509378718416615473646349537501789989363229e-71), tolerance * 100); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37033445628502141399361852883285362383866808742814e-56), tolerance * 100); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.34096664947790338152990789779350354526301978444227e-43), tolerance * 100); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.68877771535989487461767283800177475346958322976577e-33), tolerance * 100); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.82006696453724258217996541433935771573414304428384e-24), tolerance * 10); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.54482240843563125964619012431713490038548382437138e-17), tolerance * 10); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-7.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.95446089249867191439127373027848930673014745742088e-14), tolerance * 10); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-7)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.50933920988971071711086365057147867083089476835078e-12), tolerance * 10); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-6.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.93525639583557913222186453754518161964863338679333e-10), tolerance * 10); + + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-6)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.34369873917936310843493426518284206307542912325702e-8), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-5.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.77757355685380561185988935905104213909281485602180e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.67935873875498302175093073530783568485155988744416e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-4.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.63150314678587224494834533488274597847689803128076e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.66981984951457236403520646020207894651500649740558e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.04268591430185285447948956767040247962753669747157e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.09373105986325625209096934627967360395341037677581e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.80640911685196781581446750934825559197579090806069e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.30714423198107251239523977966407204142168461729995e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.58842018103237928265884912263898874481595562824878e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.34619157601942089113215976120224270739528013289579e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.75682912797714827638251175725141830254079472660215e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.14483832832989822788477500521594411868042501441052e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.31592413389237158115773602554741285666601187136132e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.46510720433737601145589738058516645303764778406120e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.58858272589879457467907897007761708777068403816847e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.68368758744508533942159519264649183356982627934537e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.74896964572402100481706929301679979523752439534115e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.78416838013401425639828509948809230256694219667844e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.79011912859672711819203848701778087056321687064703e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.76859868856746781256050397658493368372419755176282e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.74830251162716136956231178987638601629634664517919e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.72213275423897601118140737012980725371274046892426e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.69048759814952957802002736887143054018790117979041e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.65378566438926186069214998647211849395648980215839e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.61245973171416933849635378258875498386938909727468e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.56695079986621470612303095505427278554320952987612e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51770257100814033767420472605045312962380868746169e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.46515640532722451246144916562599607636382596292905e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.40974679016952551097229293394786875981693451661862e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.35189734654776422654774161240658760813142609084491e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.29201738275575132039254286232840244115188891902544e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.23049899232453590038819913858072064402640465533782e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.16771468279209758359211730425922824067563080471965e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.10401551277763824950435892543895916698505857289016e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.03972970763820126963564357339894388732551496850922e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.97516171847191855609649452292217911972760948598791e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.91059168530983397246791731314734572731339598377834e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.84627526286757244484016179988853282946752058004097e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.78244376604908808362842960720569088074360938826161e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.71930459233559687354598878881397561629142415087483e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.65704187907786028551352925788813828181432590627815e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.59581735536596915694662484173754591721771767208970e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.53577135041201613422320904399972678346505180911383e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.47702392309337834830220258805531647259773671641587e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41967608032785834866384133800904772318199442922830e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.36381105516273814949846883397888219175600292125024e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.30949561875080790965818583863955676147392613436720e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.25678140366749341891056123744605385205177726623077e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.20570621922063209990039201192595153753061823668443e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.15629534246005614282003528019134390685312636509026e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10856277146400733535248998121026984388464547942987e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.06251243013238748252181151646220197947016365256337e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.75430585815861237530788049942964394941727146945119e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94921730852144630624722291210866171228958719672719e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.20763203888240939750507494683136041919542710442553e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.52664687715163418854003417614711690443203995990429e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.90290701026305425949257079944431253582616228954748e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.33278922127799799766017618158404889945497518669482e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.81254742548053622180113078981721846479230408163441e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.33842514891989443409465171800884519330814876941244e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.51394330031190703409753192401513286012367671189008e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.83173172055121251708819783948372658040389943407125e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.26731989005960717430587605328985374107046652534330e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.79973178629260510506067822703511722927370913396772e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.41138621807489585364575132430814179891782893106309e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.08776953835588218788258294328943072921113243548837e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.81702027546943420543987006667270192025143215867522e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.58950538583133457383574346194006716984204842764692e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.23449076237421124835496017947109115185689559096654e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.76628876438498186161275834549825153942245265285021e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.85705896089536983465980519032147649251164182381151e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(6)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.41725094843861993121315653435763289609915116903808e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(6.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.31264184292047732621870128909412110588268320306673e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.45166594303360764259552410935368398129332569193241e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.77078907451534652348813394683088320326083698637357e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22517551525042172427941302520759668293351400085609e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.41981613066309674421788083490352250077859372362907e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.86815272152296425461960094149288322349331776254317e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.47672748088907799783338276475559452864086595323508e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.19065885055336418361425251181752339740309873019493e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.76274498770011155322885494753359606185503116800378e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.12117840379514058437502004817680010914158504614072e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.84060120900265238260840046704576012273231257957218e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.82527663232857270992129793621400616909426228224712e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.34356222389517260476288187086191333487351565998487e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.33976274743353308671561884595553840397953308913098e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.63275420187782102031440426363742618331512228841827e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.11866107787483058586064754989935066085956111714438e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73477843721978250663679288968512001020601996296490e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.44160680253022056601252575834792105383788377162879e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21335317476130403409545135558158224084771179668233e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.03264853379349880038687006045193401398742550912390e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.69348218890827802115199892879428047102258557679491e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(40)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.91237960791142062915636488977731277854393252956156e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(44)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.65910753386639565315739798326227665091960854776722e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(48)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.74840664437921635017204117045344765826413564522111e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(52)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.06868586281732253998273705361085730421392207516563e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(56)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.54975706173930172767473002839017573406030702226132e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(60)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.14583740785288043496760695039190976938266337954109e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(64)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.82612140613373038344483207825545571090342007879025e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(72)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.36036300551703042854867518460643847165588663407845e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(80)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.04535842750631349697889823754314492592824987833936e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(88)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.23732650061248767465314076860143478427557447053122e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(96)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.62699739226146233957434830649961751777393343487704e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(104)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.42516447612776691413186917108911633335528994759200e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(112)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.50767100225890854218096000852153526257706640350006e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(120)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.79354212598752921854694346382153053933709178870365e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(128)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22829848834607910587947957072698363475405049514861e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(256)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.70691063363569289518344600523741530561019748614806e-7), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(512)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.00884949274594535609095332297684714775260624951825e-7), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1024)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.78341094639115825398956813042728307580960455542744e-8), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2048)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.15265496830848341113806943808080759239756631409525e-9), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4096)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.57315927453204720744811655603371636021315489208197e-10), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8192)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.85204679078224624495444948682547526667095102524654e-11), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(16384)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.74161227361870459284450362091832192677055853279409e-11), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(32768)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.07876462219180661771716253718191722284989080940137e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(65536)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.44253835507444012610805302754717855328014016707006e-13), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(131072)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.62113944435292862305033337145279742309373660330666e-14), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(262144)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.70079323596084060715031479698836179832962876226040e-14), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(524288)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.00660607636030744539992938919621601865776189138704e-15), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1048576)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.31497886237763070924617652541844323609885629317601e-16), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2097152)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.39564398862596160919395415621974601387332621717152e-17), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4194304)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.66093089449300961525223017779109302708950139673730e-17), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8388608)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.93613874644561300698599726959494859627890174964948e-18), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(16777216)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.19040904529065504857204743126112225011195501281143e-19), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(33554432)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.17543358264254064703206600829360293655988827362640e-20), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(67108864)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.62200282665332970268320245960144424095679956397013e-20), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.34217728e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.86732299457579395219850121616992176031753071031156e-21), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.68435456e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.06875883329165532088522436776488158979648490753308e-22), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.36870912e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.96038435804935610062036418083267399916819002834560e-23), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.073741824e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.58398713540364228777663367294171284220596445493878e-23), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.147483648e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.80012011189042378144386404030074611545380892760386e-24), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.294967296e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.94995979813638214930198027960375045149298281432705e-25), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7179869184e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.54686243691761942165686883762842249372631955082800e-26), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(6.8719476736e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.83394511536756069267771511760113721074800848019252e-28), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.74877906944e11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.51060784855236271646178597425041551955920802058680e-29), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.099511627776e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.72064952672613348894308116953255143520457854922274e-31), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.398046511104e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.47520297710191671529471286547892233784021035466379e-32), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7592186044416e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.61000930344348973529597770462163230645079307893137e-34), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.0368744177664e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.44062790732609054227999303269426009576929146861433e-35), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.81474976710656e14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.50196221039403294462497822716956279927920276478346e-37), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.125899906842624e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40686319074813529519530569599048837477475167906008e-38), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.503599627370496e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.39644747108792279748533029997027617117109903686087e-40), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8014398509481984e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.37388983471497587421416571874071130349096844921335e-41), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.2057594037927936e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.29340573348429960691926787106472282340927640380120e-43), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.88230376151711744e17)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.34168929171384362716227120970772588231539887618792e-44), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.152921504606846976e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.19277903660576133488209753033664338223562148808726e-46), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.611686018427387904e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.31024344893930041715065547823020105694863171502727e-47), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8446744073709551616e19)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.09451077793531380359579836946937830296447410946021e-49), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.95147905179352825856e20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.99854568157745488632402184518493974898874424751974e-52), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.722366482869645213696e21)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.90482976716548328742580258318841772362182055421850e-55), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.5557863725914323419136e22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.81331031949754227287676033514493918322443413497900e-58), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.208925819614629174706176e24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.72393585888431862585621126478997967111761145994043e-61), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.9342813113834066795298816e25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.63665611219171740806270631327146452257579244134808e-64), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.09485009821345068724781056e26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.55142198456222403131123663405416457282792230600398e-67), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.951760157141521099596496896e27)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.46818553179904690557737952544352009065226787695701e-70), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.9228162514264337593543950336e28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.38689993339750674372790969281593758852760534859083e-73), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.267650600228229401496703205376e30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.30751946620850267942178680939056405129648959823324e-76), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.0282409603651670423947251286016e31)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22999947871924089787283868104547270634422812327464e-79), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.24518553658426726783156020576256e32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.15429636593675868932894402445846943978928527663539e-82), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.192296858534827628530496329220096e33)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.08036754486011590754779689888522406229422390296425e-85), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8.3076749736557242056487941267521536e34)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.00817143052745694096464540906760162333420303023853e-88), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.329227995784915872903807060280344576e36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.93766741262446966891078653229257971028730764671731e-91), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.1267647932558653966460912964485513216e37)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.86881583264108366104568997294197237332744887374738e-94), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.40282366920938463463374607431768211456e38)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.80157796156355826273993161420114489582758679076892e-97), tolerance); +} + +template +void do_test_mapairy_cdf() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + mapairy_distribution dist(static_cast(0), static_cast(1)); + + // Left tail of MapAiry distribution inherently limits accuracy due to the rapid decay of the function value. + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-52)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41267677661910675305382637108866964194971791718950e-4526), tolerance * 10000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-48)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.54257458395442655204313046627840914088415076161558e-3561), tolerance * 1000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-44)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.76526114681351440657658256501506814774341295354922e-2743), tolerance * 1000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-40)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.27125192542763584917976723724200097302881304411026e-2062), tolerance * 1000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.63420353908123838151105660636393196705034472693701e-1504), tolerance * 1000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.73063520387773809387189485017024200015891995562535e-1057), tolerance * 1000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.87621737485296751690587747650586494006422187478425e-871), tolerance * 1000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.15431208733487028595846723973676765010037279135068e-709), tolerance * 1000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.43691228284359420616981379531226120901046405612148e-568), tolerance * 1000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.94968725712637201733674598027292284194096042437396e-447), tolerance * 1000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.29903053626343464859342616262182157628847143496274e-345), tolerance * 1000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.84047255379287327139957588241933355294847277196332e-260), tolerance * 1000); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.79693358121995588307456046556605766916709047503732e-190), tolerance * 100); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.18430997009344263598977403572421080974427275299628e-134), tolerance * 100); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.48855014561480471542019201883561279219078606560987e-111), tolerance * 100); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21188569601559235190706821985880880180873775432009e-90), tolerance * 100); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.35130675597097791570481439579882762106711974084282e-73), tolerance * 100); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.37868088180310978639226395953519655144561270921646e-58), tolerance * 100); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.96213643222050268066173675729245650285594216946076e-45), tolerance * 100); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.54299664164424690506837069440249011982208536500223e-34), tolerance * 100); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.55256887328573175640232009727759270424877561672436e-25), tolerance * 10); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.76658378173553845515260323095527685644595481193099e-18), tolerance * 10); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-7.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.53962634794926085939153812168733146892427038438756e-15), tolerance * 10); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-7)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.86644224834640735242565183060109673582728544145215e-13), tolerance * 10); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-6.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.03383983622833649608546095853620837892086215933298e-10), tolerance * 10); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-6)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.91537779419133030075704775849634109699414218730481e-9), tolerance * 10); + + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-5.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.98085764775551392183308859729746156105641469279537e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.74005376900861403666100209810033834996576655180465e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-4.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38210242545410097936371084112947842536958832190953e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.20388922732913226923590659641162717163243937441333e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.01190141003747964176020229987886598385662366685178e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.81314867410709227363443913418400543623685087660036e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40335466769957406990026955582239481134043242080576e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.65057217408705944017729221733489193253150025104939e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.62249422314997336809404422537950480283670862386341e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.49463093988108215731880519187728405325669137953076e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.13731490830425435301322069056843269169838775278008e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.62598955251978523174755901843430986522046460911826e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90499210557846036762061906872202100639194335579553e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.20405659651083834253744598353980626247223640040816e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.52019615753011340929652761968369152398962550184606e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.85001847038770817549042011993996310385733185736928e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.18987376977895959785022298515900161162070947963445e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.53600587820316569763364664186012515534206385253539e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.88469588484092929432583134493879046529813482615104e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.23238998449671083670041452413316011919930693856385e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.40482473418234444080637631800355214131813723348029e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.57580541347059341976751497432836530189703719631253e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.74497724348320019407539810613151808302214091800752e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.91201100390145330029548239186193815674350921221373e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.07660411254690680532566892253363954450731338298810e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.23848132271235424597841060643701240046967758423031e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.39739506217816326324441201522899717272689507530078e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.55312544188864070398568309403385234827691551635647e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.70547996523808722092270387778468756135745550977842e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.85429297088468989836573146625524898390641430572229e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.99942484305170440309173928292359597658678248461166e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.14076102348433999265595009037280955266566735857487e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.27821085871238004955876961091597273535850920355153e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.41170631513311055182782737833523982566081113132113e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.54120059278782917662600347641177702821526512639253e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.66666666666666666666666666666666666666666666666667e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.78809578204369927830516637473281842472755486735670e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.90549592781258492544813432997757039278246435622280e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.01889030914802776673544656107973638254340107333208e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.12831583813566709661955692651725308671816974125125e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.23382165835700226601867127791408227947098667962247e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.33546771684027578538449554398877013955180783305967e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.43332339433579641844979454704458465657719551526672e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.52746620257793576893322261719616438461321552900402e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.61798055507971738758762860873629690865112979477773e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.70495661608502783177600997939957544744070827966369e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.78848923058628458126731690124829998626066330325893e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.86867693680400430433267457602884639416039914905443e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.94562106121611865967124973894234486976489176337189e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.01942489511196041360944230423166502583801465481058e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.09019295071828335416784977458008517243666113680032e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.15803029418984060112492565010063896412665755747313e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.28533238809939722865056318522346970220432633092471e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.40216194581500702945839843944471675879234503695234e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.50932751104023843947651194694738668613497033313653e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.60760530927220029947644215642926175488027901722942e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.69773224168421631436187338078646751800825779589535e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.78040142637134263427912246171411479166776409276684e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.85625978983111842670865940159150361843054620140300e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.92590726602475875901684499549667744162908005254207e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.04873777288161758991649770533103505875566036067315e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.15278911856248478088063341213669352039898456875983e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.24130503839415290663064766600863877055306793445333e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.31696102735179394495180164200593784488582138327694e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.38195112746199551037885830108115610693678956104594e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.43806900885896605694390358343940460845582243989715e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.48677954836791634391273767979450406335892640585045e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.52927980046477119746205391036666872656611789316554e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(4.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.59939373386293535847669182576818465955927373035467e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.65433945362867879413538593557411941750837354200812e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(5.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.69816672594606569822299986511094581346810669802925e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(6)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.73368884642273321841166642302379087929797275815602e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(6.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.76289558464640301369422872101450331194067414657857e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(7)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.78721979671508698647720200666528542996105699216801e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(7.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.80771139145909061814002155447578879059651577452407e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.82515243555548699954994382507757214540918643206410e-1), tolerance); +} + +template +void do_test_mapairy_ccdf() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + mapairy_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-2))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.37401044748021476825244098156569013477953539088174e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.09500789442153963237938093127797899360805664420447e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.79594340348916165746255401646019373752776359959184e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.47980384246988659070347238031630847601037449815394e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.14998152961229182450957988006003689614266814263072e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.81012623022104040214977701484099838837929052036555e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.46399412179683430236635335813987484465793614746461e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.11530411515907070567416865506120953470186517384896e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.76761001550328916329958547586683988080069306143615e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.9375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.59517526581765555919362368199644785868186276651971e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.42419458652940658023248502567163469810296280368747e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.8125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.25502275651679980592460189386848191697785908199248e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.08798899609854669970451760813806184325649078778627e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.6875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.92339588745309319467433107746636045549268661701190e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.76151867728764575402158939356298759953032241576969e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.5625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.60260493782183673675558798477100282727310492469922e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.44687455811135929601431690596614765172308448364353e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.4375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.29452003476191277907729612221531243864254449022158e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.14570702911531010163426853374475101609358569427771e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.3125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.00057515694829559690826071707640402341321751538834e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.85923897651566000734404990962719044733433264142513e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.1875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.72178914128761995044123038908402726464149079644847e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.58829368486688944817217262166476017433918886867887e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.0625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.45879940721217082337399652358822297178473487360747e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.33333333333333333333333333333333333333333333333333e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.0625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.21190421795630072169483362526718157527244513264330e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.09450407218741507455186567002242960721753564377720e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.1875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.98110969085197223326455343892026361745659892666792e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.87168416186433290338044307348274691328183025874875e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.3125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.76617834164299773398132872208591772052901332037754e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.66453228315972421461550445601122986044819216694033e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.4375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.56667660566420358155020545295541534342280448473328e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.47253379742206423106677738280383561538678447099598e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.5625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.38201944492028261241237139126370309134887020522227e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.29504338391497216822399002060042455255929172033631e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.6875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.21151076941371541873268309875170001373933669674107e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.13132306319599569566732542397115360583960085094557e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.8125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.05437893878388134032875026105765513023510823662811e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.98057510488803958639055769576833497416198534518943e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.9375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90980704928171664583215022541991482756333886319968e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.84196970581015939887507434989936103587334244252687e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.71466761190060277134943681477653029779567366907529e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.59783805418499297054160156055528324120765496304766e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.49067248895976156052348805305261331386502966686347e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.39239469072779970052355784357073824511972098277058e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.30226775831578368563812661921353248199174220410465e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21959857362865736572087753828588520833223590723316e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.14374021016888157329134059840849638156945379859700e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.07409273397524124098315500450332255837091994745793e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.51262227118382410083502294668964941244339639326852e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.47210881437515219119366587863306479601015431240172e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.58694961605847093369352333991361229446932065546671e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.83038972648206055048198357994062155114178616723061e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.18048872538004489621141698918843893063210438954059e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.61930991141033943056096416560595391544177560102847e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.13220451632083656087262320205495936641073594149555e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.70720199535228802537946089633331273433882106834460e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.00606266137064641523308174231815340440726269645335e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.45660546371321205864614064425880582491626457991880e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.01833274053934301777000134889054186531893301970748e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.66311153577266781588333576976209120702027241843979e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37104415353596986305771278985496688059325853421426e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.12780203284913013522797993334714570038943007831995e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.92288608540909381859978445524211209403484225475927e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.74847564444513000450056174922427854590813567935902e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.46888494885704354461170804278826523218710845325600e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.25613324230091750631240813030902908673461241410450e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.08995384276796746727925033729177141093311272472945e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.57298412261448730944183018356841954457807894385431e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.49445667426015051170301411155410826055184233951431e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.60377136717752997401167765152949642869947243569953e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.85823720627621671017207210698248665551570440429385e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.22684103170563193014558918295924551172698239430713e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.22006950358287273393523413555812293504310335665744e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.45787594574479193246071067008198432980227781543963e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.86454025983790677529906306805195677315975322722262e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.39200041143645646258373331865031120883657317932172e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.00844464598329521611240330284790908003180945122524e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.69207105975977872414400493979073211647180301757125e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.42749222811426799055113000065152671289607878504149e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.20357145727036120652264700679701054983338793783565e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.84678186992189202260619598427428218285343162114238e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(40))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.57685005349633837416913019835892196933717853056275e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(44))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.36681189477727165566612776659042216546642387956225e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(48))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.19958501309529382285703116836639459985687034231775e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(52))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.06387729083711703707125561075502300925516821745411e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(56))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.51956726422504037060971384488455660747488001979504e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(60))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.58369730588727742464054792329377206933983130862391e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(64))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.79171138168694768852946218859426934990849762414603e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(72))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.52989549449674176739274234303186543768254475184699e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(80))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.57534022322054445175812334907544905864245720421642e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(88))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.83262692804541386527340439387556377914021496108680e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(96))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.24132027619974492546489695559384126869565934766815e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(104))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.76147662885863808608468523190827912794216909524203e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(112))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.36574864341415676513997111497521230889735520043816e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(120))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.03484906797876224319052497399923183994442800112441e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(128))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.75482620393356950171417803995157642981745916059418e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.73979922776430555363554632966080889507162029820752e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(512))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.44353982639936003430898773389958569528340214901924e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1024))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21747521599099094720054911524728128905331418743558e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2048))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.30442492111514986227593224497576120783344940470632e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4096))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.52184402609265962838062304205455964936542503385355e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8192))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.38053115409151479601077504716814204054241984396579e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16384))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90230503273504174320645323659877052404533613091567e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(32768))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.72566394266708055503723315148592640827491725732841e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(65536))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37788129092113064009710124961268854372530077851514e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(131072))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.40707992833487973793766069223107728401530584918012e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(262144))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.97235161365145877787702193738699569533619914113956e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(524288))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.05088499104186197709404571098840228587836479911802e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1048576))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.71543951706432436058369237052221627684485231071286e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2097152))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.31360623880232751062247585210413319083311528997997e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4194304))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.64429939633040546807800247387131067206560952703714e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8388608))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.64200779850290938904479244625064763530742033320990e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16777216))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.80537424541300683543633877614223483555123688801843e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(33554432))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.05250974812863673632096512092113144155816177586613e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(67108864))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.25671780676625854430204135462707277286762193086669e-13), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.34217728e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.56563718516079592040149887308711394838177046916383e-13), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.68435456e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.07089725845782318037768094883949095101477347530653e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.36870912e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.20704648145099490050187930370138656919662848438144e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.073741824e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.13386215730722789754721037105719349775366357126605e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.147483648e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.00880810181374362562734924119592255004499293746830e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.294967296e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41732769663403487193401296875220001924045479390391e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7179869184e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.77165962079254358991751621103655291754760707304047e-16), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6.8719476736e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.21457452599067948739689526379757206282312287607911e-17), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.74877906944e11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.76821815748834935924611907974700181516735308796565e-18), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.099511627776e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.46027269686043669905764884968375298647166107661462e-19), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.398046511104e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.32534087107554587382206106210469124710349176992174e-20), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7592186044416e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.40667608884443234227757632763086405915307399803018e-21), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.0368744177664e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.75834511105554042784697040953858007394668838202264e-22), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.81474976710656e14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.44793138881942553480871301192322509243346488933465e-23), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.125899906842624e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.05599142360242819185108912649040313655418331509614e-23), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.503599627370496e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.31998927950303523981386140811300392069272914785317e-24), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8014398509481984e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.64998659937879404976732676014125490086591143489426e-25), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.2057594037927936e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.06248324922349256220915845017656862608238929361934e-26), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.88230376151711744e17))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.57810406152936570276144806272071078260298661702420e-27), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.152921504606846976e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22263007691170712845181007840088847825373327128025e-28), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.611686018427387904e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.02828759613963391056476259800111059781716658910032e-29), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8446744073709551616e19))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.03535949517454238820595324750138824727145823637540e-30), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.95147905179352825856e20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.86774921121022248157180194922091913636165349433656e-32), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.722366482869645213696e21))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.22933581425159726274559405456576861505650835849009e-33), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.5557863725914323419136e22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.92083720976812072303999071025901346102579431014076e-35), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.208925819614629174706176e24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.00130814026268862974998548477970853285280360959494e-37), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.9342813113834066795298816e25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.68954396916045098398435231996829458258250563999209e-39), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.09485009821345068724781056e26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.32741245181320466247555049995046028528516506248764e-41), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.951760157141521099596496896e27))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.14490819559581322851180476561725941957580704101369e-42), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.9228162514264337593543950336e28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.78891905561845816954969494627696784308719850158390e-44), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.267650600228229401496703205376e30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.79518602440384088992139835355776225482374765872484e-46), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.0282409603651670423947251286016e31))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.36747816313100139050218492743400352316210571675756e-48), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.24518553658426726783156020576256e32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.82418462989218967265966394911563050494079018243369e-50), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.192296858534827628530496329220096e33))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.06627884842065463635307249204931726639699846600526e-51), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8.3076749736557242056487941267521536e34))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.66606070065727286930167576882705822874531010313323e-53), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.329227995784915872903807060280344576e36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.60321984477698885828386838879227848241454703614566e-55), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.1267647932558653966460912964485513216e37))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.06753100746404509106854435748793512877272974397760e-57), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.40282366920938463463374607431768211456e38))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.35551719916257045479460055857489863870739022496500e-59), tolerance); + + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 600))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.71969536983273370677446521953393512020163902133418e-272), tolerance); + + // The test is terminated because x is inf after this in fp64. + if (N <= 53) { + return; + } + + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 10000))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41571262853590848961675783559267306723234880166889e-4516), tolerance); +} + +template +void do_test_mapairy_quantile_nearzero() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + mapairy_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.03125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.92947985498880164288717582971263069265106409267331e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.59822399410385083283727681965013516508738702183587e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.09375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.37051518906738394785544825118798831695789651589080e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.18765177572396470161180571018467021827812222940306e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.15625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.02990438632621036358966845969387883330987649629695e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.88799753980914934718534117636680696659950540760708e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.21875)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.75672646260182080486757173789442594487758358719568e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.63281240925531315038207673147576301428806562043208e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.28125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.51400400121400801502802449510679455584862826208973e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.39864166928988824635332108295073034590821798923232e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.34375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.28542241490194660184907680173328998444992309715534e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.17326074020471664204142312429732771994689840460362e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.40625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.06119903663447640834652691309939508582577539512003e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -9.48344198262277235851026749871350785648904607023049e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.46875)), BOOST_MATH_BIG_CONSTANT(RealType, N, -8.33817641975610807828267883212039917352738594297812e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, -7.16710685455022053317001962780672309444401429230030e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.53125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.96039220307812911673187933977720502663701213461352e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.70691924008504753346480857177819427470334982130948e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.59375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.39365150798529936746993802101957358628812489096556e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.00474815142578902619056852805926625285378475306847e-1), tolerance); + + // Relative error decreases near the root. + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.65625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.20300033010874226241969971846939668616524880409485e-2), tolerance * 4); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.08557609474704600193050942980969400222443967430903e-1), tolerance * 4); + + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.71875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.84775355628419671941908878470333245751721020657513e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.81512108276093787175849069715334396559730936013748e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.78125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.05946829281923976565971908177998486051088750363345e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.69237131791870252926200620656937624841227431099908e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.84375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.29003620591891062966640208281844476036608475704263e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.70276979914029738186601698003670175695927342267323e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.90625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.28080064428173146950050714257245479404308412291534e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22141517097499177560650456638736418866609207598601e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.96875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.36798741582712685566660459972731625067678977232527e0), tolerance); +} + +template +void do_test_mapairy_quantile_lower() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + mapairy_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -3)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.18765177572396470161180571018467021827812222940306e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -4)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.59822399410385083283727681965013516508738702183587e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -5)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.92947985498880164288717582971263069265106409267331e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -6)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.20998806047945704828514962310033638603842757237089e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -7)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.45496901537018787335070643452598202244805633093375e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -8)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.67354365380697578246790709817724830651682057476917e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -10)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.05331626220443158014611601879873776289585727270317e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -12)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.37844135506419820279451552495734835192576864639213e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -14)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.66475100891248273292011043832615771689316788780040e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -16)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.92187819510636694694450607724165688786106650410224e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -20)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.37198340489560108355199818136414022326129982959773e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -24)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.76028477470580699278679082649703786389435657070830e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -28)), BOOST_MATH_BIG_CONSTANT(RealType, N, -6.10419378761193307962534180728809528372838135595700e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -32)), BOOST_MATH_BIG_CONSTANT(RealType, N, -6.41443550638291131009585191506467027832121974024563e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -40)), BOOST_MATH_BIG_CONSTANT(RealType, N, -6.96026448032205844753104387192915744062974794241787e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -48)), BOOST_MATH_BIG_CONSTANT(RealType, N, -7.43355682497258196703130282301265363831865507562392e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -56)), BOOST_MATH_BIG_CONSTANT(RealType, N, -7.85432398223245647091315413807705550499215849013310e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -64)), BOOST_MATH_BIG_CONSTANT(RealType, N, -8.23500806363233607692361021471929015767129541901722e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -80)), BOOST_MATH_BIG_CONSTANT(RealType, N, -8.90695141954692987290075695228754376250679911499016e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -96)), BOOST_MATH_BIG_CONSTANT(RealType, N, -9.49149767947731938416802231743764792842977181401152e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -112)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.00124089585489463242206889945762289007601620222216e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -128)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.04845570631944023525776899386112795192930377369709e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -160)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.13196240444608571220864964743861585994042496495014e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -192)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.20475312075429969521072327133506584708675011147301e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -224)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.26971371983788322297191645356972895828456120573844e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -256)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.32865827226175697711590794217590458317537880046696e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -256)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.32865827226175697711590794217590458317537880046696e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -320)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.43303723297942256778502134022428247271630018451935e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -384)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.52413050129859916220402440029315858653640179700446e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -448)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.60549473918897820617071548963372947780704796096977e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -512)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.67937186583822375017526293948703697021001956377209e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -640)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.81028650954862232126230250634527453300745376729470e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -768)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.92461760606525027716536281516018610241283237089375e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -896)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.02678879167343824140492421290271637384390204302948e1), tolerance); + + // The test is terminated because p = 0 after this in fp64. + if(N <= 53){ + return; + } + + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -1024)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.11959316095291435774375635827672516757012476284109e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -1280)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.28411538998117558460421271505353342631141242515516e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -1536)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.42785430825019465839030492595482468932343681278349e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -1792)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.55634220352411216642587067287258912926964865154135e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -2048)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.67307564006689676593687414536012112442665935238575e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -2560)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.88006705102088142572333576380332410442882971872985e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -3072)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.06095108081567569614908765234696115918183394966145e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -3584)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.22266885559263332213569359568928269416384800428618e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -4096)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.36960987939726803544369406181770745085696438921663e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -5120)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.63019918860979732881015320942243118103538614206846e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -6144)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.85794964449030059786959849735574335608745736630897e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -7168)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.06158611834421484993920289979452825015061756369038e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -8192)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.24662793339079714510108682543625432044226557042768e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -10240)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.57480988422877882295975852850886697641784458384426e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -12288)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.86165509604814747106458415059041118242367113233764e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -14336)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.11814205550106893579346476384206383922751551334008e1), tolerance); +} + +template +void do_test_mapairy_quantile_upper() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + mapairy_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, -7.16710685455022053317001962780672309444401429230030e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.46875))), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.96039220307812911673187933977720502663701213461352e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.4375))), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.70691924008504753346480857177819427470334982130948e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.40625))), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.39365150798529936746993802101957358628812489096556e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.00474815142578902619056852805926625285378475306847e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.34375))), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.20300033010874226241969971846939668616524880409485e-2), tolerance * 4); + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.3125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.08557609474704600193050942980969400222443967430903e-1), tolerance * 4); + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.28125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.84775355628419671941908878470333245751721020657513e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.81512108276093787175849069715334396559730936013748e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.21875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.05946829281923976565971908177998486051088750363345e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.1875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.69237131791870252926200620656937624841227431099908e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, static_cast(0.15625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.29003620591891062966640208281844476036608475704263e0), tolerance); + + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -3))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.70276979914029738186601698003670175695927342267323e0), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -4))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22141517097499177560650456638736418866609207598601e0), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.36798741582712685566660459972731625067678977232527e0), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -6))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.63240190107315016002742117235901647573374032928275e0), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -7))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.37487073802383509843362175744776155324007021797019e1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18429841828919685808654152263914024115105410242857e1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.50552947051871870287466561935025391775332522082960e1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38732922416208535732704088926085913683321415168727e2), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.49585416520688234273370911116680490544653394894587e2), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.80900106401310352569173769396359734191276945763559e2), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.59336704609415555521333325344685782416363311947039e3), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.55156669326461321628671444544286440554399508021258e4), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.25510428200953290831680861672648808196801287129080e5), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43190196382396984755739962193081183260874381700500e6), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -40))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.77306696194440571351895040208958865072901805506645e7), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -48))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.32755474809804845725014907927003674268598932505496e9), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -56))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.38411271011676880227484089908793278086771148389202e10), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -64))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.78343716417988572841183668816998971166780683532365e12), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -80))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.14997210570212560225883973162628933329443239976683e15), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -96))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.99677152273063632531264438890163357898418349270434e18), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -112))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.62497388866235918645459765949830559011448320623360e22), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -128))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.64139290653028845793860203742403295803332310962125e25), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -160))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.97920970865877789202766313638336627695568626671453e31), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -192))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.84407885843159775798215826490261804734522750775796e38), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -224))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.87250989448760462117787200600339872607929758715096e44), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28743695332377477386366453958993754420344828061498e51), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28743695332377477386366453958993754420344828061498e51), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -320))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.98819430202303731872899900564216427734599065613620e63), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -384))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.27507518735966284635753747136817320622994832637767e76), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -448))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.38092093738495853701408205401696240265896114717023e89), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -512))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.05852403143769157513875467957386926795647775801563e102), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -640))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.49075014586685014041688089060587827415714205982384e128), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -768))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.26604066065618724776472365999448082037897284653223e153), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -896))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.54152887582709267575372250070675971504362522185818e179), tolerance); +} + +template +void do_test_mapairy_locscale_param() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + mapairy_distribution dist_0_1(static_cast(0), static_cast(1)); + mapairy_distribution dist_1_3(static_cast(1), static_cast(3)); + mapairy_distribution dist_0_invcbrt18(static_cast(0), 1 / cbrt(static_cast(18))); + + BOOST_CHECK_CLOSE(entropy(dist_0_1), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.0072768184106563460003025875575283708), tolerance); + BOOST_CHECK_CLOSE(entropy(dist_1_3), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.0072768184106563460003025875575283708) + log(static_cast(3)), tolerance); + BOOST_CHECK_CLOSE(entropy(dist_0_invcbrt18), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.0438195657786014485977283891231190450), tolerance); + + BOOST_CHECK_CLOSE(median(dist_0_1), BOOST_MATH_BIG_CONSTANT(RealType, N, -0.71671068545502205331700196278067230944440), tolerance); + BOOST_CHECK_CLOSE( + median(dist_1_3), + (1 + 3 * BOOST_MATH_BIG_CONSTANT(RealType, N, -0.71671068545502205331700196278067230944440)), + tolerance + ); + BOOST_CHECK_CLOSE(median(dist_0_invcbrt18), BOOST_MATH_BIG_CONSTANT(RealType, N, -0.27347630981017495237228835747364595601553), tolerance); + + BOOST_CHECK_CLOSE(mode(dist_0_1), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.1615872711359706852500000803029112987), tolerance); + BOOST_CHECK_CLOSE( + mode(dist_1_3), + (1 + 3 * BOOST_MATH_BIG_CONSTANT(RealType, N, -1.1615872711359706852500000803029112987)), + tolerance + ); + BOOST_CHECK_CLOSE(mode(dist_0_invcbrt18), BOOST_MATH_BIG_CONSTANT(RealType, N, -0.4432284977460014720866292801600737435), tolerance); + + BOOST_CHECK_CLOSE(pdf(dist_0_1, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.06251243013238748252181151646220197947016365256337e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist_1_3, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.97516171847191855609649452292217911972760948598791e-1) / 3, tolerance); + BOOST_CHECK_CLOSE(pdf(dist_0_invcbrt18, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.29264884227495575949271548513687010027396013858107e-2), tolerance); + + BOOST_CHECK_CLOSE(cdf(dist_0_1, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.15803029418984060112492565010063896412665755747313e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_1_3, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.66666666666666666666666666666666666666666666666667e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_0_invcbrt18, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.19730152884211135907661924151362266458717453254074e-1), tolerance); + + BOOST_CHECK_CLOSE(cdf(dist_0_1, quantile(dist_0_1, static_cast(0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.25), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_1_3, quantile(dist_1_3, static_cast(0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.25), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_0_invcbrt18, quantile(dist_0_invcbrt18, static_cast(0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.25), tolerance); + + BOOST_CHECK_CLOSE(cdf(dist_0_1, quantile(dist_0_1, static_cast(0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.75), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_1_3, quantile(dist_1_3, static_cast(0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.75), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_0_invcbrt18, quantile(dist_0_invcbrt18, static_cast(0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.75), tolerance); +} + +BOOST_AUTO_TEST_CASE(mapairy_pdf_fp64) +{ + do_test_mapairy_pdf(); +} + +BOOST_AUTO_TEST_CASE(mapairy_pdf_fp128) +{ + do_test_mapairy_pdf(); +} + +BOOST_AUTO_TEST_CASE(mapairy_cdf_fp64) +{ + do_test_mapairy_cdf(); +} + +BOOST_AUTO_TEST_CASE(mapairy_cdf_fp128) +{ + do_test_mapairy_cdf(); +} + +BOOST_AUTO_TEST_CASE(mapairy_ccdf_fp64) +{ + do_test_mapairy_ccdf(); +} + +BOOST_AUTO_TEST_CASE(mapairy_ccdf_fp128) +{ + do_test_mapairy_ccdf(); +} + +BOOST_AUTO_TEST_CASE(mapairy_quantile_nearzero_fp64) +{ + do_test_mapairy_quantile_nearzero(); +} + +BOOST_AUTO_TEST_CASE(mapairy_quantile_nearzero_fp128) +{ + do_test_mapairy_quantile_nearzero(); +} + +BOOST_AUTO_TEST_CASE(mapairy_quantile_lower_fp64) +{ + do_test_mapairy_quantile_lower(); +} + +BOOST_AUTO_TEST_CASE(mapairy_quantile_lower_fp128) +{ + do_test_mapairy_quantile_lower(); +} + +BOOST_AUTO_TEST_CASE(mapairy_quantile_upper_fp64) +{ + do_test_mapairy_quantile_upper(); +} + +BOOST_AUTO_TEST_CASE(mapairy_quantile_upper_fp128) +{ + do_test_mapairy_quantile_upper(); +} + +BOOST_AUTO_TEST_CASE(mapairy_locscale_fp64) +{ + do_test_mapairy_locscale_param(); +} + +BOOST_AUTO_TEST_CASE(mapairy_locscale_fp128) +{ + do_test_mapairy_locscale_param(); +} From 7103a2694d23291c2499823eccc6817f251311fc Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Tue, 16 Jul 2024 14:40:31 +0900 Subject: [PATCH 002/399] Add holtsmark distribution --- .../boost/math/distributions/holtsmark.hpp | 2465 +++++++++++++++++ test/test_holtsmark.cpp | 795 ++++++ 2 files changed, 3260 insertions(+) create mode 100644 include/boost/math/distributions/holtsmark.hpp create mode 100644 test/test_holtsmark.cpp diff --git a/include/boost/math/distributions/holtsmark.hpp b/include/boost/math/distributions/holtsmark.hpp new file mode 100644 index 0000000000..5e759cb3e3 --- /dev/null +++ b/include/boost/math/distributions/holtsmark.hpp @@ -0,0 +1,2465 @@ +// Copyright Takuma Yoshimura 2024. +// 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) + +#ifndef BOOST_STATS_HOLTSMARK_HPP +#define BOOST_STATS_HOLTSMARK_HPP + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4127) // conditional expression is constant +#endif + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace math { +template +class holtsmark_distribution; + +namespace detail { + +template +inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integral_constant&) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 1) { + // Rational Approximation + // Maximum Relative Error: 4.7894e-17 + static const RealType P[8] = { + static_cast(2.87352751452164445024e-1), + static_cast(1.18577398160636011811e-3), + static_cast(-2.16526599226820153260e-2), + static_cast(2.06462093371223113592e-3), + static_cast(2.43382128013710116747e-3), + static_cast(-2.15930711444603559520e-4), + static_cast(-1.04197836740809694657e-4), + static_cast(1.74679078247026597959e-5), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(4.12654472808214997252e-3), + static_cast(2.93891863033354755743e-1), + static_cast(8.70867222155141724171e-3), + static_cast(3.15027515421842640745e-2), + static_cast(2.11141832312672190669e-3), + static_cast(1.23545521355569424975e-3), + static_cast(1.58181113865348637475e-4), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 3.0925e-17 + static const RealType P[8] = { + static_cast(2.02038159607840130389e-1), + static_cast(-1.20368541260123112191e-2), + static_cast(-3.19235497414059987151e-3), + static_cast(8.88546222140257289852e-3), + static_cast(-5.37287599824602316660e-4), + static_cast(-2.39059149972922243276e-4), + static_cast(9.19551014849109417931e-5), + static_cast(-8.45210544648986348854e-6), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(6.11634701234079515138e-1), + static_cast(4.39922162828115412952e-1), + static_cast(1.73609068791154078128e-1), + static_cast(6.15831808473403962054e-2), + static_cast(1.64364949550314788638e-2), + static_cast(2.94399615562137394932e-3), + static_cast(4.99662797033514776061e-4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 1.4499e-17 + static const RealType P[10] = { + static_cast(8.45396231261375200568e-2), + static_cast(-9.15509628797205847643e-3), + static_cast(1.82052933284907579374e-2), + static_cast(-2.44157914076021125182e-4), + static_cast(8.40871885414177705035e-4), + static_cast(7.26592615882060553326e-5), + static_cast(-1.87768359214600016641e-6), + static_cast(1.65716961206268668529e-6), + static_cast(-1.73979640146948858436e-7), + static_cast(7.24351142163396584236e-9), + }; + static const RealType Q[9] = { + static_cast(1), + static_cast(8.88099527896838765666e-1), + static_cast(6.53896948546877341992e-1), + static_cast(2.96296982585381844864e-1), + static_cast(1.14107585229341489833e-1), + static_cast(3.08914671331207488189e-2), + static_cast(7.03139384769200902107e-3), + static_cast(1.01201814277918577790e-3), + static_cast(1.12200113270398674535e-4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 6.5259e-17 + static const RealType P[11] = { + static_cast(1.36729417918039395222e-2), + static_cast(1.19749117683408419115e-2), + static_cast(6.26780921592414207398e-3), + static_cast(1.84846137440857608948e-3), + static_cast(3.39307829797262466829e-4), + static_cast(2.73606960463362090866e-5), + static_cast(-1.14419838471713498717e-7), + static_cast(1.64552336875610576993e-8), + static_cast(-7.95501797873739398143e-10), + static_cast(2.55422885338760255125e-11), + static_cast(-4.12196487201928768038e-13), + }; + static const RealType Q[9] = { + static_cast(1), + static_cast(1.61334003864149486454e0), + static_cast(1.28348868912975898501e0), + static_cast(6.36594545291321210154e-1), + static_cast(2.11478937436277242988e-1), + static_cast(4.71550897200311391579e-2), + static_cast(6.64679677197059316835e-3), + static_cast(4.93706832858615742810e-4), + static_cast(9.26919465059204396228e-6), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 3.5084e-17 + static const RealType P[8] = { + static_cast(1.90649774685568282390e-3), + static_cast(7.43708409389806210196e-4), + static_cast(9.53777347766128955847e-5), + static_cast(3.79800193823252979170e-6), + static_cast(2.84836656088572745575e-8), + static_cast(-1.22715411241721187620e-10), + static_cast(8.56789906419220801109e-13), + static_cast(-4.17784858891714869163e-15), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(7.29383849235788831455e-1), + static_cast(2.16287201867831015266e-1), + static_cast(3.28789040872705709070e-2), + static_cast(2.64660789801664804789e-3), + static_cast(1.03662724048874906931e-4), + static_cast(1.47658125632566407978e-6), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 1.4660e-19 + static const RealType P[9] = { + static_cast(3.07231582988207590928e-4), + static_cast(5.16108848485823513911e-5), + static_cast(3.05776014220862257678e-6), + static_cast(7.64787444325088143218e-8), + static_cast(7.40426355029090813961e-10), + static_cast(1.57451122102115077046e-12), + static_cast(-2.14505675750572782093e-15), + static_cast(5.11204601013038698192e-18), + static_cast(-9.00826023095223871551e-21), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(3.28966789835486457746e-1), + static_cast(4.46981634258601621625e-2), + static_cast(3.22521297380474263906e-3), + static_cast(1.31985203433890010111e-4), + static_cast(3.01507121087942156530e-6), + static_cast(3.47777238523841835495e-8), + static_cast(1.50780503777979189972e-10), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 4.2292e-18 + static const RealType P[8] = { + static_cast(5.25741312407933720817e-5), + static_cast(2.34425802342454046697e-6), + static_cast(3.30042747965497652847e-8), + static_cast(1.58564820095683252738e-10), + static_cast(1.54070758384735212486e-13), + static_cast(-8.89232435250437247197e-17), + static_cast(8.14099948000080417199e-20), + static_cast(-4.61828164399178360925e-23), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.23544974283127158019e-1), + static_cast(6.01210465184576626802e-3), + static_cast(1.45390926665383063500e-4), + static_cast(1.80594709695117864840e-6), + static_cast(1.06088985542982155880e-8), + static_cast(2.20287881724613104903e-11), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType t = 1 / sqrt(x * x * x); + + // Rational Approximation + // Maximum Relative Error: 2.3004e-17 + static const RealType P[4] = { + static_cast(2.99206710301074508455e-1), + static_cast(-8.62469397757826072306e-1), + static_cast(1.74661995423629075890e-1), + static_cast(8.75909164947413479137e-1), + }; + static const RealType Q[3] = { + static_cast(1), + static_cast(-6.07405848111002255020e0), + static_cast(1.34068401972703571636e1), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t / x; + } + + return result; +} + + +template +inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integral_constant&) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 1) { + // Rational Approximation + // Maximum Relative Error: 4.5215e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.87352751452164445024482162286994868262e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.07622509000285763173795736744991173600e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.75004930885780661923539070646503039258e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.72358602484766333657370198137154157310e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.80082654994455046054228833198744292689e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.53887200727615005180492399966262970151e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07684195532179300820096260852073763880e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.39151986881253768780523679256708455051e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.31700721746247708002568205696938014069e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.52538425285394123789751606057231671946e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.13997198703138372752313576244312091598e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74788965317036115104204201740144738267e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.18994723428163008965406453309272880204e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.49208308902369087634036371223527932419e-11), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.07053963271862256947338846403373278592e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.30146528469038357598785392812229655811e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.22168809220570888957518451361426420755e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.30911708477464424748895247790513118077e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.32037605861909345291211474811347056388e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.37380742268959889784160508321242249326e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.17777859396994816599172003124202701362e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.69357597449425742856874347560067711953e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.22061268498705703002731594804187464212e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.03685918248668999775572498175163352453e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.42037705933347925911510259098903765388e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.13651251802353350402740200231061151003e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.15390928968620849348804301589542546367e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.96186359077726620124148756657971390386e-9), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 1.3996e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.02038159607840130388931544845552929992e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.85240836242909590376775233472494840074e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.92928437142375928121954427888812334305e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.56075992368354834619445578502239925632e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.85410663490566091471288623735720924369e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.09160661432404033681463938555133581443e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.60290555290385646856693819798655258098e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.24420942563054709904053017769325945705e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.06370233020823161157791461691510091864e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.51562554221298564845071290898761434388e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.77361020844998296791409508640756247324e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.10768937536097342883548728871352580308e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.97810512763454658214572490850146305033e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.77430867682132459087084564268263825239e-11), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.30030169049261634787262795838348954434e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.45935676273909940847479638179887855033e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.14724239378269259016679286177700667008e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21580123796578745240828564510740594111e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.70287348745451818082884807214512422940e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.46859813604124308580987785473592196488e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.49627445316021031361394030382456867983e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05157712406194406440213776605199788051e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.91541875103990251411297099611180353187e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.47960462287955806798879139599079388744e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.80126815763067695392857052825785263211e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04569118116204820761181992270024358122e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.63024381269503801668229632579505279520e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00967434338725770754103109040982001783e-8), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 1.6834e-35 + static const RealType P[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.45396231261375200568114750897618690566e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.83107635287140466760500899510899613385e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.71690205829238281191309321676655995475e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.95995611963950467634398178757261552497e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.52444689050426648467863527289016233648e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.40423239472181137610649503303203209123e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.72181273738390251101985797318639680476e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.11423032981781501087311583401963332916e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.37255768388351332508195641748235373885e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.25140171472943043666747084376053803301e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.98925617316135247540832898350427842870e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.27532592227329144332335468302536835334e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.25846339430429852334026937219420930290e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.17852693845678292024334670662803641322e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.60008761860786244203651832067697976835e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.85474213475378978699789357283744252832e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.05561259222780127064607109581719435800e-15), + }; + static const RealType Q[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.08902510590064634965634560548380735284e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.60127698266075086782895988567899172787e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.73299227011247478433171171063045855612e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.94019328695445269130845646745771017029e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21478511930928822349285105322914093227e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.42888485420705779382804725954524839381e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36839484685440714657854206969200824442e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.77082068469251728028552451884848161629e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.92625563541021144576900067220082880950e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.88302521658522279293312672887766072876e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.37703703342287521257351386589629343948e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.32454189932655869016489443530062686013e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.81822848072558151338694737514507945151e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.40176559099032106726456059226930240477e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.55722115663529425797132143276461872035e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.18236697046568703899375072798708359035e-10), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 5.6207e-35 + static const RealType P[20] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36729417918039395222067998266923903488e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.05780369334958736210688756060527042344e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.88449456199223796440901487003885388570e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.20213624124017393492512893302682417041e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.95009975955570002297453163471062373746e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.35668345583965001606910217518443864382e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.69006847702829685253055277085000792826e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.08366922884479491780654020783735539561e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.71834368599657597252633517017213868956e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.88269472722301903965736220481240654265e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.37797139843759131750966129487745639531e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.72390971590654495025982276782257590019e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.68354503497961090303189233611418754374e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.20749461042713568368181066233478264894e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.71167265100639100355339812752823628805e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.37497033071709741762372104386727560387e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.08992504249040731356693038222581843266e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.03311745412603363076896897060158476094e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.89266184062176002518506060373755160893e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.22157263424086267338486564980223658130e-22), + }; + static const RealType Q[19] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.24254809760594824834854946949546737102e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.66740386908805016172202899592418717176e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.17175023341071972435947261868288366592e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33939409711833786730168591434519989589e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.58859674176126567295417811572162232222e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.66346764121676348703738437519493817401e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.00687534341032230207422557716131339293e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.57352381181825892637055619366793541271e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.23955067096868711061473058513398543786e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.28279376429637301814743591831507047825e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.22380760186302431267562571014519501842e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.21421839279245792393425090284615681867e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.80151544531415207189620615654737831345e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.57177992740786529976179511261318869505e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.54223623314672019530719165336863142227e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.26447311109866547647645308621478963788e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.76514314007336173875469200193103772775e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.63785420481380041892410849615596985103e-13), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 6.8882e-35 + static const RealType P[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.90649774685568282389553481307707005425e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.70151946710788532273869130544473159961e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.76188245008605985768921328976193346788e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.94997481586873355765607596415761713534e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.83556339450065349619118429405554762845e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.39766178753196196595432796889473826698e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.48835240264191055418415753552383932859e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.23205178959384483669515397903609703992e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.80665018951397281836428650435128239368e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.27113208299726105096854812628329439191e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.75272882929773945317046764560516449105e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.73174017370926101455204470047842394787e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.55548825213165929101134655786361059720e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.79786015549170518239230891794588988732e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.73060731998834750292816218696923192789e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.62842837946576938669447109511449827857e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33878078951302606409419167741041897986e-26), + }; + static const RealType Q[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.75629880937514507004822969528240262723e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43883005193126748135739157335919076027e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.26826935326347315479579835343751624245e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.52263130214924169696993839078084050641e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.34708681216662922818631865761136370252e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19079618273418070513605131981401070622e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.68812668867590621701228940772852924670e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.81323523265546812020317698573638573275e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.46655191174052062382710487986225631851e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.79864553144116347379916608661549264281e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.81866770335021233700248077520029108331e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15408288688082935176022095799735538723e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.29421875915133979067465908221270435168e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.74564282803894180881025348633912184161e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.69782249847887916810010605635064672269e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.85875986197737611300062229945990879767e-18), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 2.7988e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.07231582988207590928480356376941073734e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.35574911514921623999866392865480652576e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.60219401814297026945664630716309317015e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.84927222345566515103807882976184811760e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96327408363203008584583124982694689234e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.86684048703029160378252571846517319101e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.65469175974819997602752600929172261626e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.21842057555380199566706533446991680612e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.53555106309423641769303386628162522042e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.92686543698369260585325449306538016446e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.01838615452860702770059987567879856504e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.65492535746962514730615062374864701860e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.53395563720606494853374354984531107080e-24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.99957357701259203151690416786669242677e-28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.46357124817620384236108395837490629563e-31), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.02259092175256156108200465685980768901e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.63438230616954606028022008517920766366e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.63880061357592661176130881772975919418e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.81911305852397235014131637306820512975e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.09690724408294608306577482852270088377e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11275552068434583356476295833517496456e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.24681861037105338446379750828324925566e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16034379416965004687140768474445096709e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.23234481703249409689976894391287818596e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.93297387560911081670605071704642179017e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.50338428974314371000017727660753886621e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.27897854868353937080739431205940604582e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.37798740524930029176790562876868493344e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.29920082153439260734550295626576101192e-22), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 6.9688e-36 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.25741312407933720816582583160953651639e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.04434146174674791036848306058526901384e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.68959516304795838166182070164492846877e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.78859935261158263390023581309925613858e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.21854067989018450973827853792407054510e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.20573856697340412957421887367218135538e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30843538021351383101589538141878424462e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.05991458689384045976214216819611949900e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.82253708752556965233757129893944884411e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.97645331663303764054986066027964294209e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.69353366461654917577775981574517182648e-24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.59050144462227302681332505386238071973e-27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.85165507189649330971049854127575847359e-31), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70711310565669331853925519429988855964e-34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.72047006026700174884151916064158941262e-38), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.50985661940624198574968436548711898948e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.81705882167596649186405364717835589894e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.86537779048672498307196786015602357729e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.09555188550938733096253930959407749063e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.41930442687159455334801545898059105733e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.09084284266255183930305946875294557622e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.58122754063904909636061457739518406730e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.91800215912676651584368499126132687326e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.66413330532845384974993669138524203429e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.65919563020196445006309683624384862816e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.61596083414169579692212575079167989319e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16321386033703806802403099255708972015e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.90892719803158002834365234646982537288e-25), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType t = 1 / sqrt(x * x * x); + + // Rational Approximation + // Maximum Relative Error: 3.0545e-39 + static const RealType P[8] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.99206710301074508454959544950786401357e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.75243304700875633383991614142545185173e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.69652690455351600373808930804785330828e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.36233941060408773406522171349397343951e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.28958973553713980463808202034854958375e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.55704950313835982743029388151551925282e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.28767698270323629107775935552991333781e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.80591252844738626580182351673066365090e1), + }; + static const RealType Q[7] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.57593243741246726197476469913307836496e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.99458751269722094414105565700775283458e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.91043982880665229427553316951582511317e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.99054490423334526438490907473548839751e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.36948968143124830402744607365089118030e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.13781639547150826385071482161074041168e4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t / x; + } + + return result; +} + + +template +inline RealType holtsmark_pdf_imp_prec(const RealType& x, const std::integral_constant &tag) { + BOOST_MATH_STD_USING // for ADL of std functions + + return holtsmark_pdf_plus_imp_prec(abs(x), tag); +} + +template +inline RealType holtsmark_pdf_imp_prec(const RealType& x, const std::integral_constant& tag) { + BOOST_MATH_STD_USING // for ADL of std functions + + return holtsmark_pdf_plus_imp_prec(abs(x), tag); +} + +template +inline RealType holtsmark_pdf_imp(const holtsmark_distribution& dist, const RealType& x) { + // + // This calculates the pdf of the Holtsmark distribution and/or its complement. + // + + BOOST_MATH_STD_USING // for ADL of std functions + static const char* function = "boost::math::pdf(holtsmark<%1%>&, %1%)"; + RealType result = 0; + RealType location = dist.location(); + RealType scale = dist.scale(); + + if (false == detail::check_location(function, location, &result, Policy())) + { + return result; + } + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + if (false == detail::check_x(function, x, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + RealType u = (x - location) / scale; + + result = holtsmark_pdf_imp_prec(u, tag_type()) / scale; + + return result; +} + +template +inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 0.5) { + // Rational Approximation + // Maximum Relative Error: 1.3147e-17 + static const RealType P[6] = { + static_cast(5.0e-1), + static_cast(-1.34752580674786639030e-1), + static_cast(1.86318418252163378528e-2), + static_cast(1.04499798132512381447e-2), + static_cast(-1.60831910014592923855e-3), + static_cast(1.38823662364438342844e-4), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(3.05200341554753776087e-1), + static_cast(2.12663999430421346175e-1), + static_cast(7.23836000984872591553e-2), + static_cast(1.67941072412796299986e-2), + static_cast(4.71213644318790580839e-3), + static_cast(5.86825130959777535991e-4), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 1) { + RealType t = x - 0.5; + + // Rational Approximation + // Maximum Relative Error: 1.6265e-18 + static const RealType P[7] = { + static_cast(3.60595773518728397351e-1), + static_cast(5.75238626843218819756e-1), + static_cast(-3.31245319943021227117e-1), + static_cast(1.48132966310216368831e-1), + static_cast(-2.32875122617713403365e-2), + static_cast(2.08038303148835575624e-3), + static_cast(6.01511310581302829460e-6), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(2.32264360456739861886e0), + static_cast(6.39715443864749851087e-1), + static_cast(5.03940458163958921325e-1), + static_cast(8.84780893031413729292e-2), + static_cast(3.01497774031208621961e-2), + static_cast(3.45886005612108195390e-3), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 7.4398e-20 + static const RealType P[8] = { + static_cast(2.43657975600729535515e-1), + static_cast(-6.02286263626532324632e-2), + static_cast(4.68361231392743283350e-2), + static_cast(-1.13497179885838883972e-3), + static_cast(1.20141595689136205012e-3), + static_cast(3.02402304689333413256e-4), + static_cast(-1.22652173865646814676e-6), + static_cast(2.29521832683440044997e-6), + }; + static const RealType Q[9] = { + static_cast(1), + static_cast(5.82002427359748247121e-1), + static_cast(3.96529686558825119743e-1), + static_cast(1.49690294526117385174e-1), + static_cast(5.15049953937764895435e-2), + static_cast(1.30218216530450637564e-2), + static_cast(2.53640337919037463659e-3), + static_cast(3.79575042317720710311e-4), + static_cast(2.94034997185982139717e-5), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 5.6148e-17 + static const RealType P[9] = { + static_cast(1.05039829654829164883e-1), + static_cast(1.66621813028423002562e-2), + static_cast(2.93820049104275137099e-2), + static_cast(3.36850260303189378587e-3), + static_cast(2.27925819398326978014e-3), + static_cast(1.66394162680543987783e-4), + static_cast(4.51400415642703075050e-5), + static_cast(2.12164734714059446913e-7), + static_cast(1.69306881760242775488e-8), + }; + static const RealType Q[9] = { + static_cast(1), + static_cast(9.63461239051296108254e-1), + static_cast(6.54183344973801096611e-1), + static_cast(2.92007762594247903696e-1), + static_cast(1.00918751132022401499e-1), + static_cast(2.55899135910670703945e-2), + static_cast(4.85740416919283630358e-3), + static_cast(6.11435190489589619906e-4), + static_cast(4.10953248859973756440e-5), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 6.5866e-17 + static const RealType P[8] = { + static_cast(3.05754562114095142887e-2), + static_cast(3.25462617990002726083e-2), + static_cast(1.78205524297204753048e-2), + static_cast(5.61565369088816402420e-3), + static_cast(1.05695297340067353106e-3), + static_cast(9.93588579804511250576e-5), + static_cast(2.94302107205379334662e-6), + static_cast(1.09016076876928010898e-8), + }; + static const RealType Q[9] = { + static_cast(1), + static_cast(1.51164395622515150122e0), + static_cast(1.09391911233213526071e0), + static_cast(4.77950346062744800732e-1), + static_cast(1.34082684956852773925e-1), + static_cast(2.37572579895639589816e-2), + static_cast(2.41806218388337284640e-3), + static_cast(1.10378140456646280084e-4), + static_cast(1.31559373832822136249e-6), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 5.6575e-17 + static const RealType P[8] = { + static_cast(9.47408470248235718880e-3), + static_cast(4.70888722333356024081e-3), + static_cast(8.66397831692913140221e-4), + static_cast(7.11721056656424862090e-5), + static_cast(2.56320582355149253994e-6), + static_cast(3.37749186035552101702e-8), + static_cast(8.32182844837952178153e-11), + static_cast(-8.80541360484428526226e-14), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(6.98261117346347123707e-1), + static_cast(1.97823959738695249267e-1), + static_cast(2.89311735096848395080e-2), + static_cast(2.30087055379997473849e-3), + static_cast(9.60592522700377510007e-5), + static_cast(1.84474415187428058231e-6), + static_cast(1.14339998084523151203e-8), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 1.4164e-17 + static const RealType P[8] = { + static_cast(3.19610991747326729867e-3), + static_cast(5.11880074251341162590e-4), + static_cast(2.80704092977662888563e-5), + static_cast(6.31310155466346114729e-7), + static_cast(5.29618446795457166842e-9), + static_cast(9.20292337847562746519e-12), + static_cast(-9.16761719448360345363e-15), + static_cast(1.20433396121606479712e-17), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(2.56283944667056551858e-1), + static_cast(2.56811818304462676948e-2), + static_cast(1.26678062261253559927e-3), + static_cast(3.17001344827541091252e-5), + static_cast(3.68737201224811007437e-7), + static_cast(1.47625352605312785910e-9), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 9.2537e-18 + static const RealType P[8] = { + static_cast(1.11172037056341397612e-3), + static_cast(7.84545643188695076893e-5), + static_cast(1.94862940242223222641e-6), + static_cast(2.02704958737259525509e-8), + static_cast(7.99772378955335076832e-11), + static_cast(6.62544230949971310060e-14), + static_cast(-3.18234118727325492149e-17), + static_cast(2.03424457039308806437e-20), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.17861198759233241198e-1), + static_cast(5.45962263583663240699e-3), + static_cast(1.25274651876378267111e-4), + static_cast(1.46857544539612002745e-6), + static_cast(8.06441204620771968579e-9), + static_cast(1.53682779460286464073e-11), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType x_cube = x * x * x; + RealType t = isnormal(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3); + + // Rational Approximation + // Maximum Relative Error: 4.2897e-18 + static const RealType P[4] = { + static_cast(1.99471140200716338970e-1), + static_cast(-6.90933799347184400422e-1), + static_cast(4.30385245884336871950e-1), + static_cast(3.52790131116013716885e-1), + }; + static const RealType Q[3] = { + static_cast(1), + static_cast(-5.05959751628952574534e0), + static_cast(8.04408113719341786819e0), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t; + } + + return result; +} + +template +inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 0.5) { + // Rational Approximation + // Maximum Relative Error: 8.6635e-36 + static const RealType P[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.0e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.48548242430636907136192799540229598637e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.31541453581608245475805834922621529866e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.16579064508490250336159593502955219069e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.61598809551362112011328341554044706550e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.15119245273512554325709429759983470969e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.02145196753734867721148927112307708045e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.90817224464950088663183617156145065001e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.69596202760983052482358128481956242532e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.50461337222845025623869078372182437091e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.62777995800923647521692709390412901586e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.63937253747323898965514197114021890186e-8), + }; + static const RealType Q[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.76090180430550757765787254935343576341e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.07685236907561593034104428156351640194e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.27770556484351179553611274487979706736e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.99201460869149634331004096815257398515e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.70139000408086498153685620963430185837e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.74682544708653069148470666809094453722e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.57607114117485446922700160080966856243e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01069214414741946409122492979083487977e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.19996282759031441186748256811206136921e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.60933466092746543579699079418115420013e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.92780739162611243933581782562159603862e-8), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 1) { + RealType t = x - 0.5; + + // Rational Approximation + // Maximum Relative Error: 7.1235e-35 + static const RealType P[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.60595773518728397925852903878144761766e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.46999595154527091473427440379143006753e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36962313432466566724352608642383560211e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.08387290167105915393692028475888846796e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.34156151832478939276011262838869269011e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.15970594471853166393830585755485842021e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.47022841547527682761332752928069503835e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.01955019188793323293925482112543902560e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.03069493388735516695142799880566783261e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.61367662035593735709965982000611000987e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.62800430658278408539398798888955969345e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.22300086876618079439960709120163780513e-8), + }; + static const RealType Q[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.19740977756009966244249035150363085180e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.39394884078938560974435920719979860046e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.97107758486905601309707335353809421910e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.36594079604957733960211938310153276332e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.85712904264673773213248691029253356702e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.87605080555629969548037543637523346061e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.26356599628579249350545909071984757938e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.79582114368994462181480978781382155103e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.00970375323007336435151032145023199020e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.06528824060244313614177859412028348352e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.13914667697998291289987140319652513139e-7), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 6.7659e-38 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.43657975600729535499895880792984203140e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.37090874182351552816526775008685285108e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.70793783828569126853147999925198280654e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.27295555253412802819195403503721983066e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.95916890788873842705597506423512639342e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.93625795791721417553345795882983866640e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.73237387099610415336810752053706403935e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.08118655139419640900853055479087235138e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74920069862339840183963818219485580710e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59015304773612605296533206093582658838e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.57256820413579442950151375512313072105e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.36240848333000575199740403759568680951e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.53890585580518120552628221662318725825e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.59245311730292556271235324976832000740e-10), + }; + static const RealType Q[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.49800491033591771256676595185869442663e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.35827615015880595229881139361463765537e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.41657125931991211322147702760511651998e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11782602975553967179829921562737846592e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.79410805176258968660086532862367842847e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.22872839892405613311532856773434270554e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.23742349724658114137235071924317934569e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.80350762663884259375711329227548815674e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59501693037547119094683008622867020131e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.86068186167498269806443077840917848151e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.36940342373887783231154918541990667741e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.48911186460768204167014270878839691938e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.55051094964993052272146587430780404904e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.96312716130620326771080033656930839768e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.45496951385730104726429368791951742738e-10), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 9.9091e-35 + static const RealType P[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05039829654829170780787685299556996311e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.28948022754388615368533934448107849329e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.34139151583225691775740839359914493385e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.13366377215523066657592295006960955345e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.08045462837998791188853367062130086996e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.37648565386728404881404199616182064711e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14881702523183566448187346081007871684e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.73169022445183613027772635992366708052e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.86434609673325793686202636939208406356e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.20865083025640755296377488921536984172e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.24550087063009488023243811976147518386e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.78763689691843975658550702147832072016e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.53901449493513509116902285044951137217e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.64133451376958243174967226929215155126e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.78021916681275593923355425070000331160e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.40116391931116431686557163556034777896e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.43891156389092896219387988411277617045e-15), + }; + static const RealType Q[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30840297297890638941129884491157396207e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16059271948787750556465175239345182035e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.32333703228724830516425197803770832978e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.74722711058640395885914966387546141874e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.57544653090705553268164186689966671940e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.65943099435809995745673109708218670077e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74158626875895095042054345316232575354e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.65978318533667031874695821156329945501e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07907034178758316909655424935083792468e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.16769901831316460137104511711073411646e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.72764558714782436683712413015421717627e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.42494185105694341746192094740530489313e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.47668761140694808076322373887857100882e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.06395948884595166425357861427667353718e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.04398743651684916010743222115099630062e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47852251142917253705233519146081069006e-10), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 3.2255e-36 + static const RealType P[20] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.05754562114095147060025732340404111260e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.29082907781747007723015304584383528212e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.15736486393536930535038719804968063752e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.47619683293773846642359668429058772885e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.78777185267549567154655052281449528836e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.32280474402180284471490985942690221861e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.45430564625797085273267452885960070105e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.81643129239005795245093568930666448817e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.57851748656417804512189330871167578685e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.04264676511381380381909064283066657450e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.84536783037391183433322642273799250079e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.27169201994160924743393109705813711010e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.42623512076200527099335832138825884729e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.98298083389459839517970895839114237996e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.71357920034737751299594537655948527288e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.98563999354325930973228648080876368296e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36248172644168880316722905969876969074e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.61071663749398045880261823483568866904e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.95933262363502031836408613043245164787e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.23007623135952181561484264810647517912e-21), + }; + static const RealType Q[19] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.17760389606658547971193065026711073898e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.49565543987559264712057768584303008339e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.94822569926563661124528478579051628722e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14676844425183314970062115422221981422e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.35960757354198367535169328826167556715e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.04865288305482048252211468989095938024e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.51599632816346741950206107526304703067e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74065824586512487126287762563576185455e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.91819078437689679732215988465616022328e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.41675362609023565846569121735444698127e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17176431752708802291177040031150143262e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52367587943529121285938327286926798550e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59405168077254169099025950029539316125e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29448420654438993509041228047289503943e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.70091773726833073512661846603385666642e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.03909417984236210307694235586859612592e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.59098698207309055890188845050700901852e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.28146456709550379493162440280752828165e-14), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 2.0174e-36 + static const RealType P[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.47408470248235665279366712356669210597e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32149712567170349164953101675315481096e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.39806230477579028722350422669222849223e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.19665271447867857827798702851111114658e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.06773237553503696884546088197977608676e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41294370314265386485116359052296796357e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74848600628353761723457890991084017928e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52963427970210468265870547940464851481e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.33389244528769791436454176079341120973e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.86702000100897346192018772319301428852e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04192907586200235211623448416582655030e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70804269459077260463819507381406529187e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52665761996923502719902050367236108720e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.01866635015788942430563628065687465455e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.46658865059509532456423012727042498365e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.05806999626031246519161395419216393127e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.37645700309533972676063947195650607935e-26), + }; + static const RealType Q[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59608758824065179587008165265773042260e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17347162462484266250945490058846704988e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.24511137251392519285309985668265122633e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.58497164094526279145784765183039854604e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.40787701096334660711443654292041286786e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.34615029717812271556414485397095293077e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.17712219229282308306346195001801048971e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.24578142893420308057222282020407949529e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.23429691331344898578916434987129070432e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41486460551571344910835151948209788541e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.23569151219279213399210115101532416912e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.21438860148387356361258237451828377118e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.46770060692933726695086996017149976796e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.58079984178724940266882149462170567147e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19997796316046571607659704855966005180e-17), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 4.5109e-36 + static const RealType P[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.19610991747326725339429696634365932643e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74646611039453235739153286141429338461e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.13331430865337412098234177873337036811e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.58947311195482646360642638791970923726e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.79226752074485124923797575635082779509e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.73081326043094090549807549513512116319e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05408849431691450650464797109033182773e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.75716486666270246158606737499459843698e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.81075133718930099703621109350447306080e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.41318403854345256855350755520072932140e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.70220987388883118699419526374266655536e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.38711669183547686107032286389030018396e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.31300491679098874872172866011372530771e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.99223939265527640018203019269955457925e-25), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.18316957049006338447926554380706108087e-28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.47298013808154174645356607027685011183e-32), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.42561659771176310412113991024326129105e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.83353398513931409985504410958429204317e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.07254121026393428163401481487563215753e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.36667170168890854756291846167398225330e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.54019749685699795075624204463938596069e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.35321766966107368759516431698755077175e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.13350720091296144188972188966204719103e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.38107118390482863395863404555696613407e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.59267757423034664579822257229473088511e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.29549090773392058626428205171445962834e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.69922128600755513676564327500993739088e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.31337037977667816904491472174578334375e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.28088047429043940293455906253037445768e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.01213369826105495256520034997664473667e-22), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 1.2707e-35 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11172037056341396583040940446061501972e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.09383362521204903801686281772843962372e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.71440982391172647693486692131238237524e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.01685075759372692173396811575536866699e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.36574894913423830789864836789988898151e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.59644999935503505576091023207315968623e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.95573282292603122067959656607163690356e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.10361486103428098366627536344769789255e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.80946231978997457068033851007899208222e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.39341134002270945594553624959145830111e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.72307967968246649714945553177468010263e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41093409238620968003297675770440189200e-24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.70464969040825495565297719377221881609e-28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.25341184125872354328990441812668510029e-32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.54663422572657744572284839697818435372e-36), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.35632539169215377884393376342532721825e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.46975491055790597767445011183622230556e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.51806800870130779095309105834725930741e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.07403939022350326847926101278370197017e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.66046114012817696416892197044749060854e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.16723371111678357128668916130767948114e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.22972796529973974439855811125888770710e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.91073180314665062004869985842402705599e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.43753004383633382914827301174981384446e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.77313206526206002175298314351042907499e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.32850553089285690900825039331456226080e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.85369976595753971532524294793778805089e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.28948021485210224442871255909409155592e-25), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType x_cube = x * x * x; + RealType t = isnormal(x_cube) ? 1 / sqrt(x_cube) : 1 / pow(sqrt(x), 3); + + // Rational Approximation + // Maximum Relative Error: 5.4677e-35 + static const RealType P[7] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.99471140200716338969973029967190934238e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.48481268366645066801385595379873318648e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.64087860141734943856373451877569284231e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.45555576045996041260191574503331698473e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43290677381328916734673040799990923091e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.63011127597770211743774689830589568544e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.61127812511057623691896118746981066174e0), + }; + static const RealType Q[6] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.90660291309478542795359451748753358123e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.60631500002415936739518466837931659008e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.88655117367497147850617559832966816275e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.48350179543067311398059386524702440002e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.18873206560757944356169500452181141647e3), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t; + } + + return result; +} + +template +inline RealType holtsmark_cdf_imp_prec(const RealType& x, bool complement, const std::integral_constant& tag) { + if (x >= 0) { + return complement ? holtsmark_cdf_plus_imp_prec(x, tag) : 1 - holtsmark_cdf_plus_imp_prec(x, tag); + } + else if (x <= 0) { + return complement ? 1 - holtsmark_cdf_plus_imp_prec(-x, tag) : holtsmark_cdf_plus_imp_prec(-x, tag); + } + else { + return std::numeric_limits::quiet_NaN(); + } +} + +template +inline RealType holtsmark_cdf_imp_prec(const RealType& x, bool complement, const std::integral_constant& tag) { + if (x >= 0) { + return complement ? holtsmark_cdf_plus_imp_prec(x, tag) : 1 - holtsmark_cdf_plus_imp_prec(x, tag); + } + else if (x <= 0) { + return complement ? 1 - holtsmark_cdf_plus_imp_prec(-x, tag) : holtsmark_cdf_plus_imp_prec(-x, tag); + } + else { + return std::numeric_limits::quiet_NaN(); + } +} + +template +inline RealType holtsmark_cdf_imp(const holtsmark_distribution& dist, const RealType& x, bool complement) { + // + // This calculates the cdf of the Holtsmark distribution and/or its complement. + // + + BOOST_MATH_STD_USING // for ADL of std functions + static const char* function = "boost::math::cdf(holtsmark<%1%>&, %1%)"; + RealType result = 0; + RealType location = dist.location(); + RealType scale = dist.scale(); + + if (false == detail::check_location(function, location, &result, Policy())) + { + return result; + } + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + if (false == detail::check_x(function, x, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + RealType u = (x - location) / scale; + + result = holtsmark_cdf_imp_prec(u, complement, tag_type()); + + return result; +} + +template +inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (ilogb(p) >= -2) { + RealType t = -log2(ldexp(p, 1)); + + // Rational Approximation + // Maximum Relative Error: 5.8068e-17 + static const RealType P[8] = { + static_cast(7.59789769759814986929e-1), + static_cast(1.27515008642985381862e0), + static_cast(4.38619247097275579086e-1), + static_cast(-1.25521537863031799276e-1), + static_cast(-2.58555599127223857177e-2), + static_cast(1.20249932437303932411e-2), + static_cast(-1.36753104188136881229e-3), + static_cast(6.57491277860092595148e-5), + }; + static const RealType Q[9] = { + static_cast(1), + static_cast(2.48696501912062288766e0), + static_cast(2.06239370128871696850e0), + static_cast(5.67577904795053902651e-1), + static_cast(-2.89022828087034733385e-2), + static_cast(-2.17207943286085236479e-2), + static_cast(3.14098307020814954876e-4), + static_cast(3.51448381406676891012e-4), + static_cast(5.71995514606568751522e-5), + }; + + result = t * tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -3) { + RealType t = -log2(ldexp(p, 2)); + + // Rational Approximation + // Maximum Relative Error: 1.0339e-17 + static const RealType P[8] = { + static_cast(3.84521387984759064238e-1), + static_cast(4.15763727809667641126e-1), + static_cast(-1.73610240124046440578e-2), + static_cast(-3.89915764128788049837e-2), + static_cast(1.07252911248451890192e-2), + static_cast(7.62613727089795367882e-4), + static_cast(-3.11382403581073580481e-4), + static_cast(3.93093062843177374871e-5), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(6.76193897442484823754e-1), + static_cast(3.70953499602257825764e-2), + static_cast(-2.84211795745477605398e-2), + static_cast(2.66146101014551209760e-3), + static_cast(1.85436727973937413751e-3), + static_cast(2.00318687649825430725e-4), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -4) { + RealType t = -log2(ldexp(p, 3)); + + // Rational Approximation + // Maximum Relative Error: 1.4431e-17 + static const RealType P[8] = { + static_cast(4.46943301497773314460e-1), + static_cast(-1.07267614417424412546e-2), + static_cast(-7.21097021064631831756e-2), + static_cast(2.93948745441334193469e-2), + static_cast(-7.33259305010485915480e-4), + static_cast(-1.38660725579083612045e-3), + static_cast(2.95410432808739478857e-4), + static_cast(-2.88688017391292485867e-5), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(-2.72809429017073648893e-2), + static_cast(-7.85526213469762960803e-2), + static_cast(2.41360900478283465241e-2), + static_cast(3.44597797125179611095e-3), + static_cast(-8.65046428689780375806e-4), + static_cast(-1.04147382037315517658e-4), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -6) { + RealType t = -log2(ldexp(p, 4)); + + // Rational Approximation + // Maximum Relative Error: 4.8871e-17 + static const RealType P[10] = { + static_cast(4.25344469980677332786e-1), + static_cast(3.42055470008289997369e-2), + static_cast(9.33607217644370441642e-2), + static_cast(4.57057092587794346086e-2), + static_cast(1.16149976708336017542e-2), + static_cast(6.40479797962035786337e-3), + static_cast(1.58526153828271386329e-3), + static_cast(3.84032908993313260466e-4), + static_cast(6.98960839033991110525e-5), + static_cast(9.66690587477825432174e-6), + }; + static const RealType Q[10] = { + static_cast(1), + static_cast(1.60044610004497775009e-1), + static_cast(2.41675490962065446592e-1), + static_cast(1.13752642382290596388e-1), + static_cast(4.05058759031434785584e-2), + static_cast(1.59432816225295660111e-2), + static_cast(4.79286678946992027479e-3), + static_cast(1.16048151070154814260e-3), + static_cast(2.01755520912887201472e-4), + static_cast(2.82884561026909054732e-5), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -8) { + RealType t = -log2(ldexp(p, 6)); + + // Rational Approximation + // Maximum Relative Error: 4.8173e-17 + static const RealType P[9] = { + static_cast(3.68520435599726877886e-1), + static_cast(8.26682725061327242371e-1), + static_cast(6.85235826889543887309e-1), + static_cast(3.28640408399661746210e-1), + static_cast(9.04801242897407528807e-2), + static_cast(1.57470088502958130451e-2), + static_cast(1.61541023176880542598e-3), + static_cast(9.78919203915954346945e-5), + static_cast(9.71371309261213597491e-8), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(2.29132755303753682133e0), + static_cast(1.95530118226232968288e0), + static_cast(9.55029685883545321419e-1), + static_cast(2.68254036588585643328e-1), + static_cast(4.61398419640231283164e-2), + static_cast(4.66131710581568432246e-3), + static_cast(2.94491397241310968725e-4), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -16) { + RealType t = -log2(ldexp(p, 8)); + + // Rational Approximation + // Maximum Relative Error: 6.0376e-17 + static const RealType P[10] = { + static_cast(3.48432718168951419458e-1), + static_cast(2.99680703419193973028e-1), + static_cast(1.09531896991852433149e-1), + static_cast(2.28766133215975559897e-2), + static_cast(3.09836969941710802698e-3), + static_cast(2.89346186674853481383e-4), + static_cast(1.96344583080243707169e-5), + static_cast(9.48415601271652569275e-7), + static_cast(3.08821091232356755783e-8), + static_cast(5.58003465656339818416e-10), + }; + static const RealType Q[10] = { + static_cast(1), + static_cast(8.73938978582311007855e-1), + static_cast(3.21771888210250878162e-1), + static_cast(6.70432401844821772827e-2), + static_cast(9.05369648218831664411e-3), + static_cast(8.50098390828726795296e-4), + static_cast(5.73568804840571459050e-5), + static_cast(2.78374120155590875053e-6), + static_cast(9.03427646135263412003e-8), + static_cast(1.63556457120944847882e-9), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -32) { + RealType t = -log2(ldexp(p, 16)); + + // Rational Approximation + // Maximum Relative Error: 2.2804e-17 + static const RealType P[10] = { + static_cast(3.41419813138786920868e-1), + static_cast(1.30219412019722274099e-1), + static_cast(2.36047671342109636195e-2), + static_cast(2.67913051721210953893e-3), + static_cast(2.10896260337301129968e-4), + static_cast(1.19804595761611765179e-5), + static_cast(4.91470756460287578143e-7), + static_cast(1.38299844947707591018e-8), + static_cast(2.25766283556816829070e-10), + static_cast(-8.46510608386806647654e-18), + }; + static const RealType Q[9] = { + static_cast(1), + static_cast(3.81461950831351846380e-1), + static_cast(6.91390438866520696447e-2), + static_cast(7.84798596829449138229e-3), + static_cast(6.17735117400536913546e-4), + static_cast(3.50937328177439258136e-5), + static_cast(1.43958654321452532854e-6), + static_cast(4.05109749922716264456e-8), + static_cast(6.61306247924109415113e-10), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -64) { + RealType t = -log2(ldexp(p, 32)); + + // Rational Approximation + // Maximum Relative Error: 4.8545e-17 + static const RealType P[9] = { + static_cast(3.41392032051575965049e-1), + static_cast(1.53372256183388434238e-1), + static_cast(3.33822240038718319714e-2), + static_cast(4.66328786929735228532e-3), + static_cast(4.67981207864367711082e-4), + static_cast(3.48119463063280710691e-5), + static_cast(2.17755850282052679342e-6), + static_cast(7.40424342670289242177e-8), + static_cast(4.61294046336533026640e-9), + }; + static const RealType Q[9] = { + static_cast(1), + static_cast(4.49255524669251621744e-1), + static_cast(9.77826688966262423974e-2), + static_cast(1.36596271675764346980e-2), + static_cast(1.37080296105355418281e-3), + static_cast(1.01970588303201339768e-4), + static_cast(6.37846903580539445994e-6), + static_cast(2.16883897125962281968e-7), + static_cast(1.35121503608967367232e-8), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else { + const static RealType c = ldexp(cbrt(constants::pi()), 1); + + RealType p_square = p * p; + + if (isnormal(p_square)) { + result = 1 / (cbrt(p_square) * c); + } + else if (p > 0) { + result = 1 / (cbrt(p) * cbrt(p) * c); + } + else { + result = std::numeric_limits::infinity(); + } + } + + return result; +} + + +template +inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (ilogb(p) >= -2) { + RealType u = -log2(ldexp(p, 1)); + + if (u < 0.5) { + // Rational Approximation + // Maximum Relative Error: 1.7987e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.59789769759815031687162026655576575384e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.23247138049619855169890925442523844619e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.35351935489348780511227763760731136136e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.17321534695821967609074567968260505604e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30930523792327030433989902919481147250e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.47676800034255152477549544991291837378e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.09952071024064609787697026812259269093e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.65479872964217159571026674930672527880e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.30204907832301876030269224513949605725e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.61038349134944320766567917361933431224e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.17242905696479357297850061918336600969e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.43640101589433162893041733511239841220e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.39406616773257816628641556843884616119e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.54871597065387376666252643921309051097e-7), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.06310038178166385607814371094968073940e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06144046990424238286303107360481469219e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17860081295611631017119482265353540470e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.26319639748358310901277622665331115333e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.25962127567362715217159291513550804588e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.65543974081934423010588955830131357921e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.80331848633772107482330422252085368575e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.97426948050874772305317056836660558275e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.10722999873793200671617106731723252507e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.68871255379198546500699434161302033826e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.70190278641952708999014435335172772138e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.11562497711461468804693130702653542297e-7), + }; + + result = u * tools::evaluate_polynomial(P, u) / (tools::evaluate_polynomial(Q, u) * cbrt(p * p)); + } + else { + RealType t = u - 0.5; + + // Rational Approximation + // Maximum Relative Error: 2.5554e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.63490994331899195346399558699533994243e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.68682839419340144322747963938810505658e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.63089084712442063245295709191126453412e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.24910510426787025593146475670961782647e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.14005632199839351091767181535761567981e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.88144015238275997284082820907124267240e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.12015895125039876623372795832970536355e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.96386756665254981286292821446749025989e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.82855208595003635135641502084317667629e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.18007513930934295792217002090233670917e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.82563310387467580262182864644541746616e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.52830681121195099547078704713089681353e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.91383571211375811878311159248551586411e-8), + }; + static const RealType Q[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96820655322136936855997114940653763917e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30209571878469737819039455443404070107e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.61235660141139249931521613001554108034e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.31683133997030095798635713869616211197e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.20681979279848555447978496580849290723e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.08958899028812330281115719259773001136e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.02478613175545210977059079339657545008e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.68653479132148912896487809682760117627e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.35166554499214836086438565154832646441e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.95409975934011596023165394669416595582e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.84312112139729518216217161835365265801e-7), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + } + else if (ilogb(p) >= -3) { + RealType u = -log2(ldexp(p, 2)); + + if (u < 0.5) { + // Rational Approximation + // Maximum Relative Error: 1.0297e-35 + static const RealType P[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.84521387984759060262188972210005114936e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.70837834325236202821328032137877091515e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.53856963029219911450181095566096563059e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.97659091653089105048621336944687224192e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.77726241585387617566937892474685179582e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21657224955483589784473724186837316423e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.76357400631206366078287330192525531850e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.45967265853745968166172649261385754061e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.08367654892620484522749804048317330020e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.41224530727710207304898458924763411052e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.02908228738160003274584644834000176496e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.05702214080592377840761032481067834813e-7), + }; + static const RealType Q[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33954869248363301881659953529609341564e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.73738626674455393272550888585363920917e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.90708494363306682523722238824373341707e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.49559648492983033200126224112060119905e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.07561158260652000950392950266037061167e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.30349651195547682860585068738648645100e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.21766408404123861757376277367204136764e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.22181499366766592894880124261171657846e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.74488053046587079829684775540618210211e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.90504597668186854963746384968119788469e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.45195198322028676384075318222338781298e-7), + }; + + result = tools::evaluate_polynomial(P, u) / (tools::evaluate_polynomial(Q, u) * cbrt(p * p)); + } + else { + RealType t = u - 0.5; + + // Rational Approximation + // Maximum Relative Error: 1.3688e-35 + static const RealType P[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.34418795581931891732555950599385666106e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.13006013029934051875748102515422669897e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.27990072710518465265454549585803147529e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.82530244963278920355650323928131927272e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.05335741422175616606162502617378682462e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.71242678756797136217651369710748524650e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.65147398836785709305701073315614307906e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.23912765853731378067295654886575185240e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.77861910171412622761254991979036167882e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.11971510714149983297022108523700437739e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23649928279010039670034778778065846828e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.99636080473697209793683863161785312159e-8), + }; + static const RealType Q[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.95056572065373808001002483348789719155e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.55702988004729812458415992666809422570e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.07586989542594910084052301521098115194e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96831670560124470215505714403486118412e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.86445076378084412691927796983792892534e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.75566285003039738258189045863064261980e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.18557444175572723760508226182075127685e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.66667716357950609103712975111660496416e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.70999480357934082364999779023268059131e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.14604868719110256415222454908306045416e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.32724040071094913191419223901752642417e-8), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + } + else if (ilogb(p) >= -4) { + RealType t = -log2(ldexp(p, 3)); + + // Rational Approximation + // Maximum Relative Error: 6.6020e-36 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.46943301497773318715008398224877079279e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.85403413700924949902626248891615772650e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.02791895890363892816315784780533893399e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.89147412486638444082129846251261616763e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.93382251168424191872267997181870008850e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.68332196426082871660060467570049113632e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.88720436260994811649162949644253306037e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.34099304204778307050211441936900839075e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.42970601149275611131932131801993030928e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.19329425598839605828710629592687495198e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.48826007216547106568423189194739111033e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.47132934846160946190230821709692067279e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.34123780321108493820637601375183345528e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.64549285026064221742294542922996905241e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.72723306533295983872420985773212608299e-9), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.23756826160440280076231428938184359865e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.46557011055563840763437682311082689407e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18907861669025579159409035585375166964e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.09998981512549500250715800529896557509e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.09496663758959409482213456915225652712e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.37086325651334206453116588474211557676e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.65325780110454655811120026458133145750e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.93435549562125602056160657604473721758e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.34967558308250784125219085040752451132e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.73883529653464036447550624641291181317e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.88600727347267778330635397957540267359e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.26681383000234695948685993798733295748e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19871610873353691152255428262732390602e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.42468017918888155246438948321084323623e-9), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -5) { + RealType u = -log2(ldexp(p, 4)); + + if (u < 0.5) { + // Rational Approximation + // Maximum Relative Error: 5.0596e-35 + static const RealType P[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.25344469980677353573160570139298422046e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.41915371584999983192100443156935649063e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.02829239548689190780023994008688591230e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29283473326959885625548350158197923999e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.01078477165670046284950196047161898687e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.02714892887893367912743194877742997622e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.43133417775367444366548711083157149060e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34782994090554432391320506638030058071e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.06742736859237185836735105245477248882e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.55982601406660341132288721616681417444e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.57770758189194396236862269776507019313e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.29311341249565125992213260043135188072e-8), + }; + static const RealType Q[12] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.54021943144355190773797361537886598583e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30965787836836308380896385568728211303e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.19314242976592846926644622802257778872e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.84123785238634690769817401191138848504e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.75779029464908805680899310810660326192e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15078294915445673781718097749944059134e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.84667183003626452412083824490324913477e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.59521438712225874821007396323337016693e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.90446539427779905568600432145715126083e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.21425779911599424040614866482614099753e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.00972806247654369646317764344373036462e-8), + }; + + result = tools::evaluate_polynomial(P, u) / (tools::evaluate_polynomial(Q, u) * cbrt(p * p)); + } + else { + RealType t = u - 0.5; + + // Rational Approximation + // Maximum Relative Error: 8.3743e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.08071367192424306005939751362206079160e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.94625900993512461462097316785202943274e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.55970241156822104458842450713854737857e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.07663066299810473476390199553510422731e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.89859986209620592557993828310690990189e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.04002735956724252558290154433164340078e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.28754717941144647796091692241880059406e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19307116062867039608045413276099792797e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.02377178609994923303160815309590928289e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.71739619655097982325716241977619135216e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.70229045058419872036870274360537396648e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.90495731447121207951661931979310025968e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23210708203609461650368387780135568863e-8), + }; + static const RealType Q[11] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.93402256203255215539822867473993726421e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.42452702043886045884356307934634512995e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.16981055684612802160174937997247813645e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.39560623514414816165791968511612762553e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.26014275897567952035148355055139912545e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.42163967753843746501638925686714935099e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.63605648300801696460942201096159808446e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.55933967787268788177266789383155699064e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.41526208021076709058374666903111908743e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.08505866202670144225100385141263360218e-6), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + } + else if (ilogb(p) >= -6) { + RealType t = -log2(ldexp(p, 5)); + + // Rational Approximation + // Maximum Relative Error: 2.4734e-35 + static const RealType P[16] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.92042979500197776619414802317216082414e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.94742044285563829335663810275331541585e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.14525306632578654372860377652983462776e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.88893010132758460781753381176593178775e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.08491462791290535107958214106528611951e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.61374431854187722720094162894017991926e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.11641062509116613779440753514902522337e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.12474548036763970495563846370119556004e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.48140831258790372410036499310440980121e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.26913338169355215445128368312197650848e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.63109797282729701768942543985418804075e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.55296802973076575732233624155433324402e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.72108609713971908723724065216410393928e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.93328436272999507339897246655916666269e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.72119240610740992234979508242967886200e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17836139198065889244530078295061548097e-10), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.78065342260594920160228973261455037923e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.08575070304822733863613657779515344137e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.81185785915044621118680763035984134530e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.87597191269586886460326897968559867853e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07903258768761230286548634868645339678e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.88395769450457864233486684232536503140e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.05678227243099671420442217017131559055e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.24803207742284923122212652186826674987e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06094715338829793088081672723947647238e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.96454433858093590192363331553516923090e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.94509901530299070041475386866323617753e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49001710126540196485963921184736711193e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.58899179756014192338509671769986887613e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.06916561094749601736592488829778059190e-8), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -8) { + RealType t = -log2(ldexp(p, 6)); + + // Rational Approximation + // Maximum Relative Error: 1.1570e-35 + static const RealType P[18] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.68520435599726860132888599110871216319e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.01076105507184082206031922185510102322e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.39912455237662038937400667644545834191e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.51088991221663244634723139723207272560e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.26465949648856746869050310379379898086e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.37079746226805258449355819952819997723e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.49372033421420312720741838903118544951e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.95729572745049276972587492142384353131e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.92794840197452838799536047152725573779e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96897979363475104635129765703613472468e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.44138843334474914059035559588791041371e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.78076328055619970057667292651627051391e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04182093251998194244585085400876144351e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04392999917657413659748817212746660436e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.76006125565969084470924344826977844710e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.21045181507045010640119572995692565368e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.61400097324698003962179537436043636306e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.88084230973635340409728710734906398080e-11), + }; + static const RealType Q[18] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.49319798750825059930589954921919984293e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.90218243410186000622818205955425584848e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.25384789213915993855434876209137054104e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.58563858782064482133038568901836564329e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.39112608961600614189971858070197609546e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29192895265168981204927382938872469754e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.66418375973954918346810939649929797237e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.01606040038159207768769492693779323748e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.75837675697421536953171865636865644576e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30258315910281295093103384193132807400e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.28333635097670841003561009290200071343e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.04871369296490431325621140782944603554e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.05077352164673794093561693258318905067e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.28508157403208548483052311164947568580e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.22527248376737724147359908626095469985e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.75479484339716254784610505187249810386e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.39990051830081888581639577552526319577e-11), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -16) { + RealType t = -log2(ldexp(p, 8)); + + // Rational Approximation + // Maximum Relative Error: 1.1362e-35 + static const RealType P[22] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.48432718168951398420402661878962745094e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.55946442453078865766668586202885528338e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.54912640113904816247923987542554486059e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.60852745978561293262851287627328856197e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.93256608166097432329211369307994852513e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.94707001299612588571704157159595918562e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.40368387009950846525432054396214443833e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.62326983889228773089492130483459202197e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.97166112600628615762158757484340724056e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.95053681446806610424931810174198926457e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.13613767164027076487881255767029235747e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.46627172639536503825606138995804926378e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.26813757095977946534946955553296696736e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.01393212063713249666862633388902006492e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04428602119155661411061942866480445477e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.52977051350929618206095556763031195967e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.63092013964238065197415324341392517794e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.77457116423818347179318334884304764609e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.10372468210274291890669895933038762772e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.85517152798650696598776156882211719502e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.01916800572423194619358228507804954863e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.72241483171311778625855302356391965266e-26), + }; + static const RealType Q[21] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.18341916009800042837726003154518652168e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19215655980509256344434487727207541208e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34380326549827252189214516628038733750e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.65069135930665131327262366757787760402e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74132905027750048531814627726862962404e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.11184893124573373947875834716323223477e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.68456853089572312034718359282699132364e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16340806625223749486884390838046244494e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.45007766006724826837429360471785418874e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.50443251593190111677537955057976277305e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30829464745241179175728900376502542995e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.57256894336319418553622695416919409120e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.89973763917908403951538315949652981312e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.05834675579622824896206540981508286215e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32721343511724613011656816221169980981e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.77569292346900432492044041866264215291e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.39903737668944675386972393000746368518e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.23200083621376582032771041306045737695e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.43557805626692790539354751731913075096e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.91326410956582998375100191562832969140e-20), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -32) { + RealType t = -log2(ldexp(p, 16)); + + // Rational Approximation + // Maximum Relative Error: 9.1729e-35 + static const RealType P[19] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.41419813138786928653984591611599949126e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.94225020281693988785012368481961427155e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.28967134188573605597955859185818311256e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.16617725083935565014535265818666424029e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.13379610773944032381149443514208866162e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06508483032198116332154635763926628153e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.89315471210589177037346413966039863126e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.72993906450633221200844495419180873066e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.32883391567312244751716481903540505335e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.50998889887280885500990101116973130081e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.23247766687180294767338042555173653249e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.12326475887709255500757383109178584638e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.11688319088825228685832870139320733695e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.95381542569360703428852622701723193645e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.70730387484749668293167350494151199659e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.84243405919322052861165273432136993833e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.40860917180131228318146854666419586211e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.85122374200561402546731933480737679849e-30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.79744248200459077556218062241428072826e-32), + }; + static const RealType Q[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.68930884381361438749954611436694811868e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.54944129151720429074748655153760118465e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.68493670923968273171437877298940102712e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.32109946297461941811102221103314572340e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.11983030120265263999033828442555862122e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.31204888358097171713697195034681853057e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.38548604936907265274059071726622071821e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.82158855359673890472124017801768455208e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.78564556026252472894386810079914912632e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.46854501887011863360558947087254908412e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.67236380279070121978196383998000020645e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.20076045812548485396837897240357026254e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15814123143437217877762088763846289858e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.67177999717442465582949551415385496304e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.71135001552136641449927514544850663366e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.98449056954034104266783180068258117013e-22), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -64) { + RealType t = -log2(ldexp(p, 32)); + + // Rational Approximation + // Maximum Relative Error: 1.8330e-35 + static const RealType P[19] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.41392032051575981622151194498090952488e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32651097995974052731414709779952524875e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.51927763729719814565225981452897995722e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.11148082477882981299945196621348531180e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.80457559655975695558885644380771202301e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96223001525552834934139567532649816367e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.10625449265784963560596299595289620029e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.14785887121654524328854820350425279893e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.00832358736396150660417651391240544392e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.63128732906298604011217701767305935851e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.86148432181465165445355560568442172406e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.44088921565424320298916604159745842835e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.95220124898384051195673049864765987092e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.50531060529388128674128631193212903032e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06119051130826148039530805693452156757e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19849873960405145967462029876325494393e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.66833600176986734600260382043861669021e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.07829060832934383885234817363480653925e-26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21485411177823993142696645934560017341e-40), + }; + static const RealType Q[18] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.88559444380290379529260819350179144435e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.37942717465159991856146428659881557553e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.11409915376157429952160202733757574026e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.21511733003564236929107862750700281202e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.74773232555012468159223116269289241483e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.24042271031862389840796415749527818562e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.50790246845873571117791557191071320982e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.88274886666078071130557536971927872847e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.94242592538917360235050248151146832636e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.45262967284548223426004177385213311949e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30081806380053435857465845326686775489e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.62226426496757450797456131921060042081e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.40933140159573381494354127717542598424e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.03760580312376891985077265621432029857e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.43980683769941233230954109646012150124e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.88686274782816858372719510890126716148e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.07336140055510452905474533727353308321e-25), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else if (ilogb(p) >= -128) { + RealType t = -log2(ldexp(p, 64)); + + // Rational Approximation + // Maximum Relative Error: 5.9085e-35 + static const RealType P[18] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.41392031627647840832213878541731833340e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.48256908849985263191468999842405689327e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.16515822909144946601084169745484248278e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.42246334265547596187501472291026180697e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.54145961608971551335283437288203286104e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.64840354062369555376354747633807898689e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.38246669464526050793398379055335943951e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29684566081664150074215568847731661446e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.98456331768093420851844051941851740455e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.36738267296531031235518935656891979319e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.08128287278026286279504717089979753319e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.38334581618709868951669630969696873534e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.08478537820365448038773095902465198679e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30768169494950935152733510713679558562e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.49254243621461466892836128222648688091e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.17026357413798368802986708112771803774e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.05630817682870951728748696694117980745e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.13881361534205323565985756195674181203e-50), + }; + static const RealType Q[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.34271731953273239599863811873205236246e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.27133013035186849060586077266046297964e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29542078693828543540010668640353491847e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33027698228265344545932885863767276804e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06868444562964057780556916100143215394e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.97868278672593071061800234869603536243e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.79869926850283188735312536038469293739e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.75298857713475428365153491580710497759e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.93449891515741631851202042430818496480e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.36715626731277089013724968542144140938e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.98125789528264426869121548546848968670e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.78234546049400950521459021508632294206e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.83044000387150792643468853129175805308e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.30111486296552039388613073915170671881e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.28628462422858134962149154420358876352e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.48108558735886480279744474396456699335e-21), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * cbrt(p * p)); + } + else { + const static RealType c = ldexp(cbrt(constants::pi()), 1); + + RealType p_square = p * p; + + if (isnormal(p_square)) { + result = 1 / (cbrt(p_square) * c); + } + else if (p > 0) { + result = 1 / (cbrt(p) * cbrt(p) * c); + } + else { + result = std::numeric_limits::infinity(); + } + } + + return result; +} + +template +inline RealType holtsmark_quantile_imp_prec(const RealType& p, bool complement, const std::integral_constant& tag) +{ + if (p > 0.5) { + return holtsmark_quantile_imp_prec(1 - p, !complement, tag); + } + + return complement ? holtsmark_quantile_upper_imp_prec(p, tag) : -holtsmark_quantile_upper_imp_prec(p, tag); +} + +template +inline RealType holtsmark_quantile_imp_prec(const RealType& p, bool complement, const std::integral_constant& tag) +{ + if (p > 0.5) { + return holtsmark_quantile_imp_prec(1 - p, !complement, tag); + } + + return complement ? holtsmark_quantile_upper_imp_prec(p, tag) : -holtsmark_quantile_upper_imp_prec(p, tag); +} + +template +inline RealType holtsmark_quantile_imp(const holtsmark_distribution& dist, const RealType& p, bool complement) +{ + // This routine implements the quantile for the Holtsmark distribution, + // the value p may be the probability, or its complement if complement=true. + + static const char* function = "boost::math::quantile(holtsmark<%1%>&, %1%)"; + BOOST_MATH_STD_USING // for ADL of std functions + + RealType result = 0; + RealType scale = dist.scale(); + RealType location = dist.location(); + + if (false == detail::check_location(function, location, &result, Policy())) + { + return result; + } + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + if (false == detail::check_probability(function, p, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + result = location + scale * holtsmark_quantile_imp_prec(p, complement, tag_type()); + + return result; +} + +template +inline RealType holtsmark_entropy_imp_prec(const std::integral_constant& tag) +{ + return static_cast(2.06944850513462440032); +} + +template +inline RealType holtsmark_entropy_imp_prec(const std::integral_constant& tag) +{ + return BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.0694485051346244003155800384542166381); +} + +template +inline RealType holtsmark_entropy_imp(const holtsmark_distribution& dist) +{ + // This implements the entropy for the Holtsmark distribution, + + static const char* function = "boost::math::entropy(holtsmark<%1%>&, %1%)"; + BOOST_MATH_STD_USING // for ADL of std functions + + RealType result = 0; + RealType scale = dist.scale(); + + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + result = holtsmark_entropy_imp_prec(tag_type()) + log(scale); + + return result; +} + +} // detail + +template > +class holtsmark_distribution +{ + public: + typedef RealType value_type; + typedef Policy policy_type; + + holtsmark_distribution(RealType l_location = 0, RealType l_scale = 1) + : mu(l_location), c(l_scale) + { + static const char* function = "boost::math::holtsmark_distribution<%1%>::holtsmark_distribution"; + RealType result = 0; + detail::check_location(function, l_location, &result, Policy()); + detail::check_scale(function, l_scale, &result, Policy()); + } // holtsmark_distribution + + RealType location()const + { + return mu; + } + RealType scale()const + { + return c; + } + + private: + RealType mu; // The location parameter. + RealType c; // The scale parameter. +}; + +typedef holtsmark_distribution holtsmark; + +#ifdef __cpp_deduction_guides +template +holtsmark_distribution(RealType) -> holtsmark_distribution::type>; +template +holtsmark_distribution(RealType, RealType) -> holtsmark_distribution::type>; +#endif + +template +inline const std::pair range(const holtsmark_distribution&) +{ // Range of permissible values for random variable x. + if (std::numeric_limits::has_infinity) + { + return std::pair(-std::numeric_limits::infinity(), std::numeric_limits::infinity()); // - to + infinity. + } + else + { // Can only use max_value. + using boost::math::tools::max_value; + return std::pair(-max_value(), max_value()); // - to + max. + } +} + +template +inline const std::pair support(const holtsmark_distribution&) +{ // Range of supported values for random variable x. + // This is range where cdf rises from 0 to 1, and outside it, the pdf is zero. + if (std::numeric_limits::has_infinity) + { + return std::pair(-std::numeric_limits::infinity(), std::numeric_limits::infinity()); // - to + infinity. + } + else + { // Can only use max_value. + using boost::math::tools::max_value; + return std::pair(-tools::max_value(), max_value()); // - to + max. + } +} + +template +inline RealType pdf(const holtsmark_distribution& dist, const RealType& x) +{ + return detail::holtsmark_pdf_imp(dist, x); +} // pdf + +template +inline RealType cdf(const holtsmark_distribution& dist, const RealType& x) +{ + return detail::holtsmark_cdf_imp(dist, x, false); +} // cdf + +template +inline RealType quantile(const holtsmark_distribution& dist, const RealType& p) +{ + return detail::holtsmark_quantile_imp(dist, p, false); +} // quantile + +template +inline RealType cdf(const complemented2_type, RealType>& c) +{ + return detail::holtsmark_cdf_imp(c.dist, c.param, true); +} // cdf complement + +template +inline RealType quantile(const complemented2_type, RealType>& c) +{ + return detail::holtsmark_quantile_imp(c.dist, c.param, true); +} // quantile complement + +template +inline RealType mean(const holtsmark_distribution &dist) +{ + return dist.location(); +} + +template +inline RealType variance(const holtsmark_distribution& /*dist*/) +{ + return std::numeric_limits::infinity(); +} + +template +inline RealType mode(const holtsmark_distribution& dist) +{ + return dist.location(); +} + +template +inline RealType median(const holtsmark_distribution& dist) +{ + return dist.location(); +} + +template +inline RealType skewness(const holtsmark_distribution& /*dist*/) +{ + // There is no skewness: + typedef typename Policy::assert_undefined_type assert_type; + static_assert(assert_type::value == 0, "assert type is undefined"); + + return policies::raise_domain_error( + "boost::math::skewness(holtsmark<%1%>&)", + "The Holtsmark distribution does not have a skewness: " + "the only possible return value is %1%.", + std::numeric_limits::quiet_NaN(), Policy()); // infinity? +} + +template +inline RealType kurtosis(const holtsmark_distribution& /*dist*/) +{ + // There is no kurtosis: + typedef typename Policy::assert_undefined_type assert_type; + static_assert(assert_type::value == 0, "assert type is undefined"); + + return policies::raise_domain_error( + "boost::math::kurtosis(holtsmark<%1%>&)", + "The Holtsmark distribution does not have a kurtosis: " + "the only possible return value is %1%.", + std::numeric_limits::quiet_NaN(), Policy()); +} + +template +inline RealType kurtosis_excess(const holtsmark_distribution& /*dist*/) +{ + // There is no kurtosis excess: + typedef typename Policy::assert_undefined_type assert_type; + static_assert(assert_type::value == 0, "assert type is undefined"); + + return policies::raise_domain_error( + "boost::math::kurtosis_excess(holtsmark<%1%>&)", + "The Holtsmark distribution does not have a kurtosis: " + "the only possible return value is %1%.", + std::numeric_limits::quiet_NaN(), Policy()); +} + +template +inline RealType entropy(const holtsmark_distribution& dist) +{ + return detail::holtsmark_entropy_imp(dist); +} + +}} // namespaces + + +#endif // BOOST_STATS_HOLTSMARK_HPP diff --git a/test/test_holtsmark.cpp b/test/test_holtsmark.cpp new file mode 100644 index 0000000000..8f34124d14 --- /dev/null +++ b/test/test_holtsmark.cpp @@ -0,0 +1,795 @@ +// Copyright Takuma Yoshimura 2024. +// 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) + +#define BOOST_TEST_MODULE StatsHoltsmarkTest +#include +#include + +#include +using boost::math::holtsmark_distribution; +using boost::multiprecision::cpp_bin_float_quad; + +template +void do_test_holtsmark_pdf(){ + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + holtsmark_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.36729417918039395222067998266923903487897550760740e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.65389736963758327689008908803579458127136270822821e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.02515191704410688567167143509210415364664018836038e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51083986231955529936787758130352472694082331202869e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.15094236163249353135030241188004077293096105502542e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.99750209903363198419241505065146206315152726747464e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.11488945306717663129360225856869217115733169200098e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.57635410598104651856363821355027691095093972951943e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.45396231261375200568114750897618690566092315194568e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.56644599840900478087175884712634478003230341866094e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.07991505579130717014680432847812811882295188855215e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21504440259916207727077397273468920426729181666284e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.36133628073378183373326886775069575640127303211029e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.51745548085348400860371488668500734429223868343929e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.68134487107062900924723590620591092812119992658420e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85018067925573560771430043931430243630326746823000e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.02038159607840130388931544845552929991729709746772e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.10468477092312109723487937526691724501188944561469e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18768434960425041116444711570747254236793293668156e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.26876533945661456653252880545328465490361724757011e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.34729279420630671501163324236373491976559833675371e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.42262031889641529582832839126322520342094549884605e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.49409942058625893002692983261905908575520500298169e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.56108951988457608160176526934999395388199046235972e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.62296840354090035789597147663858548813023471783846e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.67914286936215258107106284322230987052088197806732e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.72905929336501384188469491706325278582273134014420e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.77221383677408177290219591627664575751370295766362e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.80816200831657887972174538033323818453141437738815e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.83652730587590691770044766018047580182775092180058e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.85700868106012048340895194764008089858950037497619e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.86938660017923959009561433879636172948429661600328e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.87352751452164445024482162286994868261727837966217e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.86938660017923959009561433879636172948429661600328e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.85700868106012048340895194764008089858950037497619e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.83652730587590691770044766018047580182775092180058e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.80816200831657887972174538033323818453141437738815e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.77221383677408177290219591627664575751370295766362e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.72905929336501384188469491706325278582273134014420e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.67914286936215258107106284322230987052088197806732e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.62296840354090035789597147663858548813023471783846e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.56108951988457608160176526934999395388199046235972e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.49409942058625893002692983261905908575520500298169e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.42262031889641529582832839126322520342094549884605e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.34729279420630671501163324236373491976559833675371e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.26876533945661456653252880545328465490361724757011e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18768434960425041116444711570747254236793293668156e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.10468477092312109723487937526691724501188944561469e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.02038159607840130388931544845552929991729709746772e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85018067925573560771430043931430243630326746823000e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.68134487107062900924723590620591092812119992658420e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.51745548085348400860371488668500734429223868343929e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.36133628073378183373326886775069575640127303211029e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21504440259916207727077397273468920426729181666284e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.07991505579130717014680432847812811882295188855215e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.56644599840900478087175884712634478003230341866094e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.45396231261375200568114750897618690566092315194568e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.57635410598104651856363821355027691095093972951943e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.11488945306717663129360225856869217115733169200098e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.99750209903363198419241505065146206315152726747464e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.15094236163249353135030241188004077293096105502542e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51083986231955529936787758130352472694082331202869e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.02515191704410688567167143509210415364664018836038e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.65389736963758327689008908803579458127136270822821e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.36729417918039395222067998266923903487897550760740e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.66754576694881156512310862711445437434536539665220e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.11173604765480684115169149814306652067264621028219e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.40661030133408839114013026681116038222350468593972e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(6)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.22346322254737897976061662951210609505224644527458e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(6.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.37441612177611972649583292419049409747033180591176e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.74744460065068339118467750880557414156817094839507e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.27304026309950351561235691054710976330201642992015e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90649774685568282389553481307707005424869182652166e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38767874243521145729361398147898730301527980427894e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.04777602492944046116536405570429208835346612226751e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.14427312838534546510639939284636768866987456541955e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.48125490715334110982111302156190976484065179596964e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.25926848543648125740563360613612653857829343973075e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.33819608589296696976594994753563070519825392999328e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62882342819480981578669644070664737082208227167328e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.07231582988207590928480356376941073734041404814646e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.27006701837892764913571864450685488819589225207004e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73366906892470965030093227280098921046549874789447e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.35957320021440204694920969306620767773792096574145e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.08962051920666002556891360954800856160496745325982e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.89257005093845424113694708405490444536741708307432e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.36985573727704971748849427466806366268717813920884e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.18908057108330090847508167263164576897080536147998e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.25741312407933720816582583160953651639222885045617e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.90521803068812235229266578780465914597024834788499e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(40)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.99440098605222381975051163529379005706849379136631e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(44)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.35556983515831713649398537010595127693244595946631e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(48)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.89252591391344813399503397931059007207167187335384e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(52)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.54761819718387004182264813450582914982582239574760e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(56)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28473144505453904388319480756963924103363111590946e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(60)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.08038477619830474574170723303117982155643976342020e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(64)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.18821097500148811906668422616947735567544539343910e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(72)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.83770756909753597744679176403606964363170824955403e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(80)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.25030682765210472090258978149127752580598842866547e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(88)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.13470581474698689445958562292807701026370826971490e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(96)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.32481553840568432886657947564022812389544240910245e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(104)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.72079249234488105623103527050493983216840056389979e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(112)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.25993583492605042781181768463472827114252734385354e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(120)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90139785097711606987697985776461422964227374409867e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(128)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61772178749879746562419160426660201168856327635754e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(256)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.85568203412051586615998003517909621954036193765824e-7), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(512)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.04563780918059698346140819518179336362098891429611e-8), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1024)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.91792339891869109849236922708731694322153177924824e-9), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2048)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.57638176923363231335450711092364627257129748508825e-9), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4096)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.78661356398095539721893167504764083609118624639856e-10), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8192)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.92604459926540711296353370623384343787650705186643e-11), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(16384)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.70807462044367666228538283653300633948804226008283e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(32768)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.53938313936621297172285881159282265471330118114236e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(65536)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.72126969520581558576219170420297785383800313247716e-13), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(131072)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.81057004571925961169117504945825287978291651680376e-14), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(262144)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.50396638201843310535816082381660912483279969324341e-15), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(524288)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50330305081854272655464104542050109297998338121296e-15), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1048576)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.65748943908780839905864199570025333227786061957216e-16), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2097152)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.69782199924985143903444545973473854205301886566784e-17), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4194304)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.30465447555059221873312238790689561215989143051468e-18), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8388608)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.46806937341565301230797169380667244412810953871153e-18), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(16777216)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.59520452276585659227559942516968833301265805493281e-19), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(33554432)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.58771679139660099100514647692148711295768774585921e-20), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(67108864)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.11001413331373018059574227843565648889473010676660e-21), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.34217728e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43366149729083958029796238740037446793377590904146e-21), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.68435456e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.53437941664766678806680232945039585344994407777604e-22), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.36870912e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.48019217902582750507529988918628139079404963189635e-23), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.073741824e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.91993567701892984811136675864172386794777828712695e-24), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.147483648e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40006005594525679129869441468227938628239752074460e-24), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.294967296e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.47497989906821913751146663525981445654490373951224e-25), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7179869184e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.73431218458810807033921781897016124929992555367139e-27), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(6.8719476736e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.41697255768378077454412606000376285104775580444420e-28), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.74877906944e11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.55303924276181374957661287953452523234530316565188e-30), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.099511627776e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.36032476336306675100543445227730858361169873925804e-31), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.398046511104e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.37601488550958357902586661939110889053699438042016e-33), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7592186044416e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.30500465172174486774768816059192932509423715417166e-34), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.0368744177664e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.20313953663045271143891020576861031160487434865093e-36), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.81474976710656e14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.25098110519701647231401040429952006498171313622520e-37), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.125899906842624e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.03431595374067647597712273413788666502302011992057e-39), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.503599627370496e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.19822373554396139874268836303925702273981755123190e-40), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8014398509481984e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.86944917357487937107083766130282172728072819621788e-42), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.2057594037927936e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.14670286674214980345963428973545770896346187182759e-43), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.88230376151711744e17)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.70844645856921813581135618689921390269372237700480e-45), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.152921504606846976e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.09638951830288066744104877057303202280205793138993e-46), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.611686018427387904e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.55121724469650208575327739326222025805731763269349e-48), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8446744073709551616e19)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.04725538896765690179789918481715848637732139291593e-49), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.95147905179352825856e20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.99927284078872744316201092259372825667966088624440e-52), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.722366482869645213696e21)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.95241488358274164371290129159422806319923560612665e-55), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.5557863725914323419136e22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90665515974877113643838016757246988460215123083510e-58), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.208925819614629174706176e24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.86196792944215931292810563239498984002947733280447e-61), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.9342813113834066795298816e25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.81832805609585870403135315663573226135611325562940e-64), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.09485009821345068724781056e26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.77571099228111201565561831702708228641500206234884e-67), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.951760157141521099596496896e27)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73409276589952345278868976272176004532614982149466e-70), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.9228162514264337593543950336e28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.69344996669875337186395484640796879426380291665101e-73), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.267650600228229401496703205376e30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.65375973310425133971089340469528202564824480281467e-76), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.0282409603651670423947251286016e31)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61499973935962044893641934052273635317211406169375e-79), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.24518553658426726783156020576256e32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.57714818296837934466447201222923471989464263831856e-82), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.192296858534827628530496329220096e33)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.54018377243005795377389844944261203114711195148214e-85), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8.3076749736557242056487941267521536e34)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50408571526372847048232270453380081166710151511926e-88), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.329227995784915872903807060280344576e36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.46883370631223483445539326614628985514365382335866e-91), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.1267647932558653966460912964485513216e37)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43440791632054183052284498647098618666372443687369e-94), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.40282366920938463463374607431768211456e38)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40078898078177913136996580710057244791379339538446e-97), tolerance); +} + +template +void do_test_holtsmark_cdf() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + holtsmark_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.05754562114095147060025732340404110273918791128410e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.43368449353064312968788810247763526151579823896375e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.89152652981222928500336992235218785823347685619486e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.45576815036790322986175114501424442292398775002753e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.15978035591850473786135203626730317231876547935253e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.04840867577215219812315602202859291564396444891271e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.18107352643844092577238041212187564083206726822056e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.63452659158632535349648745626466375370661702427253e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.05039829654829170780787685299557006719608839147146e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.16290125976286647650587923507379034571826555851855e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.29006094814340314434551699445775276932192677014796e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43337488600334723245402521343673257218591019586678e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.59428804524998597404889957316726146572475641692056e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.77411943695232738645173996334900914289694617802622e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.97397674713122675501528813572074060920189377220435e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.19466281873758062089629668872911218009781881016957e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.43657975600729535499895880792984203156689462603233e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.56549331000915958092357114949075709547374035120716e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.69963821328456787766164921360924665804748003656962e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.83891389704828738280543932012082190429368746897774e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.98318069008956501931929973721256792184639224594009e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.13225883262651243874304479279543149837428487068880e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.28592804901375835801811223649103787689862120396348e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.44392772657854742558827130471487286937515502098876e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.60595773518728397925852903878144782668636743128847e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.77167990746831553875195022302050315427406387091454e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.94072018335986771952143399033763464047462959349960e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.11267140533666880513239944176560287064005137544504e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.28709673289702231328042170648699212093305785288837e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.46353362731996489993314637378816744341919505345430e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.64149834100915287958166424201293669944118353975980e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.82049083059559169016945833205795772857456974521089e-1), tolerance); + BOOST_CHECK_EQUAL(cdf(dist, static_cast(0)), static_cast(0.5)); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.17950916940440830983054166794204227142543025478911e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.35850165899084712041833575798706330055881646024020e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.53646637268003510006685362621183255658080494654570e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.71290326710297768671957829351300787906694214711163e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.88732859466333119486760055823439712935994862455496e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.05927981664013228047856600966236535952537040650040e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.22832009253168446124804977697949684572593612908546e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.39404226481271602074147096121855217331363256871153e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.55607227342145257441172869528512713062484497901124e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.71407195098624164198188776350896212310137879603652e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.86774116737348756125695520720456850162571512931120e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.01681930991043498068070026278743207815360775405991e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.16108610295171261719456067987917809570631253102226e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.30036178671543212233835078639075334195251996343038e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.43450668999084041907642885050924290452625964879284e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.56342024399270464500104119207015796843310537396767e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.80533718126241937910370331127088781990218118983044e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.02602325286877324498471186427925939079810622779565e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.22588056304767261354826003665099085710305382197378e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.40571195475001402595110042683273853427524358307944e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.56662511399665276754597478656326742781408980413322e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.70993905185659685565448300554224723067807322985204e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.83709874023713352349412076492620965428173444148145e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94960170345170829219212314700442993280391160852854e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.13654734084136746465035125437353362462933829757275e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.28189264735615590742276195878781243591679327317794e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.39515913242278478018768439779714070843560355510873e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.48402196440814952621386479637326968276812345206475e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.55442318496320967701382488549857555770760122499725e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.61084734701877707149966300776478121417665231438051e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.65663155064693568703121118975223647384842017610363e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.69424543788590485293997426765959588972608120887159e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(4.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.75181239051510561995724918481437181225561682663730e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.79330912859883809209439632732487322514831404016950e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(5.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.82433333964997258238374422700352745232108521574338e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(6)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.84823776850456273960749947374965581355459282720918e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(6.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.86712078422837181984231917376692653955733800370589e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(7)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.88234978933381804514525314568892574021644736001062e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(7.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.89484817977790488434819448808352507951600536883956e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.90525915297517643347206332876433307912297417265919e-1), tolerance); +} + +template +void do_test_holtsmark_ccdf() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + holtsmark_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-2))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94960170345170829219212314700442993280391160852854e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.83709874023713352349412076492620965428173444148145e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.70993905185659685565448300554224723067807322985204e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.56662511399665276754597478656326742781408980413322e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.40571195475001402595110042683273853427524358307944e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.22588056304767261354826003665099085710305382197378e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.02602325286877324498471186427925939079810622779565e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.80533718126241937910370331127088781990218118983044e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.56342024399270464500104119207015796843310537396767e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.9375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.43450668999084041907642885050924290452625964879284e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.30036178671543212233835078639075334195251996343038e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.8125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.16108610295171261719456067987917809570631253102226e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.01681930991043498068070026278743207815360775405991e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.6875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.86774116737348756125695520720456850162571512931120e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.71407195098624164198188776350896212310137879603652e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.5625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.55607227342145257441172869528512713062484497901124e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.39404226481271602074147096121855217331363256871153e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.4375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.22832009253168446124804977697949684572593612908546e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.05927981664013228047856600966236535952537040650040e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.3125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.88732859466333119486760055823439712935994862455496e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.71290326710297768671957829351300787906694214711163e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.1875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.53646637268003510006685362621183255658080494654570e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.35850165899084712041833575798706330055881646024020e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.0625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.17950916940440830983054166794204227142543025478911e-1), tolerance); + BOOST_CHECK_EQUAL(cdf(complement(dist, static_cast(0))), static_cast(0.5)); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.0625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.82049083059559169016945833205795772857456974521089e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.64149834100915287958166424201293669944118353975980e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.1875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.46353362731996489993314637378816744341919505345430e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.28709673289702231328042170648699212093305785288837e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.3125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.11267140533666880513239944176560287064005137544504e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.94072018335986771952143399033763464047462959349960e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.4375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.77167990746831553875195022302050315427406387091454e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.60595773518728397925852903878144782668636743128847e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.5625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.44392772657854742558827130471487286937515502098876e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.28592804901375835801811223649103787689862120396348e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.6875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.13225883262651243874304479279543149837428487068880e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.98318069008956501931929973721256792184639224594009e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.8125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.83891389704828738280543932012082190429368746897774e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.69963821328456787766164921360924665804748003656962e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.9375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.56549331000915958092357114949075709547374035120716e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.43657975600729535499895880792984203156689462603233e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.19466281873758062089629668872911218009781881016957e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.97397674713122675501528813572074060920189377220435e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.77411943695232738645173996334900914289694617802622e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.59428804524998597404889957316726146572475641692056e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43337488600334723245402521343673257218591019586678e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.29006094814340314434551699445775276932192677014796e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.16290125976286647650587923507379034571826555851855e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.05039829654829170780787685299557006719608839147146e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.63452659158632535349648745626466375370661702427253e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.18107352643844092577238041212187564083206726822056e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.04840867577215219812315602202859291564396444891271e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.15978035591850473786135203626730317231876547935253e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.45576815036790322986175114501424442292398775002753e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.89152652981222928500336992235218785823347685619486e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.43368449353064312968788810247763526151579823896375e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.05754562114095147060025732340404110273918791128410e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.48187609484894380042750815185628187744383173362701e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.06690871401161907905603672675126774851685959830498e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.75666660350027417616255772996472547678914784256620e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.51762231495437260392500526250344186445407172790817e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.32879215771628180157680826233073460442661996294112e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.17650210666181954854746854311074259783552639989383e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.05151820222095115651805511916474920483994631160437e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.47408470248235665279366712356669208770258273408139e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.84633233633455623701916449563937321750458546930453e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.63980919776847052871529866313101745651230650390958e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.71560271091813267790502831701953317735310509411390e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.98877952779840995427042841099634486251917561421235e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.40474538743684446341559852404247422921805516802754e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.92694975034713587589009244180464471384939103569360e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.53008216069181937774819568728358865566934398876406e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.19610991747326725339429696634365931201323237447865e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.66754697245984312281273324441306444625571550964874e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.27055303995134836245432119316955904009319977641407e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.96335385591609284864855802297989450933958012331026e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.71983068404058084817697571696065106175519154567134e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.52289416073896095009461377823763903270627907120760e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.36093802515022944719982175339249822123873546752029e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.22583027731897389283291308558313649709444449306352e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.11172037056341396583040940446061500559620114648017e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.30343276748924876383449972567328892540120922780153e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(40))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.93479451609843506274951848311637162210971363421001e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(44))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.87195324030611990483144403072151789810819131065125e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(48))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.02706331251660616582062908165140543120249377843861e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(52))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.34227281260431186934023112980425214646324423530835e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(56))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.77808682390572890160969127059116197868923042197157e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(60))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.30671561098656496307105837586195479010992455366704e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(64))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.90809577465797739887717333706777298095814323854594e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(72))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.27353325758395877256315285908308787899438871193344e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(80))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.79392283157821028307612118603031347679870090601645e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(88))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.42100764912263851750335808792156725434230560510519e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(96))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.12427366298380215713674931256380175628765437052256e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(104))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.88357904993849478063900853297202135211787374336745e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(112))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.68514784935653217641685603828708555083243580835252e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(120))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.51927236784831507287987712585213807190192778503378e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(128))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.37893523202524132194116984313653211252949573780743e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.87179879353850251536193247663317269917137569329013e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(512))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.72200715673082274403568012456413425331659480927047e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1024))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.08767256634253255597053159005214917567906016620942e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2048))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.15224951834965340756402503731619739933629215689572e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4096))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.60926645137475638433041259135060814007792759468100e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8192))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.69027136710097153757239920401079588116557633592788e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16384))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.51153240121827639330112195094153363441740650435701e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(32768))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.36283287602527689849064009106938913094716520594050e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(65536))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.18894075854698171408179022464997418218329601220535e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(131072))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.20354010552543796231728241342645692784842686349965e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(262144))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.48617582449547816069323420820736862370145659607645e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(524288))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.25442497729649541267939242007563203416972765165476e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1048576))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85771976129306035185873711236944017216967773980517e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2097152))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.56803119746276025902637885330726865801883592203156e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4194304))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.32214969859659307190062902673645385449168267230206e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8388608))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.21003899305378486738410997502574389330326609057126e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16777216))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.90268712277390815798081242324390081166198190434103e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(33554432))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.02625487407274396069298698869802596448489279633645e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(67108864))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62835890339366126281650716118851052269284048205938e-13), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.34217728e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28281859258171445903392888079435183340041265714998e-13), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.68435456e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.53544862923055721373031196622890601888700626111182e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.36870912e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.60352324072570315319362346398633880353985161880622e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.073741824e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.66931078653639661641440656550426788294070266782671e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.147483648e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.00440405090690395389846895694672344247801107283103e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.294967296e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.08663848317021453602605776312368607691806298813143e-16), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7179869184e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.85829810396272422714320494875293186097734524880995e-17), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6.8719476736e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10728726299533984178525425523566315206520781873938e-17), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.74877906944e11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38410907874417469494912307476988489629927133322828e-18), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.099511627776e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73013634843021835192352185216943643167993641440545e-19), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.398046511104e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.16267043553777293728520200407227686276581114275508e-20), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7592186044416e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.70333804442221617119725245647479628568092558840977e-21), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.0368744177664e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.37917255552777021393262025049731570198920941773050e-22), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.81474976710656e14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.22396569440971276740578385685661655637545268535833e-23), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.125899906842624e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.27995711801214095925566865602936005935821644314758e-24), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.503599627370496e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.59994639751517619906934188799897966230541134026964e-25), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8014398509481984e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.24993299689397024883663924561783076352358304956329e-26), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.2057594037927936e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.03124162461174628110457931016502737959110130110786e-26), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.88230376151711744e17))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28905203076468285138072404465359649544991622324619e-27), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.152921504606846976e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61131503845585356422590504127751316165005771606733e-28), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.611686018427387904e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.01414379806981695528238129932509731805283190086691e-29), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8446744073709551616e19))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51767974758727119410297662380140381412701796292469e-30), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.95147905179352825856e20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.93387460560511124078590097461169759773383672872924e-32), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.722366482869645213696e21))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.14667907125798631372797027282887330061342582520339e-34), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.5557863725914323419136e22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.60418604884060361519995355129506804305208883665969e-36), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.208925819614629174706176e24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50065407013134431487499274238985426822797191535889e-37), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.9342813113834066795298816e25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.34477198458022549199217615998414729133523646527342e-39), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.09485009821345068724781056e26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.66370622590660233123777524997523014264365635070860e-41), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.951760157141521099596496896e27))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.72454097797906614255902382808629709787906142136400e-43), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.9228162514264337593543950336e28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94459527809229084774847473138483921543599314796577e-45), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.267650600228229401496703205376e30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.39759301220192044496069917677888112741187383092503e-46), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.0282409603651670423947251286016e31))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18373908156550069525109246371700176158105285841693e-48), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.24518553658426726783156020576256e32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.41209231494609483632983197455781525247039509121778e-50), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.192296858534827628530496329220096e33))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.33139424210327318176536246024658633198499233002634e-52), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8.3076749736557242056487941267521536e34))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.33030350328636434650837884413529114372655051566613e-54), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.329227995784915872903807060280344576e36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.30160992238849442914193419439613924120727351807283e-55), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.1267647932558653966460912964485513216e37))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.03376550373202254553427217874396756438636487198880e-57), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.40282366920938463463374607431768211456e38))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.17775859958128522739730027928744931935369511248250e-59), tolerance); + + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 600))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.35984768491636685338723260976696756010081951066709e-272), tolerance); + + // The test is terminated because x is inf after this in fp64. + if (N <= 53) { + return; + } + + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 10000))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.07856314267954244808378917796336533616174400834444e-4517), tolerance); +} + +template +void do_test_holtsmark_quantile_nearzero() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 4; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + holtsmark_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.03125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.95154561868642736172727541497862573947423988108440e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.70076903638473389271107254016757513871156973570753e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.09375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.14334937403136202998120100318789158621074793095204e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.78777320599109327486003359289950832456660816353247e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.15625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.52359744792606448551215814625237535910408488746319e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.31030403921397562363480619469818801698833367088973e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.21875)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.12887694529692805365864437467349833307816315605127e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, -9.68933181713583005208786313049614919507807226788256e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.28125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -8.24180933056718074475811972779037648260058221511975e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -6.90498457639035315478919560434827057700411821656397e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.34375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.65011034985136468564856594364133703131867596374603e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.45602574935161564367593993713685007358536186330925e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.40625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.30636223130194458226267853223267146033119688836326e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.18783126811804488668597304309230757418655445388316e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.46875)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.08910089454817618171205461377219663239656206354005e-1), tolerance); + BOOST_CHECK_EQUAL(quantile(dist, static_cast(0.5)), static_cast(0)); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.50390625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.35942281074760935023421465350943213907657016740203e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5078125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.71903117534558589826852519194663375075753566669865e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.51171875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.07901080568320221484687881885423066805647774437405e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.515625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.43954773006081419776089446583406196027634755818438e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.51953125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.80082845222988104915780076816665811376325257794804e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5234375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.16304011143799846843111212111260495740955724460844e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.52734375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.52637064382003902226333974540096053392566128735022e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.53125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.08910089454817618171205461377219663239656206354005e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.53515625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.22571450376289000001278843371459783620761964026442e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5390625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.36249702341028008589045826702986410397012912904709e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.54296875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.49946773116932301309732751744953722231029126346486e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.546875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.63664606836100199300226165836560082654887238338208e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.55078125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.77405165765079089783419383641965337744707947259452e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5546875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.91170432114732759551367174850419509782585472590891e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.55859375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.04962409893975946705863512977926741730110899605668e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18783126811804488668597304309230757418655445388316e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.56640625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.32634636232249536218129854873203382200612639970098e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5703125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.46519019187105731139818680492599864661432850376167e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.57421875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.60438386451527503677057942069112096470660708202704e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.578125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.74394880687856404334281468719091417527159191461011e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.58203125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.88390678663337502806483517706706303095739191330472e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5859375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.02427993547706435128366410334899635275725704584021e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.58984375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.16509077296982960387421259319514641259915543447926e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.59375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.30636223130194458226267853223267146033119688836326e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.59765625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.44811768106176498805637646337817923388445968601566e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6015625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.59038095808060603000739360761949422570819209911788e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.60546875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.73317639143565086527888233910690716885943557654200e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.609375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.87652883269757340156275635385373789172745768932299e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.61328125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.02046368651559365036792703758158149784555601527522e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6171875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.16500694263927667044145946879116606537710528519644e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.62109375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.31018520948359067342384024222999190532594772267877e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.45602574935161564367593993713685007358536186330925e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.62890625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.60255651543790720669175415204007861250418903243190e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6328125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.74980619074494545171846930824082767773201407564280e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.63671875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.89780422905541754178666731200120149076546958331875e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.640625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.04658089811438846102378009478135229217539543328542e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.64453125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.19616732518780928821098759267869073306168616762584e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6484375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.34659554517741239172052324381351337830662490680744e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.65234375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.49789855148697728320168560667825948269915149112198e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.65625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.65011034985136468564856594364133703131867596374603e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.66015625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.80326601535777269419392897717286438879602729753825e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6640625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.95740175290855108336930680485963056005472680796594e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.66796875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.11255496139682430686772264889247897534154814090188e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.671875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.26876430189035334589546274389116075758343949758676e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.67578125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.42606977014577414303134971466049624688623181490963e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6796875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.58451277380488310882288163359470075488686595989134e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.68359375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.74413621465733462219129425896964561569492923310844e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.90498457639035315478919560434827057700411821656397e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.69140625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.06710401828627699619029762829527775785025847826609e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6953125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.23054247537343446268743874344186034038860806575417e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.69921875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.39534976558556849766533672421653104101284193327489e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.703125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.56157770454041251979362066603791706893576777672076e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.70703125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.72928022860981170501224651695596294779402544635284e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7109375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.89851352702281826568041708053406482267060399077072e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.71484375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.06933618382042868991732981731903327683778049211437e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.71875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.24180933056718074475811972779037648260058221511975e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.72265625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.41599681082196095188647911444502703373377770261645e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7265625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.59196535747955714353182241432999465132648793939716e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.73046875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.76978478421742214185140384463517803619244579498785e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.734375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94952819242075830879661206434669971092120406861116e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.73828125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.13127219511566873406119301005062170096048576202346e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7421875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.31509715961740080067603245114697688184732500932588e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.74609375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.50108747080172235764142816696014524944397797022118e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.68933181713583005208786313049614919507807226788256e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.75390625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.87992350186512083533727177758662092012850600324604e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7578125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.00729607820486228792863859054788768644744365249151e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.76171875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.02685472384747190194216544893563951741322238866541e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.765625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.04667921798768908218602656800798525125137666299761e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.76953125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.06678110853147091220341113291781102477507787382916e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7734375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.08717260890978562986849760571609969494354300822263e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.77734375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10786665132220733188524032283620543957825067010411e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.78125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.12887694529692805365864437467349833307816315605127e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.78515625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.15021804221161134460394215947401773984635551400974e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7890625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.17190540651154074066537741066806130017312231661434e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.79296875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.19395549446874295273954813640902172894636549828066e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.796875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21638584145104788446634880619086527181141939030279e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.80078125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.23921515881685008719278461299232510042094064507963e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8046875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.26246344172387198181843263481470665031951188807903e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.80859375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28615208934364044613153187689263023500565577152964e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.31030403921397562363480619469818801698833367088973e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.81640625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.33494391774730388327762461486718746182135887404098e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8203125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.36009820925261741664314298719135880075160309673291e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.82421875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38579544623528308147561770378298998291069435447743e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.828125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41206642422644329402039008236727065491131379281346e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.83203125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43894444498096320102061428365633543440558564852878e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8359375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.46646559259303986239248263261753112540493595538180e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.83984375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.49466904794112146248736006028509653369456653722975e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.84375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.52359744792606448551215814625237535910408488746319e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.84765625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.55329729725622722446696215102952397443200898053734e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8515625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.58381944212178952767489242020964875845531372433107e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.85546875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61521961706725528436767664289542667668084392814972e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.859375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.64755907881888895242774154629775987069182281943649e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.86328125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.68090534388763421593277486421165006597881155937148e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8671875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.71533305062559095290467926282068904086311880655794e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.87109375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.75092497130127405520149304919663885139873951807268e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.78777320599109327486003359289950832456660816353247e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.87890625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.82598059808698758538443295349421685195378444570311e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8828125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.86566242157090907181680189290396765394233286379846e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.88671875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90694840369852884963353039612138690706293500611801e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.890625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.94998516446439884497123835171451955479771823102329e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.89453125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.99493917772297054805704471816059443529057908424094e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8984375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.04200039028200656353168185848438653746136511354273e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.90234375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.09138667776446768039690693058064390661207192288310e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.90625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.14334937403136202998120100318789158621074793095204e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.91015625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.19818019103302928413100774795456740418726081571239e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9140625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.25621995785515543565780905111478616154698242356459e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.91796875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.31786976613802108820384089261971867032207069978249e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.921875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.38360533647314959687029290315016585988822268727435e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.92578125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.45399575188877505107943151191453137828469465461499e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9296875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.52972819582716132188558325053476431645151134471514e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.93359375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.61164107343000684767083444817632028828927968917161e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.70076903638473389271107254016757513871156973570753e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.94140625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.79840522818853957979403024307775647164832128717134e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9453125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.90618896524175502682103322803168945370341377670787e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.94921875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.02623187745561328365781914812219941666139382669240e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.953125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.16130376436882129187002225210296787778679380216571e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.95703125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.31511403805596290718635028471440503099806209998330e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9609375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.49275168669289561003117954123304779848451307206373e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.96484375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.70139933971958385705119882168933347231988022896107e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.96875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.95154561868642736172727541497862573947423988108440e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.97265625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.25916037511354144395537844168672288266598351274466e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9765625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.64987772024289138285743520182808805983174934278635e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.98046875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.16779337095862086311250586064141028622224308218889e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.984375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.89632696959562976212621758577393939287586784169403e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.98828125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.01689760146742972661016754806402368873114241071209e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9921875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.02446937207505244639190533898754565373763855739835e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.99609375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40479269149807902190125365288201718857308359786880e1), tolerance); +} + +template +void do_test_holtsmark_quantile_lower() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + holtsmark_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -3)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.78777320599109327486003359289950832456660816353247e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -4)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.70076903638473389271107254016757513871156973570753e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -5)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.95154561868642736172727541497862573947423988108440e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -6)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.89632696959562976212621758577393939287586784169403e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -7)), BOOST_MATH_BIG_CONSTANT(RealType, N, -9.02446937207505244639190533898754565373763855739835e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -8)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.40479269149807902190125365288201718857308359786880e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -10)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.48634712845212854436829850825868101882854019691874e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -12)), BOOST_MATH_BIG_CONSTANT(RealType, N, -8.75100888665534247471443047755794084714498529274899e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -14)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.20296704598194178128278789813687898595549252840676e2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -16)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.54977454632239578277064855837334284482347724412824e2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -20)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.52361836255645260708087122768062244544827526253646e3), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -24)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.23734752970824778029419146983721335265273533376700e4), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -28)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.42062670553125367339285994800008811139726501576815e5), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -32)), BOOST_MATH_BIG_CONSTANT(RealType, N, -9.02041713923935805934169232925253585383521252378005e5), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -40)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.63680429392084153704899843149763443252941653727485e7), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -48)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.46626761095577290791010108814328116732395911944180e9), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -56)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.91162056903107188819131273099660458893079363542047e10), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -64)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.38341606205240162091324729036756554251581053237655e12), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -80)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.87423965612020298589373786039770640757408383939246e15), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -96)), BOOST_MATH_BIG_CONSTANT(RealType, N, -6.29757143623897661671305188560924841842505858740001e18), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -112)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.02366940392761715971201478542352832996294475084257e22), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -128)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.66397326199025580692950800332626492430331068544172e25), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -160)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.39662661178492965217151228166250717006976010266469e31), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -192)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.16169688570203891305395889425358741905195655516409e38), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -224)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.06948889094299024072567114732250581789838857797378e44), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -256)), BOOST_MATH_BIG_CONSTANT(RealType, N, -8.11034458952573565292573972403491751744218292992004e50), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -256)), BOOST_MATH_BIG_CONSTANT(RealType, N, -8.11034458952573565292573972403491751744218292992004e50), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -320)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.66220760083199094068657639449976729910923748932480e63), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -384)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.95304965911372717286692649124348058110571556299024e76), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -448)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.75980725346824443030445016705237404631255977139835e89), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -512)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.92674940440883821350824836233864795634501852860731e102), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -640)), BOOST_MATH_BIG_CONSTANT(RealType, N, -9.39113744455748572074441450789762236967081046313794e127), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -768)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.57731878887639063343639480262468437174058078877170e153), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -896)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.23102338973254024994084948896750440849135610207358e179), tolerance); +} + +template +void do_test_holtsmark_quantile_upper() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + holtsmark_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -3))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.78777320599109327486003359289950832456660816353247e0), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -4))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.70076903638473389271107254016757513871156973570753e0), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.95154561868642736172727541497862573947423988108440e0), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -6))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.89632696959562976212621758577393939287586784169403e0), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -7))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.02446937207505244639190533898754565373763855739835e0), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40479269149807902190125365288201718857308359786880e1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.48634712845212854436829850825868101882854019691874e1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.75100888665534247471443047755794084714498529274899e1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.20296704598194178128278789813687898595549252840676e2), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.54977454632239578277064855837334284482347724412824e2), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.52361836255645260708087122768062244544827526253646e3), tolerance); +} + +template +void do_test_holtsmark_locscale_param() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + holtsmark_distribution dist_0_1(static_cast(0), static_cast(1)); + holtsmark_distribution dist_1_3(static_cast(1), static_cast(3)); + + BOOST_CHECK_CLOSE(entropy(dist_0_1), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.0694485051346244003155800384542166381), tolerance); + BOOST_CHECK_CLOSE(entropy(dist_1_3), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.0694485051346244003155800384542166381) + log(static_cast(3)), tolerance); + + BOOST_CHECK_EQUAL(median(dist_0_1), static_cast(0)); + BOOST_CHECK_EQUAL(median(dist_1_3), static_cast(1)); + + BOOST_CHECK_EQUAL(mode(dist_0_1), static_cast(0)); + BOOST_CHECK_EQUAL(mode(dist_1_3), static_cast(1)); + + BOOST_CHECK_CLOSE(pdf(dist_0_1, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.02038159607840130388931544845552929991729709746772e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist_1_3, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.87352751452164445024482162286994868261727837966217e-1) / 3, tolerance); + + BOOST_CHECK_CLOSE(cdf(dist_0_1, static_cast(2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94960170345170829219212314700442993280391160852854e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_1_3, static_cast(7)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94960170345170829219212314700442993280391160852854e-1), tolerance); + + BOOST_CHECK_CLOSE(cdf(dist_0_1, quantile(dist_0_1, static_cast(0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.25), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_1_3, quantile(dist_1_3, static_cast(0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.25), tolerance); + + BOOST_CHECK_CLOSE(cdf(dist_0_1, quantile(dist_0_1, static_cast(0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.75), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_1_3, quantile(dist_1_3, static_cast(0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.75), tolerance); +} + +BOOST_AUTO_TEST_CASE(holtsmark_pdf_fp64) +{ + do_test_holtsmark_pdf(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_pdf_fp128) +{ + do_test_holtsmark_pdf(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_cdf_fp64) +{ + do_test_holtsmark_cdf(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_cdf_fp128) +{ + do_test_holtsmark_cdf(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_ccdf_fp64) +{ + do_test_holtsmark_ccdf(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_ccdf_fp128) +{ + do_test_holtsmark_ccdf(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_quantile_nearzero_fp64) +{ + do_test_holtsmark_quantile_nearzero(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_quantile_nearzero_fp128) +{ + do_test_holtsmark_quantile_nearzero(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_quantile_lower_fp64) +{ + do_test_holtsmark_quantile_lower(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_quantile_lower_fp128) +{ + do_test_holtsmark_quantile_lower(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_quantile_upper_fp64) +{ + do_test_holtsmark_quantile_upper(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_quantile_upper_fp128) +{ + do_test_holtsmark_quantile_upper(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_locscale_fp64) +{ + do_test_holtsmark_locscale_param(); +} + +BOOST_AUTO_TEST_CASE(holtsmark_locscale_fp128) +{ + do_test_holtsmark_locscale_param(); +} From 0d0ff9493ce17309328a427ab6125889c7d4a1ea Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Tue, 16 Jul 2024 16:44:22 +0900 Subject: [PATCH 003/399] Add saspoint5 distribution --- .../boost/math/distributions/saspoint5.hpp | 2742 +++++++++++++++++ test/test_saspoint5.cpp | 878 ++++++ 2 files changed, 3620 insertions(+) create mode 100644 include/boost/math/distributions/saspoint5.hpp create mode 100644 test/test_saspoint5.cpp diff --git a/include/boost/math/distributions/saspoint5.hpp b/include/boost/math/distributions/saspoint5.hpp new file mode 100644 index 0000000000..231b8f4939 --- /dev/null +++ b/include/boost/math/distributions/saspoint5.hpp @@ -0,0 +1,2742 @@ +// Copyright Takuma Yoshimura 2024. +// 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) + +#ifndef BOOST_STATS_SASPOINT5_HPP +#define BOOST_STATS_SASPOINT5_HPP + +#ifdef _MSC_VER +#pragma warning(push) +#pragma warning(disable : 4127) // conditional expression is constant +#endif + +#include +#include +#include +#include +#include +#include + +namespace boost { namespace math { +template +class saspoint5_distribution; + +namespace detail { + +template +inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integral_constant&) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 0.125) { + // Rational Approximation + // Maximum Relative Error: 7.8747e-17 + static const RealType P[13] = { + static_cast(6.36619772367581343076e-1), + static_cast(2.17275699713513462507e2), + static_cast(3.49063163361344578910e4), + static_cast(3.40332906932698464252e6), + static_cast(2.19485577044357440949e8), + static_cast(9.66086435948730562464e9), + static_cast(2.90571833690383003932e11), + static_cast(5.83089315593106044683e12), + static_cast(7.37911022713775715766e13), + static_cast(5.26757196603002476852e14), + static_cast(1.75780353683063527570e15), + static_cast(1.85883041942144306222e15), + static_cast(4.19828222275972713819e14), + }; + static const RealType Q[15] = { + static_cast(1), + static_cast(3.41295871011779138155e2), + static_cast(5.48907134827349102297e4), + static_cast(5.36641455324410261980e6), + static_cast(3.48045461004960397915e8), + static_cast(1.54920747349701741537e10), + static_cast(4.76490595358644532404e11), + static_cast(1.00104823128402735005e13), + static_cast(1.39703522470411802507e14), + static_cast(1.23724881334160220266e15), + static_cast(6.47437580921138359461e15), + static_cast(1.77627318260037604066e16), + static_cast(2.04792815832538146160e16), + static_cast(7.45102534638640681964e15), + static_cast(3.68496090049571174527e14), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 0.25) { + RealType t = x - 0.125; + + // Rational Approximation + // Maximum Relative Error: 2.1471e-17 + static const RealType P[7] = { + static_cast(4.35668401768623200524e-1), + static_cast(7.12477357389655327116e0), + static_cast(4.02466317948738993787e1), + static_cast(9.04888497628205955839e1), + static_cast(7.56175387288619211460e1), + static_cast(1.26950253999694502457e1), + static_cast(-6.59304802132933325219e-1), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.98623818041545101115e1), + static_cast(1.52856383017632616759e2), + static_cast(5.70706902111659740041e2), + static_cast(1.06454927680197927878e3), + static_cast(9.13160352749764887791e2), + static_cast(2.58872466837209126618e2), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 0.5) { + RealType t = x - 0.25; + + // Rational Approximation + // Maximum Relative Error: 5.3265e-17 + static const RealType P[8] = { + static_cast(2.95645445681747568732e-1), + static_cast(2.23779537590791610124e0), + static_cast(5.01302198171248036052e0), + static_cast(2.76363131116340641935e0), + static_cast(1.18134858311074670327e-1), + static_cast(2.00287083462139382715e-2), + static_cast(-7.53979800555375661516e-3), + static_cast(1.37294648777729527395e-3), + }; + static const RealType Q[6] = { + static_cast(1), + static_cast(1.02879626214781666701e1), + static_cast(3.85125274509784615691e1), + static_cast(6.18474367367800231625e1), + static_cast(3.77100050087302476029e1), + static_cast(5.41866360740066443656e0), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 1) { + RealType t = x - 0.5; + + // Rational Approximation + // Maximum Relative Error: 2.7947e-17 + static const RealType P[7] = { + static_cast(1.70762401725206223811e-1), + static_cast(8.43343631021918972436e-1), + static_cast(1.39703819152564365627e0), + static_cast(8.75843324574692085009e-1), + static_cast(1.86199552443747562584e-1), + static_cast(7.35858280181579907616e-3), + static_cast(-1.03693607694266081126e-4), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(6.73363440952557318819e0), + static_cast(1.74288966619209299976e1), + static_cast(2.15943268035083671893e1), + static_cast(1.29818726981381859879e1), + static_cast(3.40707211426946022041e0), + static_cast(2.80229012541729457678e-1), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 1.7051e-18 + static const RealType P[7] = { + static_cast(8.61071469126041183247e-2), + static_cast(1.69689585946245345838e-1), + static_cast(1.09494833291892212033e-1), + static_cast(2.76619622453130604637e-2), + static_cast(2.44972748006913061509e-3), + static_cast(4.09853605772288438003e-5), + static_cast(-2.63561415158954865283e-7), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(3.04082856018856244947e0), + static_cast(3.52558663323956252986e0), + static_cast(1.94795523079701426332e0), + static_cast(5.23956733400745421623e-1), + static_cast(6.19453597593998871667e-2), + static_cast(2.31061984192347753499e-3), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 2.9247e-17 + static const RealType P[7] = { + static_cast(3.91428580496513429479e-2), + static_cast(4.07162484034780126757e-2), + static_cast(1.43342733342753081931e-2), + static_cast(2.01622178115394696215e-3), + static_cast(1.00648013467757737201e-4), + static_cast(9.51545046750892356441e-7), + static_cast(-3.56598940936439037087e-9), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.63904431617187026619e0), + static_cast(1.03812003196677309121e0), + static_cast(3.18144310790210668797e-1), + static_cast(4.81930155615666517263e-2), + static_cast(3.25435391589941361778e-3), + static_cast(7.01626957128181647457e-5), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 2.6547e-17 + static const RealType P[7] = { + static_cast(1.65057384221262866484e-2), + static_cast(8.05429762031495873704e-3), + static_cast(1.35249234647852784985e-3), + static_cast(9.18685252682786794440e-5), + static_cast(2.23447790937806602674e-6), + static_cast(1.03176916111395079569e-8), + static_cast(-1.94913182592441292094e-11), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(8.10113554189626079232e-1), + static_cast(2.54175325409968367580e-1), + static_cast(3.87119072807894983910e-2), + static_cast(2.92520770162792443587e-3), + static_cast(9.89094130526684467420e-5), + static_cast(1.07148513311070719488e-6), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 2.5484e-17 + static const RealType P[7] = { + static_cast(6.60044810497290557553e-3), + static_cast(1.59342644994950292031e-3), + static_cast(1.32429706922966110874e-4), + static_cast(4.45378136978435909660e-6), + static_cast(5.36409958111394628239e-8), + static_cast(1.22293787679910067873e-10), + static_cast(-1.16300443044165216564e-13), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(4.10446485803039594111e-1), + static_cast(6.51887342399859289520e-2), + static_cast(5.02151225308643905366e-3), + static_cast(1.91741179639551137839e-4), + static_cast(3.27316600311598190022e-6), + static_cast(1.78840301213102212857e-8), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 2.9866e-17 + static const RealType P[7] = { + static_cast(2.54339461777955741686e-3), + static_cast(3.10069525357852579756e-4), + static_cast(1.30082682796085732756e-5), + static_cast(2.20715868479255585050e-7), + static_cast(1.33996659756026452288e-9), + static_cast(1.53505360463827994365e-12), + static_cast(-7.42649416356965421308e-16), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(2.09203384450859785642e-1), + static_cast(1.69422626897631306130e-2), + static_cast(6.65649059670689720386e-4), + static_cast(1.29654785666009849481e-5), + static_cast(1.12886139474560969619e-7), + static_cast(3.14420104899170413840e-10), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 3.3581e-17 + static const RealType P[7] = { + static_cast(9.55085695067883584460e-4), + static_cast(5.86125496733202756668e-5), + static_cast(1.23753971325810931282e-6), + static_cast(1.05643819745933041408e-8), + static_cast(3.22502949410095015524e-11), + static_cast(1.85366144680157942079e-14), + static_cast(-4.53975807317403152058e-18), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.05980850386474826374e-1), + static_cast(4.34966042652000070674e-3), + static_cast(8.66341538387446465700e-5), + static_cast(8.55608082202236124363e-7), + static_cast(3.77719968378509293354e-9), + static_cast(5.33287361559571716670e-12), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType t = 1 / sqrt(x); + + // Rational Approximation + // Maximum Relative Error: 4.7450e-19 + static const RealType P[5] = { + static_cast(1.99471140200716338970e-1), + static_cast(-1.93310094131437487158e-2), + static_cast(-8.44282614309073196195e-3), + static_cast(3.47296024282356038069e-3), + static_cast(-4.05398011689821941383e-4), + }; + static const RealType Q[5] = { + static_cast(1), + static_cast(7.00973251258577238892e-1), + static_cast(2.66969681258835723157e-1), + static_cast(5.51785147503612200456e-2), + static_cast(6.50130030979966274341e-3), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t / x; + } + + return result; +} + + +template +inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integral_constant&) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 0.0625) { + // Rational Approximation + // Maximum Relative Error: 8.8841e-35 + static const RealType P[27] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.36619772367581343075535053490057448138e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.57459506929453385798277946154823008327e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.46717322844023441698710451505816706570e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.71501459971530549476153273173061194095e8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.76700973495278431084530045707075552432e10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01328150775099946510145440412520620021e13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70028222513668830210058353057559790101e15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.29641781943744384078006991488193839955e17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.52611994112742436432957758588495082163e19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.27833177267552931459542318826727288124e21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.68946162731840551853993619351896931533e23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.02965010233956763504899745874128908220e25), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.14128569264874914146628076133997950655e26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.09103580386900060922163883603492216942e28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.86778299087452621293332172137014749128e29), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.80029712249744334924217328667885673985e31), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.70890080432228368476255091774238573277e32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.88600513999992354909078399482884993261e33), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.01189178534848836605739139176681647755e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.06531475170803043941021113424602440078e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.64956999370443524098457423629252855270e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.44276098283517934229787916584447559248e37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.45856704224433991524661028965741649584e37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.47263237190968408624388275549716907309e37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.66186300951901408251743228798832386260e37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.48064966533519934186356663849904556319e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.64877082086372991309408001661535573441e35), + }; + static const RealType Q[28] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18981461118065892086304195732751798634e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.01761929839041982958990681130944341399e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.69465252239913021973760046507387620537e8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.49221044103838155300076098325950584061e10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59327386289821190042576978177896481082e13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.67528179803224728786405503232064643870e15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.61672367849271591791062829736720884633e17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.98395893917909208201801908435620016552e19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.60025693881358827551113845076726845495e21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.67730578745705562356709169493821118109e23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.63843883526710042156562706339553092312e25), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.23075214698024188140971761421762265880e26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.37775321923937393366376907114580842429e28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.12444724625354796650300159037364355605e30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.00860835602766063447009568106012449767e31), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.39614080159468893509273006948526469708e32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06547095715472468415058181351212520255e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36755997709303811764051969789337337957e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32519530489892818585066019217287415587e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.45230390606834183602522256278256501404e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.80344475131699029428900627020022801971e37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.66469314795307459840482483320814279444e38), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.70209065673736156218117594311801487932e38), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.84490531246108754748100009460860427732e38), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.30215083398643966091721732133851539475e38), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.58032845332990262754766784625271262271e37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.50461648438613634025964361513066059697e36), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 0.125) { + RealType t = x - 0.0625; + + // Rational Approximation + // Maximum Relative Error: 3.4585e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.46416716200748206779925127900698754119e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.41771273526123373239570033672829787791e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.56142610225585235535211648703534340871e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.15655694129872563686497490176725921724e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.00791883661952751945853742455643714995e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.30252591667828615354689186280704562254e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.76168115448224677276551213052798322583e7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.88534624532179841393387625270218172719e7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14740447137831585842166880265350244623e8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14904082614021239315925958812100948136e8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.76866867279164114004579652405104553404e7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.53475339598769347326916978463911377965e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.88896160275915786487519266368539625326e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05543800791717482823610940401201712196e4), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.44407579416524903840331499438398472639e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.15911780811299460009161345260146251462e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.88457596285725454686358792906273558406e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.66501639812506059997744549411633476528e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.12674134216028769532305433586266118000e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.87676063477990584593444083577765264392e7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.56084282739608760299329382263598821653e8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.34250986378665047914811630036201995871e8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.31288233106689286803200674021353188597e9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33621494302241474082474689597125896975e9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.63379428046258653791600947328520263412e8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14558538557562267533922961110917101850e8), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 0.25) { + RealType t = x - 0.125; + + // Rational Approximation + // Maximum Relative Error: 6.9278e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.35668401768623200524372663239480799018e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30066509937988171489091367354416214000e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.05924026744937322690717755156090122074e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.12998524955326375684693500551926325112e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.52237930808361186011042950178715609183e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.10734809597587633852077152938985998879e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.20796157836149826988172603622242119074e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.12398478061053302537736799402801934778e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17841330491647012385157454335820786724e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.46281413765362795389526259057436151953e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52220357379402116641048490644093497829e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.51130316105543847380510577656570543736e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.32201781975497810173532067354797097401e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.96874547436310030183519174847668703774e0), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.63164311578114868477819520857286165076e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34964379844144961683927306966955217328e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.82966031793809959278519002412667883288e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.56215285850856046267451500310816276675e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.81046679663412610005501878092824281161e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.33868038251479411246071640628518434659e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.46262495881941625571640264458627940579e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.40052628730443097561652737049917920495e7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.44394803828297754346261138417756941544e7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.56647617803506258343236509255155360957e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.53513095899009948733175317927025056561e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.69130675750530663088963759279778748696e5), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 0.5) { + RealType t = x - 0.25; + + // Rational Approximation + // Maximum Relative Error: 6.9378e-36 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.95645445681747568731488283573032414811e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.83246437763964151893665752064650172391e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.85333417559435252576820440080930004674e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.90974714199542064991001365628659054084e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.39707205668285805800884524044738261436e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.24814598419826565698241508792385416075e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.95012897118808793886195172068123345314e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.87265743900139300849404272909665705025e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.98795164648056126707212245325405968413e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07012128790318535418330629467906917213e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.99797198893523173981812955075412130913e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.55029227544167913873724286459253168886e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.54064889901609722583601330171719819660e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.72254289950537680833853394958874977464e-3), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.58291085070053442257438623486099473087e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.95618461039379226195473938654286975682e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.97427161745150579714266897556974326502e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.52730436681412535198281529590508861106e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.49521185356761585062135933350225236726e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.03881178612341724262911142022761966061e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.02360046338629039644581819847209730553e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.65580339066083507998465454599272345735e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.15462499626138125314518636645472893045e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.61951767959774678843021179589300545717e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.60745557054877240279811529503888551492e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.91061555870569579915258835459255406575e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43045229010040855016672246098687100063e1), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 1) { + RealType t = x - 0.5; + + // Rational Approximation + // Maximum Relative Error: 6.4363e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70762401725206223811383500786268939645e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19353011456197635663058525904929358535e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.22974648900600015961253465796487372402e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.91951696059042324975935209295355569292e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.79039444119906169910281912009369164227e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00089963120992100860902142265631127046e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.37108883429306700857182028809960789020e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.49586566873564432788366931251358248417e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49790521605774884174840168128255220471e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.90660338063979435668763608259382712726e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.93409982383888149064797608605579930804e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.22802459215932860445033185874876812040e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07739227340181463034286653569468171767e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.02669738424010290973023004028523684766e-7), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.46404480283267324138113869370306506431e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.54550184643308468933661600211579108422e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.63602410602063476726031476852965502123e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.94463479638213888403144706176973026333e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.48607087483870766806529883069123352339e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.69715692924508994524755312953665710218e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33237849965272853370191827043868842100e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.08460086451666825383009487734769646087e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.47365552394788536087148438788608689300e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.38010282703940184371247559455167674975e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.67219842525655806370702248122668214685e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.01852843874982199859775136086676841910e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.14767043526088185802569803397824432028e-3), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 9.1244e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.61071469126041183247373313827161939454e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.35837460186564880289965856498718321896e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.47783071967681246738651796742079530382e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16019502727107539284403003943433359877e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.80510046274709592896987229782879937271e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.30456542768955299533391113704078540955e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36539167913428133313942008990965988621e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.76450743657913389896743235938695682829e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.42847090205575096649865021874905747106e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.41380341540026027117735179862124402398e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.40549721587212773424211923602910622515e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.09089653391032945883918434200567278139e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.21403900721572475664926557233205232491e-10), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.13172035933794917563324458011617112124e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.65687100738157412154132860910003018338e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.59672433683883998168388916533196510994e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.61469557815097583209668778301921207455e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.77070955301136405523492329700943077340e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.20825570431301943907348077675777546304e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.60136197167727810483751794121979805142e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.53723076053642006159503073104152703814e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.63397465217490984394478518334313362490e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.40577918603319523990542237990107206371e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.94376458316662573143947719026985667328e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.09333568224541559157192543410988474886e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.59947287428695057506683902409023760438e-8), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 8.1110e-35 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.91428580496513429479068747515164587814e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.69015019070193436467106672180804948494e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.03147451266231819912643754579290008651e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.18825170881552297150779588545792258740e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30548850262278582401286533053286406505e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.54315108501815531776138839512564427279e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.66434584176931077662201101557716482514e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.66158632576958238392567355014249971287e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.31365802206301246598393821671437863818e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.85378389166807263837732376845556856416e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.20375363151456683883984823721339648679e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06637401794693307359898089790558771957e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.08663671047376684678494625068451888284e-14), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.07443397096591141329212291707948432414e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.16665031056584124503224711639009530348e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.27666060511630720485121299731204403783e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.65646979169107732387032821262953301311e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.63594064986880863092994744424349361396e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.31360114173642293100378020953197965181e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.09489929949457075237756409511944811481e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.24574519309785870806550506199124944514e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.56048486483867679310086683710523566607e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.60417286783794818094722636906776809193e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.53154117367296710469692755461431646999e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.60041713691072903334637560080298818163e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.77381528950794767694352468734042252745e-12), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 2.5228e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.65057384221262866484014802392420311075e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.92801687242885330588201777283015178448e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.65508815862861196424333614846876229064e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.71545573465295958468808641544341412235e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.72077718130407940498710469661947719216e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.26299620525538984108147098966692839348e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.77971404992990847565880351976461271350e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.71176235845517643695464740679643640241e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.64603919225244695533557520384631958897e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.85274347406803894317891882905083368489e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.48564096627181435612831469651920186491e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.90886715044580341917806394089282500340e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.39396206221935864416563232680283312796e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.37760675743046300528308203869876086823e-22), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49023284463742780238035958819642738891e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.76284367953836866133894756472541395734e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.69932155343422362573146811195224195135e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.97593541520549770519034085640975455763e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.45862809001322359249894968573830094537e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.61348135835522976885804369721316193713e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21069949470458047530981551232427019037e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.03132437580490629136144285669590192597e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.91030348024641585284338958059030520141e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.56320479309161046934628280237629402373e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.39524198476052364627683067034422502163e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18666081063885228839052386515073873844e-13), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 9.6732e-36 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.60044810497290557552736366450372523266e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.27034183360438185616541260923634443241e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19813403884333707962156711479716066536e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.91346554854771687970018076643044998737e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.91975837766081548424458764226669789039e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.26031304514411902758114277797443618334e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.47127194811140370123712253347211626753e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.55248861254135821097921903190564312000e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.78340847719683652633864722047250151066e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.95888612422041337572422846394029849086e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.66363005792960308636467394552324255493e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.93244800648299424751906591077496534948e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.95046217952146113063614290717113024410e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.46784746963816915795587433372284530785e-25), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.16012189991825507132967712656930682478e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.95202772611563835130347051925062280272e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.23801477561401113332870463345197159418e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.54022665579711946784722766000062263305e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.94266182294627770206082679848878391116e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.11782839184878848480753630961211685630e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.28827067686094594197542725283923947812e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.00220719177374237332018587370837457299e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.42250513143925626748132661121749401409e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.82007216963767723991309138907689681422e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34214834652884406013489167210936679359e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.85519293212465087373898447546710143008e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.96728437809303144188312623363453475831e-19), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 1.0113e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.54339461777955741686401041938275102207e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.17747085249877439037826121862689145081e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14104576580586095462211756659036062930e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.06903778663262313120049231822412184382e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.53115958954246158081703822428768781010e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.48225007017630665357941682179157662142e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.20810829523286181556951002345409843125e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.54070972719909957155251432996372246019e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.06258623970363729581390609798632080752e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.15603641527498625694677136504611545743e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.05376970060354261667000502105893106009e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.14727542705613448694396750352455931731e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.76883960167449461476228984331517762578e-25), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.03558202009465610972808653993060437679e-29), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.08809672969012756295937194823378109391e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.41148083436617376855422685448827300528e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.85101541143091590863368934606849033688e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.38984899982960112626157576750593711628e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.51437845497783812562009857096371643785e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.12891276596072815764119699444334380521e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.82412500887161687329929693518498698716e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.80215715026891688444965605768621763721e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.85838684678780184082810752634454259831e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.83675729736846176693608812315852523556e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.80347165008408134158968403924819637224e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23639219622240634094606955067799349447e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.63446235885036169537726818244420509024e-23), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 9.7056e-36 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.55085695067883584460317653567009454037e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52919532248638251721278667010429548877e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06266842295477991789450356745903177571e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.20671609948319334255323512011575892813e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04692714549374449244320605137676408001e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70605481454469287545965803970738264158e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.83960996572005209177458712170004097587e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29732261733491885750067029092181853751e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.78385693918239619309147428897790440735e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52969197316398995616879018998891661712e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.14063120299947677255281707434419044806e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.25957675329657493245893497219459256248e-25), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.55238112862817593053765898004447484717e-29), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.93970406521541790658675747195982964585e-34), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.04722757068068234153968603374387493579e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.85854131835804458353300285777969427206e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.85809281481040288085436275150792074968e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.38860750164285700051427698379841626305e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.91463283601681120487987016215594255423e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.28104952818420195583669572450494959042e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43912720109615655035554724090181888734e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.10668954229813492117417896681856998595e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.65093571330749369067212003571435698558e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.81758227619561958470583781325371429458e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.36970757752002915423191164330598255294e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.06487673393164724939989217811068656932e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.47121057452822097779067717258050172115e-27), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType t = 1 / sqrt(x); + + // Rational Approximation + // Maximum Relative Error: 7.1032e-36 + static const RealType P[8] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.99471140200716338969973029967190934238e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.82846732476244747063962056024672844211e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.69724475658159099827638225237895868258e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.21259630917863228526439367416146293173e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.13469812721679130825429547254346177005e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.73237434182338329541631611908947123606e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.72986150007117100707304201395140411630e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.53567129749337040254350979652515879881e-7), + }; + static const RealType Q[9] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.89815449697874475254942178935516387239e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.21223228867921988134838870379132038419e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.79514417558927397512722128659468888701e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.43331254539687594239741585764730095049e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.99078779616201786316256750758748178864e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04590833634768023225748107112347131311e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.17497990182339853998751740288392648984e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.53420609011698705803549938558385779137e-6), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t / x; + } + + return result; +} + + +template +inline RealType saspoint5_pdf_imp_prec(const RealType& x, const std::integral_constant &tag) { + BOOST_MATH_STD_USING // for ADL of std functions + + return saspoint5_pdf_plus_imp_prec(abs(x), tag); +} + +template +inline RealType saspoint5_pdf_imp_prec(const RealType& x, const std::integral_constant& tag) { + BOOST_MATH_STD_USING // for ADL of std functions + + return saspoint5_pdf_plus_imp_prec(abs(x), tag); +} + +template +inline RealType saspoint5_pdf_imp(const saspoint5_distribution& dist, const RealType& x) { + // + // This calculates the pdf of the Saspoint5 distribution and/or its complement. + // + + BOOST_MATH_STD_USING // for ADL of std functions + static const char* function = "boost::math::pdf(saspoint5<%1%>&, %1%)"; + RealType result = 0; + RealType location = dist.location(); + RealType scale = dist.scale(); + + if (false == detail::check_location(function, location, &result, Policy())) + { + return result; + } + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + if (false == detail::check_x(function, x, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + RealType u = (x - location) / scale; + + result = saspoint5_pdf_imp_prec(u, tag_type()) / scale; + + return result; +} + +template +inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 0.5) { + // Rational Approximation + // Maximum Relative Error: 2.6225e-17 + static const RealType P[16] = { + static_cast(5.0e-1), + static_cast(1.11530082549581486148e2), + static_cast(1.18564167533523512811e4), + static_cast(7.51503793077701705413e5), + static_cast(3.05648233678438482191e7), + static_cast(8.12176734530090957088e8), + static_cast(1.39533182836234507573e10), + static_cast(1.50394359286077974212e11), + static_cast(9.79057903542935575811e11), + static_cast(3.73800992855150140014e12), + static_cast(8.12697090329432868343e12), + static_cast(9.63154058643818290870e12), + static_cast(5.77714904017642642181e12), + static_cast(1.53321958252091815685e12), + static_cast(1.36220966258718212359e11), + static_cast(1.70766655065405022702e9), + }; + static const RealType Q[16] = { + static_cast(1), + static_cast(2.24333404643898143947e2), + static_cast(2.39984636687021023600e4), + static_cast(1.53353791432086858132e6), + static_cast(6.30764952479861776476e7), + static_cast(1.70405769169309597488e9), + static_cast(3.00381227010195289341e10), + static_cast(3.37519046677507392667e11), + static_cast(2.35001610518109063314e12), + static_cast(9.90961948200767679416e12), + static_cast(2.47066673978544828258e13), + static_cast(3.51442593932882610556e13), + static_cast(2.68891431106117733130e13), + static_cast(9.99723484253582494535e12), + static_cast(1.49190229409236772612e12), + static_cast(5.68752980146893975323e10), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 1) { + RealType t = x - 0.5; + + // Rational Approximation + // Maximum Relative Error: 9.2135e-19 + static const RealType P[8] = { + static_cast(3.31309550000758082456e-1), + static_cast(1.63012162307622129396e0), + static_cast(2.97763161467248770571e0), + static_cast(2.49277948739575294031e0), + static_cast(9.49619262302649586821e-1), + static_cast(1.38360148984087584165e-1), + static_cast(4.00812864075652334798e-3), + static_cast(-4.82051978765960490940e-5), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(5.43565383128046471592e0), + static_cast(1.13265160672130133152e1), + static_cast(1.13352316246726435292e1), + static_cast(5.56671465170409694873e0), + static_cast(1.21011708389501479550e0), + static_cast(8.34618282872428849500e-2), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 6.4688e-17 + static const RealType P[7] = { + static_cast(2.71280312689343248819e-1), + static_cast(7.44610837974139249205e-1), + static_cast(7.17844128359406982825e-1), + static_cast(2.98789060945288850507e-1), + static_cast(5.22747411439102272576e-2), + static_cast(3.06447984437786430265e-3), + static_cast(2.60407071021044908690e-5), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(3.06221257507188300824e0), + static_cast(3.44827372231472308047e0), + static_cast(1.78166113338930668519e0), + static_cast(4.25580478492907232687e-1), + static_cast(4.09983847731128510426e-2), + static_cast(1.04343172183467651240e-3), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 8.2289e-18 + static const RealType P[7] = { + static_cast(2.13928162275383716645e-1), + static_cast(2.35139109235828185307e-1), + static_cast(9.35967515134932733243e-2), + static_cast(1.64310489592753858417e-2), + static_cast(1.23186728989215889119e-3), + static_cast(3.13500969261032539402e-5), + static_cast(1.17021346758965979212e-7), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.28212183177829510267e0), + static_cast(6.17321009406850420793e-1), + static_cast(1.38400318019319970893e-1), + static_cast(1.44994794535896837497e-2), + static_cast(6.17774446282546623636e-4), + static_cast(7.00521050169239269819e-6), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 3.7284e-17 + static const RealType P[7] = { + static_cast(1.63772802979087193656e-1), + static_cast(9.69009603942214234119e-2), + static_cast(2.08261725719828138744e-2), + static_cast(1.97965182693146960970e-3), + static_cast(8.05499273532204276894e-5), + static_cast(1.11401971145777879684e-6), + static_cast(2.25932082770588727842e-9), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(6.92463563872865541733e-1), + static_cast(1.80720987166755982366e-1), + static_cast(2.20416647324531054557e-2), + static_cast(1.26052070140663063778e-3), + static_cast(2.93967534265875431639e-5), + static_cast(1.82706995042259549615e-7), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 4.9609e-17 + static const RealType P[7] = { + static_cast(1.22610122564874280532e-1), + static_cast(3.70273222121572231593e-2), + static_cast(4.06083618461789591121e-3), + static_cast(1.96898134215932126299e-4), + static_cast(4.08421066512186972853e-6), + static_cast(2.87707419853226244584e-8), + static_cast(2.96850126180387702894e-11), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(3.55825191301363023576e-1), + static_cast(4.77251766176046719729e-2), + static_cast(2.99136605131226103925e-3), + static_cast(8.78895785432321899939e-5), + static_cast(1.05235770624006494709e-6), + static_cast(3.35423877769913468556e-9), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 5.6559e-17 + static const RealType P[7] = { + static_cast(9.03056141356415077080e-2), + static_cast(1.37568904417652631821e-2), + static_cast(7.60947271383247418831e-4), + static_cast(1.86048302967560067128e-5), + static_cast(1.94537860496575427218e-7), + static_cast(6.90524093915996283104e-10), + static_cast(3.58808434477817122371e-13), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.80501347735272292079e-1), + static_cast(1.22807958286146936376e-2), + static_cast(3.90421541115275676253e-4), + static_cast(5.81669449234915057779e-6), + static_cast(3.53005415676201803667e-8), + static_cast(5.69883025435873921433e-11), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 6.0653e-17 + static const RealType P[7] = { + static_cast(6.57333571766941474226e-2), + static_cast(5.02795551798163084224e-3), + static_cast(1.39633616037997111325e-4), + static_cast(1.71386564634533872559e-6), + static_cast(8.99508156357247137439e-9), + static_cast(1.60229460572297160486e-11), + static_cast(4.17711709622960498456e-15), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(9.10198637347368265508e-2), + static_cast(3.12263472357578263712e-3), + static_cast(5.00524795130325614005e-5), + static_cast(3.75913188747149725195e-7), + static_cast(1.14970132098893394023e-9), + static_cast(9.34957119271300093120e-13), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType t = 1 / sqrt(x); + + // Rational Approximation + // Maximum Relative Error: 2.0104e-20 + static const RealType P[5] = { + static_cast(3.98942280401432677940e-1), + static_cast(8.12222388783621449146e-2), + static_cast(1.68515703707271703934e-2), + static_cast(2.19801627205374824460e-3), + static_cast(-5.63321705854968264807e-5), + }; + static const RealType Q[5] = { + static_cast(1), + static_cast(6.02536240902768558315e-1), + static_cast(1.99284471400121092380e-1), + static_cast(3.48012577961755452113e-2), + static_cast(3.38545004473058881799e-3), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t; + } + + return result; +} + + +template +inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (x < 0.125) { + // Rational Approximation + // Maximum Relative Error: 6.9340e-35 + static const RealType P[30] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.0e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.25520067710293108163697513129883130648e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.70866020657515874782126804139443323023e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.00865235319309486225795793030882782077e7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.15226363537737769449645357346965170790e10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.90371247243851280277289046301838071764e12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.55124590509169425751300134399513503679e14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.31282020412787511681760982839078664474e16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.81134278666896523873256421982740565131e18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.36154530125229747305141034242362609073e20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.67793867640429875837167908549938345465e22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34584264816825205490037614178084070903e24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.52622279567059369718208827282730379468e25), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.84678324511679577282571711018484545185e27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.99412564257799793932936828924325638617e28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.08467105431111959283045453636520222779e30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.87466808926544728702827204697734995611e31), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.55020252231174414164534905191762212055e32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.69582736077420504345389671165954321163e33), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.18203860972249826626461130638196586188e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32955733788770318392204091471121129386e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.97972270315674052071792562126668438695e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.93941537398987201071027348577636994465e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.40818708062034138095495206258366082481e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.76833406751769751643745383413977973530e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.67873467711368838525239991688791162617e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.94179310584115437584091984619858795365e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.24348215908456320362232906012152922949e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.71625432346533320597285660433110657670e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.54662474187354179772157464533408058525e33), + }; + static const RealType Q[31] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05231337496532137901354609636674085703e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.43071888317491317900094470796567113997e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.80864482202910830302921131771345102044e8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.32755297215862998181755216820621285536e10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.86251123527611073428156549377791985741e12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.12025543961949466786297141758805461421e15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.27681657695574252637426145112570596483e17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17850553865715973904162289375819555884e19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.87285897504702686250962844939736867339e20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.46852796231948446334549476317560711795e22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.76101689878844725930808096548998198853e24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14017776727845251567032313915953239178e26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.83738954971390158348334918235614003163e27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04701345216121451992682705965658316871e29), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.29994190638467725374533751141434904865e30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.03334024242845994501493644478442360593e31), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.59094378123268840693978620156028975277e32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.05630254163426327113368743426054256780e33), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.06008195534030444387061989883493342898e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.21262490304347036689874956206774563906e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52353024633841796119920505314785365242e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.28839143293381125956284415313626962263e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.31074057704096457802547386358094338369e37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.24762412200364040971704861346921094354e37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.55663903116458425420509083471048286114e37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.81839283802391753865642022579846918253e37), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.40026559327708207943879092058654410696e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.48767474646810049293505781106444169229e36), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.10591353097667671736865938428051885499e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.26980708896893794012677171239610721832e33), + }; + + result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); + } + else if (x < 0.25) { + RealType t = x - 0.125; + + // Rational Approximation + // Maximum Relative Error: 9.6106e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.31887921568009055676985827521151969069e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.62791448964529380666250180886203090183e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.18238045199893937316918299064825702894e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.77274519306540522227493503092956314136e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.89424638466340765479970877448972418958e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.84027004420207996285174223581748706097e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.84633134142285937075423713704784530853e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.76780579189423063605715733542379494552e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19812409802969581112716039533798357401e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.60039008588877024309600768114757310858e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.10268260529501421009222937882726290612e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.72169594688819848498039471657587836720e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.27181379647139697258984772894869505788e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.73617450590346508706222885401965820190e1), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.18558935411552146390814444666395959919e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49210559503096368944407109881023223654e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.93959323596111340518285858313038058302e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.53590607436758691037825792660167970938e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.82700985983018132572589829602100319330e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.62137033935442506086127262036686905276e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.76014299715348555304267927238963139228e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.12336796972134088340556958396544477713e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.01952132024838508233050167059872220508e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.41846547214877387780832317250797043384e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.02083431572388097955901208994308271581e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.30401057171447074343957754855656724141e4), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 0.5) { + RealType t = x - 0.25; + + // Rational Approximation + // Maximum Relative Error: 3.1519e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.87119665000174806422420129219814467874e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.60769554551148293079169764245570645155e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.49181979810834706538329284478129952168e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.15722765491675871778645250624425739489e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.65973147084701923411221710174830072860e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.93709338011482232037110656459951914303e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.57393131299425403017769538642434714791e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.24110491141294379107651487490031694257e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23670394514211681515965192338544032862e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.06141024932329394052395469123628405389e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.08599362073145455095790192415468286304e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.22746783794652085925801188098270888502e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.19652234873414609727168969049557770989e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.73529976407853894192156335785920329181e-4), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.04157569499592889296640733909653747983e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.82248883130787159161541119440215325308e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.35191216924911901198168794737654512677e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.05099314677808235578577204150229855903e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.61081069236463123032873733048661305746e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.65340645555368229718826047069323437201e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.44526681322128674428653420882660351679e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.03963804195353853550682049993122898950e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.40399236835577953127465726826981753422e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.46764755170079991793106428011388637748e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.06384106042490712972156545051459068443e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.27614406724572981099586665536543423891e0), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 1) { + RealType t = x - 0.5; + + // Rational Approximation + // Maximum Relative Error: 7.1196e-37 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.31309550000758082761278726632760756847e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.07242222531117199094690544171275415854e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.18286763141875580859241637334381199648e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.72102024869298528501604761974348686708e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.31748399999514540052066169132819656757e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.72168003284748405703923567644025252608e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52648991506052496046447777354251378257e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.16777263528764704804758173026143295383e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.66044453196259367950849328889468385159e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.35095952392355288307377427145581700484e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43011308494452327007589069222668324337e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16582092138863383294685790744721021189e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.02261914949200575965813000131964695720e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.93943913630044161720796150617166047233e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.76395009419307902351328300308365369814e-8), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.28073115520716780203055949058270715651e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.20245752585870752942356137496087189194e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.34548337034735803039553186623067144497e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.90925817267776213429724248532378895039e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.92883822651628140083115301005227577059e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.72868136219107985834601503784789993218e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.50498744791568911029110559017896701095e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.05178276667813671578581259848923964311e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.16880263792490095344135867620645018480e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16199396397514668672304602774610890666e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.25543193822942088303609988399416145281e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.62522294286034117189844614005500278984e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18342889744790118595835138444372660676e-3), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 2) { + RealType t = x - 1; + + // Rational Approximation + // Maximum Relative Error: 9.5605e-36 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.71280312689343266367958859259591541365e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49628636612698702680819948707479820292e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.61090930375686902075245639803646265081e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.01191924051756106307211298794294657688e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.42496510376427957390465373165464672088e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.59577769624139820954046058289100998534e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.02664809521258420718170586857797408674e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.72258711278476951299824066502536249701e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.72578941800687566921553416498339481887e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.12553368488232553360765667155702324159e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.20749770911901442251726681861858323649e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00621121212654384864006297569770703900e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18976033102817074104109472578202752346e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.22093548539863254922531707899658394458e-10), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.83305694892673455436552817409325835774e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49922543669955056754932640312490112609e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.23488972536322019584648241457582608908e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.14051527527038669918848981363974859889e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.37891280136777182304388426277537358346e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.08058775103864815769223385606687612117e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.83305488980337433132332401784292281716e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.71072208215804671719811563659227630554e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.86332040813989094594982937011005305263e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.87698178237970337664105782546771501188e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.69113555019737313680732855691540088318e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.31888539972217875242352157306613891243e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.85633766164682554126992822326956560433e-8), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 4) { + RealType t = x - 2; + + // Rational Approximation + // Maximum Relative Error: 1.1494e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.13928162275383718405630406427822960090e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.90742307267701162395764574873947997211e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.13821826367941514387521090205756466068e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.96186879146063565484800486550739025293e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19438785955706463753454881511977831603e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.44969124820016994689518539612465708536e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.27841835070651018079759230944461773079e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.69952429132675045239242077293594666305e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47919853099168659881487026035933933068e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.04644774117864306055402364094681541437e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.52604718870921084048756263996119841957e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.97610950633031564892821158058978809537e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.35934159016861180185992558083703785765e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.21044098237798939057079316997065892072e-14), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.94437702178976797218081686254875998984e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.82068837586514484653828718675654460991e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.87606058269189306593797764456467061128e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.39130528408903116343256483948950693356e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.52792074489091396425713962375223436022e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00892233011840867583848470677898363716e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.53717105060592851173320646706141911461e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.57293857675930200001382624769341451561e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04219251796696135508847408131139677925e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.20053006131133304932740325113068767057e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.26384707028090985155079342718673255493e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.19146442700994823924806249608315505708e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.59879298772002950043508762057850408213e-12), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 8) { + RealType t = x - 4; + + // Rational Approximation + // Maximum Relative Error: 1.9710e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.63772802979087199762340235165979751298e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.31941534705372320785274994658709390116e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43643960022585762678456016437621064500e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.11415302325466272779041471612529728187e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15767742459744253874067896740220951622e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.74049309186016489825053763513176160256e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.76349898574685150849080543168157785281e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19757202370729036627932327405149840205e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.32067727965321839898287320520750897894e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47636340015260789807543414080472136575e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.36236727340568181129875213546468908164e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.89379573960280486883733996547662506245e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.71832232038263988173042637335112603365e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.72380245500539326441037770757072641975e-18), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.51702400281458104713682413542736419584e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01375164846907815766683647295932603968e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.92796007869834847612192314006582598557e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.77580441164023725582659445614058463183e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.63592331843149724480258804892989851727e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.87334158717610115008450674967492650941e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.46596056941432875244263245821845070102e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.69980051560936361597177347949112822752e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.61690034211585843423761830218320365457e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.40619773800285766355596852314940341504e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.10624533319804091814643828283820958419e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.10009654621246392691126133176423833259e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.48070591106986983088640496621926852293e-16), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 16) { + RealType t = x - 8; + + // Rational Approximation + // Maximum Relative Error: 5.2049e-36 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.22610122564874286614786819620499101143e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.30352481858382230273216195795534959290e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.45933050053542949214164590814846222512e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.18776888646200567321599584635465632591e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.53421996228923143480455729204878676265e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.26075686557831306993734433164305349875e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.58045762501721375879877727645933749122e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.13469629033419341069106781092024950086e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.09157226556088521407323375433512662525e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.44961350323527660188267669752380722085e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11052101325523147964890915835024505324e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.26421404354976214191891992583151033361e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.17133505681224996657291059553060754343e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41010917905686427164414364663355769988e-22), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.31062773739451672808456319166347015167e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.35386721434011881226168110614121649232e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.39357338312443465616015226804775178232e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.26630144036271792027494677957363535353e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.24340476859846183414651435036807677467e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.33917136421389571662908749253850939876e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.80972141456523767244381195690041498939e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.22653625120465488656616983786525028119e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.64072452032620505897896978124863889812e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.61842001579321492488462230987972104386e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96631619425501661980194304605724632777e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.80392324086028812772385536034034039168e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.34254502871215949266781048808984963366e-20), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 32) { + RealType t = x - 16; + + // Rational Approximation + // Maximum Relative Error: 1.7434e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.03056141356415128156562790092782153630e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.15331583242023443256381237551843296356e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.81847913073640285776566199343276995613e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.23578443960486030170636772457627141406e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.36906354316016270165240908809929957836e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.80584421020238085239890207672296651219e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.20726437845755296397071540583729544203e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.71042563703818585243207722641746283288e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.08307373360265947158569900625482137206e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.80776566500233755365518221977875432763e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11405351639704510305055492207286172753e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.21575609293568296049921888011966327905e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.66081982641748223969990279975752576675e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96483118060215455299182487430511998831e-26), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.77347004038951368607085827825968614455e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.27559305780716801070924630708599448466e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.05452382624230160738008550961679711827e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.75369667590360521677018734348769796476e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.56551290985905942229892419848093494661e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.46972102361871185271727958608184616388e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.72423917010499649257775199140781647069e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14337306905269302583746182007852069459e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.69949885309711859563395555285232232606e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.00318719634300754237920041312234711548e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41139664927184402637020651515172315287e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.79013190225240505774959477465594797961e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.46536966503325413797061462062918707370e-24), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else if (x < 64) { + RealType t = x - 32; + + // Rational Approximation + // Maximum Relative Error: 2.0402e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.57333571766941514095434647381791040479e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15416685251021339933358981066948923001e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.86806753164417557035166075399588122481e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.91972616817770660098405128729991574724e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.10225768760715861978198010761036882002e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.05986998674039047865566990469266534338e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.59572646670205456333051888086612875871e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19347294198055585461131949159508730257e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21328285448498841418774425071549974153e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.19331596847283822557042655221763459728e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.36128017817576942059191451016251062072e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.35600223942735523925477855247725326228e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.14658948592500290756690769268766876322e-26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.86984591055448991335081550609451649866e-30), + }; + static const RealType Q[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.90112824856612652807095815199496602262e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59291524937386142936420775839969648652e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.74245361925275011235694006013677228467e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.41828589449615478387532599798645159282e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.08088176420557205743676774127863572768e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.30760429417424419297000535744450830697e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.18464910867914234357511605329900284981e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.74255540513281299503596269087176674333e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.02616028440371294233330747672966435921e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.26276597941744408946918920573146445795e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.47463109867603732992337779860914933775e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.77217411888267832243050973915295217582e-24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.67397425207383164084527830512920206074e-28), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); + } + else { + RealType t = 1 / sqrt(x); + + // Rational Approximation + // Maximum Relative Error: 9.2612e-35 + static const RealType P[9] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.98942280401432677939946059934381868476e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33908701314796522684603310107061150444e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.92120397142832495974006972404741124398e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.15463147603421962834297353867930971657e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.44488751006069172847577645328482300099e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.44057582804743599116332797864164802887e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.02968018188491417839349438941039867033e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.75092244933846337077999183310087492887e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.35099582728548602389917143511323566818e-8), + }; + static const RealType Q[7] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.34601617336219074065534356705298927390e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.82954035780824611941899463895040327299e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.70929001162671283123255408612494541378e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05508596604210030533747793197422815105e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.02913299057943756875992272236063124608e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.37824426836648736125759177846682556245e-5), + }; + + result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t) * t; + } + + return result; +} + +template +inline RealType saspoint5_cdf_imp_prec(const RealType& x, bool complement, const std::integral_constant& tag) { + if (x >= 0) { + return complement ? saspoint5_cdf_plus_imp_prec(x, tag) : 1 - saspoint5_cdf_plus_imp_prec(x, tag); + } + else if (x <= 0) { + return complement ? 1 - saspoint5_cdf_plus_imp_prec(-x, tag) : saspoint5_cdf_plus_imp_prec(-x, tag); + } + else { + return std::numeric_limits::quiet_NaN(); + } +} + +template +inline RealType saspoint5_cdf_imp_prec(const RealType& x, bool complement, const std::integral_constant& tag) { + if (x >= 0) { + return complement ? saspoint5_cdf_plus_imp_prec(x, tag) : 1 - saspoint5_cdf_plus_imp_prec(x, tag); + } + else if (x <= 0) { + return complement ? 1 - saspoint5_cdf_plus_imp_prec(-x, tag) : saspoint5_cdf_plus_imp_prec(-x, tag); + } + else { + return std::numeric_limits::quiet_NaN(); + } +} + +template +inline RealType saspoint5_cdf_imp(const saspoint5_distribution& dist, const RealType& x, bool complement) { + // + // This calculates the cdf of the Saspoint5 distribution and/or its complement. + // + + BOOST_MATH_STD_USING // for ADL of std functions + static const char* function = "boost::math::cdf(saspoint5<%1%>&, %1%)"; + RealType result = 0; + RealType location = dist.location(); + RealType scale = dist.scale(); + + if (false == detail::check_location(function, location, &result, Policy())) + { + return result; + } + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + if (false == detail::check_x(function, x, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + RealType u = (x - location) / scale; + + result = saspoint5_cdf_imp_prec(u, complement, tag_type()); + + return result; +} + +template +inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (ilogb(p) >= -2) { + RealType u = -log2(ldexp(p, 1)); + + if (u < 0.125) { + // Rational Approximation + // Maximum Relative Error: 4.2616e-17 + static const RealType P[13] = { + static_cast(1.36099130643975127045e-1), + static_cast(2.19634434498311523885e1), + static_cast(1.70276954848343179287e3), + static_cast(8.02187341786354339306e4), + static_cast(2.48750112198456813443e6), + static_cast(5.20617858300443231437e7), + static_cast(7.31202030685167303439e8), + static_cast(6.66061403138355591915e9), + static_cast(3.65687892725590813998e10), + static_cast(1.06061776220305595494e11), + static_cast(1.23930642673461465346e11), + static_cast(1.49986408149520127078e10), + static_cast(-6.17325587219357123900e8), + }; + static const RealType Q[13] = { + static_cast(1), + static_cast(1.63111146753825227716e2), + static_cast(1.27864461509685444043e4), + static_cast(6.10371533241799228037e5), + static_cast(1.92422115963507708309e7), + static_cast(4.11544185502250709497e8), + static_cast(5.95343302992055062258e9), + static_cast(5.65615858889758369947e10), + static_cast(3.30833154992293143503e11), + static_cast(1.06032392136054207216e12), + static_cast(1.50071282012095447931e12), + static_cast(5.43552396263989180433e11), + static_cast(9.57434915768660935004e10), + }; + + result = u * tools::evaluate_polynomial(P, u) / (tools::evaluate_polynomial(Q, u) * (p * p)); + } + else if (u < 0.25) { + RealType t = u - 0.125; + + // Rational Approximation + // Maximum Relative Error: 2.3770e-19 + static const RealType P[8] = { + static_cast(1.46698650748920243698e-2), + static_cast(3.58380131788385557227e-1), + static_cast(3.39153750029553194566e0), + static_cast(1.55457424873957272207e1), + static_cast(3.44403897039657057261e1), + static_cast(3.01881531964962975320e1), + static_cast(2.77679052294606319767e0), + static_cast(-7.76665288232972435969e-2), + }; + static const RealType Q[7] = { + static_cast(1), + static_cast(1.72584280323876188464e1), + static_cast(1.11983518800147654866e2), + static_cast(3.25969893054048132145e2), + static_cast(3.91978809680672051666e2), + static_cast(1.29874252720714897530e2), + static_cast(2.08740114519610102248e1), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else if (u < 0.5) { + RealType t = u - 0.25; + + // Rational Approximation + // Maximum Relative Error: 9.2445e-18 + static const RealType P[8] = { + static_cast(2.69627866689346445458e-2), + static_cast(3.23091180507445216811e-1), + static_cast(1.42164019533549860681e0), + static_cast(2.74613170828120023406e0), + static_cast(2.07865023346180997996e0), + static_cast(2.53267176863740856907e-1), + static_cast(-2.55816250186301841152e-2), + static_cast(3.02683750470398342224e-3), + }; + static const RealType Q[6] = { + static_cast(1), + static_cast(8.55049920135376003042e0), + static_cast(2.48726119139047911316e1), + static_cast(2.79519589592198994574e1), + static_cast(9.88212916161823866098e0), + static_cast(1.39749417956251951564e0), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else { + RealType t = u - 0.5; + + // Rational Approximation + // Maximum Relative Error: 2.2918e-20 + static const RealType P[9] = { + static_cast(4.79518653373241051274e-2), + static_cast(3.81837125793765918564e-1), + static_cast(1.13370353708146321188e0), + static_cast(1.55218145762186846509e0), + static_cast(9.60938271141036509605e-1), + static_cast(2.11811755464425606950e-1), + static_cast(8.84533960603915742831e-3), + static_cast(1.73314614571009160225e-3), + static_cast(-3.63491208733876986098e-5), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(6.36954463000253710936e0), + static_cast(1.40601897306833147611e1), + static_cast(1.33838075106916667084e1), + static_cast(5.60958095533108032859e0), + static_cast(1.11796035623375210182e0), + static_cast(1.12508482637488861060e-1), + static_cast(5.18503975949799718538e-3), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + } + else if (ilogb(p) >= -4) { + RealType t = -log2(ldexp(p, 2)); + + // Rational Approximation + // Maximum Relative Error: 4.2057e-18 + static const RealType P[10] = { + static_cast(8.02395484493329835881e-2), + static_cast(2.46132933068351274622e-1), + static_cast(2.81820176867119231101e-1), + static_cast(1.47754061028371025893e-1), + static_cast(3.54638964490281023406e-2), + static_cast(3.99998730093393774294e-3), + static_cast(3.81581928434827040262e-4), + static_cast(1.82520920154354221101e-5), + static_cast(-2.06151396745690348445e-7), + static_cast(6.77986548138011345849e-9), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(2.39244329037830026691e0), + static_cast(2.12683465416376620896e0), + static_cast(9.02612272334554457823e-1), + static_cast(2.06667959191488815314e-1), + static_cast(2.79328968525257867541e-2), + static_cast(2.28216286216537879937e-3), + static_cast(1.04195690531437767679e-4), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else if (ilogb(p) >= -8) { + RealType t = -log2(ldexp(p, 4)); + + // Rational Approximation + // Maximum Relative Error: 3.3944e-17 + static const RealType P[9] = { + static_cast(1.39293493266195561875e-1), + static_cast(1.26741380938661691592e-1), + static_cast(4.31117040307200265931e-2), + static_cast(7.50528269269498076949e-3), + static_cast(8.63100497178570310436e-4), + static_cast(6.75686286034521991703e-5), + static_cast(3.11102625473120771882e-6), + static_cast(9.63513655399980075083e-8), + static_cast(-6.40223609013005302318e-11), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(8.11234548272888947555e-1), + static_cast(2.63525516991753831892e-1), + static_cast(4.77118226533147280522e-2), + static_cast(5.46090741266888954909e-3), + static_cast(4.15325425646862026425e-4), + static_cast(2.02377681998442384863e-5), + static_cast(5.79823311154876056655e-7), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else if (ilogb(p) >= -16) { + RealType t = -log2(ldexp(p, 8)); + + // Rational Approximation + // Maximum Relative Error: 4.1544e-17 + static const RealType P[9] = { + static_cast(1.57911660613037760235e-1), + static_cast(5.59740955695099219682e-2), + static_cast(8.92895854008560399142e-3), + static_cast(8.88795299273855801726e-4), + static_cast(5.66358335596607738071e-5), + static_cast(2.46733195253941569922e-6), + static_cast(6.44829870181825872501e-8), + static_cast(7.62193242864380357931e-10), + static_cast(-7.82035413331699873450e-14), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(3.49007782566002620811e-1), + static_cast(5.65303702876260444572e-2), + static_cast(5.54316442661801299351e-3), + static_cast(3.58498995501703237922e-4), + static_cast(1.53872913968336341278e-5), + static_cast(4.08512152326482573624e-7), + static_cast(4.72959615756470826429e-9), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else if (ilogb(p) >= -32) { + RealType t = -log2(ldexp(p, 16)); + + // Rational Approximation + // Maximum Relative Error: 8.5877e-18 + static const RealType P[10] = { + static_cast(1.59150086070234563099e-1), + static_cast(6.07144002506911115092e-2), + static_cast(1.10026443723891740392e-2), + static_cast(1.24892739209332398698e-3), + static_cast(9.82922518655171276487e-5), + static_cast(5.58366837526347222893e-6), + static_cast(2.29005408647580194007e-7), + static_cast(6.44325718317518336404e-9), + static_cast(1.05110361316230054467e-10), + static_cast(1.48083450629432857655e-18), + }; + static const RealType Q[9] = { + static_cast(1), + static_cast(3.81470315977341203351e-1), + static_cast(6.91330250512167919573e-2), + static_cast(7.84712209182587717077e-3), + static_cast(6.17595479676821181012e-4), + static_cast(3.50829361179041199953e-5), + static_cast(1.43889153071571504712e-6), + static_cast(4.04840254888235877998e-8), + static_cast(6.60429636407045050112e-10), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else if (ilogb(p) >= -64) { + RealType t = -log2(ldexp(p, 32)); + + // Rational Approximation + // Maximum Relative Error: 8.7254e-17 + static const RealType P[9] = { + static_cast(1.59154943017783026201e-1), + static_cast(6.91506515614472069475e-2), + static_cast(1.44590186111155933843e-2), + static_cast(1.92616138327724025421e-3), + static_cast(1.79640147906775699469e-4), + static_cast(1.30852535070639833809e-5), + static_cast(5.55259657884038297268e-7), + static_cast(3.50107118687544980820e-8), + static_cast(-1.47102592933729597720e-22), + }; + static const RealType Q[8] = { + static_cast(1), + static_cast(4.34486357752330500669e-1), + static_cast(9.08486933075320995164e-2), + static_cast(1.21024289017243304241e-2), + static_cast(1.12871233794777525784e-3), + static_cast(8.22170725751776749123e-5), + static_cast(3.48879932410650101194e-6), + static_cast(2.19978790407451988423e-7), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else { + result = 1 / (p * p * constants::two_pi()); + } + + return result; +} + + +template +inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +{ + BOOST_MATH_STD_USING + RealType result; + + if (ilogb(p) >= -2) { + RealType u = -log2(ldexp(p, 1)); + + if (u < 0.125) { + // Rational Approximation + // Maximum Relative Error: 2.5675e-36 + static const RealType P[31] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36099130643975133156293056139850872219e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.03940482189350763127508703926866548690e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.00518276893354880480781640750482315271e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.55844903094077096941027360107304259099e6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04507684135310729583474324660276395831e9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.28519957085041757616278379578781441623e11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.26054173986187219679917530171252145632e13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00693075272502479915569708465960917906e15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.64153695410984136395853200311209462775e16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.64993034609287363745840801813540992383e18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.68080300629977787949474098413155901197e20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.50632142671665246974634799849090331338e21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.11943753054362349397013211631038480307e23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.80601829873419334580289886671478701625e24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33441650581633426542372642262736818512e26), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.56279427934163518272441555879970370340e27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.08899113985387092689705022477814364717e28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.37750989391907347952902900750138805007e29), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.76961267256299304213687639380275530721e30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.98417586455955659885944915688130612888e31), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.40932923796679251232655132670811114351e32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.80810239916688876216017180714744912573e33), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.23907429566810200929293428832485038147e33), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.11441754640405256305951569489818422227e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.30534222360394829628175800718529342304e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.73301799323855143458670230536670073483e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.53142592196246595846485130434777396548e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.81719621726393542967303806360105998384e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.00188544550531824809437206713326495544e33), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.62706943144847786115732327787879709587e32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.32129438774563059735783287456769609571e31), + }; + static const RealType Q[32] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.65910866673514847742559406762379054364e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.21954860438789969160116317316418373146e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.85684385746348850219351196129081986508e7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.76131116920014625994371306210585646224e9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.57402411617965582839975369786525269977e11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.42213951996062253608905591667405322835e13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.55477693883842522631954327528060778834e15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.00397907346473927493255003955380711046e17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.76305959503723486331556274939198109922e19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.27926540483498824808520492399128682366e21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.98253913105291675445666919447864520248e22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.63457445658532249936389003141915626894e24), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.51446616633910582673057455450707805902e25), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04744823698010333311911891992022528040e27), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.03400927415310540137351756981742318263e28), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.28761940359662123632247441327784689568e29), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.39016138777648624292953560568071708327e30), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.79639567867465767764785448609833337532e31), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.23406781975678544311073661662680006588e32), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.97261483656310352862554580475760827374e33), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.62715040832592600542933595577003951697e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.77359945057399130202830211722221279906e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.07842295432910751940058270741081867701e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.51739306780247334064265249344359460675e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.60574331076505049588401700048488577194e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.08286808700840316336961663635580879141e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.27661033115008662284071342245200272702e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00465576791024249023365007797010262700e35), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.83311248273885136105510175099322638440e34), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96635220211386288597285960837372073054e33), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23849744128418288892902205619933047730e32), + }; + + result = u * tools::evaluate_polynomial(P, u) / (tools::evaluate_polynomial(Q, u) * (p * p)); + } + else if (u < 0.25) { + RealType t = u - 0.125; + + // Rational Approximation + // Maximum Relative Error: 9.0663e-36 + static const RealType P[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.46698650748920243663487731226111319705e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.39021286045890143123252180276484388346e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21933242816562043224009451007344301143e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33741547463966207206741888477702151242e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.29556944160837955334643715180923663741e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.25261081330476435844217173674285740857e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.28690563577245995896389783271544510833e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.51764495004238264050843085122188741180e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.00501773552098137637598813101153206656e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.93991776883375928647775429233323885440e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.13059418708769178567954713937745050279e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.41565791250614170744069436181282300453e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.35838723365672196069179944509778281549e1), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.63888803456697300467924455320638435538e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.74785179836182339383932806919167693991e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.15133301804008879476562749311747788645e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.87361675398393057971764841741518474061e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.02992617475892211368309739891693879676e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.36356854400440662641546588001882412251e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.35807552915245783626759227539698719908e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.75959389290929178190646034566377062463e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18514088996371641206828142820042918681e5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.54881978220293930450469794941944831047e4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.83958740186543542804045767758191509433e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.26637084978098507405883170227585648985e2), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else if (u < 0.5) { + RealType t = u - 0.25; + + // Rational Approximation + // Maximum Relative Error: 7.1265e-35 + static const RealType P[14] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.69627866689346442965083437425920959525e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.28948812330446670380449765578224539665e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.38832694133021352110245148952631526683e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.70206624753427831733487031852769976576e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34677850226082773550206949299306677736e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.18657422004942861459539366963056149110e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.90933843076824719761937043667767333536e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.78597771586582252472927601403235921029e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.76489020985978559079198751910122765603e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.37662018494780327201390375334403954354e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11303058491765900888068268844399186476e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.38147649159947518976483710606042789880e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.81260575060831053615857196033574207714e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.26783311530618626413866321968979725353e-3), + }; + static const RealType Q[13] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.98941943311823528497840052715295329781e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70142252619301982454969690308614487433e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.17472255695869018956165466705137979540e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.42016169942136311355803413981032780219e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.55874385736597452997483327962434131932e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.45782883079400958761816030672202996788e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.05272877129840019671123017296056938361e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.79833037593794381103412381177370862105e3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.67388248713896792948592889733513376054e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.19952164110429183557842014635391021832e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.43813483967503071358907030110791934870e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.21327682641358836049127780506729428797e-1), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else { + RealType t = u - 0.5; + + // Rational Approximation + // Maximum Relative Error: 2.7048e-37 + static const RealType P[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.79518653373241051262822702930040975338e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.62230291299220868262265687829866364204e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.87315544620612697712513318458226575394e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.38993950875334507399211313740958438201e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.54257654902026056547861805085572437922e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.85673656862223617197701693270067722169e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47842193222521213922734312546590337064e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.76640627287007744941009407221495229316e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.71884893887802925773271837595143776207e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.87432154629995817972739015224205530101e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.44664933176248007092868241686074743562e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.32094739938150047092982705610586287965e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.18537678581395571564129512698022192316e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.99365265557355974918712592061740510276e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.66467016868206844419002547523627548705e-6), + }; + static const RealType Q[15] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01315080955831561204744043759079263546e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.43409077070585581955481063438385546913e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.09863540097812452102765922256432103612e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.69971336507400724019217277303598318934e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.71444880426858110981683485927452024652e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15252748520663939799185721687082682973e2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.28399989835264172624148638350889215004e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.73464700365199500083227290575797895127e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.40421770918884020099427978511354197438e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.97023025282119988988976542004620759235e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.38774609088015115009880504176630591783e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52748138528630655371589047000668876440e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.13088455793478303045390386135591069087e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.18220605549460262119565543089703387122e-5), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + } + else if (ilogb(p) >= -4) { + RealType t = -log2(ldexp(p, 2)); + + // Rational Approximation + // Maximum Relative Error: 3.8969e-35 + static const RealType P[18] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.02395484493329839255216366819344305871e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.02703992140456336967688958960484716694e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.38779662796374026809611637926067177436e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.22326903547451397450399124548020897393e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.29321119874906326000117036864856138032e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.60045794013093831332658415095234082115e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.75863216252160126657107771372004587438e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.65658718311497180532644775193008407069e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.53225259384404343896446164609240157391e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17876243295156782920260122855798305258e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59647007234516896762020830535717539733e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.64519789656979327339865975091579252352e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29566724776730544346201080459027524931e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.40979492647851412567441418477263395917e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.78894057948338305679452471174923939381e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.97064244496171921075006182915678263370e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.13496588267213644899739513941375650458e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.75224691413667093006312591320754720811e-14), + }; + static const RealType Q[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.59000688626663121310675150262772434285e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.37518060227321498297232252379976917550e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96559443266702775026538144474892076437e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.81865210018244220041408788510705356696e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15188291931842064325756652570456168425e1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.16909307081950035111952362482113369939e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.68454509269150307761046136063890222011e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.06391236761753712424925832120306727169e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.35744804731044427608283991933125506859e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00655928177646208520006978937806043639e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04093230988242553633939757013466501271e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.07921031269974885975846184199640060403e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.61356596082773699708092475561216104426e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.83968520269928804453766899533464507543e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.44620973323561344735660659502096499899e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.84398925760354259350870730551452956164e-11), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else if (ilogb(p) >= -8) { + RealType t = -log2(ldexp(p, 4)); + + // Rational Approximation + // Maximum Relative Error: 4.0176e-35 + static const RealType P[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.39293493266195566603513288406748830312e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.75724665658983779947977436518056682748e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.42437549740894393207094008058345312893e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.26189619865771499663660627120168211026e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.38952430871711360962228087792821341859e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.09604487371653920602809626594722822237e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06215021409396534038209460967790566899e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.02245531075243838209245241246011523536e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.52822482024384335373072062232322682354e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.32527687997718638700761890588399465467e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.54799997015944073019842889902521208940e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59368565314052950335981455903474908073e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.09459594346367728583560281313278117879e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.30296867679720593932307487485758431355e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04594079707862644415224596859620253913e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.40274507498190913768918372242285652373e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.48644117815971872777609922455371868747e-16), + }; + static const RealType Q[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.88079839671202113888025645668230104601e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.58898753182105924446845274197682915131e0), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.05418719178760837974322764299800701708e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.76439568495464423890950166804368135632e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.87661284201828717694596419805804620767e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29462021166220769918154388930589492957e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.89960014717788045459266868996575581278e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.21759236630028632465777310665839652757e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.08884467282860764261728614542418632608e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.60098870889198704716300891829788260654e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00120123451682223443624210304146589040e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.08868117923724451329261971335574401646e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.07346130275947166224129347124306950150e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.57848230665832873347797099944091265220e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.50841502849442327828534131901583916707e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19165038770000448560339443014882434202e-15), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else if (ilogb(p) >= -16) { + RealType t = -log2(ldexp(p, 8)); + + // Rational Approximation + // Maximum Relative Error: 4.1682e-36 + static const RealType P[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.57911660613037766795694241662819364797e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.28799302413396670477035614399187456630e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.87488304496324715063356722168914018093e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.15106082041721012436439208357739139578e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.91744691940169259573871742836817806248e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.40707390548486625606656777332664791183e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.37047148097688601398129659532643297674e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.88039545021930711122085375901243257574e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.22254460725736448552173288004145978774e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.58462349007293730244197837509157696852e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.95242372547984999431208546685672497090e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.10113734998651793201123616276573169622e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.38963677413425618019569452771868834246e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.45242599273032563942546507899265865936e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.64855118157117311049698715635863670233e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.31679318790012894619592273346600264199e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.97289727214495789126072009268721022605e-20), + }; + static const RealType Q[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.10184661848812835285809771940181522329e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.06179300560230499194426573196970342618e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.23171547302923911058112454487643162794e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.20486436116678834807354529081908850425e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.51239574861351183874145649960640500707e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.48939385253081273966380467344920741615e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18148716720470800170115047757600735127e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.68156131480770927662478944117713742978e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.13720275846166334505537351224097058812e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.85505701632948614345319635028225905820e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.91876669388212587242659571229471930880e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.12971661051277278610784329698988278013e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.31096179726750865531615367639563072055e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.03579138802970748888093188937926461893e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.45570688568663643410924100311054014175e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23959804461200982866930072222355142173e-19), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else if (ilogb(p) >= -32) { + RealType t = -log2(ldexp(p, 16)); + + // Rational Approximation + // Maximum Relative Error: 6.2158e-37 + static const RealType P[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59150086070234561732507586188017224084e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.80849532387385837583114307010320459997e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41158479406270598752210344238285334672e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.88824037165656723581890282427897772492e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.82912940787568736176030025420621547622e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36469458704261637785603215754389736108e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.13801486421774537025334682673091205328e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.97058432407176502984043208925327069250e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.60823277541385163663463406307766614689e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.45016369260792040947272022706860047646e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.54846457278644736871929319230398689553e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.67291749890916930953794688556299297735e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.18742803398417392282841454979723852423e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.13337431668170547244474715030235433597e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.37782648734897338547414800391203459036e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17863064141234633971470839644872485483e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.58768205048500915346781559321978174829e-24), + }; + static const RealType Q[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.27782279546086824129750042200649907991e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.86934772625607907724733810228981095894e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18640923531164938140838239032346416143e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14927915778694317602192656254187608215e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.57462121236985574785071163024761935943e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.11326475640883361512750692176665937785e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.49479333407835032831192117009600622344e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01048164044583907219965175201239136609e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.42444147056333448589159611785359705792e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.72928365136507710372724683325279209464e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30776323450676114149657959931149982200e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.51599272091669693373558919762006698549e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.12120236145539526122748260176385899774e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.65713807525694136400636427188839379484e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.40555520515542383952495965093730818381e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.51084407433793180162386990118245623958e-23), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else if (ilogb(p) >= -64) { + RealType t = -log2(ldexp(p, 32)); + + // Rational Approximation + // Maximum Relative Error: 9.8515e-35 + static const RealType P[18] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59154943017783040087729009335921759322e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.35955784629344586058432079844665517425e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.24333525582177610783141409282489279582e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.58257137499954581519132407255793210808e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47191495695958634792434622715063010854e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06408464185207904662485396901099847317e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.20796977470988464880970001894205834196e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.99451680244976178843047944033382023574e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21331607817814211329055723244764031561e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.16997758215752306644496702331954449485e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.22151810180865778439184946086488092970e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.05017329554372903197056366604190738772e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.45919279055502465343977575104142733356e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14611865933281087898817644094411667861e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.66574579315129285098834562564888533591e-19), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.90098275536617376789480602467351545227e-21), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.56200324658873566425094389271790730206e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.35526648761411463124801128103381691418e-26), + }; + static const RealType Q[18] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.99582804063194774835771688139366152937e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.81210581320456331960539046132284190053e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.94358920922810097599951120081974275145e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.24831443209858422294319043037419780210e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.68584098673893150929178892200446909375e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.90058244779420124535106788512940199547e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.88151039746201934320258158884886191886e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.62348975553160355852344937226490493460e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.62007418751593938350474825754731470453e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.67502458979132962529935588245058477825e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.91648040348401277706598232576212305626e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.05843052379331618504561151714467880641e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.20127592059771206959014911028588129920e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.04661894930286305556240859086772458465e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19442269177165740287568170417649762849e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.81435584873372180820418114652670864136e-23), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.62145023253666168339801687459484937001e-25), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else if (ilogb(p) >= -128) { + RealType t = -log2(ldexp(p, 64)); + + // Rational Approximation + // Maximum Relative Error: 2.2157e-35 + static const RealType P[18] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59154943091895335751628149866310390641e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.91164927854420277537616294413463565970e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47557801928232619499125670863084398577e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06172621625221091203249391660455847328e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.11720157411653968975956625234656001375e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70086412127379161257840749700428137407e-5), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11069186177775505692019195793079552937e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.04581765901792649215653828121992908775e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.78996797234624395264657873201296117159e-9), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.10365978021268853654282661591051834468e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.76744621013787434243259445839624450867e-12), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11110170303355425599446515240949433934e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.83669090335022069229153919882930282425e-15), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.09633460833089193733622172621696983652e-17), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16200852052266861122422190933586966917e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47795810090424252745150042033544310609e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.35722092370326505616747155207965300634e-22), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.98381676423023212724768510437325359364e-51), + }; + static const RealType Q[17] = { + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.34271731953273239691423485699928257808e-1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.27133013035186849140772481980360839559e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29542078693828543560388747333519393752e-2), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33027698228265344561650492600955601983e-3), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06868444562964057795387778972002636261e-4), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.97868278672593071151212650783507879919e-6), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.79869926850283188785885503049178903204e-7), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.75298857713475428388051708713106549590e-8), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.93449891515741631942400181171061740767e-10), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.36715626731277089044713008494971829270e-11), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.98125789528264426960496891930942311971e-13), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.78234546049400950544724588355539821858e-14), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.83044000387150792693434128054414524740e-16), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.30111486296552039483196431122555524886e-18), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.28628462422858135083238952377446358986e-20), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.48108558735886480298604270981393793162e-21), + }; + + result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); + } + else { + result = 1 / (p * p * constants::two_pi()); + } + + return result; +} + +template +inline RealType saspoint5_quantile_imp_prec(const RealType& p, bool complement, const std::integral_constant& tag) +{ + if (p > 0.5) { + return saspoint5_quantile_imp_prec(1 - p, !complement, tag); + } + + return complement ? saspoint5_quantile_upper_imp_prec(p, tag) : -saspoint5_quantile_upper_imp_prec(p, tag); +} + +template +inline RealType saspoint5_quantile_imp_prec(const RealType& p, bool complement, const std::integral_constant& tag) +{ + if (p > 0.5) { + return saspoint5_quantile_imp_prec(1 - p, !complement, tag); + } + + return complement ? saspoint5_quantile_upper_imp_prec(p, tag) : -saspoint5_quantile_upper_imp_prec(p, tag); +} + +template +inline RealType saspoint5_quantile_imp(const saspoint5_distribution& dist, const RealType& p, bool complement) +{ + // This routine implements the quantile for the Saspoint5 distribution, + // the value p may be the probability, or its complement if complement=true. + + static const char* function = "boost::math::quantile(saspoint5<%1%>&, %1%)"; + BOOST_MATH_STD_USING // for ADL of std functions + + RealType result = 0; + RealType scale = dist.scale(); + RealType location = dist.location(); + + if (false == detail::check_location(function, location, &result, Policy())) + { + return result; + } + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + if (false == detail::check_probability(function, p, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + result = location + scale * saspoint5_quantile_imp_prec(p, complement, tag_type()); + + return result; +} + +template +inline RealType saspoint5_entropy_imp_prec(const std::integral_constant& tag) +{ + return static_cast(3.63992444568030649573); +} + +template +inline RealType saspoint5_entropy_imp_prec(const std::integral_constant& tag) +{ + return BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.6399244456803064957308496039071853510); +} + +template +inline RealType saspoint5_entropy_imp(const saspoint5_distribution& dist) +{ + // This implements the entropy for the Saspoint5 distribution, + + static const char* function = "boost::math::entropy(saspoint5<%1%>&, %1%)"; + BOOST_MATH_STD_USING // for ADL of std functions + + RealType result = 0; + RealType scale = dist.scale(); + + if (false == detail::check_scale(function, scale, &result, Policy())) + { + return result; + } + + typedef typename tools::promote_args::type result_type; + typedef typename policies::precision::type precision_type; + typedef std::integral_constant tag_type; + + result = saspoint5_entropy_imp_prec(tag_type()) + log(scale); + + return result; +} + +} // detail + +template > +class saspoint5_distribution +{ + public: + typedef RealType value_type; + typedef Policy policy_type; + + saspoint5_distribution(RealType l_location = 0, RealType l_scale = 1) + : mu(l_location), c(l_scale) + { + static const char* function = "boost::math::saspoint5_distribution<%1%>::saspoint5_distribution"; + RealType result = 0; + detail::check_location(function, l_location, &result, Policy()); + detail::check_scale(function, l_scale, &result, Policy()); + } // saspoint5_distribution + + RealType location()const + { + return mu; + } + RealType scale()const + { + return c; + } + + private: + RealType mu; // The location parameter. + RealType c; // The scale parameter. +}; + +typedef saspoint5_distribution saspoint5; + +#ifdef __cpp_deduction_guides +template +saspoint5_distribution(RealType) -> saspoint5_distribution::type>; +template +saspoint5_distribution(RealType, RealType) -> saspoint5_distribution::type>; +#endif + +template +inline const std::pair range(const saspoint5_distribution&) +{ // Range of permissible values for random variable x. + if (std::numeric_limits::has_infinity) + { + return std::pair(-std::numeric_limits::infinity(), std::numeric_limits::infinity()); // - to + infinity. + } + else + { // Can only use max_value. + using boost::math::tools::max_value; + return std::pair(-max_value(), max_value()); // - to + max. + } +} + +template +inline const std::pair support(const saspoint5_distribution&) +{ // Range of supported values for random variable x. + // This is range where cdf rises from 0 to 1, and outside it, the pdf is zero. + if (std::numeric_limits::has_infinity) + { + return std::pair(-std::numeric_limits::infinity(), std::numeric_limits::infinity()); // - to + infinity. + } + else + { // Can only use max_value. + using boost::math::tools::max_value; + return std::pair(-tools::max_value(), max_value()); // - to + max. + } +} + +template +inline RealType pdf(const saspoint5_distribution& dist, const RealType& x) +{ + return detail::saspoint5_pdf_imp(dist, x); +} // pdf + +template +inline RealType cdf(const saspoint5_distribution& dist, const RealType& x) +{ + return detail::saspoint5_cdf_imp(dist, x, false); +} // cdf + +template +inline RealType quantile(const saspoint5_distribution& dist, const RealType& p) +{ + return detail::saspoint5_quantile_imp(dist, p, false); +} // quantile + +template +inline RealType cdf(const complemented2_type, RealType>& c) +{ + return detail::saspoint5_cdf_imp(c.dist, c.param, true); +} // cdf complement + +template +inline RealType quantile(const complemented2_type, RealType>& c) +{ + return detail::saspoint5_quantile_imp(c.dist, c.param, true); +} // quantile complement + +template +inline RealType mean(const saspoint5_distribution &dist) +{ + // There is no mean: + typedef typename Policy::assert_undefined_type assert_type; + static_assert(assert_type::value == 0, "assert type is undefined"); + + return policies::raise_domain_error( + "boost::math::mean(saspoint5<%1%>&)", + "The SaSpoint5 distribution does not have a mean: " + "the only possible return value is %1%.", + std::numeric_limits::quiet_NaN(), Policy()); +} + +template +inline RealType variance(const saspoint5_distribution& /*dist*/) +{ + // There is no variance: + typedef typename Policy::assert_undefined_type assert_type; + static_assert(assert_type::value == 0, "assert type is undefined"); + + return policies::raise_domain_error( + "boost::math::variance(saspoint5<%1%>&)", + "The SaSpoint5 distribution does not have a variance: " + "the only possible return value is %1%.", + std::numeric_limits::quiet_NaN(), Policy()); +} + +template +inline RealType mode(const saspoint5_distribution& dist) +{ + return dist.location(); +} + +template +inline RealType median(const saspoint5_distribution& dist) +{ + return dist.location(); +} + +template +inline RealType skewness(const saspoint5_distribution& /*dist*/) +{ + // There is no skewness: + typedef typename Policy::assert_undefined_type assert_type; + static_assert(assert_type::value == 0, "assert type is undefined"); + + return policies::raise_domain_error( + "boost::math::skewness(saspoint5<%1%>&)", + "The SaSpoint5 distribution does not have a skewness: " + "the only possible return value is %1%.", + std::numeric_limits::quiet_NaN(), Policy()); // infinity? +} + +template +inline RealType kurtosis(const saspoint5_distribution& /*dist*/) +{ + // There is no kurtosis: + typedef typename Policy::assert_undefined_type assert_type; + static_assert(assert_type::value == 0, "assert type is undefined"); + + return policies::raise_domain_error( + "boost::math::kurtosis(saspoint5<%1%>&)", + "The SaSpoint5 distribution does not have a kurtosis: " + "the only possible return value is %1%.", + std::numeric_limits::quiet_NaN(), Policy()); +} + +template +inline RealType kurtosis_excess(const saspoint5_distribution& /*dist*/) +{ + // There is no kurtosis excess: + typedef typename Policy::assert_undefined_type assert_type; + static_assert(assert_type::value == 0, "assert type is undefined"); + + return policies::raise_domain_error( + "boost::math::kurtosis_excess(saspoint5<%1%>&)", + "The SaSpoint5 distribution does not have a kurtosis: " + "the only possible return value is %1%.", + std::numeric_limits::quiet_NaN(), Policy()); +} + +template +inline RealType entropy(const saspoint5_distribution& dist) +{ + return detail::saspoint5_entropy_imp(dist); +} + +}} // namespaces + + +#endif // BOOST_STATS_SASPOINT5_HPP diff --git a/test/test_saspoint5.cpp b/test/test_saspoint5.cpp new file mode 100644 index 0000000000..97a7c43ad5 --- /dev/null +++ b/test/test_saspoint5.cpp @@ -0,0 +1,878 @@ +// Copyright Takuma Yoshimura 2024. +// 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) + +#define BOOST_TEST_MODULE StatsSaSpoint5Test +#include +#include + +#include +using boost::math::saspoint5_distribution; +using boost::multiprecision::cpp_bin_float_quad; + +template +void do_test_saspoint5_pdf(){ + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + saspoint5_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.65057384221262866484014802392420311075288403543570e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.79329640523490376041131493419821198600076403419386e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.95852304370396879516224023732198088002401888082616e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.15165745993244539388932384769132623478818505719254e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37991930003932826612228434406591616554240049257806e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.65315905048420909110038030496372707676321065455853e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.98514782971078642902580240066249560381976244868252e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.39569569206548434200616180477229996876301302607033e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.91428580496513429479068747515164587814473831035141e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.22747038893846641865142698258984886289652875016810e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.58664432176873307685856460747711890398474760309135e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.00211113907132159419276991035240896253998639909692e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.48740303942235865293078214071409846807501918299929e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.06062847902700317213276816720705695621399130112975e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.74654707859965380374478388584454386653113140787247e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.57987022193031994457557921317658430036146780413966e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.61071469126041183247373313827161939453635781053656e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.22226841107155902731102159116498022415283445125970e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.91402704796678469983705063964301389721348302634810e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.07020274682586388030767450697192728366834992164365e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.16067678880616390663660038956460612725510361666743e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.26548452861398188870931570373322249360362213948984e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38813584257594010463041381178865326769684234839162e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.53335207865128979807776513257284069794567700115319e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.70762401725206223811383500786268939644546879037607e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.46875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.80837633035190650461893908063251050472045384954446e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.92009924039028830545431687288769864540254439571691e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.40625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.04458865222194329452641393707783622253522148720927e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18403802814813998631607652585109350067000954260159e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.34375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.34114858767964975455487653703370079404113295500766e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51927454673218629749392967500746624956301580234179e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.28125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.72261384495736629760803695406845321684342258638651e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.95645445681747568731488283573032414811445124048278e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.234375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.08683711301287379599769504729521857091008674908403e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.21875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22747777451211671698876953149906906288207621283740e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.203125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.37948342659965914836420291897431271791569870739942e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.54408462624872191505363112311495187968578947455635e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.171875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.72263350586688041299651258469337654343439789762344e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.15625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.91658567295250072264436343404335704809676265611623e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.140625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.12745086277094097472011430871049070050383274543942e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.35668401768623200524372663239480799018368629449958e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.109375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.60546312221207321659735213679473165482665805082365e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.09375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.87425051951658593562735199923143476116556674561953e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.078125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.16193612095139713576014676574899762241637086348666e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.46416716200748206779925127900698754118588044244443e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.046875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.77011156717390291621839083396306231100301720494794e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.03125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.05643252618763782827233685490846659295644445464474e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(-0.015625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.27802677165093171536432271430054096075199851236277e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.36619772367581343075535053490057448137838582961826e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.015625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.27802677165093171536432271430054096075199851236277e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.03125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.05643252618763782827233685490846659295644445464474e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.046875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.77011156717390291621839083396306231100301720494794e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.46416716200748206779925127900698754118588044244443e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.078125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.16193612095139713576014676574899762241637086348666e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.09375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.87425051951658593562735199923143476116556674561953e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.109375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.60546312221207321659735213679473165482665805082365e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.35668401768623200524372663239480799018368629449958e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.140625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.12745086277094097472011430871049070050383274543942e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.15625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.91658567295250072264436343404335704809676265611623e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.171875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.72263350586688041299651258469337654343439789762344e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.54408462624872191505363112311495187968578947455635e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.203125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.37948342659965914836420291897431271791569870739942e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.21875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22747777451211671698876953149906906288207621283740e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.234375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.08683711301287379599769504729521857091008674908403e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.95645445681747568731488283573032414811445124048278e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.28125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.72261384495736629760803695406845321684342258638651e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51927454673218629749392967500746624956301580234179e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.34375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.34114858767964975455487653703370079404113295500766e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18403802814813998631607652585109350067000954260159e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.40625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.04458865222194329452641393707783622253522148720927e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.92009924039028830545431687288769864540254439571691e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.46875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.80837633035190650461893908063251050472045384954446e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.70762401725206223811383500786268939644546879037607e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.53335207865128979807776513257284069794567700115319e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38813584257594010463041381178865326769684234839162e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.26548452861398188870931570373322249360362213948984e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.16067678880616390663660038956460612725510361666743e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.07020274682586388030767450697192728366834992164365e-1), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.91402704796678469983705063964301389721348302634810e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.22226841107155902731102159116498022415283445125970e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.61071469126041183247373313827161939453635781053656e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.57987022193031994457557921317658430036146780413966e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.74654707859965380374478388584454386653113140787247e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.06062847902700317213276816720705695621399130112975e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.48740303942235865293078214071409846807501918299929e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.00211113907132159419276991035240896253998639909692e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.58664432176873307685856460747711890398474760309135e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.22747038893846641865142698258984886289652875016810e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.91428580496513429479068747515164587814473831035141e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.39569569206548434200616180477229996876301302607033e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.98514782971078642902580240066249560381976244868252e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.65315905048420909110038030496372707676321065455853e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37991930003932826612228434406591616554240049257806e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.15165745993244539388932384769132623478818505719254e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.95852304370396879516224023732198088002401888082616e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.79329640523490376041131493419821198600076403419386e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.65057384221262866484014802392420311075288403543570e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41709229627396868333284301965586098495341505333984e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.23486804023715403906392442935982382364217653266772e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.08928004905124817201928007015908544910529569714342e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(6)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.70693662562544123549117032234725245555978806476399e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(6.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.72521377242204601673499906339041894791681660981780e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.90118208003638158949103509569466271651423947601700e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.20122199033087670451578082577537221533524657616689e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.60044810497290557552736366450372523266254544297541e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.62568921883700157286068393009259359194911515759460e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.87225538372111615796471446753804828223647849403478e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.27521869884978603565623102805698827447589635270965e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.79233594205638037575121942287372720508125859480601e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.39503653350126602107748523248767674409207708020015e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.06336366766043497753645671560287680725185122482037e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.78299184327161285281451711213360177146934142134357e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.54339461777955741686401041938275102206830951452701e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.15681965291001751496355126714032815564803295371462e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85998635069315959390913560004569618374730778555584e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.62608332259613979271666391679559272984023328035102e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43781372306723685704327334057789272970358761256651e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28356349911089078230470059243188541053449454702148e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.15527095704472843921748976306796551576061214402975e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.04718107132157571106811924450948266398728667364202e-3), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.55085695067883584460317653567009454037053097890033e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.07065059415060466523722913682664006023733154400679e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(40)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.93920671056491824666303660784084772546983031349823e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(44)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.05105752932345415433215445597062488386383300986381e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(48)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.33854958380909922933873661422920090995959934982337e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(52)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.75647800724537927733394825316181366013592737695448e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(56)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.27359757459764665859327891341356484542630879530500e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(60)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.86768631746691871635029152331878689826668170171440e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(64)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.52254909340415842254122300688608224784456787996634e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(72)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.96929220521963282370464091269016751022713088743640e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(80)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.54771289809160518824087477899271848785553979294988e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(88)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.21766390014321750130289247373333697019024113873128e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(96)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.95349215386026125880558883477711894508813402521643e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(104)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73811374936907293362277490498742346151511716286084e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(112)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.55975461659552125943580943693269482505834989982945e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(120)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41006225150819455490222552628817791206744288460867e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(128)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28296324273402304808354336538549844914883481532620e-4), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(256)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.63180321475387230691526892287847669196997380044025e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(512)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.66189768326912251607424407981263646223230063365226e-5), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1024)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.93708011998897739786377954224930716533616609090213e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2048)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.11452967162743112245198615236484567129951718982008e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4096)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.51482080833564338340856966996445313498079083789150e-7), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8192)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.66663174159211670027542189178751103023898387998523e-7), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(16384)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.45238046039194445466823557091765258247216574897413e-8), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(32768)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.34803516847185617806978815778928715951216310353916e-8), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(65536)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.18523956611649861747653810989133680515605456258881e-8), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(131072)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.19428394481581920558479056092124822410228982935516e-9), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(262144)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.48386121491270229946980639019289494044106626390164e-9), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(524288)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.24863743761365464204033370116809431054495238229389e-10), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1048576)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85627269567198410070703889816912945617135110666962e-10), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2097152)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.56441321254434701892659687588069630508140502616495e-11), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4194304)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.32124514546671241752437061147193743959791071682877e-11), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8388608)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.20777750941928700289773286319085009877829580100394e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(16777216)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.90212173401654051439660118394241371322264056105160e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(33554432)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.02611352372467016891796952205325499928128114461973e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(67108864)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62800552193521241168029742332979605534754328327140e-13), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.34217728e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28273024622868202243706785685607188210679822726442e-13), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.68435456e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.53522776159999787175268870767580373267754737032134e-14), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.36870912e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.60346802350897629386145672448930505388450307742542e-14), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.073741824e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.66917274294807913528606004426646232913424627695599e-15), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.147483648e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.00436953991320274750778716874695704836278902566390e-15), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.294967296e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.08655220551513998962815689594959332706015306211632e-16), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7179869184e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.85824418029941626524148561830736428793658611772587e-17), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(6.8719476736e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10728389276235510083072832489179009106826041868534e-17), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.74877906944e11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38410697234730043795694534456878302211221269628364e-18), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.099511627776e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73013503193177856102694285471291153594530345945373e-19), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.398046511104e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.16266961272612513551592941445333504133461857377298e-20), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7592186044416e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.70333753016489787852265460543736089676535476354358e-21), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.0368744177664e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.37917223411693427580584068017775560157489239248184e-22), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.81474976710656e14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.22396549352793655444565334974277876088154820156655e-23), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.125899906842624e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.27995699246102965377026386970340969776925728507708e-24), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.503599627370496e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.59994631904573126677044584818697892085174708564778e-25), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8014398509481984e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.24993294785056705165902599588868178759415543962830e-26), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.2057594037927936e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.03124162154653357770314062605026847259176035189343e-26), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.88230376151711744e17)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28905202884892491063675049720005913844624989838025e-27), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.152921504606846976e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61131503725850485091152332729977897011733755140179e-28), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.611686018427387904e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.01414379732147400935170577498436447103578962194983e-29), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8446744073709551616e19)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51767974711955685286218349809111390785355323964808e-30), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.95147905179352825856e20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.93387460542241032622871979569574240917519314612402e-32), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.722366482869645213696e21)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.14667907118661876897809516737349031422411025903664e-34), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.5557863725914323419136e22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.60418604881272566803193825546858269428369981726767e-36), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.208925819614629174706176e24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50065407013025533256374121391266749023560191365933e-37), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.9342813113834066795298816e25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.34477198457980010827684344075634340204878641095256e-39), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.09485009821345068724781056e26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.66370622590643616572397339764831428700168401193312e-41), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.951760157141521099596496896e27)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.72454097797900123415519497865404920881954749456838e-43), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.9228162514264337593543950336e28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94459527809226549290322908699069488543719245241219e-45), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.267650600228229401496703205376e30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.39759301220191945453705676879390798465474357652431e-46), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.0282409603651670423947251286016e31)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18373908156550030836685714809779087770458087234145e-48), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.24518553658426726783156020576256e32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.41209231494609468520317755439405311521523337977429e-50), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.192296858534827628530496329220096e33)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.33139424210327312273151307737011597702780857146510e-52), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(8.3076749736557242056487941267521536e34)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.33030350328636432344828142894916983611711484679173e-54), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.329227995784915872903807060280344576e36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.30160992238849442824114913911543137689436308410131e-55), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.1267647932558653966460912964485513216e37)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.03376550373202254518240301652494105481741383790265e-57), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.40282366920938463463374607431768211456e38)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.17775859958128522725985138779564208904631966988869e-59), tolerance); +} + +template +void do_test_saspoint5_cdf() { + // + // Basic sanity checks, tolerance is either 5 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 5; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + saspoint5_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.63772802979087199762340235165979754525757604354946e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.68073422703516098355866522837852256596174289760926e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.72758003279298484112934948051066338979626419965674e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.77889244858892026253876673752518849640459231269905e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.83545491848533781581075416061045687904524946502798e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.89826216632004296533051251749295777627320352902276e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.96860081561627764765290065134912151446894162470366e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.04817161935798121677981868384882359833404907918648e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.13928162275383718405630406427822962549133076160983e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.19012422407024648274998126765803685575224367865758e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.24515968592015292591213160991283529212368507398551e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.30502444449412087831256855850010593081747948385277e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37050277816586024016699127500442336442368833061485e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.44257500572741387471454711747681504603506105875273e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.52248669635662507718372623246751628200366838868998e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.61185078990430196469782036568483593931021694091782e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.71280312689343266367958859259591543958449635451967e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.76849301027297680034801351032711397512725349083505e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.82824834763715399283433728056507088064285422281461e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.89261854625965316722646909500096608624627558333255e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.96226648191670403196061310683376239616840103866983e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.03800118279447955882543375356729458148212335628057e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.12082296340545811234455810077892380496395042488318e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.21198706286302016964660139725707925695690953535621e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.31309550000758082761278726632760757082965788779064e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.46875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.36800649890180441699589040706573844882916813862746e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.42623318957604837956085530683032551753868317236287e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.40625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.48814554885607965224431388327096964758526950639963e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.55417563843010824151990624091505209837963398189766e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.34375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62483167142022658662698467701475815382565060700827e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.70071604494776495147661422048036562690579901259931e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.28125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.78254859359158098510888509896172431097522748703865e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.87119665000174806422420129219814480076318292452197e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.234375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.91839717977573455659490354583900768691773107778703e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.21875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.96771371640645784475148651296909803541218278211201e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.203125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.01931503128208807344707441840522746424640776733482e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.07338815387886469109799016905025356718337763965952e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.171875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.13014030144742808960599738063482904351064602625491e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.15625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.18980066583859588646492309993087622866113891170991e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.140625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.25262169970425461499760639161103103516585531687363e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.31887921568009055676985827521151927561905069756334e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.109375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.38886999325100940692217415763934459424688336515323e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.09375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.46290440538810971901075463907912052110770078557001e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.078125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.54128928252324244858536397279015277684698852998387e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.62429173448713128429248489740624277005917720602166e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.046875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.71206593195666184191280277407391829224588075252830e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.03125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.80450931389242086819408627721643501783105413645046e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(-0.015625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.90099745314478063577240966101000818037412904585595e-1), tolerance); + BOOST_CHECK_EQUAL(cdf(dist, static_cast(0)), static_cast(0.5)); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.015625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.09900254685521936422759033898999181962587095414405e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.03125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.19549068610757913180591372278356498216894586354954e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.046875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.28793406804333815808719722592608170775411924747170e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.37570826551286871570751510259375722994082279397834e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.078125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.45871071747675755141463602720984722315301147001613e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.09375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.53709559461189028098924536092087947889229921442999e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.109375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.61113000674899059307782584236065540575311663484677e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.68112078431990944323014172478848072438094930243666e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.140625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.74737830029574538500239360838896896483414468312637e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.15625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.81019933416140411353507690006912377133886108829009e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.171875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.86985969855257191039400261936517095648935397374509e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.92661184612113530890200983094974643281662236034048e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.203125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.98068496871791192655292558159477253575359223266518e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.21875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.03228628359354215524851348703090196458781721788799e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.234375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.08160282022426544340509645416099231308226892221297e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.12880334999825193577579870780185519923681707547803e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.28125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.21745140640841901489111490103827568902477251296135e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.29928395505223504852338577951963437309420098740069e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.34375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.37516832857977341337301532298524184617434939299173e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.44582436156989175848009375908494790162036601810234e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.40625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.51185445114392034775568611672903035241473049360037e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.57376681042395162043914469316967448246131682763713e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.46875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.63199350109819558300410959293426155117083186137254e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.68690449999241917238721273367239242917034211220936e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.78801293713697983035339860274292074304309046464379e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.87917703659454188765544189922107619503604957511682e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.96199881720552044117456624643270541851787664371943e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.03773351808329596803938689316623760383159896133017e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.10738145374034683277353090499903391375372441666745e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.17175165236284600716566271943492911935714577718539e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.23150698972702319965198648967288602487274650916495e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.28719687310656733632041140740408456041550364548033e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.38814921009569803530217963431516406068978305908218e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.47751330364337492281627376753248371799633161131002e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.55742499427258612528545288252318495396493894124727e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.62949722183413975983300872499557663557631166938515e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.69497555550587912168743144149989406918252051614723e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.75484031407984707408786839008716470787631492601449e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(1.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.80987577592975351725001873234196314424775632134242e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.86071837724616281594369593572177037450866923839017e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.95182838064201878322018131615117640166595092081352e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.03139918438372235234709934865087848553105837529634e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(2.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.10173783367995703466948748250704222372679647097724e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.16454508151466218418924583938954312095475053497202e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.22110755141107973746123326247481150359540768730095e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.27241996720701515887065051948933661020373580034326e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(3.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.31926577296483901644133477162147743403825710239074e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(4)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.36227197020912800237659764834020245474242395645054e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(4.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.43871020523024507614851721583135267180360280594143e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.50483092818015575884212092733928976209364127755594e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(5.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.56280494417603102056412672973803628491156640138235e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(6)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.61420731826426116856340074125786936047174397075840e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(6.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.66021349395697519291462973006173132761227963124588e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(7)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.70172157747564156568159926049840862439194389470164e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(7.5)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.73943162478672589326613255747804240803057053984280e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist, static_cast(8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.77389877435125713385213180379500898219171021326151e-1), tolerance); +} + +template +void do_test_saspoint5_ccdf() { + // + // Basic sanity checks, tolerance is either 5 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 5; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + saspoint5_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-2))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.86071837724616281594369593572177037450866923839017e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.80987577592975351725001873234196314424775632134242e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.75484031407984707408786839008716470787631492601449e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.69497555550587912168743144149989406918252051614723e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.62949722183413975983300872499557663557631166938515e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.55742499427258612528545288252318495396493894124727e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.47751330364337492281627376753248371799633161131002e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.38814921009569803530217963431516406068978305908218e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-1))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.28719687310656733632041140740408456041550364548033e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.9375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.23150698972702319965198648967288602487274650916495e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.17175165236284600716566271943492911935714577718539e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.8125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.10738145374034683277353090499903391375372441666745e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.03773351808329596803938689316623760383159896133017e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.6875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.96199881720552044117456624643270541851787664371943e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.87917703659454188765544189922107619503604957511682e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.5625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.78801293713697983035339860274292074304309046464379e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.68690449999241917238721273367239242917034211220936e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.46875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.63199350109819558300410959293426155117083186137254e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.4375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.57376681042395162043914469316967448246131682763713e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.40625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.51185445114392034775568611672903035241473049360037e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.44582436156989175848009375908494790162036601810234e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.34375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.37516832857977341337301532298524184617434939299173e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.3125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.29928395505223504852338577951963437309420098740069e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.28125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.21745140640841901489111490103827568902477251296135e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.12880334999825193577579870780185519923681707547803e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.234375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.08160282022426544340509645416099231308226892221297e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.21875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.03228628359354215524851348703090196458781721788799e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.203125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.98068496871791192655292558159477253575359223266518e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.1875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.92661184612113530890200983094974643281662236034048e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.171875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.86985969855257191039400261936517095648935397374509e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.15625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.81019933416140411353507690006912377133886108829009e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.140625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.74737830029574538500239360838896896483414468312637e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.68112078431990944323014172478848072438094930243666e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.109375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.61113000674899059307782584236065540575311663484677e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.09375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.53709559461189028098924536092087947889229921442999e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.078125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.45871071747675755141463602720984722315301147001613e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.0625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.37570826551286871570751510259375722994082279397834e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.046875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.28793406804333815808719722592608170775411924747170e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.03125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.19549068610757913180591372278356498216894586354954e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(-0.015625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.09900254685521936422759033898999181962587095414405e-1), tolerance); + BOOST_CHECK_EQUAL(cdf(dist, static_cast(0)), static_cast(0.5)); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.015625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.90099745314478063577240966101000818037412904585595e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.03125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.80450931389242086819408627721643501783105413645046e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.046875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.71206593195666184191280277407391829224588075252830e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.0625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.62429173448713128429248489740624277005917720602166e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.078125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.54128928252324244858536397279015277684698852998387e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.09375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.46290440538810971901075463907912052110770078557001e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.109375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.38886999325100940692217415763934459424688336515323e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.31887921568009055676985827521151927561905069756334e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.140625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.25262169970425461499760639161103103516585531687363e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.15625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.18980066583859588646492309993087622866113891170991e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.171875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.13014030144742808960599738063482904351064602625491e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.1875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.07338815387886469109799016905025356718337763965952e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.203125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.01931503128208807344707441840522746424640776733482e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.21875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.96771371640645784475148651296909803541218278211201e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.234375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.91839717977573455659490354583900768691773107778703e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.87119665000174806422420129219814480076318292452197e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.28125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.78254859359158098510888509896172431097522748703865e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.3125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.70071604494776495147661422048036562690579901259931e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.34375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62483167142022658662698467701475815382565060700827e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.55417563843010824151990624091505209837963398189766e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.40625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.48814554885607965224431388327096964758526950639963e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.4375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.42623318957604837956085530683032551753868317236287e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.46875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.36800649890180441699589040706573844882916813862746e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.31309550000758082761278726632760757082965788779064e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.5625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.21198706286302016964660139725707925695690953535621e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.12082296340545811234455810077892380496395042488318e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.6875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.03800118279447955882543375356729458148212335628057e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.96226648191670403196061310683376239616840103866983e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.8125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.89261854625965316722646909500096608624627558333255e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.82824834763715399283433728056507088064285422281461e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(0.9375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.76849301027297680034801351032711397512725349083505e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.71280312689343266367958859259591543958449635451967e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.125))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.61185078990430196469782036568483593931021694091782e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.52248669635662507718372623246751628200366838868998e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.375))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.44257500572741387471454711747681504603506105875273e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37050277816586024016699127500442336442368833061485e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.625))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.30502444449412087831256855850010593081747948385277e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.24515968592015292591213160991283529212368507398551e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.875))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.19012422407024648274998126765803685575224367865758e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.13928162275383718405630406427822962549133076160983e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.04817161935798121677981868384882359833404907918648e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.96860081561627764765290065134912151446894162470366e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.89826216632004296533051251749295777627320352902276e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.83545491848533781581075416061045687904524946502798e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.77889244858892026253876673752518849640459231269905e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.72758003279298484112934948051066338979626419965674e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.68073422703516098355866522837852256596174289760926e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.63772802979087199762340235165979754525757604354946e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.56128979476975492385148278416864732819639719405857e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.49516907181984424115787907266071023790635872244406e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43719505582396897943587327026196371508843359861765e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38579268173573883143659925874213063952825602924160e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.33978650604302480708537026993826867238772036875412e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.29827842252435843431840073950159137560805610529836e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.26056837521327410673386744252195759196942946015720e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.22610122564874286614786819620499101780828978673850e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.16519065397529967010603916749661994058495038701903e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.11285389689081092090080900757256655213056507935765e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.06722664628240641657463412013080864534542465320880e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.02697048057896404675748265840787538239835533463915e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.91095580948192894243059119812739170064298855954150e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.58851606064421509151228732938834025845710632753865e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.29657717833196446423749763633852786438048712229891e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.03056141356415128156562790092782169373827214514422e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.56233191903709448828683239881723764461808662475751e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.16188637156340219345609662100276117883253664060901e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.81416233095397134117651222065771104114974953207875e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.50842302656587649324679534871796140718152459081608e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.23677655844367661796208750471724232185503310585430e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.99327211922253387063577514052912042212460501121145e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.77332469896087134873409606852930319306153102107748e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.57333571766941514095434647381791053890536948900264e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.22230201122276543582018268125914307770458422539453e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(40))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.92306196750274052986046861933822660319647411503460e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(44))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.66393766871935144778495176368042799313533760396735e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(48))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.43664512355365430998504793608427289643995825810352e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(52))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.23512057902480812783067842173364430254180391574517e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(56))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.05480824780342286194892111115606787981112335506282e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(60))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.89220914007246019306457129229565668476439227449653e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(64))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.74458482861654721048545411630851774084511858223315e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(72))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.48596753801598503319767014729339663622931424118435e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(80))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.26600858175294196667322269091614319302918711248774e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(88))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.07590501853150263567490077970815440178521221113294e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(96))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.90943298811551585430796926339912286222583383628380e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(104))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.76204970249877025738751243150107820229031119377257e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(112))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.63035057455899788326457066144517427412403198177255e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(120))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.51172649975372596610965298504076329424502797908092e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(128))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.40413948757894194852726127978788270443438529203793e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.43203077043778334466271831424077221758122536074329e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(512))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73229441904414627006839605354679934626132938387870e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1024))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.23125360026260788506665554837055341098621632464561e-2), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2048))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.73810855742053432677942037710993481024582345070051e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4096))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.19474376202028990304398162068685909212949561120262e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8192))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.38834786517841980543748022239405103577545566369058e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16384))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.10703837128619218169124143528829380601241157169895e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(32768))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.19901414203078529527146967144846039577487804212104e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(65536))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.55594175267868082494169767822936567533407971376816e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(131072))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10071922510385832628139939726551776872500893306030e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(262144))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.78577261178721830451003518231079692441875499186244e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(524288))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.50662913793980803259595258646776816982578828753293e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1048576))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.89440319684962022373915418699465975439163763242915e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2097152))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.75407315047618220330559697044875151329985165407760e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4194304))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.94758093727122517797618473870421858045294374184298e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8388608))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.37722626166484277233388378972371910745163900023301e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16777216))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.73885317860649699113798763978865018837655503068780e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(33554432))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.88660557570383272842403146191017664814974769956447e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(67108864))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.86966373050763507830869601193566593204764987942763e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.34217728e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.44342136111091391837428138940493220527760482550819e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.68435456e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.43489115282263847728003495903341128041631655237825e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.36870912e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.72174032467196796417055336934387675311978746399112e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.073741824e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21746039858699001180528503217054534969400689600469e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.147483648e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.60877573465331935753972340571396643508918647400950e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.294967296e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.08733904872845891588154720869252063263709578283331e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7179869184e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.04367878835689816266760026397728945536920490441769e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6.8719476736e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.52184171018215269383027201178304809813110038062619e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.74877906944e11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.60921434092694304578619454290395143640352517265958e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.099511627776e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.80460861796838148522601893634284307293180095878460e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.398046511104e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90230467086052636671801670850090200893179111799503e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7592186044416e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.51152425899360606075482273396798501430313790237214e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.0368744177664e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.75576235566956348303137380307065627552780450075955e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.81474976710656e14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37788123437797396666202471539368169920940171968838e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.125899906842624e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.18894063132478530361545271176786170012121225204887e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.503599627370496e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.94470319196342264878568431977547823579033279922390e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8014398509481984e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.97235160481658539831961233459162678510644673997599e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.2057594037927936e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.48617580461701122279770683403051652704243983949025e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.88230376151711744e17))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.43087902860685242952854599081275466963995418723234e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.152921504606846976e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.71543951568387529445493346979934712370552753482953e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.611686018427387904e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85771975818704991725083904340140685678094729181896e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8446744073709551616e19))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.28859879179803026143850997564073108091243061664589e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.95147905179352825856e20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.32214969811127894197045507227361880900936362117960e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.722366482869645213696e21))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.80537424537930446531251492646463803649696387208569e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.5557863725914323419136e22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.45134356135114531072734934087281275202470211834375e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.208925819614629174706176e24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62835890338181277331789748787296614195690507700714e-13), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.9342813113834066795298816e25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.07089725845700036860694806306823770374585029986489e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.09485009821345068724781056e26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.26772431461440436935874981470647001703932928470872e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.951760157141521099596496896e27))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.66931078653610734665125754039671239552191451228014e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.9228162514264337593543950336e28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41732769663403286311621332289317114802389526570992e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.267650600228229401496703205376e30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.54331924158508592432390764336465547336588796613693e-16), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.0282409603651670423947251286016e31))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.85829810396271716489312806849560623979223766702760e-17), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.24518553658426726783156020576256e32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.21457452599067943835349195212917512291401637194850e-17), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.192296858534827628530496329220096e33))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.53643631497669868784011108970123778268444560432089e-18), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8.3076749736557242056487941267521536e34))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38410907874417467770730159801145325661085046788106e-18), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.329227995784915872903807060280344576e36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.46027269686043669786030013601997303312653750436687e-19), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.1267647932558653966460912964485513216e37))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.65068174215109174689577917816952001659129997288134e-20), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.40282366920938463463374607431768211456e38))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.16267043553777293686425909692485421878259294596496e-20), tolerance); +} + +template +void do_test_saspoint5_quantile_nearzero() { + // + // Basic sanity checks, tolerance is either 4 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 4; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + saspoint5_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.03125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.52796721097108753422708089760626414214332697170320e2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.0625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.56591342761460650504994018321276991271746451691815e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.09375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.47218526924747883249737601803820876470332879082284e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -7.64871492892195438064623231330402224448304864505255e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.15625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.49147047287704191198103513188406591369158240312651e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.1875)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.83944503273842706198239703540854699099743899944658e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.21875)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.88121977453918311545713678336944882698543050262508e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.25)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.28383277518932774280834618691095083936296378494548e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.28125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -8.91036143728268221909726623759154622815926077224027e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.3125)), BOOST_MATH_BIG_CONSTANT(RealType, N, -6.21997830440617027092737461125926863143124423787158e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.34375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.31665804788247227155363433182318290115115268840234e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.93390030300024509983060478023436359505370694478274e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.40625)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.90586867715715827365143687189250571789458607638023e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.4375)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.12403044179836064404720613683569098344014116798151e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.46875)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.11633396058323297953641398479658668551534240629654e-2), tolerance); + BOOST_CHECK_EQUAL(quantile(dist, static_cast(0.5)), static_cast(0)); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.50390625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.14052785123109810231692510348602868600338388040310e-3), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5078125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.23083326042460532375320968182992121472721389674838e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.51171875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85291421003937677871303076502465267120545270922005e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.515625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.48262870167331460723959759110260709264416995145257e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.51953125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.12205802380990657930467930989682569659575359795940e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5234375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.77305954522603022893044033304410291628163249182374e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.52734375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.43730759016907991505397132799991250199870494073045e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.53125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.11633396058323297953641398479658668551534240629654e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.53515625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.81156327963950319747789851203804452183342931095156e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5390625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.52434225749394951914392360992042907273807357938464e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.54296875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.25596345497536099309066715771745797836543079457304e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.546875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.00768452063066360042362619764345937296973490700293e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.55078125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.78074386337778547450756599814721014853736307848400e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5546875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.57637357991828558350746829889151355918095876787015e-2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.55859375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.03958102936522630889618724151593050682836910322233e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.12403044179836064404720613683569098344014116798151e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.56640625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21111282406179691889755301310617804156919563608730e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5703125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.30095831353205038001599004861145346134019254008840e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.57421875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.39370061391699662824182194486817335276363125501648e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.578125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.48947760819317620418221654282830443278848716355952e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.58203125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.58843194157470428889620974461757508836357970580066e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.5859375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.69071158647072305786338619311971877757990751767576e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.58984375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.79647039926214909876835259387875129672714154918583e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.59375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90586867715715827365143687189250571789458607638023e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.59765625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.01907372223400262964766551738092686471437958693421e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6015625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.13626041895044652657368022843673732366221034591882e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.60546875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.25761183081873425453317860727230431668344830552276e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.609375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.38331982156037948249435913385386178518604561255635e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.61328125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51358570582737493855890017214322139090955378416415e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6171875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.64862093447749446836087591919859178171321397783436e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.62109375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.78864781940101196225997767818887450385653350744028e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.93390030300024509983060478023436359505370694478274e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.62890625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.08462477761234306446751675008291773968116735262918e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6328125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.24108096043381713255460633677010126705310806557902e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.63671875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.40354282984953644763765300071916088017186215793874e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.640625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.57229962948879265758087216105113103390988022371525e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.64453125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.74765694682819607503814996847853363329594489637064e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6484375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.92993787373911729744782959203924101663354892145487e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.65234375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.11948425704142844251280879133218574177911117813611e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.65625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.31665804788247227155363433182318290115115268840234e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.66015625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.52184275961932281071152630025400546639852185492776e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6640625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.73544504485420224870167294387230375351476906471546e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.66796875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.95789640337012040028773901682608788684052806162084e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.671875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.18965503395137956448285166074873893264110804474852e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.67578125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.43120784446902465897667277460048286927884165223763e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6796875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.68307263618494854564544144712177429500269729880351e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.68359375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.94580048000377446115526240745459082802949048053747e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.21997830440617027092737461125926863143124423787158e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.69140625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.50623171706258215659862497663103390044283888606793e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.6953125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.80522808468923275824853139897350453182651092750420e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.69921875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.11767989861122001397308542198440114248503523449816e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.703125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.44434845679017252964098546334886010522317885397184e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.70703125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.78604789681373771559537778013045202059314559478553e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7109375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.14364961859827390982162302693689202778040961541097e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.71484375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.51808714040276392410190679405041748405632099066392e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.71875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.91036143728268221909726623759154622815926077224027e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.72265625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.32154681743453457545426144342359967492966930439508e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7265625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.75279739912087792579527536186650514912572075425034e-1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.73046875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.02053542591698211050464719677242867419786774375833e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.734375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.06805533335867623214314225100786133910606465280065e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.73828125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.11798341618055383937616799179262778846061718089667e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7421875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.17047495787852935040070049482482614635865914736031e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.74609375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.22569764738178929583883189036464601993502267035808e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.75)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28383277518932774280834618691095083936296378494548e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.75390625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.34507656531879179894649466860868632699377270813348e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7578125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40964166091862115574755023135179331832042209281055e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.76171875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.47775878407059212254277747469428558567366208287249e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.765625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.54967859343857147744530902523828155595548983145552e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.76953125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.62567376708606422065437126777269201178590320302836e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7734375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.70604134209343637939962724226064374287142808011846e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.77734375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.79110534768099925573827334628551158224393429767853e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.78125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.88121977453918311545713678336944882698543050262508e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.78515625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.97677193016829061858313922289253621707890698703331e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.7890625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.07818623846627168681622781867868137142587154742683e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.79296875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18592855185448213952914641315720989891399211112618e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.796875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.30051105624503972344131618629751440966474716683287e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.80078125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.42249786355837299731799089007913700561632679250929e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8046875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.55251140382947389347453508427822893893843094122006e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.80859375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.69123974986228153051487214813181004658778348371858e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.83944503273842706198239703540854699099743899944658e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.81640625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.99797313731027706223638793579547090613393780037951e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8203125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.16776490443789287489784195960321745577830473993117e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.82421875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.34986911285371709243134965339463237363883153982305e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.828125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.54545757031320957733016491289957363442390624403356e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.83203125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.75584271388037850609173432108976499052095906002965e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8359375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.98249820637230758503593250844352437505576086329541e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.83984375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.22708312477451358281191586486620734769643769191868e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.84375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.49147047287704191198103513188406591369158240312651e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.84765625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.77778092239392917026904003217947497405149113745180e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8515625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.08842290488213149257806983557860643076120157707468e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.85546875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.42614045478507551744169142637868564301201400254633e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.859375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.79407056051931174009446309499422812782537696684469e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.86328125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.19581224082198008577426461565974789703165385453255e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8671875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.63551016172006234258563545412611777992137495354692e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.87109375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.11795639223606059741678567601858859535625176228939e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.64871492892195438064623231330402224448304864505255e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.87890625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.23427499059001976769144078614154782774804457875826e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8828125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.88224092195729153863789585576784499265806702821498e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.88671875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.60156902856277721120026862113617294726340622812143e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.890625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.04028650542151264864039545865194654420659149847715e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.89453125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.12987606827387901549180798300970689324385087503567e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.8984375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.23043939515379786765482759320371211340959481379476e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.90234375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.34380276304930757031534891808152959303504163146383e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.90625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.47218526924747883249737601803820876470332879082284e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.91015625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61830428929231043118455947432627297107033412348157e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9140625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.78551541642651806413112158903680754166702207111037e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.91796875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.97800037388343052469605081868946702260361591387557e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.921875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.20102262690774549296442657868648686186513838548331e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.92578125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.46128002888129351171085541318961326325857070786293e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9296875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.76739893404884608939800784860050078072327340444416e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.93359375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.13063845566677402478557805956745594172754985803934e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.56591342761460650504994018321276991271746451691815e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.94140625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.09331197973287229185946564870900349250152411988374e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9453125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.74040079933008774660558150020826896333899909298154e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.94921875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.54582183342592176371744225018671216049948426069910e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.953125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.56507752301931033036206963972726950780990330962767e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.95703125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.88016814096703401470072036376924072379132872310869e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9609375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.61631402738793734570515994292749381948933242893841e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.96484375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.19723988112353634841352379780826428736159712449728e2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.96875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.52796721097108753422708089760626414214332697170320e2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.97265625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.01231735395463433145333990641210588531111270293944e2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9765625)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.76159370958398793120791299241979313515017333512222e2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.98046875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.00925470915587723915099888946681205221515647834867e2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.984375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.31534559333932129219229424636026382581685146602733e2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.98828125)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.13177617125304414676334752220512104772421667697176e3), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.9921875)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.56685855095635428319020462289713380105568378947326e3), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, static_cast(0.99609375)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.03488985899360430847226178216145298481879311104883e4), tolerance); +} + +template +void do_test_saspoint5_quantile_lower() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + saspoint5_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -3)), BOOST_MATH_BIG_CONSTANT(RealType, N, -7.64871492892195438064623231330402224448304864505255e0), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -4)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.56591342761460650504994018321276991271746451691815e1), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -5)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.52796721097108753422708089760626414214332697170320e2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -6)), BOOST_MATH_BIG_CONSTANT(RealType, N, -6.31534559333932129219229424636026382581685146602733e2), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -7)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.56685855095635428319020462289713380105568378947326e3), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -8)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.03488985899360430847226178216145298481879311104883e4), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -10)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.66560111810464968102166352094329039797553809013180e5), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -12)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.66887306794201818857999976857911823063870328368667e6), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -14)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.27176145418643796488192673589719523675773715325372e7), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -16)), BOOST_MATH_BIG_CONSTANT(RealType, N, -6.83544414827242601690013182749435284100680743652971e8), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -20)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.74992376775466783667682507089110333268769521176506e11), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -24)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.47981285598233127388251456426050883440628660913084e13), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -28)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.14683221929996578514587273759806303045535542474016e16), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -32)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.93589050191487067535089237582921756933019831739543e18), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -40)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.92406520022739246958562710299618130085960993793414e23), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -48)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.26095536962330863369654555704556352597738045353834e28), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -56)), BOOST_MATH_BIG_CONSTANT(RealType, N, -8.26379711036337395023730103376706642065822106379442e32), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -64)), BOOST_MATH_BIG_CONSTANT(RealType, N, -5.41576207424774090175793327287164715152292673169682e37), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -80)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.32605209918111709774537445734765990902394758994645e47), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -96)), BOOST_MATH_BIG_CONSTANT(RealType, N, -9.99031769477504631556283515692397586421188586846623e56), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -112)), BOOST_MATH_BIG_CONSTANT(RealType, N, -4.29080877757089340022276728331106401823387140732677e66), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -128)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.84288833730567254754590245964397936517161760904520e76), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -160)), BOOST_MATH_BIG_CONSTANT(RealType, N, -3.39952895147018642535639799349517299692324064545541e95), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -192)), BOOST_MATH_BIG_CONSTANT(RealType, N, -6.27102405389367073393026479530690706073270941007595e114), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -224)), BOOST_MATH_BIG_CONSTANT(RealType, N, -1.15679975802253118434756797269580371455350883468455e134), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -256)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.13391890807707704630144658385551537641074743396505e153), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -256)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.13391890807707704630144658385551537641074743396505e153), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -320)), BOOST_MATH_BIG_CONSTANT(RealType, N, -7.26134976857812288039693249651849278418162312282066e191), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -384)), BOOST_MATH_BIG_CONSTANT(RealType, N, -2.47090928629257240812467048839513197145079590955310e230), tolerance); + BOOST_CHECK_CLOSE(quantile(dist, ldexp(static_cast(1), -448)), BOOST_MATH_BIG_CONSTANT(RealType, N, -8.40806860386563308738645719151345111937971699513862e268), tolerance); +} + +template +void do_test_saspoint5_quantile_upper() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + saspoint5_distribution dist(static_cast(0), static_cast(1)); + + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -3))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.64871492892195438064623231330402224448304864505255e0), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -4))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.56591342761460650504994018321276991271746451691815e1), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -5))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.52796721097108753422708089760626414214332697170320e2), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -6))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.31534559333932129219229424636026382581685146602733e2), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -7))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.56685855095635428319020462289713380105568378947326e3), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.03488985899360430847226178216145298481879311104883e4), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.66560111810464968102166352094329039797553809013180e5), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.66887306794201818857999976857911823063870328368667e6), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.27176145418643796488192673589719523675773715325372e7), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.83544414827242601690013182749435284100680743652971e8), tolerance); + BOOST_CHECK_CLOSE(quantile(complement(dist, ldexp(static_cast(1), -20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.74992376775466783667682507089110333268769521176506e11), tolerance); +} + +template +void do_test_saspoint5_locscale_param() { + // + // Basic sanity checks, tolerance is either 3 epsilon + // expressed as a percentage: + // + + BOOST_MATH_STD_USING + RealType tolerance = boost::math::tools::epsilon() * 100 * 3; + + std::cout << "Testing acurracy[%]: " << tolerance << std::endl; + + saspoint5_distribution dist_0_1(static_cast(0), static_cast(1)); + saspoint5_distribution dist_1_3(static_cast(1), static_cast(3)); + + BOOST_CHECK_CLOSE(entropy(dist_0_1), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.6399244456803064957308496039071853510), tolerance); + BOOST_CHECK_CLOSE(entropy(dist_1_3), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.6399244456803064957308496039071853510) + log(static_cast(3)), tolerance); + + BOOST_CHECK_EQUAL(median(dist_0_1), static_cast(0)); + BOOST_CHECK_EQUAL(median(dist_1_3), static_cast(1)); + + BOOST_CHECK_EQUAL(mode(dist_0_1), static_cast(0)); + BOOST_CHECK_EQUAL(mode(dist_1_3), static_cast(1)); + + BOOST_CHECK_CLOSE(pdf(dist_0_1, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.61071469126041183247373313827161939453635781053656e-2), tolerance); + BOOST_CHECK_CLOSE(pdf(dist_1_3, static_cast(1)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.36619772367581343075535053490057448137838582961826e-1) / 3, tolerance); + + BOOST_CHECK_CLOSE(cdf(dist_0_1, static_cast(2)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.86071837724616281594369593572177037450866923839017e-1), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_1_3, static_cast(7)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.86071837724616281594369593572177037450866923839017e-1), tolerance); + + BOOST_CHECK_CLOSE(cdf(dist_0_1, quantile(dist_0_1, static_cast(0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.25), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_1_3, quantile(dist_1_3, static_cast(0.25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.25), tolerance); + + BOOST_CHECK_CLOSE(cdf(dist_0_1, quantile(dist_0_1, static_cast(0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.75), tolerance); + BOOST_CHECK_CLOSE(cdf(dist_1_3, quantile(dist_1_3, static_cast(0.75))), BOOST_MATH_BIG_CONSTANT(RealType, N, 0.75), tolerance); +} + +BOOST_AUTO_TEST_CASE(saspoint5_pdf_fp64) +{ + do_test_saspoint5_pdf(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_pdf_fp128) +{ + do_test_saspoint5_pdf(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_cdf_fp64) +{ + do_test_saspoint5_cdf(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_cdf_fp128) +{ + do_test_saspoint5_cdf(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_ccdf_fp64) +{ + do_test_saspoint5_ccdf(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_ccdf_fp128) +{ + do_test_saspoint5_ccdf(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_quantile_nearzero_fp64) +{ + do_test_saspoint5_quantile_nearzero(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_quantile_nearzero_fp128) +{ + do_test_saspoint5_quantile_nearzero(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_quantile_lower_fp64) +{ + do_test_saspoint5_quantile_lower(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_quantile_lower_fp128) +{ + do_test_saspoint5_quantile_lower(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_quantile_upper_fp64) +{ + do_test_saspoint5_quantile_upper(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_quantile_upper_fp128) +{ + do_test_saspoint5_quantile_upper(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_locscale_fp64) +{ + do_test_saspoint5_locscale_param(); +} + +BOOST_AUTO_TEST_CASE(saspoint5_locscale_fp128) +{ + do_test_saspoint5_locscale_param(); +} From 8b675ac5565e63f3d8e3c7edb3ac088f3f5da28d Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Tue, 16 Jul 2024 23:28:15 +0900 Subject: [PATCH 004/399] Add saspoint5 limit test case --- test/test_saspoint5.cpp | 250 +++++++++++++++++++++++----------------- 1 file changed, 142 insertions(+), 108 deletions(-) diff --git a/test/test_saspoint5.cpp b/test/test_saspoint5.cpp index 97a7c43ad5..f66fcbfaec 100644 --- a/test/test_saspoint5.cpp +++ b/test/test_saspoint5.cpp @@ -164,60 +164,77 @@ void do_test_saspoint5_pdf(){ BOOST_CHECK_CLOSE(pdf(dist, static_cast(256)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.63180321475387230691526892287847669196997380044025e-5), tolerance); BOOST_CHECK_CLOSE(pdf(dist, static_cast(512)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.66189768326912251607424407981263646223230063365226e-5), tolerance); BOOST_CHECK_CLOSE(pdf(dist, static_cast(1024)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.93708011998897739786377954224930716533616609090213e-6), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2048)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.11452967162743112245198615236484567129951718982008e-6), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4096)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.51482080833564338340856966996445313498079083789150e-7), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(8192)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.66663174159211670027542189178751103023898387998523e-7), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(16384)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.45238046039194445466823557091765258247216574897413e-8), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(32768)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.34803516847185617806978815778928715951216310353916e-8), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(65536)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.18523956611649861747653810989133680515605456258881e-8), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(131072)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.19428394481581920558479056092124822410228982935516e-9), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(262144)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.48386121491270229946980639019289494044106626390164e-9), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(524288)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.24863743761365464204033370116809431054495238229389e-10), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1048576)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85627269567198410070703889816912945617135110666962e-10), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2097152)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.56441321254434701892659687588069630508140502616495e-11), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4194304)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.32124514546671241752437061147193743959791071682877e-11), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(8388608)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.20777750941928700289773286319085009877829580100394e-12), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(16777216)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.90212173401654051439660118394241371322264056105160e-12), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(33554432)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.02611352372467016891796952205325499928128114461973e-12), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(67108864)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62800552193521241168029742332979605534754328327140e-13), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.34217728e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28273024622868202243706785685607188210679822726442e-13), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.68435456e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.53522776159999787175268870767580373267754737032134e-14), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.36870912e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.60346802350897629386145672448930505388450307742542e-14), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.073741824e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.66917274294807913528606004426646232913424627695599e-15), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.147483648e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.00436953991320274750778716874695704836278902566390e-15), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.294967296e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.08655220551513998962815689594959332706015306211632e-16), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7179869184e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.85824418029941626524148561830736428793658611772587e-17), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(6.8719476736e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10728389276235510083072832489179009106826041868534e-17), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.74877906944e11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38410697234730043795694534456878302211221269628364e-18), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.099511627776e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73013503193177856102694285471291153594530345945373e-19), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.398046511104e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.16266961272612513551592941445333504133461857377298e-20), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7592186044416e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.70333753016489787852265460543736089676535476354358e-21), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.0368744177664e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.37917223411693427580584068017775560157489239248184e-22), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.81474976710656e14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.22396549352793655444565334974277876088154820156655e-23), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.125899906842624e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.27995699246102965377026386970340969776925728507708e-24), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.503599627370496e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.59994631904573126677044584818697892085174708564778e-25), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8014398509481984e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.24993294785056705165902599588868178759415543962830e-26), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.2057594037927936e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.03124162154653357770314062605026847259176035189343e-26), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.88230376151711744e17)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28905202884892491063675049720005913844624989838025e-27), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.152921504606846976e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61131503725850485091152332729977897011733755140179e-28), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.611686018427387904e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.01414379732147400935170577498436447103578962194983e-29), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8446744073709551616e19)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51767974711955685286218349809111390785355323964808e-30), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.95147905179352825856e20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.93387460542241032622871979569574240917519314612402e-32), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.722366482869645213696e21)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.14667907118661876897809516737349031422411025903664e-34), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.5557863725914323419136e22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.60418604881272566803193825546858269428369981726767e-36), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.208925819614629174706176e24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50065407013025533256374121391266749023560191365933e-37), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.9342813113834066795298816e25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.34477198457980010827684344075634340204878641095256e-39), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.09485009821345068724781056e26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.66370622590643616572397339764831428700168401193312e-41), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.951760157141521099596496896e27)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.72454097797900123415519497865404920881954749456838e-43), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.9228162514264337593543950336e28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94459527809226549290322908699069488543719245241219e-45), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.267650600228229401496703205376e30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.39759301220191945453705676879390798465474357652431e-46), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.0282409603651670423947251286016e31)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18373908156550030836685714809779087770458087234145e-48), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.24518553658426726783156020576256e32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.41209231494609468520317755439405311521523337977429e-50), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.192296858534827628530496329220096e33)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.33139424210327312273151307737011597702780857146510e-52), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(8.3076749736557242056487941267521536e34)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.33030350328636432344828142894916983611711484679173e-54), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.329227995784915872903807060280344576e36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.30160992238849442824114913911543137689436308410131e-55), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.1267647932558653966460912964485513216e37)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.03376550373202254518240301652494105481741383790265e-57), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.40282366920938463463374607431768211456e38)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.17775859958128522725985138779564208904631966988869e-59), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.11452967162743112245198615236484567129951718982008e-6), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.51482080833564338340856966996445313498079083789150e-7), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.66663174159211670027542189178751103023898387998523e-7), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.45238046039194445466823557091765258247216574897413e-8), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.34803516847185617806978815778928715951216310353916e-8), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.18523956611649861747653810989133680515605456258881e-8), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 17)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.19428394481581920558479056092124822410228982935516e-9), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.48386121491270229946980639019289494044106626390164e-9), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 19)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.24863743761365464204033370116809431054495238229389e-10), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85627269567198410070703889816912945617135110666962e-10), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 21)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.56441321254434701892659687588069630508140502616495e-11), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.32124514546671241752437061147193743959791071682877e-11), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 23)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.20777750941928700289773286319085009877829580100394e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.90212173401654051439660118394241371322264056105160e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.02611352372467016891796952205325499928128114461973e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62800552193521241168029742332979605534754328327140e-13), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 27)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28273024622868202243706785685607188210679822726442e-13), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.53522776159999787175268870767580373267754737032134e-14), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 29)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.60346802350897629386145672448930505388450307742542e-14), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.66917274294807913528606004426646232913424627695599e-15), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 31)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.00436953991320274750778716874695704836278902566390e-15), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.08655220551513998962815689594959332706015306211632e-16), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 34)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.85824418029941626524148561830736428793658611772587e-17), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10728389276235510083072832489179009106826041868534e-17), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 38)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38410697234730043795694534456878302211221269628364e-18), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 40)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73013503193177856102694285471291153594530345945373e-19), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 42)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.16266961272612513551592941445333504133461857377298e-20), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 44)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.70333753016489787852265460543736089676535476354358e-21), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 46)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.37917223411693427580584068017775560157489239248184e-22), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 48)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.22396549352793655444565334974277876088154820156655e-23), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 50)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.27995699246102965377026386970340969776925728507708e-24), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 52)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.59994631904573126677044584818697892085174708564778e-25), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 54)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.24993294785056705165902599588868178759415543962830e-26), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 56)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.03124162154653357770314062605026847259176035189343e-26), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 58)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28905202884892491063675049720005913844624989838025e-27), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 60)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61131503725850485091152332729977897011733755140179e-28), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 62)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.01414379732147400935170577498436447103578962194983e-29), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 64)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51767974711955685286218349809111390785355323964808e-30), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 68)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.93387460542241032622871979569574240917519314612402e-32), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 72)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.14667907118661876897809516737349031422411025903664e-34), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 76)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.60418604881272566803193825546858269428369981726767e-36), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 80)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50065407013025533256374121391266749023560191365933e-37), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 84)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.34477198457980010827684344075634340204878641095256e-39), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 88)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.66370622590643616572397339764831428700168401193312e-41), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 92)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.72454097797900123415519497865404920881954749456838e-43), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 96)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94459527809226549290322908699069488543719245241219e-45), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 100)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.39759301220191945453705676879390798465474357652431e-46), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 104)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18373908156550030836685714809779087770458087234145e-48), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 108)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.41209231494609468520317755439405311521523337977429e-50), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 112)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.33139424210327312273151307737011597702780857146510e-52), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 116)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.33030350328636432344828142894916983611711484679173e-54), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 120)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.30160992238849442824114913911543137689436308410131e-55), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 124)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.03376550373202254518240301652494105481741383790265e-57), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 128)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.17775859958128522725985138779564208904631966988869e-59), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 128)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.17775859958128522725985138779564208904631966988869e-59), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 136)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.75819970600899713717946709855764494008629724492550e-63), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 144)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.89409172509985281669900618169013228855150809470644e-66), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 152)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.62424737573206254076979053560233289660261329999266e-70), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 160)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.12896664446583558124263581916004539046704057066258e-73), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 168)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.75626622184041889951815556079707845048600270288339e-77), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 176)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.72916558066508520390174723482957902400087321179181e-81), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 184)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.64286269059206181735882501247406923061001590063666e-84), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 192)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.01089524070327592128619387871640956557675279607402e-88), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 200)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.79222470874823222970262177430243561283276571668161e-92), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 208)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.39067986053423638420474164411821626475827252277446e-95), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 216)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.83662075325741304737485752958570418264028678048960e-99), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 224)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.42495623858823560726925232655901309474567221057157e-102), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 232)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.47889706686580958805969806288821606452354641951732e-106), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 240)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.49340104215285543959887222384818382775213055976161e-110), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 248)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.07358423880684947255831841402543550598919723533894e-113), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 256)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.06246152052453484511308206549178590347199333203433e-117), tolerance); } template @@ -485,60 +502,77 @@ void do_test_saspoint5_ccdf() { BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.43203077043778334466271831424077221758122536074329e-2), tolerance); BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(512))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73229441904414627006839605354679934626132938387870e-2), tolerance); BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1024))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.23125360026260788506665554837055341098621632464561e-2), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2048))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.73810855742053432677942037710993481024582345070051e-3), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4096))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.19474376202028990304398162068685909212949561120262e-3), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8192))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.38834786517841980543748022239405103577545566369058e-3), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16384))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.10703837128619218169124143528829380601241157169895e-3), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(32768))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.19901414203078529527146967144846039577487804212104e-3), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(65536))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.55594175267868082494169767822936567533407971376816e-3), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(131072))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10071922510385832628139939726551776872500893306030e-3), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(262144))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.78577261178721830451003518231079692441875499186244e-4), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(524288))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.50662913793980803259595258646776816982578828753293e-4), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1048576))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.89440319684962022373915418699465975439163763242915e-4), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2097152))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.75407315047618220330559697044875151329985165407760e-4), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4194304))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.94758093727122517797618473870421858045294374184298e-4), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8388608))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.37722626166484277233388378972371910745163900023301e-4), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16777216))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.73885317860649699113798763978865018837655503068780e-5), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(33554432))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.88660557570383272842403146191017664814974769956447e-5), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(67108864))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.86966373050763507830869601193566593204764987942763e-5), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.34217728e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.44342136111091391837428138940493220527760482550819e-5), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.68435456e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.43489115282263847728003495903341128041631655237825e-5), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.36870912e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.72174032467196796417055336934387675311978746399112e-5), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.073741824e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21746039858699001180528503217054534969400689600469e-5), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.147483648e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.60877573465331935753972340571396643508918647400950e-6), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.294967296e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.08733904872845891588154720869252063263709578283331e-6), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7179869184e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.04367878835689816266760026397728945536920490441769e-6), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6.8719476736e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.52184171018215269383027201178304809813110038062619e-6), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.74877906944e11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.60921434092694304578619454290395143640352517265958e-7), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.099511627776e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.80460861796838148522601893634284307293180095878460e-7), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.398046511104e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90230467086052636671801670850090200893179111799503e-7), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7592186044416e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.51152425899360606075482273396798501430313790237214e-8), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.0368744177664e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.75576235566956348303137380307065627552780450075955e-8), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.81474976710656e14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37788123437797396666202471539368169920940171968838e-8), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.125899906842624e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.18894063132478530361545271176786170012121225204887e-8), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.503599627370496e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.94470319196342264878568431977547823579033279922390e-9), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8014398509481984e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.97235160481658539831961233459162678510644673997599e-9), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.2057594037927936e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.48617580461701122279770683403051652704243983949025e-9), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.88230376151711744e17))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.43087902860685242952854599081275466963995418723234e-10), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.152921504606846976e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.71543951568387529445493346979934712370552753482953e-10), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.611686018427387904e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85771975818704991725083904340140685678094729181896e-10), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8446744073709551616e19))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.28859879179803026143850997564073108091243061664589e-11), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.95147905179352825856e20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.32214969811127894197045507227361880900936362117960e-11), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.722366482869645213696e21))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.80537424537930446531251492646463803649696387208569e-12), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.5557863725914323419136e22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.45134356135114531072734934087281275202470211834375e-12), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.208925819614629174706176e24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62835890338181277331789748787296614195690507700714e-13), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.9342813113834066795298816e25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.07089725845700036860694806306823770374585029986489e-14), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.09485009821345068724781056e26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.26772431461440436935874981470647001703932928470872e-14), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.951760157141521099596496896e27))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.66931078653610734665125754039671239552191451228014e-15), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.9228162514264337593543950336e28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41732769663403286311621332289317114802389526570992e-15), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.267650600228229401496703205376e30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.54331924158508592432390764336465547336588796613693e-16), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.0282409603651670423947251286016e31))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.85829810396271716489312806849560623979223766702760e-17), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.24518553658426726783156020576256e32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.21457452599067943835349195212917512291401637194850e-17), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.192296858534827628530496329220096e33))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.53643631497669868784011108970123778268444560432089e-18), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8.3076749736557242056487941267521536e34))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38410907874417467770730159801145325661085046788106e-18), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.329227995784915872903807060280344576e36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.46027269686043669786030013601997303312653750436687e-19), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.1267647932558653966460912964485513216e37))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.65068174215109174689577917816952001659129997288134e-20), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.40282366920938463463374607431768211456e38))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.16267043553777293686425909692485421878259294596496e-20), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.73810855742053432677942037710993481024582345070051e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.19474376202028990304398162068685909212949561120262e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.38834786517841980543748022239405103577545566369058e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.10703837128619218169124143528829380601241157169895e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.19901414203078529527146967144846039577487804212104e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.55594175267868082494169767822936567533407971376816e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 17))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10071922510385832628139939726551776872500893306030e-3), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.78577261178721830451003518231079692441875499186244e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 19))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.50662913793980803259595258646776816982578828753293e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.89440319684962022373915418699465975439163763242915e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 21))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.75407315047618220330559697044875151329985165407760e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.94758093727122517797618473870421858045294374184298e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 23))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.37722626166484277233388378972371910745163900023301e-4), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.73885317860649699113798763978865018837655503068780e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.88660557570383272842403146191017664814974769956447e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.86966373050763507830869601193566593204764987942763e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 27))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.44342136111091391837428138940493220527760482550819e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.43489115282263847728003495903341128041631655237825e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 29))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.72174032467196796417055336934387675311978746399112e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21746039858699001180528503217054534969400689600469e-5), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 31))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.60877573465331935753972340571396643508918647400950e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.08733904872845891588154720869252063263709578283331e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 34))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.04367878835689816266760026397728945536920490441769e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.52184171018215269383027201178304809813110038062619e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 38))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.60921434092694304578619454290395143640352517265958e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 40))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.80460861796838148522601893634284307293180095878460e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 42))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90230467086052636671801670850090200893179111799503e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 44))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.51152425899360606075482273396798501430313790237214e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 46))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.75576235566956348303137380307065627552780450075955e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 48))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37788123437797396666202471539368169920940171968838e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 50))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.18894063132478530361545271176786170012121225204887e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 52))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.94470319196342264878568431977547823579033279922390e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 54))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.97235160481658539831961233459162678510644673997599e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 56))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.48617580461701122279770683403051652704243983949025e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 58))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.43087902860685242952854599081275466963995418723234e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 60))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.71543951568387529445493346979934712370552753482953e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 62))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85771975818704991725083904340140685678094729181896e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 64))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.28859879179803026143850997564073108091243061664589e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 68))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.32214969811127894197045507227361880900936362117960e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 72))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.80537424537930446531251492646463803649696387208569e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 76))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.45134356135114531072734934087281275202470211834375e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 80))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62835890338181277331789748787296614195690507700714e-13), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 84))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.07089725845700036860694806306823770374585029986489e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 88))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.26772431461440436935874981470647001703932928470872e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 92))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.66931078653610734665125754039671239552191451228014e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 96))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41732769663403286311621332289317114802389526570992e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 100))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.54331924158508592432390764336465547336588796613693e-16), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 104))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.85829810396271716489312806849560623979223766702760e-17), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 108))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.21457452599067943835349195212917512291401637194850e-17), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 112))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.53643631497669868784011108970123778268444560432089e-18), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 116))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38410907874417467770730159801145325661085046788106e-18), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 120))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.46027269686043669786030013601997303312653750436687e-19), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 124))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.65068174215109174689577917816952001659129997288134e-20), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 128))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.16267043553777293686425909692485421878259294596496e-20), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 128))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.16267043553777293686425909692485421878259294596496e-20), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 136))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.35166902221110808556756707276211088178619562345223e-21), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 144))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.44793138881942553480799933647572308735410707938645e-23), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 152))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.27995711801214095925541775450484763569750411131894e-24), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 160))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.29997319875758809953465243130019854989301769477462e-25), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 168))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.06248324922349256220915840763819709280743596647028e-26), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 176))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28905203076468285138072402969870025328294044417034e-27), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 184))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.05657519227926782112952519535313715734583596556713e-29), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 192))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.03535949517454238820595324747603340202581381400690e-30), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 200))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.14709968448408899262872077968737723090225341248585e-31), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 208))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.96693730280255562039295048730519109566688181166036e-32), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 216))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.22933581425159726274559405456576710378996415685244e-33), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 224))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.68334883907248289215996284103605325376468341179834e-35), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 232))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.80209302442030180759997677564753362950438836016578e-36), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 240))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.00130814026268862974998548477970853195201855431423e-37), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 248))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.87581758766418039359374092798731783299781533977493e-38), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.17238599229011274599608807999207364564425192108311e-39), tolerance); } template From 098ded39b06745b892abae72755eea6b2a8b95f1 Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Tue, 16 Jul 2024 23:34:31 +0900 Subject: [PATCH 005/399] Add holtsmark limit test case --- test/test_holtsmark.cpp | 250 +++++++++++++++++++++++----------------- 1 file changed, 142 insertions(+), 108 deletions(-) diff --git a/test/test_holtsmark.cpp b/test/test_holtsmark.cpp index 8f34124d14..ad81478f11 100644 --- a/test/test_holtsmark.cpp +++ b/test/test_holtsmark.cpp @@ -132,60 +132,77 @@ void do_test_holtsmark_pdf(){ BOOST_CHECK_CLOSE(pdf(dist, static_cast(256)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.85568203412051586615998003517909621954036193765824e-7), tolerance); BOOST_CHECK_CLOSE(pdf(dist, static_cast(512)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.04563780918059698346140819518179336362098891429611e-8), tolerance); BOOST_CHECK_CLOSE(pdf(dist, static_cast(1024)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.91792339891869109849236922708731694322153177924824e-9), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2048)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.57638176923363231335450711092364627257129748508825e-9), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4096)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.78661356398095539721893167504764083609118624639856e-10), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(8192)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.92604459926540711296353370623384343787650705186643e-11), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(16384)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.70807462044367666228538283653300633948804226008283e-12), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(32768)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.53938313936621297172285881159282265471330118114236e-12), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(65536)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.72126969520581558576219170420297785383800313247716e-13), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(131072)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.81057004571925961169117504945825287978291651680376e-14), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(262144)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.50396638201843310535816082381660912483279969324341e-15), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(524288)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50330305081854272655464104542050109297998338121296e-15), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1048576)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.65748943908780839905864199570025333227786061957216e-16), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2097152)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.69782199924985143903444545973473854205301886566784e-17), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4194304)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.30465447555059221873312238790689561215989143051468e-18), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(8388608)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.46806937341565301230797169380667244412810953871153e-18), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(16777216)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.59520452276585659227559942516968833301265805493281e-19), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(33554432)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.58771679139660099100514647692148711295768774585921e-20), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(67108864)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.11001413331373018059574227843565648889473010676660e-21), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.34217728e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43366149729083958029796238740037446793377590904146e-21), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.68435456e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.53437941664766678806680232945039585344994407777604e-22), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.36870912e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.48019217902582750507529988918628139079404963189635e-23), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.073741824e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.91993567701892984811136675864172386794777828712695e-24), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.147483648e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40006005594525679129869441468227938628239752074460e-24), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.294967296e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.47497989906821913751146663525981445654490373951224e-25), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7179869184e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.73431218458810807033921781897016124929992555367139e-27), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(6.8719476736e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.41697255768378077454412606000376285104775580444420e-28), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.74877906944e11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.55303924276181374957661287953452523234530316565188e-30), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.099511627776e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.36032476336306675100543445227730858361169873925804e-31), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.398046511104e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.37601488550958357902586661939110889053699438042016e-33), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7592186044416e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.30500465172174486774768816059192932509423715417166e-34), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.0368744177664e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.20313953663045271143891020576861031160487434865093e-36), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.81474976710656e14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.25098110519701647231401040429952006498171313622520e-37), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.125899906842624e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.03431595374067647597712273413788666502302011992057e-39), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.503599627370496e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.19822373554396139874268836303925702273981755123190e-40), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8014398509481984e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.86944917357487937107083766130282172728072819621788e-42), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.2057594037927936e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.14670286674214980345963428973545770896346187182759e-43), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.88230376151711744e17)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.70844645856921813581135618689921390269372237700480e-45), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.152921504606846976e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.09638951830288066744104877057303202280205793138993e-46), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.611686018427387904e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.55121724469650208575327739326222025805731763269349e-48), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8446744073709551616e19)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.04725538896765690179789918481715848637732139291593e-49), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.95147905179352825856e20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.99927284078872744316201092259372825667966088624440e-52), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.722366482869645213696e21)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.95241488358274164371290129159422806319923560612665e-55), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.5557863725914323419136e22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90665515974877113643838016757246988460215123083510e-58), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.208925819614629174706176e24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.86196792944215931292810563239498984002947733280447e-61), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.9342813113834066795298816e25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.81832805609585870403135315663573226135611325562940e-64), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.09485009821345068724781056e26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.77571099228111201565561831702708228641500206234884e-67), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.951760157141521099596496896e27)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73409276589952345278868976272176004532614982149466e-70), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.9228162514264337593543950336e28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.69344996669875337186395484640796879426380291665101e-73), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.267650600228229401496703205376e30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.65375973310425133971089340469528202564824480281467e-76), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.0282409603651670423947251286016e31)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61499973935962044893641934052273635317211406169375e-79), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.24518553658426726783156020576256e32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.57714818296837934466447201222923471989464263831856e-82), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.192296858534827628530496329220096e33)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.54018377243005795377389844944261203114711195148214e-85), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(8.3076749736557242056487941267521536e34)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50408571526372847048232270453380081166710151511926e-88), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.329227995784915872903807060280344576e36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.46883370631223483445539326614628985514365382335866e-91), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.1267647932558653966460912964485513216e37)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43440791632054183052284498647098618666372443687369e-94), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.40282366920938463463374607431768211456e38)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40078898078177913136996580710057244791379339538446e-97), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.57638176923363231335450711092364627257129748508825e-9), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.78661356398095539721893167504764083609118624639856e-10), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.92604459926540711296353370623384343787650705186643e-11), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.70807462044367666228538283653300633948804226008283e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.53938313936621297172285881159282265471330118114236e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.72126969520581558576219170420297785383800313247716e-13), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 17)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.81057004571925961169117504945825287978291651680376e-14), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.50396638201843310535816082381660912483279969324341e-15), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 19)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50330305081854272655464104542050109297998338121296e-15), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.65748943908780839905864199570025333227786061957216e-16), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 21)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.69782199924985143903444545973473854205301886566784e-17), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.30465447555059221873312238790689561215989143051468e-18), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 23)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.46806937341565301230797169380667244412810953871153e-18), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.59520452276585659227559942516968833301265805493281e-19), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.58771679139660099100514647692148711295768774585921e-20), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.11001413331373018059574227843565648889473010676660e-21), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 27)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43366149729083958029796238740037446793377590904146e-21), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.53437941664766678806680232945039585344994407777604e-22), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 29)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.48019217902582750507529988918628139079404963189635e-23), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.91993567701892984811136675864172386794777828712695e-24), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 31)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40006005594525679129869441468227938628239752074460e-24), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.47497989906821913751146663525981445654490373951224e-25), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 34)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.73431218458810807033921781897016124929992555367139e-27), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.41697255768378077454412606000376285104775580444420e-28), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 38)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.55303924276181374957661287953452523234530316565188e-30), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 40)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.36032476336306675100543445227730858361169873925804e-31), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 42)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.37601488550958357902586661939110889053699438042016e-33), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 44)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.30500465172174486774768816059192932509423715417166e-34), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 46)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.20313953663045271143891020576861031160487434865093e-36), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 48)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.25098110519701647231401040429952006498171313622520e-37), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 50)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.03431595374067647597712273413788666502302011992057e-39), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 52)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.19822373554396139874268836303925702273981755123190e-40), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 54)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.86944917357487937107083766130282172728072819621788e-42), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 56)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.14670286674214980345963428973545770896346187182759e-43), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 58)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.70844645856921813581135618689921390269372237700480e-45), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 60)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.09638951830288066744104877057303202280205793138993e-46), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 62)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.55121724469650208575327739326222025805731763269349e-48), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 64)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.04725538896765690179789918481715848637732139291593e-49), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 68)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.99927284078872744316201092259372825667966088624440e-52), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 72)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.95241488358274164371290129159422806319923560612665e-55), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 76)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90665515974877113643838016757246988460215123083510e-58), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 80)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.86196792944215931292810563239498984002947733280447e-61), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 84)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.81832805609585870403135315663573226135611325562940e-64), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 88)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.77571099228111201565561831702708228641500206234884e-67), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 92)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73409276589952345278868976272176004532614982149466e-70), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 96)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.69344996669875337186395484640796879426380291665101e-73), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 100)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.65375973310425133971089340469528202564824480281467e-76), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 104)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61499973935962044893641934052273635317211406169375e-79), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 108)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.57714818296837934466447201222923471989464263831856e-82), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 112)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.54018377243005795377389844944261203114711195148214e-85), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 116)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50408571526372847048232270453380081166710151511926e-88), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 120)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.46883370631223483445539326614628985514365382335866e-91), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 124)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.43440791632054183052284498647098618666372443687369e-94), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 128)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40078898078177913136996580710057244791379339538446e-97), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 128)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40078898078177913136996580710057244791379339538446e-97), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 136)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.33589647367647088181492405614907498160724010027357e-103), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 144)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.27401015632292831593983083357722757492755899455411e-109), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 152)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21499076492588836282713969571802861683612727599536e-115), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 160)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.15870548718060337336267442294886457141506888961350e-121), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 168)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10502766340313279472606127066503960744387520753240e-127), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 176)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.05383650150597838852506758753303490394961853745690e-133), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 184)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.00501680517766798832422980073264589686357358689966e-139), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 192)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.58458714654605854343633461697240731109212481403024e-146), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 200)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.14057459501844267219193898865929347142422181513809e-152), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 208)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.71713122846454875201410197130135867254659825815019e-158), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 216)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.31330416532950282288942525034080378775272203269023e-164), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 224)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.92818466694784433640425229105072382712623790043853e-170), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 232)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.56090609259399827614236096482345946037887373012402e-176), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 240)), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.21064194926643207182155701143594690359008191120531e-182), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 248)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.87660403181689459974437428611368837698944274063617e-188), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 256)), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.55804064923943958258092335330361211489624284804933e-194), tolerance); } template @@ -389,60 +406,77 @@ void do_test_holtsmark_ccdf() { BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.87179879353850251536193247663317269917137569329013e-5), tolerance); BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(512))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.72200715673082274403568012456413425331659480927047e-5), tolerance); BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1024))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.08767256634253255597053159005214917567906016620942e-6), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2048))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.15224951834965340756402503731619739933629215689572e-6), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4096))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.60926645137475638433041259135060814007792759468100e-7), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8192))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.69027136710097153757239920401079588116557633592788e-7), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16384))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.51153240121827639330112195094153363441740650435701e-8), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(32768))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.36283287602527689849064009106938913094716520594050e-8), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(65536))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.18894075854698171408179022464997418218329601220535e-8), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(131072))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.20354010552543796231728241342645692784842686349965e-9), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(262144))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.48617582449547816069323420820736862370145659607645e-9), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(524288))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.25442497729649541267939242007563203416972765165476e-10), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1048576))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85771976129306035185873711236944017216967773980517e-10), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2097152))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.56803119746276025902637885330726865801883592203156e-11), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4194304))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.32214969859659307190062902673645385449168267230206e-11), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8388608))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.21003899305378486738410997502574389330326609057126e-12), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16777216))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.90268712277390815798081242324390081166198190434103e-12), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(33554432))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.02625487407274396069298698869802596448489279633645e-12), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(67108864))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62835890339366126281650716118851052269284048205938e-13), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.34217728e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28281859258171445903392888079435183340041265714998e-13), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.68435456e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.53544862923055721373031196622890601888700626111182e-14), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.36870912e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.60352324072570315319362346398633880353985161880622e-14), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.073741824e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.66931078653639661641440656550426788294070266782671e-15), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.147483648e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.00440405090690395389846895694672344247801107283103e-15), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.294967296e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.08663848317021453602605776312368607691806298813143e-16), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7179869184e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.85829810396272422714320494875293186097734524880995e-17), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6.8719476736e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10728726299533984178525425523566315206520781873938e-17), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.74877906944e11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38410907874417469494912307476988489629927133322828e-18), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.099511627776e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73013634843021835192352185216943643167993641440545e-19), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.398046511104e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.16267043553777293728520200407227686276581114275508e-20), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7592186044416e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.70333804442221617119725245647479628568092558840977e-21), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.0368744177664e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.37917255552777021393262025049731570198920941773050e-22), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.81474976710656e14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.22396569440971276740578385685661655637545268535833e-23), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.125899906842624e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.27995711801214095925566865602936005935821644314758e-24), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.503599627370496e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.59994639751517619906934188799897966230541134026964e-25), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8014398509481984e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.24993299689397024883663924561783076352358304956329e-26), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.2057594037927936e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.03124162461174628110457931016502737959110130110786e-26), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.88230376151711744e17))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28905203076468285138072404465359649544991622324619e-27), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.152921504606846976e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61131503845585356422590504127751316165005771606733e-28), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.611686018427387904e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.01414379806981695528238129932509731805283190086691e-29), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8446744073709551616e19))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51767974758727119410297662380140381412701796292469e-30), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.95147905179352825856e20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.93387460560511124078590097461169759773383672872924e-32), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.722366482869645213696e21))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.14667907125798631372797027282887330061342582520339e-34), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.5557863725914323419136e22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.60418604884060361519995355129506804305208883665969e-36), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.208925819614629174706176e24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50065407013134431487499274238985426822797191535889e-37), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.9342813113834066795298816e25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.34477198458022549199217615998414729133523646527342e-39), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.09485009821345068724781056e26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.66370622590660233123777524997523014264365635070860e-41), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.951760157141521099596496896e27))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.72454097797906614255902382808629709787906142136400e-43), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.9228162514264337593543950336e28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94459527809229084774847473138483921543599314796577e-45), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.267650600228229401496703205376e30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.39759301220192044496069917677888112741187383092503e-46), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.0282409603651670423947251286016e31))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18373908156550069525109246371700176158105285841693e-48), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.24518553658426726783156020576256e32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.41209231494609483632983197455781525247039509121778e-50), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.192296858534827628530496329220096e33))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.33139424210327318176536246024658633198499233002634e-52), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8.3076749736557242056487941267521536e34))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.33030350328636434650837884413529114372655051566613e-54), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.329227995784915872903807060280344576e36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.30160992238849442914193419439613924120727351807283e-55), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.1267647932558653966460912964485513216e37))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.03376550373202254553427217874396756438636487198880e-57), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.40282366920938463463374607431768211456e38))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.17775859958128522739730027928744931935369511248250e-59), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.15224951834965340756402503731619739933629215689572e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.60926645137475638433041259135060814007792759468100e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.69027136710097153757239920401079588116557633592788e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.51153240121827639330112195094153363441740650435701e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.36283287602527689849064009106938913094716520594050e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.18894075854698171408179022464997418218329601220535e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 17))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.20354010552543796231728241342645692784842686349965e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.48617582449547816069323420820736862370145659607645e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 19))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.25442497729649541267939242007563203416972765165476e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.85771976129306035185873711236944017216967773980517e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 21))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.56803119746276025902637885330726865801883592203156e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.32214969859659307190062902673645385449168267230206e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 23))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.21003899305378486738410997502574389330326609057126e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.90268712277390815798081242324390081166198190434103e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.02625487407274396069298698869802596448489279633645e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.62835890339366126281650716118851052269284048205938e-13), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 27))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28281859258171445903392888079435183340041265714998e-13), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.53544862923055721373031196622890601888700626111182e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 29))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.60352324072570315319362346398633880353985161880622e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.66931078653639661641440656550426788294070266782671e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 31))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.00440405090690395389846895694672344247801107283103e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.08663848317021453602605776312368607691806298813143e-16), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 34))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.85829810396272422714320494875293186097734524880995e-17), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.10728726299533984178525425523566315206520781873938e-17), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 38))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.38410907874417469494912307476988489629927133322828e-18), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 40))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.73013634843021835192352185216943643167993641440545e-19), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 42))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.16267043553777293728520200407227686276581114275508e-20), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 44))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.70333804442221617119725245647479628568092558840977e-21), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 46))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.37917255552777021393262025049731570198920941773050e-22), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 48))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.22396569440971276740578385685661655637545268535833e-23), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 50))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.27995711801214095925566865602936005935821644314758e-24), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 52))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.59994639751517619906934188799897966230541134026964e-25), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 54))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.24993299689397024883663924561783076352358304956329e-26), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 56))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.03124162461174628110457931016502737959110130110786e-26), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 58))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.28905203076468285138072404465359649544991622324619e-27), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 60))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.61131503845585356422590504127751316165005771606733e-28), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 62))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.01414379806981695528238129932509731805283190086691e-29), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 64))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.51767974758727119410297662380140381412701796292469e-30), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 68))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.93387460560511124078590097461169759773383672872924e-32), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 72))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.14667907125798631372797027282887330061342582520339e-34), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 76))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.60418604884060361519995355129506804305208883665969e-36), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 80))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.50065407013134431487499274238985426822797191535889e-37), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 84))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.34477198458022549199217615998414729133523646527342e-39), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 88))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.66370622590660233123777524997523014264365635070860e-41), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 92))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.72454097797906614255902382808629709787906142136400e-43), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 96))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.94459527809229084774847473138483921543599314796577e-45), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 100))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.39759301220192044496069917677888112741187383092503e-46), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 104))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.18373908156550069525109246371700176158105285841693e-48), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 108))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.41209231494609483632983197455781525247039509121778e-50), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 112))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.33139424210327318176536246024658633198499233002634e-52), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 116))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.33030350328636434650837884413529114372655051566613e-54), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 120))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.30160992238849442914193419439613924120727351807283e-55), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 124))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.03376550373202254553427217874396756438636487198880e-57), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 128))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.17775859958128522739730027928744931935369511248250e-59), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 128))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.17775859958128522739730027928744931935369511248250e-59), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 136))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.75819970600899713720044013497912431482835720820923e-63), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 144))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.89409172509985281669932620482888777217489189653546e-66), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 152))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.62424737573206254076983936725802678753635716927602e-70), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 160))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.12896664446583558124263656427197919617586844953028e-73), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 168))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.75626622184041889951815567449213670941374133186103e-77), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 176))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.72916558066508520390174725217806813821714192348884e-81), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 184))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.64286269059206181735882501273878616655691941491427e-84), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 192))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.01089524070327592128619387875680216444560404031804e-88), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 200))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.79222470874823222970262177430859903429102548905771e-92), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 208))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.39067986053423638420474164411831031110620739478948e-95), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 216))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.83662075325741304737485752958571853297413914743525e-99), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 224))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.42495623858823560726925232655901331371438944029181e-102), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 232))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.47889706686580958805969806288821609793552109446243e-106), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 240))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.49340104215285543959887222384818383285039329702741e-110), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 248))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.07358423880684947255831841402543550606699055103208e-113), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.06246152052453484511308206549178590348386364998067e-117), tolerance); BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 600))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.35984768491636685338723260976696756010081951066709e-272), tolerance); From 681ee060ecbf87037627d06a5ec6cd7f79f473f8 Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Tue, 16 Jul 2024 23:43:12 +0900 Subject: [PATCH 006/399] Add mapairy limit test case --- test/test_mapairy.cpp | 250 ++++++++++++++++++++++++------------------ 1 file changed, 142 insertions(+), 108 deletions(-) diff --git a/test/test_mapairy.cpp b/test/test_mapairy.cpp index 8f5b98d587..ccae24c30f 100644 --- a/test/test_mapairy.cpp +++ b/test/test_mapairy.cpp @@ -163,60 +163,77 @@ void do_test_mapairy_pdf(){ BOOST_CHECK_CLOSE(pdf(dist, static_cast(256)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.70691063363569289518344600523741530561019748614806e-7), tolerance); BOOST_CHECK_CLOSE(pdf(dist, static_cast(512)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.00884949274594535609095332297684714775260624951825e-7), tolerance); BOOST_CHECK_CLOSE(pdf(dist, static_cast(1024)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.78341094639115825398956813042728307580960455542744e-8), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2048)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.15265496830848341113806943808080759239756631409525e-9), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4096)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.57315927453204720744811655603371636021315489208197e-10), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(8192)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.85204679078224624495444948682547526667095102524654e-11), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(16384)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.74161227361870459284450362091832192677055853279409e-11), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(32768)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.07876462219180661771716253718191722284989080940137e-12), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(65536)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.44253835507444012610805302754717855328014016707006e-13), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(131072)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.62113944435292862305033337145279742309373660330666e-14), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(262144)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.70079323596084060715031479698836179832962876226040e-14), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(524288)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.00660607636030744539992938919621601865776189138704e-15), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1048576)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.31497886237763070924617652541844323609885629317601e-16), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2097152)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.39564398862596160919395415621974601387332621717152e-17), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4194304)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.66093089449300961525223017779109302708950139673730e-17), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(8388608)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.93613874644561300698599726959494859627890174964948e-18), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(16777216)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.19040904529065504857204743126112225011195501281143e-19), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(33554432)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.17543358264254064703206600829360293655988827362640e-20), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(67108864)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.62200282665332970268320245960144424095679956397013e-20), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.34217728e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.86732299457579395219850121616992176031753071031156e-21), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.68435456e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.06875883329165532088522436776488158979648490753308e-22), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.36870912e8)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.96038435804935610062036418083267399916819002834560e-23), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.073741824e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.58398713540364228777663367294171284220596445493878e-23), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.147483648e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.80012011189042378144386404030074611545380892760386e-24), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.294967296e9)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.94995979813638214930198027960375045149298281432705e-25), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7179869184e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.54686243691761942165686883762842249372631955082800e-26), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(6.8719476736e10)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.83394511536756069267771511760113721074800848019252e-28), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.74877906944e11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.51060784855236271646178597425041551955920802058680e-29), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.099511627776e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.72064952672613348894308116953255143520457854922274e-31), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.398046511104e12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.47520297710191671529471286547892233784021035466379e-32), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.7592186044416e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.61000930344348973529597770462163230645079307893137e-34), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.0368744177664e13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.44062790732609054227999303269426009576929146861433e-35), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.81474976710656e14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.50196221039403294462497822716956279927920276478346e-37), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.125899906842624e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40686319074813529519530569599048837477475167906008e-38), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.503599627370496e15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.39644747108792279748533029997027617117109903686087e-40), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8014398509481984e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.37388983471497587421416571874071130349096844921335e-41), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.2057594037927936e16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.29340573348429960691926787106472282340927640380120e-43), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.88230376151711744e17)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.34168929171384362716227120970772588231539887618792e-44), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.152921504606846976e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.19277903660576133488209753033664338223562148808726e-46), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.611686018427387904e18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.31024344893930041715065547823020105694863171502727e-47), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.8446744073709551616e19)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.09451077793531380359579836946937830296447410946021e-49), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.95147905179352825856e20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.99854568157745488632402184518493974898874424751974e-52), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.722366482869645213696e21)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.90482976716548328742580258318841772362182055421850e-55), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.5557863725914323419136e22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.81331031949754227287676033514493918322443413497900e-58), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.208925819614629174706176e24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.72393585888431862585621126478997967111761145994043e-61), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.9342813113834066795298816e25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.63665611219171740806270631327146452257579244134808e-64), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.09485009821345068724781056e26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.55142198456222403131123663405416457282792230600398e-67), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(4.951760157141521099596496896e27)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.46818553179904690557737952544352009065226787695701e-70), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(7.9228162514264337593543950336e28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.38689993339750674372790969281593758852760534859083e-73), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.267650600228229401496703205376e30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.30751946620850267942178680939056405129648959823324e-76), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.0282409603651670423947251286016e31)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22999947871924089787283868104547270634422812327464e-79), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.24518553658426726783156020576256e32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.15429636593675868932894402445846943978928527663539e-82), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(5.192296858534827628530496329220096e33)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.08036754486011590754779689888522406229422390296425e-85), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(8.3076749736557242056487941267521536e34)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.00817143052745694096464540906760162333420303023853e-88), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(1.329227995784915872903807060280344576e36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.93766741262446966891078653229257971028730764671731e-91), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(2.1267647932558653966460912964485513216e37)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.86881583264108366104568997294197237332744887374738e-94), tolerance); - BOOST_CHECK_CLOSE(pdf(dist, static_cast(3.40282366920938463463374607431768211456e38)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.80157796156355826273993161420114489582758679076892e-97), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 11)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.15265496830848341113806943808080759239756631409525e-9), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 12)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.57315927453204720744811655603371636021315489208197e-10), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 13)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.85204679078224624495444948682547526667095102524654e-11), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 14)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.74161227361870459284450362091832192677055853279409e-11), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 15)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.07876462219180661771716253718191722284989080940137e-12), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 16)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.44253835507444012610805302754717855328014016707006e-13), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 17)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.62113944435292862305033337145279742309373660330666e-14), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 18)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.70079323596084060715031479698836179832962876226040e-14), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 19)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.00660607636030744539992938919621601865776189138704e-15), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 20)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.31497886237763070924617652541844323609885629317601e-16), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 21)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.39564398862596160919395415621974601387332621717152e-17), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 22)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.66093089449300961525223017779109302708950139673730e-17), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 23)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.93613874644561300698599726959494859627890174964948e-18), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 24)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.19040904529065504857204743126112225011195501281143e-19), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 25)), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.17543358264254064703206600829360293655988827362640e-20), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 26)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.62200282665332970268320245960144424095679956397013e-20), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 27)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.86732299457579395219850121616992176031753071031156e-21), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 28)), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.06875883329165532088522436776488158979648490753308e-22), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 29)), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.96038435804935610062036418083267399916819002834560e-23), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 30)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.58398713540364228777663367294171284220596445493878e-23), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 31)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.80012011189042378144386404030074611545380892760386e-24), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 32)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.94995979813638214930198027960375045149298281432705e-25), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 34)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.54686243691761942165686883762842249372631955082800e-26), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 36)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.83394511536756069267771511760113721074800848019252e-28), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 38)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.51060784855236271646178597425041551955920802058680e-29), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 40)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.72064952672613348894308116953255143520457854922274e-31), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 42)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.47520297710191671529471286547892233784021035466379e-32), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 44)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.61000930344348973529597770462163230645079307893137e-34), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 46)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.44062790732609054227999303269426009576929146861433e-35), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 48)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.50196221039403294462497822716956279927920276478346e-37), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 50)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.40686319074813529519530569599048837477475167906008e-38), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 52)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.39644747108792279748533029997027617117109903686087e-40), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 54)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.37388983471497587421416571874071130349096844921335e-41), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 56)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.29340573348429960691926787106472282340927640380120e-43), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 58)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.34168929171384362716227120970772588231539887618792e-44), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 60)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.19277903660576133488209753033664338223562148808726e-46), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 62)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.31024344893930041715065547823020105694863171502727e-47), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 64)), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.09451077793531380359579836946937830296447410946021e-49), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 68)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.99854568157745488632402184518493974898874424751974e-52), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 72)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.90482976716548328742580258318841772362182055421850e-55), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 76)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.81331031949754227287676033514493918322443413497900e-58), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 80)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.72393585888431862585621126478997967111761145994043e-61), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 84)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.63665611219171740806270631327146452257579244134808e-64), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 88)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.55142198456222403131123663405416457282792230600398e-67), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 92)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.46818553179904690557737952544352009065226787695701e-70), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 96)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.38689993339750674372790969281593758852760534859083e-73), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 100)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.30751946620850267942178680939056405129648959823324e-76), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 104)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22999947871924089787283868104547270634422812327464e-79), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 108)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.15429636593675868932894402445846943978928527663539e-82), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 112)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.08036754486011590754779689888522406229422390296425e-85), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 116)), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.00817143052745694096464540906760162333420303023853e-88), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 120)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.93766741262446966891078653229257971028730764671731e-91), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 124)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.86881583264108366104568997294197237332744887374738e-94), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 128)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.80157796156355826273993161420114489582758679076892e-97), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 128)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.80157796156355826273993161420114489582758679076892e-97), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 136)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.67179294735294176362984811229814996321448020054714e-103), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 144)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.54802031264585663187966166715445514985511798910822e-109), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 152)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.42998152985177672565427939143605723367225455199072e-115), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 160)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.31741097436120674672534884589772914283013777922699e-121), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 168)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.21005532680626558945212254133007921488775041506480e-127), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 176)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.10767300301195677705013517506606980789923707491379e-133), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 184)), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.01003361035533597664845960146529179372714717379932e-139), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 192)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.91691742930921170868726692339448146221842496280605e-145), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 200)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.82811491900368853443838779773185869428484436302762e-151), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 208)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.74342624569290975040282039426027173450931965163004e-157), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 216)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.66266083306590056457788505006816075755054440653805e-163), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 224)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.58563693338956886728085045821014476542524758008771e-169), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 232)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.51218121851879965522847219296469189207577474602480e-175), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 240)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.44212838985328641436431140228718938071801638224106e-181), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 248)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.37532080636337891994887485722273767539788854812723e-187), tolerance); + BOOST_CHECK_CLOSE(pdf(dist, ldexp(static_cast(1), 256)), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.31160812984788791651618467066072242297924856960987e-193), tolerance); } template @@ -451,60 +468,77 @@ void do_test_mapairy_ccdf() { BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.73979922776430555363554632966080889507162029820752e-5), tolerance); BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(512))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.44353982639936003430898773389958569528340214901924e-5), tolerance); BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1024))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.21747521599099094720054911524728128905331418743558e-5), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2048))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.30442492111514986227593224497576120783344940470632e-6), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4096))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.52184402609265962838062304205455964936542503385355e-6), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8192))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.38053115409151479601077504716814204054241984396579e-7), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16384))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90230503273504174320645323659877052404533613091567e-7), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(32768))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.72566394266708055503723315148592640827491725732841e-8), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(65536))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37788129092113064009710124961268854372530077851514e-8), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(131072))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.40707992833487973793766069223107728401530584918012e-9), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(262144))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.97235161365145877787702193738699569533619914113956e-9), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(524288))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.05088499104186197709404571098840228587836479911802e-9), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1048576))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.71543951706432436058369237052221627684485231071286e-10), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2097152))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.31360623880232751062247585210413319083311528997997e-10), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4194304))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.64429939633040546807800247387131067206560952703714e-11), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8388608))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.64200779850290938904479244625064763530742033320990e-11), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(16777216))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.80537424541300683543633877614223483555123688801843e-12), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(33554432))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.05250974812863673632096512092113144155816177586613e-12), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(67108864))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.25671780676625854430204135462707277286762193086669e-13), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.34217728e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.56563718516079592040149887308711394838177046916383e-13), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.68435456e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.07089725845782318037768094883949095101477347530653e-14), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.36870912e8))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.20704648145099490050187930370138656919662848438144e-14), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.073741824e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.13386215730722789754721037105719349775366357126605e-14), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.147483648e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.00880810181374362562734924119592255004499293746830e-15), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.294967296e9))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41732769663403487193401296875220001924045479390391e-15), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7179869184e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.77165962079254358991751621103655291754760707304047e-16), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(6.8719476736e10))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.21457452599067948739689526379757206282312287607911e-17), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.74877906944e11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.76821815748834935924611907974700181516735308796565e-18), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.099511627776e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.46027269686043669905764884968375298647166107661462e-19), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.398046511104e12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.32534087107554587382206106210469124710349176992174e-20), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.7592186044416e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.40667608884443234227757632763086405915307399803018e-21), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.0368744177664e13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.75834511105554042784697040953858007394668838202264e-22), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.81474976710656e14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.44793138881942553480871301192322509243346488933465e-23), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.125899906842624e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.05599142360242819185108912649040313655418331509614e-23), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.503599627370496e15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.31998927950303523981386140811300392069272914785317e-24), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8014398509481984e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.64998659937879404976732676014125490086591143489426e-25), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.2057594037927936e16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.06248324922349256220915845017656862608238929361934e-26), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.88230376151711744e17))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.57810406152936570276144806272071078260298661702420e-27), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.152921504606846976e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22263007691170712845181007840088847825373327128025e-28), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.611686018427387904e18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.02828759613963391056476259800111059781716658910032e-29), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.8446744073709551616e19))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.03535949517454238820595324750138824727145823637540e-30), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.95147905179352825856e20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.86774921121022248157180194922091913636165349433656e-32), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.722366482869645213696e21))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.22933581425159726274559405456576861505650835849009e-33), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.5557863725914323419136e22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.92083720976812072303999071025901346102579431014076e-35), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.208925819614629174706176e24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.00130814026268862974998548477970853285280360959494e-37), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.9342813113834066795298816e25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.68954396916045098398435231996829458258250563999209e-39), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.09485009821345068724781056e26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.32741245181320466247555049995046028528516506248764e-41), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(4.951760157141521099596496896e27))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.14490819559581322851180476561725941957580704101369e-42), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(7.9228162514264337593543950336e28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.78891905561845816954969494627696784308719850158390e-44), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.267650600228229401496703205376e30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.79518602440384088992139835355776225482374765872484e-46), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.0282409603651670423947251286016e31))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.36747816313100139050218492743400352316210571675756e-48), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.24518553658426726783156020576256e32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.82418462989218967265966394911563050494079018243369e-50), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(5.192296858534827628530496329220096e33))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.06627884842065463635307249204931726639699846600526e-51), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(8.3076749736557242056487941267521536e34))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.66606070065727286930167576882705822874531010313323e-53), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(1.329227995784915872903807060280344576e36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.60321984477698885828386838879227848241454703614566e-55), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(2.1267647932558653966460912964485513216e37))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.06753100746404509106854435748793512877272974397760e-57), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, static_cast(3.40282366920938463463374607431768211456e38))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.35551719916257045479460055857489863870739022496500e-59), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 11))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.30442492111514986227593224497576120783344940470632e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 12))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.52184402609265962838062304205455964936542503385355e-6), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 13))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.38053115409151479601077504716814204054241984396579e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 14))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.90230503273504174320645323659877052404533613091567e-7), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 15))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.72566394266708055503723315148592640827491725732841e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 16))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.37788129092113064009710124961268854372530077851514e-8), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 17))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.40707992833487973793766069223107728401530584918012e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 18))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.97235161365145877787702193738699569533619914113956e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 19))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.05088499104186197709404571098840228587836479911802e-9), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 20))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.71543951706432436058369237052221627684485231071286e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 21))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.31360623880232751062247585210413319083311528997997e-10), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 22))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.64429939633040546807800247387131067206560952703714e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 23))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.64200779850290938904479244625064763530742033320990e-11), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 24))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.80537424541300683543633877614223483555123688801843e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 25))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.05250974812863673632096512092113144155816177586613e-12), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 26))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.25671780676625854430204135462707277286762193086669e-13), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 27))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.56563718516079592040149887308711394838177046916383e-13), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 28))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.07089725845782318037768094883949095101477347530653e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 29))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.20704648145099490050187930370138656919662848438144e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 30))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.13386215730722789754721037105719349775366357126605e-14), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 31))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.00880810181374362562734924119592255004499293746830e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 32))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.41732769663403487193401296875220001924045479390391e-15), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 34))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.77165962079254358991751621103655291754760707304047e-16), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 36))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.21457452599067948739689526379757206282312287607911e-17), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 38))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.76821815748834935924611907974700181516735308796565e-18), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 40))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.46027269686043669905764884968375298647166107661462e-19), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 42))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.32534087107554587382206106210469124710349176992174e-20), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 44))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.40667608884443234227757632763086405915307399803018e-21), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 46))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.75834511105554042784697040953858007394668838202264e-22), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 48))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.44793138881942553480871301192322509243346488933465e-23), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 50))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.05599142360242819185108912649040313655418331509614e-23), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 52))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.31998927950303523981386140811300392069272914785317e-24), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 54))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.64998659937879404976732676014125490086591143489426e-25), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 56))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.06248324922349256220915845017656862608238929361934e-26), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 58))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.57810406152936570276144806272071078260298661702420e-27), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 60))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.22263007691170712845181007840088847825373327128025e-28), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 62))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.02828759613963391056476259800111059781716658910032e-29), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 64))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.03535949517454238820595324750138824727145823637540e-30), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 68))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.86774921121022248157180194922091913636165349433656e-32), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 72))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.22933581425159726274559405456576861505650835849009e-33), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 76))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.92083720976812072303999071025901346102579431014076e-35), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 80))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.00130814026268862974998548477970853285280360959494e-37), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 84))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.68954396916045098398435231996829458258250563999209e-39), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 88))), BOOST_MATH_BIG_CONSTANT(RealType, N, 7.32741245181320466247555049995046028528516506248764e-41), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 92))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.14490819559581322851180476561725941957580704101369e-42), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 96))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.78891905561845816954969494627696784308719850158390e-44), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 100))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.79518602440384088992139835355776225482374765872484e-46), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 104))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.36747816313100139050218492743400352316210571675756e-48), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 108))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.82418462989218967265966394911563050494079018243369e-50), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 112))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.06627884842065463635307249204931726639699846600526e-51), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 116))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.66606070065727286930167576882705822874531010313323e-53), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 120))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.60321984477698885828386838879227848241454703614566e-55), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 124))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.06753100746404509106854435748793512877272974397760e-57), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 128))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.35551719916257045479460055857489863870739022496500e-59), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 128))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.35551719916257045479460055857489863870739022496500e-59), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 136))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.55163994120179942744008802699582486296567144164185e-62), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 144))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.78818345019970563339865240965777554434978379307091e-66), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 152))), BOOST_MATH_BIG_CONSTANT(RealType, N, 9.24849475146412508153967873451605357507271433855203e-70), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 160))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.25793328893167116248527312854395839235173689906056e-73), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 168))), BOOST_MATH_BIG_CONSTANT(RealType, N, 5.51253244368083779903631134898427341882748266372206e-77), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 176))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.34583311613301704078034945043561362764342838469777e-80), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 184))), BOOST_MATH_BIG_CONSTANT(RealType, N, 3.28572538118412363471765002547757233311383882982854e-84), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 192))), BOOST_MATH_BIG_CONSTANT(RealType, N, 8.02179048140655184257238775751360432889120808063607e-88), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 200))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.95844494174964644594052435486171980685820509781154e-91), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 208))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.78135972106847276840948328823662062221241478957896e-95), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 216))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.16732415065148260947497150591714370659482782948705e-98), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 224))), BOOST_MATH_BIG_CONSTANT(RealType, N, 2.84991247717647121453850465311802662742877888058362e-102), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 232))), BOOST_MATH_BIG_CONSTANT(RealType, N, 6.95779413373161917611939612577643219587104218892485e-106), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 240))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.69868020843057108791977444476963676657007865940548e-109), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 248))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.14716847761369894511663682805087101213398110206416e-113), tolerance); + BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.01249230410490696902261641309835718069677272999613e-116), tolerance); BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 600))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.71969536983273370677446521953393512020163902133418e-272), tolerance); From edfa58f0c38e80bffc57e8b079f764131b27c759 Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Thu, 18 Jul 2024 22:28:30 +0900 Subject: [PATCH 007/399] Add mapairy document --- doc/distributions/mapairy.qbk | 106 ++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 doc/distributions/mapairy.qbk diff --git a/doc/distributions/mapairy.qbk b/doc/distributions/mapairy.qbk new file mode 100644 index 0000000000..41e50be0cd --- /dev/null +++ b/doc/distributions/mapairy.qbk @@ -0,0 +1,106 @@ +[section:mapairy_dist Map-Airy Distribution] + +``#include `` + + template + class mapairy_distribution; + + typedef mapairy_distribution<> mapairy; + + template + class mapairy_distribution + { + public: + typedef RealType value_type; + typedef Policy policy_type; + + mapairy_distribution(RealType location = 0, RealType scale = 1); + + RealType location()const; + RealType scale()const; + }; + +It is special case of a [@http://en.wikipedia.org/wiki/Stable_distribution stable distribution] +with shape parameter [alpha]=3/2, [beta]=1. + +This distribution is also defined as [beta] = −1, which is inverted about the x-axis. + +[@http://en.wikipedia.org/wiki/Probability_distribution probability distribution function PDF] +given by: + +[equation mapairy_ref1] + +The location parameter [mu] is the location of the distribution, +while the scale parameter [c] determines the width of the distribution. If the location is +zero, and the scale 1, then the result is a standard mapairy +distribution. + +The distribution describes the probability distribution of the area under a Brownian excursion over a unit interval. + +The following graph shows how the distributions moves as the +location parameter changes: + +[graph mapairy_pdf1] + +While the following graph shows how the shape (scale) parameter alters +the distribution: + +[graph mapairy_pdf2] + +[h4 Member Functions] + + mapairy_distribution(RealType location = 0, RealType scale = 1); + +Constructs a mapairy distribution, with location parameter /location/ +and scale parameter /scale/. When these parameters take their default +values (location = 0, scale = 1) +then the result is a Standard mapairy Distribution. + +Requires scale > 0, otherwise calls __domain_error. + + RealType location()const; + +Returns the location parameter of the distribution. + + RealType scale()const; + +Returns the scale parameter of the distribution. + +[h4 Non-member Accessors] + +All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] +that are generic to all distributions are supported: __usual_accessors. + +Note however that the mapairy distribution does not have a mean, +standard deviation, etc. See __math_undefined +[/link math_toolkit.pol_ref.assert_undefined mathematically undefined function] +to control whether these should fail to compile with a BOOST_STATIC_ASSERTION_FAILURE, +which is the default. + +Alternately, the functions __skewness, __kurtosis and __kurtosis_excess will all +return a __domain_error if called. + +The domain of the random variable is \[-[max_value], +[min_value]\]. + +[h4 Accuracy] + +The error is within 4 epsilon except for the rapidly decaying left tail. + +[h4 Implementation] + +See references. + +[h4 References] + +* [@https://mathworld.wolfram.com/Map-AiryDistribution.html Wolfram MathWorld: Map-Airy Distribution] +* T. Yoshimura, Numerical Evaluation and High Precision Approximation Formula for Map-Airy Distribution, +DOI: 10.36227/techrxiv.172053942.27675733/v1, 2024. + +[endsect][/section:mapairy_dist mapairy] + +[/ mapairy.qbk + Distributed under 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). +] From 765e0c1e88c0f2600d912119cded9c537b059d71 Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Thu, 18 Jul 2024 22:40:22 +0900 Subject: [PATCH 008/399] Add holtsmark document --- doc/distributions/holtsmark.qbk | 107 ++++++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 doc/distributions/holtsmark.qbk diff --git a/doc/distributions/holtsmark.qbk b/doc/distributions/holtsmark.qbk new file mode 100644 index 0000000000..5a0d41fb2b --- /dev/null +++ b/doc/distributions/holtsmark.qbk @@ -0,0 +1,107 @@ +[section:holtsmark_dist Holtsmark Distribution] + +``#include `` + + template + class holtsmark_distribution; + + typedef holtsmark_distribution<> holtsmark; + + template + class holtsmark_distribution + { + public: + typedef RealType value_type; + typedef Policy policy_type; + + holtsmark_distribution(RealType location = 0, RealType scale = 1); + + RealType location()const; + RealType scale()const; + }; + +The [@http://en.wikipedia.org/wiki/holtsmark_distribution Holtsmark distribution] +is named after Johan Peter Holtsmark. +It is special case of a [@http://en.wikipedia.org/wiki/Stable_distribution stable distribution] +with shape parameter [alpha]=3/2, [beta]=0. + +[@http://en.wikipedia.org/wiki/Probability_distribution probability distribution function PDF] +given by: + +[equation holtsmark_ref1] + +The location parameter [mu] is the location of the distribution, +while the scale parameter [c] determines the width of the distribution. +If the location is +zero, and the scale 1, then the result is a standard holtsmark +distribution. + +The distribution especially used in astrophysics for modeling gravitational bodies. + +The following graph shows how the distributions moves as the +location parameter changes: + +[graph holtsmark_pdf1] + +While the following graph shows how the shape (scale) parameter alters +the distribution: + +[graph holtsmark_pdf2] + +[h4 Member Functions] + + holtsmark_distribution(RealType location = 0, RealType scale = 1); + +Constructs a holtsmark distribution, with location parameter /location/ +and scale parameter /scale/. When these parameters take their default +values (location = 0, scale = 1) +then the result is a Standard holtsmark Distribution. + +Requires scale > 0, otherwise calls __domain_error. + + RealType location()const; + +Returns the location parameter of the distribution. + + RealType scale()const; + +Returns the scale parameter of the distribution. + +[h4 Non-member Accessors] + +All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] +that are generic to all distributions are supported: __usual_accessors. + +Note however that the holtsmark distribution does not have a skewness, +kurtosis, etc. See __math_undefined +[/link math_toolkit.pol_ref.assert_undefined mathematically undefined function] +to control whether these should fail to compile with a BOOST_STATIC_ASSERTION_FAILURE, +which is the default. + +Alternately, the functions __skewness, __kurtosis and __kurtosis_excess will all +return a __domain_error if called. + +The domain of the random variable is \[-[max_value], +[min_value]\]. + +[h4 Accuracy] + +The error is within 4 epsilon. + +[h4 Implementation] + +See references. + +[h4 References] + +* [@http://en.wikipedia.org/wiki/holtsmark_distribution Holtsmark Distribution] +* T. Yoshimura, Numerical Evaluation and High Precision Approximation Formula for Holtsmark Distribution, +DOI: 10.36227/techrxiv.172054657.73020014/v1, 2024. + +[endsect][/section:holtsmark_dist holtsmark] + +[/ holtsmark.qbk + Distributed under 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). +] From 18e035a34e6c23729e43dbb841785388250bc689 Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Thu, 18 Jul 2024 22:41:30 +0900 Subject: [PATCH 009/399] Fix mapairy document --- doc/distributions/mapairy.qbk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/distributions/mapairy.qbk b/doc/distributions/mapairy.qbk index 41e50be0cd..e10f598cec 100644 --- a/doc/distributions/mapairy.qbk +++ b/doc/distributions/mapairy.qbk @@ -72,8 +72,8 @@ Returns the scale parameter of the distribution. All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] that are generic to all distributions are supported: __usual_accessors. -Note however that the mapairy distribution does not have a mean, -standard deviation, etc. See __math_undefined +Note however that the mapairy distribution does not have a skewness, +kurtosis, etc. See __math_undefined [/link math_toolkit.pol_ref.assert_undefined mathematically undefined function] to control whether these should fail to compile with a BOOST_STATIC_ASSERTION_FAILURE, which is the default. From d378f70bdb334fbdb4d5268bde70a3ea53bfdba1 Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Thu, 18 Jul 2024 22:48:15 +0900 Subject: [PATCH 010/399] Add saspoint5 document --- doc/distributions/saspoint5.qbk | 105 ++++++++++++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 doc/distributions/saspoint5.qbk diff --git a/doc/distributions/saspoint5.qbk b/doc/distributions/saspoint5.qbk new file mode 100644 index 0000000000..ff977b378d --- /dev/null +++ b/doc/distributions/saspoint5.qbk @@ -0,0 +1,105 @@ +[section:saspoint5_dist S[alpha]S Point5 Distribution] + +``#include `` + + template + class saspoint5_distribution; + + typedef saspoint5_distribution<> saspoint5; + + template + class saspoint5_distribution + { + public: + typedef RealType value_type; + typedef Policy policy_type; + + saspoint5_distribution(RealType location = 0, RealType scale = 1); + + RealType location()const; + RealType scale()const; + }; + +It is special case of a [@http://en.wikipedia.org/wiki/Stable_distribution stable distribution] +with shape parameter [alpha]=1/2, [beta]=0. + +[@http://en.wikipedia.org/wiki/Probability_distribution probability distribution function PDF] +given by: + +[equation saspoint5_ref1] + +The location parameter [mu] is the location of the distribution, +while the scale parameter [c] determines the width of the distribution. +If the location is +zero, and the scale 1, then the result is a standard S[alpha]S Point5 +distribution. + +This distribution has heavier tails than the Cauchy distribution. + +The following graph shows how the distributions moves as the +location parameter changes: + +[graph saspoint5_pdf1] + +While the following graph shows how the shape (scale) parameter alters +the distribution: + +[graph saspoint5_pdf2] + +[h4 Member Functions] + + saspoint5_distribution(RealType location = 0, RealType scale = 1); + +Constructs a S[alpha]S Point5 distribution, with location parameter /location/ +and scale parameter /scale/. When these parameters take their default +values (location = 0, scale = 1) +then the result is a Standard S[alpha]S Point5 Distribution. + +Requires scale > 0, otherwise calls __domain_error. + + RealType location()const; + +Returns the location parameter of the distribution. + + RealType scale()const; + +Returns the scale parameter of the distribution. + +[h4 Non-member Accessors] + +All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] +that are generic to all distributions are supported: __usual_accessors. + +Note however that the S[alpha]S Point5 distribution does not have a mean, +standard deviation, etc. See __math_undefined +[/link math_toolkit.pol_ref.assert_undefined mathematically undefined function] +to control whether these should fail to compile with a BOOST_STATIC_ASSERTION_FAILURE, +which is the default. + +Alternately, the functions __mean, __sd, +__variance, __skewness, __kurtosis and __kurtosis_excess will all +return a __domain_error if called. + +The domain of the random variable is \[-[max_value], +[min_value]\]. + +[h4 Accuracy] + +The error is within 4 epsilon. + +[h4 Implementation] + +See references. + +[h4 References] + +* T. Yoshimura, Numerical Evaluation and High Precision Approximation Formula for S[alpha]S Point5 Distribution, +DOI: 10.36227/techrxiv.172055253.37208198/v1, 2024. + +[endsect][/section:saspoint5_dist saspoint5] + +[/ saspoint5.qbk + Distributed under 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). +] From 5e58843aece2a5af528923d4cf167aa5c8291e12 Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Sun, 21 Jul 2024 02:03:34 +0900 Subject: [PATCH 011/399] Fix saspoint5 minor corrections --- .../boost/math/distributions/saspoint5.hpp | 201 +++++++++--------- test/test_saspoint5.cpp | 56 +++++ 2 files changed, 162 insertions(+), 95 deletions(-) diff --git a/include/boost/math/distributions/saspoint5.hpp b/include/boost/math/distributions/saspoint5.hpp index 231b8f4939..597421af83 100644 --- a/include/boost/math/distributions/saspoint5.hpp +++ b/include/boost/math/distributions/saspoint5.hpp @@ -13,8 +13,11 @@ #include #include +#include #include #include +#include +#include #include #include @@ -49,7 +52,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(4.19828222275972713819e14), }; static const RealType Q[15] = { - static_cast(1), + static_cast(1.), static_cast(3.41295871011779138155e2), static_cast(5.48907134827349102297e4), static_cast(5.36641455324410261980e6), @@ -69,7 +72,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); } else if (x < 0.25) { - RealType t = x - 0.125; + RealType t = x - static_cast (0.125); // Rational Approximation // Maximum Relative Error: 2.1471e-17 @@ -83,7 +86,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-6.59304802132933325219e-1), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.98623818041545101115e1), static_cast(1.52856383017632616759e2), static_cast(5.70706902111659740041e2), @@ -95,7 +98,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (x < 0.5) { - RealType t = x - 0.25; + RealType t = x - static_cast (0.25); // Rational Approximation // Maximum Relative Error: 5.3265e-17 @@ -110,7 +113,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(1.37294648777729527395e-3), }; static const RealType Q[6] = { - static_cast(1), + static_cast(1.), static_cast(1.02879626214781666701e1), static_cast(3.85125274509784615691e1), static_cast(6.18474367367800231625e1), @@ -121,7 +124,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (x < 1) { - RealType t = x - 0.5; + RealType t = x - static_cast (0.5); // Rational Approximation // Maximum Relative Error: 2.7947e-17 @@ -135,7 +138,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-1.03693607694266081126e-4), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(6.73363440952557318819e0), static_cast(1.74288966619209299976e1), static_cast(2.15943268035083671893e1), @@ -161,7 +164,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-2.63561415158954865283e-7), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(3.04082856018856244947e0), static_cast(3.52558663323956252986e0), static_cast(1.94795523079701426332e0), @@ -187,7 +190,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-3.56598940936439037087e-9), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.63904431617187026619e0), static_cast(1.03812003196677309121e0), static_cast(3.18144310790210668797e-1), @@ -213,7 +216,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-1.94913182592441292094e-11), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(8.10113554189626079232e-1), static_cast(2.54175325409968367580e-1), static_cast(3.87119072807894983910e-2), @@ -239,7 +242,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-1.16300443044165216564e-13), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(4.10446485803039594111e-1), static_cast(6.51887342399859289520e-2), static_cast(5.02151225308643905366e-3), @@ -265,7 +268,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-7.42649416356965421308e-16), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(2.09203384450859785642e-1), static_cast(1.69422626897631306130e-2), static_cast(6.65649059670689720386e-4), @@ -291,7 +294,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-4.53975807317403152058e-18), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.05980850386474826374e-1), static_cast(4.34966042652000070674e-3), static_cast(8.66341538387446465700e-5), @@ -315,7 +318,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-4.05398011689821941383e-4), }; static const RealType Q[5] = { - static_cast(1), + static_cast(1.), static_cast(7.00973251258577238892e-1), static_cast(2.66969681258835723157e-1), static_cast(5.51785147503612200456e-2), @@ -368,7 +371,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.64877082086372991309408001661535573441e35), }; static const RealType Q[28] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18981461118065892086304195732751798634e3), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.01761929839041982958990681130944341399e5), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.69465252239913021973760046507387620537e8), @@ -401,7 +404,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); } else if (x < 0.125) { - RealType t = x - 0.0625; + RealType t = x - static_cast (0.0625); // Rational Approximation // Maximum Relative Error: 3.4585e-35 @@ -422,7 +425,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05543800791717482823610940401201712196e4), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.44407579416524903840331499438398472639e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.15911780811299460009161345260146251462e3), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.88457596285725454686358792906273558406e4), @@ -440,7 +443,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (x < 0.25) { - RealType t = x - 0.125; + RealType t = x - static_cast (0.125); // Rational Approximation // Maximum Relative Error: 6.9278e-35 @@ -461,7 +464,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.96874547436310030183519174847668703774e0), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.63164311578114868477819520857286165076e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34964379844144961683927306966955217328e3), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.82966031793809959278519002412667883288e4), @@ -479,7 +482,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (x < 0.5) { - RealType t = x - 0.25; + RealType t = x - static_cast (0.25); // Rational Approximation // Maximum Relative Error: 6.9378e-36 @@ -500,7 +503,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.72254289950537680833853394958874977464e-3), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.58291085070053442257438623486099473087e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.95618461039379226195473938654286975682e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.97427161745150579714266897556974326502e3), @@ -519,7 +522,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (x < 1) { - RealType t = x - 0.5; + RealType t = x - static_cast (0.5); // Rational Approximation // Maximum Relative Error: 6.4363e-35 @@ -540,7 +543,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.02669738424010290973023004028523684766e-7), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.46404480283267324138113869370306506431e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.54550184643308468933661600211579108422e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.63602410602063476726031476852965502123e2), @@ -579,7 +582,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.21403900721572475664926557233205232491e-10), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.13172035933794917563324458011617112124e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.65687100738157412154132860910003018338e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.59672433683883998168388916533196510994e1), @@ -618,7 +621,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.08663671047376684678494625068451888284e-14), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.07443397096591141329212291707948432414e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.16665031056584124503224711639009530348e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.27666060511630720485121299731204403783e0), @@ -658,7 +661,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.37760675743046300528308203869876086823e-22), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49023284463742780238035958819642738891e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.76284367953836866133894756472541395734e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.69932155343422362573146811195224195135e-1), @@ -697,7 +700,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.46784746963816915795587433372284530785e-25), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.16012189991825507132967712656930682478e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.95202772611563835130347051925062280272e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.23801477561401113332870463345197159418e-2), @@ -737,7 +740,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.03558202009465610972808653993060437679e-29), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.08809672969012756295937194823378109391e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.41148083436617376855422685448827300528e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.85101541143091590863368934606849033688e-3), @@ -777,7 +780,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.93970406521541790658675747195982964585e-34), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.04722757068068234153968603374387493579e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.85854131835804458353300285777969427206e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.85809281481040288085436275150792074968e-4), @@ -811,7 +814,7 @@ inline RealType saspoint5_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.53567129749337040254350979652515879881e-7), }; static const RealType Q[9] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.89815449697874475254942178935516387239e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.21223228867921988134838870379132038419e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.79514417558927397512722128659468888701e-1), @@ -876,6 +879,8 @@ inline RealType saspoint5_pdf_imp(const saspoint5_distribution precision_type::value <= 113 ? 113 : 0 > tag_type; + static_assert(tag_type::value, "The SaS point5 distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + RealType u = (x - location) / scale; result = saspoint5_pdf_imp_prec(u, tag_type()) / scale; @@ -884,7 +889,7 @@ inline RealType saspoint5_pdf_imp(const saspoint5_distribution } template -inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -911,7 +916,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(1.70766655065405022702e9), }; static const RealType Q[16] = { - static_cast(1), + static_cast(1.), static_cast(2.24333404643898143947e2), static_cast(2.39984636687021023600e4), static_cast(1.53353791432086858132e6), @@ -932,7 +937,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); } else if (x < 1) { - RealType t = x - 0.5; + RealType t = x - static_cast (0.5); // Rational Approximation // Maximum Relative Error: 9.2135e-19 @@ -947,7 +952,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-4.82051978765960490940e-5), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(5.43565383128046471592e0), static_cast(1.13265160672130133152e1), static_cast(1.13352316246726435292e1), @@ -973,7 +978,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(2.60407071021044908690e-5), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(3.06221257507188300824e0), static_cast(3.44827372231472308047e0), static_cast(1.78166113338930668519e0), @@ -999,7 +1004,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(1.17021346758965979212e-7), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.28212183177829510267e0), static_cast(6.17321009406850420793e-1), static_cast(1.38400318019319970893e-1), @@ -1025,7 +1030,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(2.25932082770588727842e-9), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(6.92463563872865541733e-1), static_cast(1.80720987166755982366e-1), static_cast(2.20416647324531054557e-2), @@ -1051,7 +1056,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(2.96850126180387702894e-11), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(3.55825191301363023576e-1), static_cast(4.77251766176046719729e-2), static_cast(2.99136605131226103925e-3), @@ -1077,7 +1082,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(3.58808434477817122371e-13), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.80501347735272292079e-1), static_cast(1.22807958286146936376e-2), static_cast(3.90421541115275676253e-4), @@ -1103,7 +1108,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(4.17711709622960498456e-15), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(9.10198637347368265508e-2), static_cast(3.12263472357578263712e-3), static_cast(5.00524795130325614005e-5), @@ -1127,7 +1132,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-5.63321705854968264807e-5), }; static const RealType Q[5] = { - static_cast(1), + static_cast(1.), static_cast(6.02536240902768558315e-1), static_cast(1.99284471400121092380e-1), static_cast(3.48012577961755452113e-2), @@ -1142,7 +1147,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr template -inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -1183,7 +1188,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.54662474187354179772157464533408058525e33), }; static const RealType Q[31] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05231337496532137901354609636674085703e3), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.43071888317491317900094470796567113997e5), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.80864482202910830302921131771345102044e8), @@ -1219,7 +1224,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr result = tools::evaluate_polynomial(P, x) / tools::evaluate_polynomial(Q, x); } else if (x < 0.25) { - RealType t = x - 0.125; + RealType t = x - static_cast (0.125); // Rational Approximation // Maximum Relative Error: 9.6106e-35 @@ -1240,7 +1245,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.73617450590346508706222885401965820190e1), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.18558935411552146390814444666395959919e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49210559503096368944407109881023223654e3), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.93959323596111340518285858313038058302e4), @@ -1258,7 +1263,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (x < 0.5) { - RealType t = x - 0.25; + RealType t = x - static_cast (0.25); // Rational Approximation // Maximum Relative Error: 3.1519e-35 @@ -1279,7 +1284,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.73529976407853894192156335785920329181e-4), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.04157569499592889296640733909653747983e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.82248883130787159161541119440215325308e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.35191216924911901198168794737654512677e2), @@ -1297,7 +1302,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (x < 1) { - RealType t = x - 0.5; + RealType t = x - static_cast (0.5); // Rational Approximation // Maximum Relative Error: 7.1196e-37 @@ -1319,7 +1324,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.76395009419307902351328300308365369814e-8), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.28073115520716780203055949058270715651e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.20245752585870752942356137496087189194e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.34548337034735803039553186623067144497e2), @@ -1359,7 +1364,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.22093548539863254922531707899658394458e-10), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.83305694892673455436552817409325835774e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49922543669955056754932640312490112609e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.23488972536322019584648241457582608908e1), @@ -1399,7 +1404,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.21044098237798939057079316997065892072e-14), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.94437702178976797218081686254875998984e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.82068837586514484653828718675654460991e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.87606058269189306593797764456467061128e0), @@ -1439,7 +1444,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.72380245500539326441037770757072641975e-18), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.51702400281458104713682413542736419584e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01375164846907815766683647295932603968e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.92796007869834847612192314006582598557e-1), @@ -1479,7 +1484,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.41010917905686427164414364663355769988e-22), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.31062773739451672808456319166347015167e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.35386721434011881226168110614121649232e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.39357338312443465616015226804775178232e-2), @@ -1519,7 +1524,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96483118060215455299182487430511998831e-26), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.77347004038951368607085827825968614455e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.27559305780716801070924630708599448466e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.05452382624230160738008550961679711827e-3), @@ -1559,7 +1564,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.86984591055448991335081550609451649866e-30), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.90112824856612652807095815199496602262e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59291524937386142936420775839969648652e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.74245361925275011235694006013677228467e-4), @@ -1594,7 +1599,7 @@ inline RealType saspoint5_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.35099582728548602389917143511323566818e-8), }; static const RealType Q[7] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.34601617336219074065534356705298927390e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.82954035780824611941899463895040327299e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.70929001162671283123255408612494541378e-2), @@ -1668,6 +1673,8 @@ inline RealType saspoint5_cdf_imp(const saspoint5_distribution precision_type::value <= 113 ? 113 : 0 > tag_type; + static_assert(tag_type::value, "The SaS point5 distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + RealType u = (x - location) / scale; result = saspoint5_cdf_imp_prec(u, complement, tag_type()); @@ -1676,7 +1683,7 @@ inline RealType saspoint5_cdf_imp(const saspoint5_distribution } template -inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -1703,7 +1710,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(-6.17325587219357123900e8), }; static const RealType Q[13] = { - static_cast(1), + static_cast(1.), static_cast(1.63111146753825227716e2), static_cast(1.27864461509685444043e4), static_cast(6.10371533241799228037e5), @@ -1721,7 +1728,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: result = u * tools::evaluate_polynomial(P, u) / (tools::evaluate_polynomial(Q, u) * (p * p)); } else if (u < 0.25) { - RealType t = u - 0.125; + RealType t = u - static_cast (0.125); // Rational Approximation // Maximum Relative Error: 2.3770e-19 @@ -1736,7 +1743,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(-7.76665288232972435969e-2), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.72584280323876188464e1), static_cast(1.11983518800147654866e2), static_cast(3.25969893054048132145e2), @@ -1748,7 +1755,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); } else if (u < 0.5) { - RealType t = u - 0.25; + RealType t = u - static_cast (0.25); // Rational Approximation // Maximum Relative Error: 9.2445e-18 @@ -1763,7 +1770,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(3.02683750470398342224e-3), }; static const RealType Q[6] = { - static_cast(1), + static_cast(1.), static_cast(8.55049920135376003042e0), static_cast(2.48726119139047911316e1), static_cast(2.79519589592198994574e1), @@ -1774,7 +1781,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); } else { - RealType t = u - 0.5; + RealType t = u - static_cast (0.5); // Rational Approximation // Maximum Relative Error: 2.2918e-20 @@ -1790,7 +1797,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(-3.63491208733876986098e-5), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(6.36954463000253710936e0), static_cast(1.40601897306833147611e1), static_cast(1.33838075106916667084e1), @@ -1821,7 +1828,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(6.77986548138011345849e-9), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(2.39244329037830026691e0), static_cast(2.12683465416376620896e0), static_cast(9.02612272334554457823e-1), @@ -1850,7 +1857,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(-6.40223609013005302318e-11), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(8.11234548272888947555e-1), static_cast(2.63525516991753831892e-1), static_cast(4.77118226533147280522e-2), @@ -1879,7 +1886,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(-7.82035413331699873450e-14), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(3.49007782566002620811e-1), static_cast(5.65303702876260444572e-2), static_cast(5.54316442661801299351e-3), @@ -1909,7 +1916,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(1.48083450629432857655e-18), }; static const RealType Q[9] = { - static_cast(1), + static_cast(1.), static_cast(3.81470315977341203351e-1), static_cast(6.91330250512167919573e-2), static_cast(7.84712209182587717077e-3), @@ -1939,7 +1946,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(-1.47102592933729597720e-22), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(4.34486357752330500669e-1), static_cast(9.08486933075320995164e-2), static_cast(1.21024289017243304241e-2), @@ -1960,7 +1967,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: template -inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -2005,7 +2012,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.32129438774563059735783287456769609571e31), }; static const RealType Q[32] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.65910866673514847742559406762379054364e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.21954860438789969160116317316418373146e5), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.85684385746348850219351196129081986508e7), @@ -2042,7 +2049,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: result = u * tools::evaluate_polynomial(P, u) / (tools::evaluate_polynomial(Q, u) * (p * p)); } else if (u < 0.25) { - RealType t = u - 0.125; + RealType t = u - static_cast (0.125); // Rational Approximation // Maximum Relative Error: 9.0663e-36 @@ -2062,7 +2069,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.35838723365672196069179944509778281549e1), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.63888803456697300467924455320638435538e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.74785179836182339383932806919167693991e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.15133301804008879476562749311747788645e3), @@ -2080,7 +2087,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); } else if (u < 0.5) { - RealType t = u - 0.25; + RealType t = u - static_cast (0.25); // Rational Approximation // Maximum Relative Error: 7.1265e-35 @@ -2101,7 +2108,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.26783311530618626413866321968979725353e-3), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.98941943311823528497840052715295329781e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.70142252619301982454969690308614487433e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.17472255695869018956165466705137979540e2), @@ -2119,7 +2126,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: result = tools::evaluate_polynomial(P, t) / (tools::evaluate_polynomial(Q, t) * (p * p)); } else { - RealType t = u - 0.5; + RealType t = u - static_cast (0.5); // Rational Approximation // Maximum Relative Error: 2.7048e-37 @@ -2141,7 +2148,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.66467016868206844419002547523627548705e-6), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01315080955831561204744043759079263546e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.43409077070585581955481063438385546913e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.09863540097812452102765922256432103612e2), @@ -2187,7 +2194,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.75224691413667093006312591320754720811e-14), }; static const RealType Q[17] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.59000688626663121310675150262772434285e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.37518060227321498297232252379976917550e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96559443266702775026538144474892076437e1), @@ -2233,7 +2240,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.48644117815971872777609922455371868747e-16), }; static const RealType Q[17] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.88079839671202113888025645668230104601e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.58898753182105924446845274197682915131e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.05418719178760837974322764299800701708e-1), @@ -2279,7 +2286,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.97289727214495789126072009268721022605e-20), }; static const RealType Q[17] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.10184661848812835285809771940181522329e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.06179300560230499194426573196970342618e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.23171547302923911058112454487643162794e-2), @@ -2325,7 +2332,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.58768205048500915346781559321978174829e-24), }; static const RealType Q[17] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.27782279546086824129750042200649907991e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.86934772625607907724733810228981095894e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18640923531164938140838239032346416143e-2), @@ -2372,7 +2379,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.35526648761411463124801128103381691418e-26), }; static const RealType Q[18] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.99582804063194774835771688139366152937e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.81210581320456331960539046132284190053e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.94358920922810097599951120081974275145e-3), @@ -2420,7 +2427,7 @@ inline RealType saspoint5_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.98381676423023212724768510437325359364e-51), }; static const RealType Q[17] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.34271731953273239691423485699928257808e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.27133013035186849140772481980360839559e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29542078693828543560388747333519393752e-2), @@ -2502,19 +2509,21 @@ inline RealType saspoint5_quantile_imp(const saspoint5_distribution tag_type; + static_assert(tag_type::value, "The SaS point5 distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + result = location + scale * saspoint5_quantile_imp_prec(p, complement, tag_type()); return result; } template -inline RealType saspoint5_entropy_imp_prec(const std::integral_constant& tag) +inline RealType saspoint5_entropy_imp_prec(const std::integral_constant&) { return static_cast(3.63992444568030649573); } template -inline RealType saspoint5_entropy_imp_prec(const std::integral_constant& tag) +inline RealType saspoint5_entropy_imp_prec(const std::integral_constant&) { return BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.6399244456803064957308496039071853510); } @@ -2543,6 +2552,8 @@ inline RealType saspoint5_entropy_imp(const saspoint5_distribution tag_type; + static_assert(tag_type::value, "The SaS point5 distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + result = saspoint5_entropy_imp_prec(tag_type()) + log(scale); return result; @@ -2653,11 +2664,11 @@ inline RealType mean(const saspoint5_distribution &dist) { // There is no mean: typedef typename Policy::assert_undefined_type assert_type; - static_assert(assert_type::value == 0, "assert type is undefined"); + static_assert(assert_type::value == 0, "The SaS point5 Distribution has no mean"); return policies::raise_domain_error( "boost::math::mean(saspoint5<%1%>&)", - "The SaSpoint5 distribution does not have a mean: " + "The SaS point5 distribution does not have a mean: " "the only possible return value is %1%.", std::numeric_limits::quiet_NaN(), Policy()); } @@ -2667,11 +2678,11 @@ inline RealType variance(const saspoint5_distribution& /*dist* { // There is no variance: typedef typename Policy::assert_undefined_type assert_type; - static_assert(assert_type::value == 0, "assert type is undefined"); + static_assert(assert_type::value == 0, "The SaS point5 Distribution has no variance"); return policies::raise_domain_error( "boost::math::variance(saspoint5<%1%>&)", - "The SaSpoint5 distribution does not have a variance: " + "The SaS point5 distribution does not have a variance: " "the only possible return value is %1%.", std::numeric_limits::quiet_NaN(), Policy()); } @@ -2693,11 +2704,11 @@ inline RealType skewness(const saspoint5_distribution& /*dist* { // There is no skewness: typedef typename Policy::assert_undefined_type assert_type; - static_assert(assert_type::value == 0, "assert type is undefined"); + static_assert(assert_type::value == 0, "The SaS point5 Distribution has no skewness"); return policies::raise_domain_error( "boost::math::skewness(saspoint5<%1%>&)", - "The SaSpoint5 distribution does not have a skewness: " + "The SaS point5 distribution does not have a skewness: " "the only possible return value is %1%.", std::numeric_limits::quiet_NaN(), Policy()); // infinity? } @@ -2707,11 +2718,11 @@ inline RealType kurtosis(const saspoint5_distribution& /*dist* { // There is no kurtosis: typedef typename Policy::assert_undefined_type assert_type; - static_assert(assert_type::value == 0, "assert type is undefined"); + static_assert(assert_type::value == 0, "The SaS point5 Distribution has no kurtosis"); return policies::raise_domain_error( "boost::math::kurtosis(saspoint5<%1%>&)", - "The SaSpoint5 distribution does not have a kurtosis: " + "The SaS point5 distribution does not have a kurtosis: " "the only possible return value is %1%.", std::numeric_limits::quiet_NaN(), Policy()); } @@ -2721,11 +2732,11 @@ inline RealType kurtosis_excess(const saspoint5_distribution& { // There is no kurtosis excess: typedef typename Policy::assert_undefined_type assert_type; - static_assert(assert_type::value == 0, "assert type is undefined"); + static_assert(assert_type::value == 0, "The SaS point5 Distribution has no kurtosis excess"); return policies::raise_domain_error( "boost::math::kurtosis_excess(saspoint5<%1%>&)", - "The SaSpoint5 distribution does not have a kurtosis: " + "The SaS point5 distribution does not have a kurtosis: " "the only possible return value is %1%.", std::numeric_limits::quiet_NaN(), Policy()); } diff --git a/test/test_saspoint5.cpp b/test/test_saspoint5.cpp index f66fcbfaec..281cad8e25 100644 --- a/test/test_saspoint5.cpp +++ b/test/test_saspoint5.cpp @@ -3,11 +3,18 @@ // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#define BOOST_TEST_MAIN #define BOOST_TEST_MODULE StatsSaSpoint5Test #include +#include #include #include + +#if __has_include() +# include +#endif + using boost::math::saspoint5_distribution; using boost::multiprecision::cpp_bin_float_quad; @@ -846,6 +853,13 @@ BOOST_AUTO_TEST_CASE(saspoint5_pdf_fp64) do_test_saspoint5_pdf(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(saspoint5_pdf_fp64) +{ + do_test_saspoint5_pdf(); +} +#endif + BOOST_AUTO_TEST_CASE(saspoint5_pdf_fp128) { do_test_saspoint5_pdf(); @@ -856,6 +870,13 @@ BOOST_AUTO_TEST_CASE(saspoint5_cdf_fp64) do_test_saspoint5_cdf(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(saspoint5_cdf_fp64) +{ + do_test_saspoint5_cdf(); +} +#endif + BOOST_AUTO_TEST_CASE(saspoint5_cdf_fp128) { do_test_saspoint5_cdf(); @@ -866,6 +887,13 @@ BOOST_AUTO_TEST_CASE(saspoint5_ccdf_fp64) do_test_saspoint5_ccdf(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(saspoint5_ccdf_fp64) +{ + do_test_saspoint5_ccdf(); +} +#endif + BOOST_AUTO_TEST_CASE(saspoint5_ccdf_fp128) { do_test_saspoint5_ccdf(); @@ -876,6 +904,13 @@ BOOST_AUTO_TEST_CASE(saspoint5_quantile_nearzero_fp64) do_test_saspoint5_quantile_nearzero(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(saspoint5_quantile_nearzero_fp64) +{ + do_test_saspoint5_quantile_nearzero(); +} +#endif + BOOST_AUTO_TEST_CASE(saspoint5_quantile_nearzero_fp128) { do_test_saspoint5_quantile_nearzero(); @@ -886,6 +921,13 @@ BOOST_AUTO_TEST_CASE(saspoint5_quantile_lower_fp64) do_test_saspoint5_quantile_lower(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(saspoint5_quantile_lower_fp64) +{ + do_test_saspoint5_quantile_lower(); +} +#endif + BOOST_AUTO_TEST_CASE(saspoint5_quantile_lower_fp128) { do_test_saspoint5_quantile_lower(); @@ -896,6 +938,13 @@ BOOST_AUTO_TEST_CASE(saspoint5_quantile_upper_fp64) do_test_saspoint5_quantile_upper(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(saspoint5_quantile_upper_fp64) +{ + do_test_saspoint5_quantile_upper(); +} +#endif + BOOST_AUTO_TEST_CASE(saspoint5_quantile_upper_fp128) { do_test_saspoint5_quantile_upper(); @@ -906,6 +955,13 @@ BOOST_AUTO_TEST_CASE(saspoint5_locscale_fp64) do_test_saspoint5_locscale_param(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(saspoint5_locscale_fp64) +{ + do_test_saspoint5_locscale_param(); +} +#endif + BOOST_AUTO_TEST_CASE(saspoint5_locscale_fp128) { do_test_saspoint5_locscale_param(); From c64db569a05ad694c84bb608c12b95aee7947c92 Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Sun, 21 Jul 2024 02:05:03 +0900 Subject: [PATCH 012/399] Fix mapairy minor corrections --- include/boost/math/distributions/mapairy.hpp | 275 ++++++++++--------- test/test_mapairy.cpp | 57 +++- 2 files changed, 201 insertions(+), 131 deletions(-) diff --git a/include/boost/math/distributions/mapairy.hpp b/include/boost/math/distributions/mapairy.hpp index d7d56ed77f..481db570f6 100644 --- a/include/boost/math/distributions/mapairy.hpp +++ b/include/boost/math/distributions/mapairy.hpp @@ -13,8 +13,11 @@ #include #include +#include #include #include +#include +#include #include #include @@ -44,7 +47,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral static_cast(-6.58470237954242016920e-7), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(7.09464351647314165710e-1), static_cast(3.66413036246461392316e-1), static_cast(1.10947882302862241488e-1), @@ -71,7 +74,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral static_cast(5.24801123304330014713e-8), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(8.10853683888611687140e-1), static_cast(3.89361261627717143905e-1), static_cast(1.15124062681082170577e-1), @@ -100,7 +103,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral static_cast(-3.14068002815368247985e-10), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(9.08772985520393226044e-1), static_cast(4.26418573702560818267e-1), static_cast(1.22033746594868893316e-1), @@ -127,7 +130,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral static_cast(1.30762989300333026019e-11), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(9.95505437381674174441e-1), static_cast(4.58882737262511297099e-1), static_cast(1.25031310192148865496e-1), @@ -155,7 +158,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral static_cast(6.41838355699777435924e-15), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(6.53390465399680164234e-1), static_cast(1.82759048270449018482e-1), static_cast(2.80407546367978533849e-2), @@ -183,7 +186,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral static_cast(5.32472028720777735712e-19), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(2.74018883667663396766e-1), static_cast(2.95901195665990089660e-2), static_cast(1.57901733512147920251e-3), @@ -210,7 +213,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral static_cast(-7.38047553655951666420e-22), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.29920843258164337377e-1), static_cast(6.75018577147646502386e-3), static_cast(1.77694968039695671819e-4), @@ -234,7 +237,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral static_cast(-1.06404478702135751872e2), }; static const RealType Q[3] = { - static_cast(1), + static_cast(1.), static_cast(5.25696892802060720079e-5), static_cast(4.03600055498020483920e1), }; @@ -271,7 +274,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.46130347604880355784938321408765318948e-13), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.11845869711743584628289654085905424438e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.80391154854347711297249357734993136108e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.75628443538173255184583966965162835227e-1), @@ -308,7 +311,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.65915115243311285178083515017249358853e-12), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33250387018216706082200927591739589024e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.71707718560216685629188467984384070512e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.81316277289673837399162302797006618384e-1), @@ -346,7 +349,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19376016170255697546854583591494809062e-13), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52686177278870816414637961315363468426e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19872083945442288336636376283295310445e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.26633866969676511944680471882188527224e-1), @@ -388,7 +391,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.53569375838863862590910010617140120876e-18), }; static const RealType Q[17] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.94337325681904859647161946168957959628e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.77120402023938328899162557073347121463e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01644685191130734907530007424741314392e0), @@ -433,7 +436,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.42496376687241918803028631991083570963e-26), }; static const RealType Q[16] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.19213376162053391168605415200906099633e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.65578261958732385181558047087365997878e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30046653564394292929001223763106276016e-1), @@ -476,7 +479,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.52190981930441828041102818178755246228e-31), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.70564782441895707961338319466546005093e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.47770566490107388849474183308889339231e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.29364672385303439788399215507370006639e-2), @@ -518,7 +521,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.33468198065176301137949068264633336529e-37), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.51951069241510130465691156908893803280e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.84647597299970149588010858770320631739e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.90239396588176334117512714878489376365e-3), @@ -552,7 +555,7 @@ inline RealType mapairy_pdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.59558963351172885545760841064831356701e3), }; static const RealType Q[7] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.51965956124978480521462518750569617550e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.61700833299761977287211297600922591853e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.94988298508869748383898344668918510537e1), @@ -589,7 +592,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra static_cast(2.94270091008508492304e-6), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(4.98673671503410894284e-1), static_cast(3.15907666864554716291e-1), static_cast(8.34463558393629855977e-2), @@ -616,7 +619,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra static_cast(-6.13516242712196835055e-5), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(1.06478618107122200489e0), static_cast(4.08809060854459518663e-1), static_cast(2.66617598099501800866e-1), @@ -647,7 +650,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra static_cast(6.97462693097107007719e-5), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(1.81256903248465876424e0), static_cast(1.43959302060852067876e0), static_cast(6.65882284117861804351e-1), @@ -675,7 +678,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra static_cast(-4.92754650783224582641e-13), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.27271216837333318516e0), static_cast(6.96551952883867277759e-1), static_cast(2.11871363524516350422e-1), @@ -700,7 +703,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra static_cast(9.21758454778883157515e-6), }; static const RealType Q[6] = { - static_cast(1), + static_cast(1.), static_cast(6.23092941554668369107e-1), static_cast(1.57829914506366827914e-1), static_cast(2.02787979758160988615e-2), @@ -723,7 +726,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra static_cast(5.40508013573989841127e-6), }; static const RealType Q[5] = { - static_cast(1), + static_cast(1.), static_cast(2.70578525590448009961e-1), static_cast(2.73082032706004833847e-2), static_cast(1.21926059813954504560e-3), @@ -768,7 +771,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00448215148716947837105979735199471601e-11), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.69069814466926608209872727645156315374e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.89657828158127300370734997707096744077e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.62713433978940724622996782534485162816e-1), @@ -806,7 +809,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.49023728251751416730708805268921994420e-10), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.11919889346080886194925406930280687022e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.99082771425048574611745923487528183522e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.99525320878512488641033584061027063035e-1), @@ -851,7 +854,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.78908322579081615215057968216358892954e-9), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.15777668058369565739250784347385217839e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.58275582332060589146223977924181161908e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.08890987062755381429904193744273374370e0), @@ -893,7 +896,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06306499345515479193219487228315566344e-11), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.13521398369589479131299586715604029947e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.17680254721938920978999949995837883884e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.40693619288419980101309080614788657638e0), @@ -933,7 +936,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.36635313919771528255819112450043338510e-12), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32484755553196872705775494679365596205e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.17714315014480774542066462899317631393e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.10789882607024692577764888497624620277e-1), @@ -970,7 +973,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.02405342795439598418033139109649640085e-35), }; static const RealType Q[11] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.78286317363568496229516074305435186276e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.06519013547074134846431611115576250187e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.71907733798006110542919988654989891098e-2), @@ -1003,7 +1006,7 @@ inline RealType mapairy_pdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.46207029637607033398822620480584537642e-38), }; static const RealType Q[9] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.54906717312241693103173902792310528801e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.84408124581401290943345932332007045483e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.81403744024723164669745491417804917709e-3), @@ -1083,6 +1086,8 @@ inline RealType mapairy_pdf_imp(const mapairy_distribution& di precision_type::value <= 113 ? 113 : 0 > tag_type; + static_assert(tag_type::value, "The Map-Airy distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + RealType u = (x - location) / scale; result = mapairy_pdf_imp_prec(u, tag_type()) / scale; @@ -1091,7 +1096,7 @@ inline RealType mapairy_pdf_imp(const mapairy_distribution& di } template -inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -1109,7 +1114,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral static_cast(-3.97941251650023182117e-6), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(8.17408156824742736411e-1), static_cast(3.57041011418415988268e-1), static_cast(1.04580353775369716002e-1), @@ -1135,7 +1140,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral static_cast(5.35982226125013888796e-7), }; static const RealType Q[6] = { - static_cast(1), + static_cast(1.), static_cast(5.70352826101668448273e-1), static_cast(1.98852010141232271304e-1), static_cast(3.64864882318453496161e-2), @@ -1161,7 +1166,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral static_cast(-1.06076300080048408251e-9), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(8.54435380513870673497e-1), static_cast(3.66021233157880878411e-1), static_cast(9.42985570806905160687e-2), @@ -1188,7 +1193,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral static_cast(-5.16172854149066643529e-11), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(9.05317644829451086870e-1), static_cast(3.73713496637025562492e-1), static_cast(8.94434672792094976627e-2), @@ -1216,7 +1221,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral static_cast(2.98763969872672156104e-14), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(5.27732094554221674504e-1), static_cast(1.14330643482604301178e-1), static_cast(1.27722341942374066265e-2), @@ -1243,7 +1248,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral static_cast(9.11626234402148561268e-17), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(3.09895694991285975774e-1), static_cast(3.69874670435930773471e-2), static_cast(2.15708854325146400153e-3), @@ -1269,7 +1274,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral static_cast(-1.48321866072033823195e-17), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.12851983233980279746e-1), static_cast(4.94650928817638043712e-3), static_cast(1.05447405092956497114e-4), @@ -1293,7 +1298,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral static_cast(-1.26770824563800250704e-1), }; static const RealType Q[3] = { - static_cast(1), + static_cast(1.), static_cast(7.26301023103568827709e-2), static_cast(1.60899894281099149848e1), }; @@ -1306,7 +1311,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral template -inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -1331,7 +1336,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.13807083548358335699029971528179486964e-13), }; static const RealType Q[12] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.00810772528427939684296334977783425582e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.24383652800043768524894854013745098654e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.64696616559657052516796844068580626381e-1), @@ -1368,7 +1373,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.00479393063394570750334218362674723065e-13), }; static const RealType Q[12] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.24929390929112144560152115661603117364e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.34853762543033883106055186520573363290e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.73783624941936412984356492130276742707e-1), @@ -1406,7 +1411,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.45008884108655511268690849420714428764e-15), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.42652074703683973183213296310906006173e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.03479786698331153607905223548719296572e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.95556520914240562719970700900964416000e-1), @@ -1446,7 +1451,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.70140037580287364298206334732060874507e-16), }; static const RealType Q[16] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.36848014038411798213992770858203510748e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.15373052017549822413011375404872359177e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.92705544967513282963463451395766172671e-1), @@ -1490,7 +1495,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.98451733054622166748935243139556132704e-26), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.08148065380582488495702136465010348576e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.42385352331252779422725444021027377277e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.66510412535270623169792008730183916611e-1), @@ -1532,7 +1537,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.65549196385656698597261688277898043367e-30), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.03426141030409708635168766288764563749e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.13808987755928828118915442251025992769e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.52253239792170999949444502938290297674e-2), @@ -1571,7 +1576,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.31961589164397397724611386366339562789e-28), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.26440207646105117747875545474828367516e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.27872879091838733280518786463281413334e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34256572873114675776148923422025029494e-3), @@ -1607,7 +1612,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.07224810408790092272497403739984510394e2), }; static const RealType Q[7] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.32474438135610721926278423612948794250e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.27594461167587027771303292526448542806e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.49207539478843628626934249487055017677e1), @@ -1623,7 +1628,7 @@ inline RealType mapairy_cdf_plus_imp_prec(const RealType& x, const std::integral } template -inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integral_constant& tag) +inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -1644,7 +1649,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra static_cast(3.09442180091323751049e-6), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(5.16241922223786900600e-1), static_cast(2.75690727171711638879e-1), static_cast(7.18707184893542884080e-2), @@ -1671,7 +1676,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra static_cast(1.22071311320012805777e-5), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(9.63771793313770952352e-2), static_cast(2.23602260938227310054e-1), static_cast(9.21944797677283179038e-3), @@ -1701,7 +1706,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra static_cast(1.13854052826846329787e-4), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(1.29694286517571741097e0), static_cast(7.99686735441213882518e-1), static_cast(3.08198207583883597188e-1), @@ -1729,7 +1734,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra static_cast(1.42364413902075896503e-5), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(1.09709853682665798542e0), static_cast(5.63687797989627787500e-1), static_cast(1.73604358560002859604e-1), @@ -1756,7 +1761,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra static_cast(4.43354791268634655473e-6), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(7.07103973315808077783e-1), static_cast(2.13664682181055450396e-1), static_cast(3.52218225168465984709e-2), @@ -1781,7 +1786,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra static_cast(1.48743616420183584738e-6), }; static const RealType Q[6] = { - static_cast(1), + static_cast(1.), static_cast(3.26493785348088598123e-1), static_cast(4.28813205161574223713e-2), static_cast(2.82893073845390254969e-3), @@ -1800,7 +1805,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra } template -inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integral_constant& tag) +inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -1827,7 +1832,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.46723648594704078875476888175530463986e-12), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.98700317671474659677458220091101276158e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.00405631175818416028878082789095587658e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.04189939150805562128632256692765842568e-1), @@ -1866,7 +1871,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.41870129065056783732691371215602982173e-9), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.75919235734607601884356783586727272494e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.57656678936617227532275100649989944452e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.72617552401870454676736869003112018648e-1), @@ -1911,7 +1916,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.88472819535099746216179119978362211227e-10), }; static const RealType Q[16] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.68923525157720774962908922391133419863e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.40714902096062779527207435671907059131e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.73120596883364361220343183559076165363e0), @@ -1955,7 +1960,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.36407983918582149239548869529460234702e-12), }; static const RealType Q[16] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.99867960957804580209868321228347067213e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.94236623527818880544030470097296139679e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21644866845440678050425616384656052588e0), @@ -1998,7 +2003,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.83956842740198388242245209024484381888e-29), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.50056124032615852703112365430040751173e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05112559537845833793684655693572118348e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.55609497026127521043140534271852131858e-1), @@ -2036,7 +2041,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.53666531487585211574942518181922132884e-14), }; static const RealType Q[12] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.82230649578130958108098853863277631065e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.12412482738973738235656376802445565005e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.98320116955422615960870363549721494683e-2), @@ -2070,7 +2075,7 @@ inline RealType mapairy_cdf_minus_imp_prec(const RealType& x, const std::integra BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.48798342894235412426464893852098239746e-14), }; static const RealType Q[10] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.81588658109851219975949691772676519853e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.52583331848892383968186924120872369151e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.57644670426430994363913234422346706991e-3), @@ -2151,6 +2156,8 @@ inline RealType mapairy_cdf_imp(const mapairy_distribution& di precision_type::value <= 113 ? 113 : 0 > tag_type; + static_assert(tag_type::value, "The Map-Airy distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + RealType u = (x - location) / scale; result = mapairy_cdf_imp_prec(u, complement, tag_type()); @@ -2159,13 +2166,13 @@ inline RealType mapairy_cdf_imp(const mapairy_distribution& di } template -inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::integral_constant& tag) +inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; if (p >= 0.375) { - RealType t = p - 0.375; + RealType t = p - static_cast (0.375); // Rational Approximation // Maximum Relative Error: 1.5488e-18 @@ -2179,7 +2186,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(4.79284243496552841508e0), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.76268072706610602584e0), static_cast(-4.88492535243404839734e0), static_cast(-5.67524172432687656881e0), @@ -2191,7 +2198,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (p >= 0.25) { - RealType t = p - 0.25; + RealType t = p - static_cast (0.25); // Rational Approximation // Maximum Relative Error: 7.5181e-17 @@ -2205,7 +2212,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(1.31575930750093554120e1), }; static const RealType Q[6] = { - static_cast(1), + static_cast(1.), static_cast(5.38761652244702318296e0), static_cast(2.40932080746189543284e0), static_cast(-1.69465870062123632126e1), @@ -2216,7 +2223,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (p >= 0.125) { - RealType t = p - 0.125; + RealType t = p - static_cast (0.125); // Rational Approximation // Maximum Relative Error: 2.3028e-18 @@ -2231,7 +2238,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(-2.33786726970025938837e2), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(1.91797638291395345792e1), static_cast(1.24293724082506952768e2), static_cast(2.82393116012902543276e2), @@ -2257,7 +2264,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(-9.74212491048543799073e-5), }; static const RealType Q[6] = { - static_cast(1), + static_cast(1.), static_cast(7.91919722132624625590e-1), static_cast(2.17415447268626558639e-1), static_cast(2.41474762519410575392e-2), @@ -2283,7 +2290,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(-4.19292241201527861927e-9), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(7.23065798041556418844e-1), static_cast(1.96731305131315877264e-1), static_cast(2.49952034298034383781e-2), @@ -2310,7 +2317,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(-3.78061321691170114390e-11), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(3.57770840766081587688e-1), static_cast(4.81290550545412209056e-2), static_cast(3.02079969075162071807e-3), @@ -2337,7 +2344,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(-3.46758191090170732580e-13), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.77270673840643360017e-1), static_cast(1.18099604045834575786e-2), static_cast(3.66889581757166584963e-4), @@ -2364,7 +2371,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(-3.23343844538964435927e-15), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(8.79845511272943785289e-2), static_cast(2.90839059356197474893e-3), static_cast(4.48172838083912540123e-5), @@ -2391,7 +2398,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(-3.05720104049292610799e-17), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(4.37395212065018405474e-2), static_cast(7.18654254114820140590e-4), static_cast(5.50371158026951899491e-6), @@ -2418,7 +2425,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(-2.92218240202835807955e-19), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(2.17740414929742679904e-2), static_cast(1.78084231709097280884e-4), static_cast(6.78870668961146609668e-7), @@ -2445,7 +2452,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(-2.81661279271583206526e-21), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.08518414679241420227e-2), static_cast(4.42335224797004486239e-5), static_cast(8.40387821972524402121e-8), @@ -2472,7 +2479,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in static_cast(-2.73260616170245224789e-23), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(5.41357843707822974161e-3), static_cast(1.10082540037527566536e-5), static_cast(1.04338126042963003178e-8), @@ -2492,13 +2499,13 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in template -inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::integral_constant& tag) +inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; if (p >= 0.4375) { - RealType t = p - 0.4375; + RealType t = p - static_cast (0.4375); // Rational Approximation // Maximum Relative Error: 4.2901e-35 @@ -2515,7 +2522,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.04356966421177683585461937085598186805e1), }; static const RealType Q[11] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.75444066345435020043849341970820565274e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.95105673975812427406540024601734210826e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.20381124524894051002242766595737443257e0), @@ -2531,7 +2538,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (p >= 0.375) { - RealType t = p - 0.375; + RealType t = p - static_cast (0.375); // Rational Approximation // Maximum Relative Error: 2.8433e-36 @@ -2549,7 +2556,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.62979741122708118776725634304028246971e0), }; static const RealType Q[10] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.10550060286464202595779024353437346419e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.15893254630199957990897452211066782021e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.58964066823516762861256609311733069353e1), @@ -2564,7 +2571,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (p >= 0.25) { - RealType t = p - 0.25; + RealType t = p - static_cast (0.25); // Rational Approximation // Maximum Relative Error: 5.9072e-35 @@ -2584,7 +2591,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.03293129698111279047104766073456412318e1), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29511778027351594854005887702013466376e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.66155745848864270109281703659789474448e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.25628362783798417463294553777015370203e1), @@ -2602,7 +2609,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (p >= 0.125) { - RealType t = p - 0.125; + RealType t = p - static_cast (0.125); // Rational Approximation // Maximum Relative Error: 9.9092e-36 @@ -2624,7 +2631,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.96914697182030973966321601422851730384e4), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.98063872144867195074924232601423646991e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.65911346382127464683324945513128779971e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.02451223307009464199634546540152067898e3), @@ -2662,7 +2669,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.61008160195204632725691076288641221707e-10), }; static const RealType Q[11] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59109221235949005113322202980300291082e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.07119192591092503378838510797916225920e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.97313678065269932508447079892684333156e-1), @@ -2700,7 +2707,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.51102540845397821195190063256442894688e-18), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.51733661576324699382035973518172469602e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.01435607980568082538278883569729476204e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.93274478117803447229185270863587786287e-1), @@ -2741,7 +2748,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.54464319402577486444841981479085908190e-22), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.56568169258142086426383908572004868200e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.52144703581828715720555168887427064424e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.87268567039210776554113754014224005739e-2), @@ -2782,7 +2789,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.84098833615882764168840211033822541979e-26), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.76933186134913044021577076301874622292e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.25794095712489484166470336696962749356e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.02367257449622569623375613790000874499e-3), @@ -2823,7 +2830,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.34400562353945663460416286570988365992e-30), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.87838171063584994806998206766890809367e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.55395225505766120991458653457272783334e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.45282436421694718640472363162421055686e-4), @@ -2864,7 +2871,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.92396730553947142987611521115040472261e-35), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.36599681872296382199486815169747516110e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.86330544720458446620644055149504593514e-3), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.23793435123936109978741252388806998743e-5), @@ -2905,7 +2912,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.40321396496046206171642334628524367374e-39), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.67292043485384876322219919215413286868e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.61652550158809553935603664087740554258e-4), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.14722810796821047167211543031044501921e-5), @@ -2946,7 +2953,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.56848486878078288956741060120464349537e-43), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.33267370502089423930888060969568705647e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.39632352029900752622967578086289898150e-4), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.42703739831525305516280300008439396218e-6), @@ -2987,7 +2994,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.21480186561579326423946788448005430367e-47), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16494591376838053609854716130343599036e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.97651667629616309497454026431358820357e-5), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.77741398674456235952879526959641925087e-7), @@ -3028,7 +3035,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.20516030880916148179297554212609531432e-51), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.81973541224235020744673910266545976833e-3), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.49156990107280109344880219729275939242e-5), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.21606730563542176411852745162267260946e-8), @@ -3069,7 +3076,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.44601448994095786447982489957909713982e-55), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.90814053669730896497462224007523900520e-3), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.72450689508305973756255440356759005330e-6), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.76517273086984384225845151573287252506e-9), @@ -3110,7 +3117,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.87159268409640967747617639113346310759e-59), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.45350026842128595165328480395513258721e-3), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.30398532102631290226106936127181928207e-7), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.45242264812189519858570105609209495630e-10), @@ -3151,7 +3158,7 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.43473066278196981345209422626769148425e-63), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.26570199429958856038191879713341034013e-4), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.32484776300757286079244074394356908390e-7), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.31234182027812869096733088981702059020e-11), @@ -3177,13 +3184,13 @@ inline RealType mapairy_quantile_lower_imp_prec(const RealType& p, const std::in } template -inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; if (p >= 0.25) { - RealType t = p - 0.25; + RealType t = p - static_cast (0.25); // Rational Approximation // Maximum Absolute Error: 1.8559e-18 @@ -3198,7 +3205,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in static_cast(-4.28101952511581488588e1), }; static const RealType Q[10] = { - static_cast(1), + static_cast(1.), static_cast(8.20189490825315245036e0), static_cast(1.63469912146101848441e1), static_cast(-1.52740920318273920072e1), @@ -3213,7 +3220,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (p >= 0.125) { - RealType t = p - 0.125; + RealType t = p - static_cast (0.125); // Rational Approximation // Maximum Absolute Error: 4.6019e-17 @@ -3227,7 +3234,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in static_cast(1.54245210917147215257e3), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(2.13092357122115486375e1), static_cast(1.57318281834689144053e2), static_cast(4.42261730187813035957e2), @@ -3255,7 +3262,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in static_cast(4.74040834029330213692e-6), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(4.14801234415100707213e-1), static_cast(1.04693730144480856638e-1), static_cast(3.81581484862997435076e-2), @@ -3286,7 +3293,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in static_cast(2.62304611053075404923e-7), }; static const RealType Q[11] = { - static_cast(1), + static_cast(1.), static_cast(5.28225379952156944029e-1), static_cast(3.49662079845715371907e-1), static_cast(1.45408903426879603625e-1), @@ -3319,7 +3326,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in static_cast(2.51255632629650930196e-14), }; static const RealType Q[9] = { - static_cast(1), + static_cast(1.), static_cast(7.58341767924960527280e-1), static_cast(2.73511775500642961539e-1), static_cast(6.16011987856129890130e-2), @@ -3349,7 +3356,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in static_cast(1.87458213915373906356e-6), }; static const RealType Q[9] = { - static_cast(1), + static_cast(1.), static_cast(8.98511036742503939380e-1), static_cast(3.91130673008184655152e-1), static_cast(1.09277016228474605069e-1), @@ -3381,13 +3388,13 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in template -inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; if (p >= 0.375) { - RealType t = p - 0.375; + RealType t = p - static_cast (0.375); // Rational Approximation // Maximum Absolute Error: 4.0835e-35 @@ -3407,7 +3414,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.10895417312529385966062255102265009972e0), }; static const RealType Q[12] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.88252553879196710256650370298744093367e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.54875259600848880869571364891152935969e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.78589587338618424770295921221996471887e1), @@ -3424,7 +3431,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (p >= 0.25) { - RealType t = p - 0.25; + RealType t = p - static_cast (0.25); // Rational Approximation // Maximum Absolute Error: 5.7633e-36 @@ -3445,7 +3452,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.54255748148299874514839812717054396793e2), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.64823387375875361292425741663822893626e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.02973633484731117050245517938177308809e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.71288209768693917630236009171518272534e2), @@ -3463,7 +3470,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in result = tools::evaluate_polynomial(P, t) / tools::evaluate_polynomial(Q, t); } else if (p >= 0.125) { - RealType t = p - 0.125; + RealType t = p - static_cast (0.125); // Rational Approximation // Maximum Absolute Error: 2.1140e-36 @@ -3485,7 +3492,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.95604329277359828898502487252547842378e6), }; static const RealType Q[16] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.79208640567193066236912382037923299779e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.94775812217734059201656828286490832145e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16467934643564936346029555887148320030e4), @@ -3527,7 +3534,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.10466412567107519640190849286913680449e-10), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.31914248618040435028023418981527961171e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.73578090645412656850163531828709850171e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.57329813782272411333511950903192234311e-2), @@ -3576,7 +3583,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.05739751797738770096482688062542436470e-15), }; static const RealType Q[23] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43370372582239919321785765900615222895e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.52872159582703775260145036441128318159e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.28243735290178057451806192890274584778e-1), @@ -3632,7 +3639,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.82128612844034824876694595066123093042e-27), }; static const RealType Q[20] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.65414405277042133067228113526697909557e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.32179221250476209346757936207079534440e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.74217392682100275524983756207618144313e-1), @@ -3683,7 +3690,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.73701196181204039400706651811524874455e-34), }; static const RealType Q[18] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.77119890916406072259446489508263892540e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.95177888809731859578167185583119074026e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.29131027214559081111011582466619105016e-2), @@ -3731,7 +3738,7 @@ inline RealType mapairy_quantile_upper_imp_prec(const RealType& p, const std::in BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.96470010392255781222480229189380065951e-18), }; static const RealType Q[18] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.82841492468725267177870050157374330523e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.83703946702662950408034486958999188355e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.09320896703777230915306208582393356690e-1), @@ -3824,19 +3831,21 @@ inline RealType mapairy_quantile_imp(const mapairy_distribution tag_type; + static_assert(tag_type::value, "The Map-Airy distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + result = location + scale * mapairy_quantile_imp_prec(p, complement, tag_type()); return result; } template -inline RealType mapairy_mode_imp_prec(const std::integral_constant& tag) +inline RealType mapairy_mode_imp_prec(const std::integral_constant&) { return static_cast(-1.16158727113597068525); } template -inline RealType mapairy_mode_imp_prec(const std::integral_constant& tag) +inline RealType mapairy_mode_imp_prec(const std::integral_constant&) { return BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.1615872711359706852500000803029112987); } @@ -3870,19 +3879,21 @@ inline RealType mapairy_mode_imp(const mapairy_distribution& d precision_type::value <= 113 ? 113 : 0 > tag_type; + static_assert(tag_type::value, "The Map-Airy distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + result = location + scale * mapairy_mode_imp_prec(tag_type()); return result; } template -inline RealType mapairy_median_imp_prec(const std::integral_constant& tag) +inline RealType mapairy_median_imp_prec(const std::integral_constant&) { return static_cast(-0.71671068545502205332); } template -inline RealType mapairy_median_imp_prec(const std::integral_constant& tag) +inline RealType mapairy_median_imp_prec(const std::integral_constant&) { return BOOST_MATH_BIG_CONSTANT(RealType, 113, -0.71671068545502205331700196278067230944440); } @@ -3916,19 +3927,21 @@ inline RealType mapairy_median_imp(const mapairy_distribution& precision_type::value <= 113 ? 113 : 0 > tag_type; + static_assert(tag_type::value, "The Map-Airy distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + result = location + scale * mapairy_median_imp_prec(tag_type()); return result; } template -inline RealType mapairy_entropy_imp_prec(const std::integral_constant& tag) +inline RealType mapairy_entropy_imp_prec(const std::integral_constant&) { return static_cast(2.00727681841065634600); } template -inline RealType mapairy_entropy_imp_prec(const std::integral_constant& tag) +inline RealType mapairy_entropy_imp_prec(const std::integral_constant&) { return BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.0072768184106563460003025875575283708); } @@ -3957,6 +3970,8 @@ inline RealType mapairy_entropy_imp(const mapairy_distribution precision_type::value <= 113 ? 113 : 0 > tag_type; + static_assert(tag_type::value, "The Map-Airy distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + result = mapairy_entropy_imp_prec(tag_type()) + log(scale); return result; @@ -4091,7 +4106,7 @@ inline RealType skewness(const mapairy_distribution& /*dist*/) { // There is no skewness: typedef typename Policy::assert_undefined_type assert_type; - static_assert(assert_type::value == 0, "assert type is undefined"); + static_assert(assert_type::value == 0, "The Map-Airy Distribution has no skewness"); return policies::raise_domain_error( "boost::math::skewness(mapairy<%1%>&)", @@ -4105,7 +4120,7 @@ inline RealType kurtosis(const mapairy_distribution& /*dist*/) { // There is no kurtosis: typedef typename Policy::assert_undefined_type assert_type; - static_assert(assert_type::value == 0, "assert type is undefined"); + static_assert(assert_type::value == 0, "The Map-Airy Distribution has no kurtosis"); return policies::raise_domain_error( "boost::math::kurtosis(mapairy<%1%>&)", @@ -4119,7 +4134,7 @@ inline RealType kurtosis_excess(const mapairy_distribution& /* { // There is no kurtosis excess: typedef typename Policy::assert_undefined_type assert_type; - static_assert(assert_type::value == 0, "assert type is undefined"); + static_assert(assert_type::value == 0, "The Map-Airy Distribution has no kurtosis excess"); return policies::raise_domain_error( "boost::math::kurtosis_excess(mapairy<%1%>&)", diff --git a/test/test_mapairy.cpp b/test/test_mapairy.cpp index ccae24c30f..cfa3a712de 100644 --- a/test/test_mapairy.cpp +++ b/test/test_mapairy.cpp @@ -3,11 +3,18 @@ // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#define BOOST_TEST_MAIN #define BOOST_TEST_MODULE StatsMapAiryTest #include +#include #include #include + +#if __has_include() +# include +#endif + using boost::math::mapairy_distribution; using boost::multiprecision::cpp_bin_float_quad; @@ -539,7 +546,6 @@ void do_test_mapairy_ccdf() { BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 240))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.69868020843057108791977444476963676657007865940548e-109), tolerance); BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 248))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.14716847761369894511663682805087101213398110206416e-113), tolerance); BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 256))), BOOST_MATH_BIG_CONSTANT(RealType, N, 1.01249230410490696902261641309835718069677272999613e-116), tolerance); - BOOST_CHECK_CLOSE(cdf(complement(dist, ldexp(static_cast(1), 600))), BOOST_MATH_BIG_CONSTANT(RealType, N, 4.71969536983273370677446521953393512020163902133418e-272), tolerance); // The test is terminated because x is inf after this in fp64. @@ -790,6 +796,13 @@ BOOST_AUTO_TEST_CASE(mapairy_pdf_fp64) do_test_mapairy_pdf(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(mapairy_pdf_fp64) +{ + do_test_mapairy_pdf(); +} +#endif + BOOST_AUTO_TEST_CASE(mapairy_pdf_fp128) { do_test_mapairy_pdf(); @@ -800,6 +813,13 @@ BOOST_AUTO_TEST_CASE(mapairy_cdf_fp64) do_test_mapairy_cdf(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(mapairy_cdf_fp64) +{ + do_test_mapairy_cdf(); +} +#endif + BOOST_AUTO_TEST_CASE(mapairy_cdf_fp128) { do_test_mapairy_cdf(); @@ -810,6 +830,13 @@ BOOST_AUTO_TEST_CASE(mapairy_ccdf_fp64) do_test_mapairy_ccdf(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(mapairy_ccdf_fp64) +{ + do_test_mapairy_ccdf(); +} +#endif + BOOST_AUTO_TEST_CASE(mapairy_ccdf_fp128) { do_test_mapairy_ccdf(); @@ -820,6 +847,13 @@ BOOST_AUTO_TEST_CASE(mapairy_quantile_nearzero_fp64) do_test_mapairy_quantile_nearzero(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(mapairy_quantile_nearzero_fp64) +{ + do_test_mapairy_quantile_nearzero(); +} +#endif + BOOST_AUTO_TEST_CASE(mapairy_quantile_nearzero_fp128) { do_test_mapairy_quantile_nearzero(); @@ -830,6 +864,13 @@ BOOST_AUTO_TEST_CASE(mapairy_quantile_lower_fp64) do_test_mapairy_quantile_lower(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(mapairy_quantile_lower_fp64) +{ + do_test_mapairy_quantile_lower(); +} +#endif + BOOST_AUTO_TEST_CASE(mapairy_quantile_lower_fp128) { do_test_mapairy_quantile_lower(); @@ -840,6 +881,13 @@ BOOST_AUTO_TEST_CASE(mapairy_quantile_upper_fp64) do_test_mapairy_quantile_upper(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(mapairy_quantile_upper_fp64) +{ + do_test_mapairy_quantile_upper(); +} +#endif + BOOST_AUTO_TEST_CASE(mapairy_quantile_upper_fp128) { do_test_mapairy_quantile_upper(); @@ -850,6 +898,13 @@ BOOST_AUTO_TEST_CASE(mapairy_locscale_fp64) do_test_mapairy_locscale_param(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(mapairy_locscale_fp64) +{ + do_test_mapairy_locscale_param(); +} +#endif + BOOST_AUTO_TEST_CASE(mapairy_locscale_fp128) { do_test_mapairy_locscale_param(); From 953cc377f1ddb0d9d21c9ab3859b85e545e38af2 Mon Sep 17 00:00:00 2001 From: tk-yoshimura Date: Sun, 21 Jul 2024 02:06:36 +0900 Subject: [PATCH 013/399] Fix holtsmark minor corrections --- .../boost/math/distributions/holtsmark.hpp | 145 ++++++++++-------- test/test_holtsmark.cpp | 56 +++++++ 2 files changed, 134 insertions(+), 67 deletions(-) diff --git a/include/boost/math/distributions/holtsmark.hpp b/include/boost/math/distributions/holtsmark.hpp index 5e759cb3e3..d53a2ac701 100644 --- a/include/boost/math/distributions/holtsmark.hpp +++ b/include/boost/math/distributions/holtsmark.hpp @@ -13,8 +13,11 @@ #include #include +#include #include #include +#include +#include #include #include @@ -44,7 +47,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(1.74679078247026597959e-5), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(4.12654472808214997252e-3), static_cast(2.93891863033354755743e-1), static_cast(8.70867222155141724171e-3), @@ -72,7 +75,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-8.45210544648986348854e-6), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(6.11634701234079515138e-1), static_cast(4.39922162828115412952e-1), static_cast(1.73609068791154078128e-1), @@ -102,7 +105,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(7.24351142163396584236e-9), }; static const RealType Q[9] = { - static_cast(1), + static_cast(1.), static_cast(8.88099527896838765666e-1), static_cast(6.53896948546877341992e-1), static_cast(2.96296982585381844864e-1), @@ -134,7 +137,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-4.12196487201928768038e-13), }; static const RealType Q[9] = { - static_cast(1), + static_cast(1.), static_cast(1.61334003864149486454e0), static_cast(1.28348868912975898501e0), static_cast(6.36594545291321210154e-1), @@ -163,7 +166,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-4.17784858891714869163e-15), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(7.29383849235788831455e-1), static_cast(2.16287201867831015266e-1), static_cast(3.28789040872705709070e-2), @@ -191,7 +194,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-9.00826023095223871551e-21), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(3.28966789835486457746e-1), static_cast(4.46981634258601621625e-2), static_cast(3.22521297380474263906e-3), @@ -219,7 +222,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-4.61828164399178360925e-23), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.23544974283127158019e-1), static_cast(6.01210465184576626802e-3), static_cast(1.45390926665383063500e-4), @@ -242,7 +245,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr static_cast(8.75909164947413479137e-1), }; static const RealType Q[3] = { - static_cast(1), + static_cast(1.), static_cast(-6.07405848111002255020e0), static_cast(1.34068401972703571636e1), }; @@ -280,7 +283,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.49208308902369087634036371223527932419e-11), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.07053963271862256947338846403373278592e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.30146528469038357598785392812229655811e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.22168809220570888957518451361426420755e-2), @@ -321,7 +324,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.77430867682132459087084564268263825239e-11), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.30030169049261634787262795838348954434e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.45935676273909940847479638179887855033e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.14724239378269259016679286177700667008e-1), @@ -365,7 +368,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.05561259222780127064607109581719435800e-15), }; static const RealType Q[17] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.08902510590064634965634560548380735284e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.60127698266075086782895988567899172787e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.73299227011247478433171171063045855612e-1), @@ -414,7 +417,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.22157263424086267338486564980223658130e-22), }; static const RealType Q[19] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.24254809760594824834854946949546737102e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.66740386908805016172202899592418717176e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.17175023341071972435947261868288366592e0), @@ -462,7 +465,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33878078951302606409419167741041897986e-26), }; static const RealType Q[17] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.75629880937514507004822969528240262723e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.43883005193126748135739157335919076027e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.26826935326347315479579835343751624245e-1), @@ -506,7 +509,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.46357124817620384236108395837490629563e-31), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.02259092175256156108200465685980768901e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.63438230616954606028022008517920766366e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.63880061357592661176130881772975919418e-2), @@ -548,7 +551,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.72047006026700174884151916064158941262e-38), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.50985661940624198574968436548711898948e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.81705882167596649186405364717835589894e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.86537779048672498307196786015602357729e-3), @@ -582,7 +585,7 @@ inline RealType holtsmark_pdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -8.80591252844738626580182351673066365090e1), }; static const RealType Q[7] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.57593243741246726197476469913307836496e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.99458751269722094414105565700775283458e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.91043982880665229427553316951582511317e3), @@ -645,6 +648,8 @@ inline RealType holtsmark_pdf_imp(const holtsmark_distribution precision_type::value <= 113 ? 113 : 0 > tag_type; + static_assert(tag_type::value, "The Holtsmark distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + RealType u = (x - location) / scale; result = holtsmark_pdf_imp_prec(u, tag_type()) / scale; @@ -653,7 +658,7 @@ inline RealType holtsmark_pdf_imp(const holtsmark_distribution } template -inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -670,7 +675,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(1.38823662364438342844e-4), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(3.05200341554753776087e-1), static_cast(2.12663999430421346175e-1), static_cast(7.23836000984872591553e-2), @@ -696,7 +701,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(6.01511310581302829460e-6), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(2.32264360456739861886e0), static_cast(6.39715443864749851087e-1), static_cast(5.03940458163958921325e-1), @@ -723,7 +728,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(2.29521832683440044997e-6), }; static const RealType Q[9] = { - static_cast(1), + static_cast(1.), static_cast(5.82002427359748247121e-1), static_cast(3.96529686558825119743e-1), static_cast(1.49690294526117385174e-1), @@ -753,7 +758,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(1.69306881760242775488e-8), }; static const RealType Q[9] = { - static_cast(1), + static_cast(1.), static_cast(9.63461239051296108254e-1), static_cast(6.54183344973801096611e-1), static_cast(2.92007762594247903696e-1), @@ -782,7 +787,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(1.09016076876928010898e-8), }; static const RealType Q[9] = { - static_cast(1), + static_cast(1.), static_cast(1.51164395622515150122e0), static_cast(1.09391911233213526071e0), static_cast(4.77950346062744800732e-1), @@ -811,7 +816,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(-8.80541360484428526226e-14), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(6.98261117346347123707e-1), static_cast(1.97823959738695249267e-1), static_cast(2.89311735096848395080e-2), @@ -839,7 +844,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(1.20433396121606479712e-17), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(2.56283944667056551858e-1), static_cast(2.56811818304462676948e-2), static_cast(1.26678062261253559927e-3), @@ -866,7 +871,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(2.03424457039308806437e-20), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(1.17861198759233241198e-1), static_cast(5.45962263583663240699e-3), static_cast(1.25274651876378267111e-4), @@ -890,7 +895,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr static_cast(3.52790131116013716885e-1), }; static const RealType Q[3] = { - static_cast(1), + static_cast(1.), static_cast(-5.05959751628952574534e0), static_cast(8.04408113719341786819e0), }; @@ -902,7 +907,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr } template -inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integral_constant& tag) +inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -925,7 +930,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.63937253747323898965514197114021890186e-8), }; static const RealType Q[12] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.76090180430550757765787254935343576341e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.07685236907561593034104428156351640194e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.27770556484351179553611274487979706736e-2), @@ -961,7 +966,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.22300086876618079439960709120163780513e-8), }; static const RealType Q[12] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.19740977756009966244249035150363085180e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.39394884078938560974435920719979860046e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.97107758486905601309707335353809421910e-2), @@ -999,7 +1004,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.59245311730292556271235324976832000740e-10), }; static const RealType Q[16] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.49800491033591771256676595185869442663e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.35827615015880595229881139361463765537e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.41657125931991211322147702760511651998e-1), @@ -1044,7 +1049,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -9.43891156389092896219387988411277617045e-15), }; static const RealType Q[17] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30840297297890638941129884491157396207e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.16059271948787750556465175239345182035e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.32333703228724830516425197803770832978e-1), @@ -1093,7 +1098,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.23007623135952181561484264810647517912e-21), }; static const RealType Q[19] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.17760389606658547971193065026711073898e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.49565543987559264712057768584303008339e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.94822569926563661124528478579051628722e0), @@ -1141,7 +1146,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.37645700309533972676063947195650607935e-26), }; static const RealType Q[16] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.59608758824065179587008165265773042260e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17347162462484266250945490058846704988e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.24511137251392519285309985668265122633e-1), @@ -1185,7 +1190,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.47298013808154174645356607027685011183e-32), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 6.42561659771176310412113991024326129105e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.83353398513931409985504410958429204317e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.07254121026393428163401481487563215753e-2), @@ -1227,7 +1232,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.54663422572657744572284839697818435372e-36), }; static const RealType Q[14] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.35632539169215377884393376342532721825e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.46975491055790597767445011183622230556e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.51806800870130779095309105834725930741e-3), @@ -1261,7 +1266,7 @@ inline RealType holtsmark_cdf_plus_imp_prec(const RealType& x, const std::integr BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.61127812511057623691896118746981066174e0), }; static const RealType Q[6] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.90660291309478542795359451748753358123e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.60631500002415936739518466837931659008e2), BOOST_MATH_BIG_CONSTANT(RealType, 113, -6.88655117367497147850617559832966816275e2), @@ -1334,6 +1339,8 @@ inline RealType holtsmark_cdf_imp(const holtsmark_distribution precision_type::value <= 113 ? 113 : 0 > tag_type; + static_assert(tag_type::value, "The Holtsmark distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + RealType u = (x - location) / scale; result = holtsmark_cdf_imp_prec(u, complement, tag_type()); @@ -1342,7 +1349,7 @@ inline RealType holtsmark_cdf_imp(const holtsmark_distribution } template -inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -1363,7 +1370,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(6.57491277860092595148e-5), }; static const RealType Q[9] = { - static_cast(1), + static_cast(1.), static_cast(2.48696501912062288766e0), static_cast(2.06239370128871696850e0), static_cast(5.67577904795053902651e-1), @@ -1392,7 +1399,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(3.93093062843177374871e-5), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(6.76193897442484823754e-1), static_cast(3.70953499602257825764e-2), static_cast(-2.84211795745477605398e-2), @@ -1419,7 +1426,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(-2.88688017391292485867e-5), }; static const RealType Q[7] = { - static_cast(1), + static_cast(1.), static_cast(-2.72809429017073648893e-2), static_cast(-7.85526213469762960803e-2), static_cast(2.41360900478283465241e-2), @@ -1448,7 +1455,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(9.66690587477825432174e-6), }; static const RealType Q[10] = { - static_cast(1), + static_cast(1.), static_cast(1.60044610004497775009e-1), static_cast(2.41675490962065446592e-1), static_cast(1.13752642382290596388e-1), @@ -1479,7 +1486,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(9.71371309261213597491e-8), }; static const RealType Q[8] = { - static_cast(1), + static_cast(1.), static_cast(2.29132755303753682133e0), static_cast(1.95530118226232968288e0), static_cast(9.55029685883545321419e-1), @@ -1509,7 +1516,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(5.58003465656339818416e-10), }; static const RealType Q[10] = { - static_cast(1), + static_cast(1.), static_cast(8.73938978582311007855e-1), static_cast(3.21771888210250878162e-1), static_cast(6.70432401844821772827e-2), @@ -1541,7 +1548,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(-8.46510608386806647654e-18), }; static const RealType Q[9] = { - static_cast(1), + static_cast(1.), static_cast(3.81461950831351846380e-1), static_cast(6.91390438866520696447e-2), static_cast(7.84798596829449138229e-3), @@ -1571,7 +1578,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: static_cast(4.61294046336533026640e-9), }; static const RealType Q[9] = { - static_cast(1), + static_cast(1.), static_cast(4.49255524669251621744e-1), static_cast(9.77826688966262423974e-2), static_cast(1.36596271675764346980e-2), @@ -1605,7 +1612,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: template -inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std::integral_constant& tag) +inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std::integral_constant&) { BOOST_MATH_STD_USING RealType result; @@ -1633,7 +1640,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.54871597065387376666252643921309051097e-7), }; static const RealType Q[13] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.06310038178166385607814371094968073940e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.06144046990424238286303107360481469219e1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17860081295611631017119482265353540470e1), @@ -1651,7 +1658,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: result = u * tools::evaluate_polynomial(P, u) / (tools::evaluate_polynomial(Q, u) * cbrt(p * p)); } else { - RealType t = u - 0.5; + RealType t = u - static_cast (0.5); // Rational Approximation // Maximum Relative Error: 2.5554e-35 @@ -1671,7 +1678,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.91383571211375811878311159248551586411e-8), }; static const RealType Q[12] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.96820655322136936855997114940653763917e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.30209571878469737819039455443404070107e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.61235660141139249931521613001554108034e-1), @@ -1709,7 +1716,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.05702214080592377840761032481067834813e-7), }; static const RealType Q[12] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.33954869248363301881659953529609341564e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.73738626674455393272550888585363920917e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, -4.90708494363306682523722238824373341707e-2), @@ -1726,7 +1733,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: result = tools::evaluate_polynomial(P, u) / (tools::evaluate_polynomial(Q, u) * cbrt(p * p)); } else { - RealType t = u - 0.5; + RealType t = u - static_cast (0.5); // Rational Approximation // Maximum Relative Error: 1.3688e-35 @@ -1745,7 +1752,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.99636080473697209793683863161785312159e-8), }; static const RealType Q[12] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.95056572065373808001002483348789719155e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, -7.55702988004729812458415992666809422570e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.07586989542594910084052301521098115194e-2), @@ -1785,7 +1792,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.72723306533295983872420985773212608299e-9), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.23756826160440280076231428938184359865e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.46557011055563840763437682311082689407e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.18907861669025579159409035585375166964e-1), @@ -1825,7 +1832,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.29311341249565125992213260043135188072e-8), }; static const RealType Q[12] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, -2.54021943144355190773797361537886598583e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.30965787836836308380896385568728211303e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.19314242976592846926644622802257778872e-2), @@ -1842,7 +1849,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: result = tools::evaluate_polynomial(P, u) / (tools::evaluate_polynomial(Q, u) * cbrt(p * p)); } else { - RealType t = u - 0.5; + RealType t = u - static_cast (0.5); // Rational Approximation // Maximum Relative Error: 8.3743e-35 @@ -1862,7 +1869,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.23210708203609461650368387780135568863e-8), }; static const RealType Q[11] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, -3.93402256203255215539822867473993726421e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.42452702043886045884356307934634512995e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.16981055684612802160174937997247813645e-2), @@ -1902,7 +1909,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.17836139198065889244530078295061548097e-10), }; static const RealType Q[15] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.78065342260594920160228973261455037923e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 8.08575070304822733863613657779515344137e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.81185785915044621118680763035984134530e-1), @@ -1947,7 +1954,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.88084230973635340409728710734906398080e-11), }; static const RealType Q[18] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.49319798750825059930589954921919984293e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.90218243410186000622818205955425584848e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.25384789213915993855434876209137054104e0), @@ -1999,7 +2006,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.72241483171311778625855302356391965266e-26), }; static const RealType Q[21] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.18341916009800042837726003154518652168e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.19215655980509256344434487727207541208e0), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.34380326549827252189214516628038733750e0), @@ -2051,7 +2058,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, -1.79744248200459077556218062241428072826e-32), }; static const RealType Q[17] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 5.68930884381361438749954611436694811868e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.54944129151720429074748655153760118465e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.68493670923968273171437877298940102712e-2), @@ -2099,7 +2106,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.21485411177823993142696645934560017341e-40), }; static const RealType Q[18] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 3.88559444380290379529260819350179144435e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 7.37942717465159991856146428659881557553e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.11409915376157429952160202733757574026e-3), @@ -2147,7 +2154,7 @@ inline RealType holtsmark_quantile_upper_imp_prec(const RealType& p, const std:: BOOST_MATH_BIG_CONSTANT(RealType, 113, -5.13881361534205323565985756195674181203e-50), }; static const RealType Q[17] = { - BOOST_MATH_BIG_CONSTANT(RealType, 113, 1), + BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.), BOOST_MATH_BIG_CONSTANT(RealType, 113, 4.34271731953273239599863811873205236246e-1), BOOST_MATH_BIG_CONSTANT(RealType, 113, 9.27133013035186849060586077266046297964e-2), BOOST_MATH_BIG_CONSTANT(RealType, 113, 1.29542078693828543540010668640353491847e-2), @@ -2241,19 +2248,21 @@ inline RealType holtsmark_quantile_imp(const holtsmark_distribution tag_type; + static_assert(tag_type::value, "The Holtsmark distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + result = location + scale * holtsmark_quantile_imp_prec(p, complement, tag_type()); return result; } template -inline RealType holtsmark_entropy_imp_prec(const std::integral_constant& tag) +inline RealType holtsmark_entropy_imp_prec(const std::integral_constant&) { return static_cast(2.06944850513462440032); } template -inline RealType holtsmark_entropy_imp_prec(const std::integral_constant& tag) +inline RealType holtsmark_entropy_imp_prec(const std::integral_constant&) { return BOOST_MATH_BIG_CONSTANT(RealType, 113, 2.0694485051346244003155800384542166381); } @@ -2282,6 +2291,8 @@ inline RealType holtsmark_entropy_imp(const holtsmark_distribution tag_type; + static_assert(tag_type::value, "The Holtsmark distribution is only implemented for types with known precision, and 113 bits or fewer in the mantissa (ie 128 bit quad-floats"); + result = holtsmark_entropy_imp_prec(tag_type()) + log(scale); return result; @@ -2416,7 +2427,7 @@ inline RealType skewness(const holtsmark_distribution& /*dist* { // There is no skewness: typedef typename Policy::assert_undefined_type assert_type; - static_assert(assert_type::value == 0, "assert type is undefined"); + static_assert(assert_type::value == 0, "The Holtsmark Distribution has no skewness"); return policies::raise_domain_error( "boost::math::skewness(holtsmark<%1%>&)", @@ -2430,7 +2441,7 @@ inline RealType kurtosis(const holtsmark_distribution& /*dist* { // There is no kurtosis: typedef typename Policy::assert_undefined_type assert_type; - static_assert(assert_type::value == 0, "assert type is undefined"); + static_assert(assert_type::value == 0, "The Holtsmark Distribution has no kurtosis"); return policies::raise_domain_error( "boost::math::kurtosis(holtsmark<%1%>&)", @@ -2444,7 +2455,7 @@ inline RealType kurtosis_excess(const holtsmark_distribution& { // There is no kurtosis excess: typedef typename Policy::assert_undefined_type assert_type; - static_assert(assert_type::value == 0, "assert type is undefined"); + static_assert(assert_type::value == 0, "The Holtsmark Distribution has no kurtosis excess"); return policies::raise_domain_error( "boost::math::kurtosis_excess(holtsmark<%1%>&)", diff --git a/test/test_holtsmark.cpp b/test/test_holtsmark.cpp index ad81478f11..b5e17dacec 100644 --- a/test/test_holtsmark.cpp +++ b/test/test_holtsmark.cpp @@ -3,11 +3,18 @@ // Boost Software License, Version 1.0. (See accompanying file // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +#define BOOST_TEST_MAIN #define BOOST_TEST_MODULE StatsHoltsmarkTest #include +#include #include #include + +#if __has_include() +# include +#endif + using boost::math::holtsmark_distribution; using boost::multiprecision::cpp_bin_float_quad; @@ -763,6 +770,13 @@ BOOST_AUTO_TEST_CASE(holtsmark_pdf_fp64) do_test_holtsmark_pdf(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(holtsmark_pdf_fp64) +{ + do_test_holtsmark_pdf(); +} +#endif + BOOST_AUTO_TEST_CASE(holtsmark_pdf_fp128) { do_test_holtsmark_pdf(); @@ -773,6 +787,13 @@ BOOST_AUTO_TEST_CASE(holtsmark_cdf_fp64) do_test_holtsmark_cdf(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(holtsmark_cdf_fp64) +{ + do_test_holtsmark_cdf(); +} +#endif + BOOST_AUTO_TEST_CASE(holtsmark_cdf_fp128) { do_test_holtsmark_cdf(); @@ -783,6 +804,13 @@ BOOST_AUTO_TEST_CASE(holtsmark_ccdf_fp64) do_test_holtsmark_ccdf(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(holtsmark_ccdf_fp64) +{ + do_test_holtsmark_ccdf(); +} +#endif + BOOST_AUTO_TEST_CASE(holtsmark_ccdf_fp128) { do_test_holtsmark_ccdf(); @@ -793,6 +821,13 @@ BOOST_AUTO_TEST_CASE(holtsmark_quantile_nearzero_fp64) do_test_holtsmark_quantile_nearzero(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(holtsmark_quantile_nearzero_fp64) +{ + do_test_holtsmark_quantile_nearzero(); +} +#endif + BOOST_AUTO_TEST_CASE(holtsmark_quantile_nearzero_fp128) { do_test_holtsmark_quantile_nearzero(); @@ -803,6 +838,13 @@ BOOST_AUTO_TEST_CASE(holtsmark_quantile_lower_fp64) do_test_holtsmark_quantile_lower(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(holtsmark_quantile_lower_fp64) +{ + do_test_holtsmark_quantile_lower(); +} +#endif + BOOST_AUTO_TEST_CASE(holtsmark_quantile_lower_fp128) { do_test_holtsmark_quantile_lower(); @@ -813,6 +855,13 @@ BOOST_AUTO_TEST_CASE(holtsmark_quantile_upper_fp64) do_test_holtsmark_quantile_upper(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(holtsmark_quantile_upper_fp64) +{ + do_test_holtsmark_quantile_upper(); +} +#endif + BOOST_AUTO_TEST_CASE(holtsmark_quantile_upper_fp128) { do_test_holtsmark_quantile_upper(); @@ -823,6 +872,13 @@ BOOST_AUTO_TEST_CASE(holtsmark_locscale_fp64) do_test_holtsmark_locscale_param(); } +#ifdef __STDCPP_FLOAT64_T__ +BOOST_AUTO_TEST_CASE(holtsmark_locscale_fp64) +{ + do_test_holtsmark_locscale_param(); +} +#endif + BOOST_AUTO_TEST_CASE(holtsmark_locscale_fp128) { do_test_holtsmark_locscale_param(); From 07d97df50ceb04bafbeb29182dcaaf5c4b1163b6 Mon Sep 17 00:00:00 2001 From: jzmaddock Date: Sun, 21 Jul 2024 11:54:58 +0100 Subject: [PATCH 014/399] Landau Integration testing (#1159) * Add landau distribution * Add landau limit test case * Add landau document * Landau integration testing. Hook up tests to Jamfile. Hook up docs by adding to dist_reference.qbk. Add std::float64_t tests. Hook up concept tests in instantiate.hpp. Add to distributions.hpp Update static_asserts with better error messages. Add header inclusion test in dist_landau_incl_test.cpp (and fix resulting errors) * Add missing #include. * More Landau test fixes. * Fix C++23 stdfloat test names. * Final (doc) update to Landau. --------- Co-authored-by: tk-yoshimura --- doc/distributions/dist_reference.qbk | 1 + doc/distributions/landau.qbk | 129 + doc/equations/landau_ref1.svg | 88 + doc/graphs/landau_ccdf_accuracy_64.png | Bin 0 -> 41960 bytes doc/graphs/landau_cdf_accuracy_64.png | Bin 0 -> 39335 bytes doc/graphs/landau_pdf1.svg | 1355 +++++ doc/graphs/landau_pdf2.svg | 1313 +++++ doc/graphs/landau_pdf_accuracy_64.png | Bin 0 -> 44144 bytes .../boost/math/concepts/std_real_concept.hpp | 13 +- include/boost/math/distributions.hpp | 1 + include/boost/math/distributions/cauchy.hpp | 10 +- include/boost/math/distributions/fwd.hpp | 4 + include/boost/math/distributions/landau.hpp | 4570 +++++++++++++++++ .../math/distributions/non_central_beta.hpp | 4 +- include/boost/math/tools/config.hpp | 4 +- test/Jamfile.v2 | 2 + test/compile_test/dist_landau_incl_test.cpp | 26 + test/compile_test/instantiate.hpp | 22 + test/test_landau.cpp | 847 +++ 19 files changed, 8376 insertions(+), 13 deletions(-) create mode 100644 doc/distributions/landau.qbk create mode 100644 doc/equations/landau_ref1.svg create mode 100644 doc/graphs/landau_ccdf_accuracy_64.png create mode 100644 doc/graphs/landau_cdf_accuracy_64.png create mode 100644 doc/graphs/landau_pdf1.svg create mode 100644 doc/graphs/landau_pdf2.svg create mode 100644 doc/graphs/landau_pdf_accuracy_64.png create mode 100644 include/boost/math/distributions/landau.hpp create mode 100644 test/compile_test/dist_landau_incl_test.cpp create mode 100644 test/test_landau.cpp diff --git a/doc/distributions/dist_reference.qbk b/doc/distributions/dist_reference.qbk index c225d1953e..75e4d5759c 100644 --- a/doc/distributions/dist_reference.qbk +++ b/doc/distributions/dist_reference.qbk @@ -22,6 +22,7 @@ [include inverse_gamma.qbk] [include inverse_gaussian.qbk] [include kolmogorov_smirnov.qbk] +[include landau.qbk] [include laplace.qbk] [include logistic.qbk] [include lognormal.qbk] diff --git a/doc/distributions/landau.qbk b/doc/distributions/landau.qbk new file mode 100644 index 0000000000..b734505047 --- /dev/null +++ b/doc/distributions/landau.qbk @@ -0,0 +1,129 @@ +[section:landau_dist Landau Distribution] + +``#include `` + + template + class landau_distribution; + + typedef landau_distribution<> landau; + + template + class landau_distribution + { + public: + typedef RealType value_type; + typedef Policy policy_type; + + landau_distribution(RealType location = 0, RealType scale = 1); + + RealType location()const; + RealType scale()const; + RealType bias()const; + }; + +The [@http://en.wikipedia.org/wiki/landau_distribution Landau distribution] +is named after Lev Landau. +It is special case of a [@http://en.wikipedia.org/wiki/Stable_distribution stable distribution] +with shape parameter [alpha]=1, [beta]=1. + +[@http://en.wikipedia.org/wiki/Probability_distribution probability distribution function PDF] +given by: + +[equation landau_ref1] [/f(x; \mu, c)=\frac{1}{\pi c} \int_{0}^{\infty} \exp(-t) \cos \left( t \left( \frac{x-\mu}{c}\right) + \frac{2t}{\pi} \log \left( \frac{t}{c} \right) \right) dt] + +The location parameter [mu] is the location of the distribution, +while the scale parameter [c] determines the width of the distribution, +but unlike other scalable distributions, +it has a peculiarity that changes the location of the distribution. If the location is +zero, and the scale 1, then the result is a standard landau +distribution. + +The distribution describe the statistical property of the energy loss by +charged particles as they traversing a thin layer of matter. + +The following graph shows how the distributions moves as the +location parameter changes: + +[graph landau_pdf1] + +While the following graph shows how the shape (scale) parameter alters +the distribution: + +[graph landau_pdf2] + +[h4 Member Functions] + + landau_distribution(RealType location = 0, RealType scale = 1); + +Constructs a landau distribution, with location parameter /location/ +and scale parameter /scale/. When these parameters take their default +values (location = 0, scale = 1) +then the result is a Standard landau Distribution. + +Requires scale > 0, otherwise calls __domain_error. + + RealType location()const; + +Returns the location parameter of the distribution. + + RealType scale()const; + +Returns the scale parameter of the distribution. + + RealType bias()const; + +Returns the amount of translation by the scale parameter. +[expression bias = - 2 / [pi] log(c)] + +[h4 Non-member Accessors] + +All the [link math_toolkit.dist_ref.nmp usual non-member accessor functions] +that are generic to all distributions are supported: __usual_accessors. + +Note however that the landau distribution does not have a mean, +standard deviation, etc. See __math_undefined +[/link math_toolkit.pol_ref.assert_undefined mathematically undefined function] +to control whether these should fail to compile with a BOOST_STATIC_ASSERTION_FAILURE, +which is the default. + +Alternately, the functions __mean, __sd, +__variance, __skewness, __kurtosis and __kurtosis_excess will all +return a __domain_error if called. + +The domain of the random variable is \[-[max_value], +[min_value]\]. + +[h4 Accuracy] + +The error is within 4 epsilon except for the rapidly decaying left tail. + +Errors in the PDF at 64-bit double precision: + +[$../graphs/landau_pdf_accuracy_64.png] + +Errors in the CDF at 64-bit double precision: + +[$../graphs/landau_cdf_accuracy_64.png] + +Errors in the CDF-complement at 64-bit double precision: + +[$../graphs/landau_ccdf_accuracy_64.png] + +[h4 Implementation] + +See references. + +[h4 References] + +* [@http://en.wikipedia.org/wiki/landau_distribution landau distribution] +* T. Yoshimura, Numerical Evaluation and High Precision Approximation Formula for Landau Distribution, +DOI: 10.36227/techrxiv.171822215.53612870/v2, 2024. + +[endsect][/section:landau_dist landau] + +[/ landau.qbk + Copyright Takuma Yoshimura 2024. + Distributed under 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). +] diff --git a/doc/equations/landau_ref1.svg b/doc/equations/landau_ref1.svg new file mode 100644 index 0000000000..19939a829f --- /dev/null +++ b/doc/equations/landau_ref1.svg @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/graphs/landau_ccdf_accuracy_64.png b/doc/graphs/landau_ccdf_accuracy_64.png new file mode 100644 index 0000000000000000000000000000000000000000..7e157eb81fe67c0d2d9d367c984b8c9f0746e6e2 GIT binary patch literal 41960 zcmcG$2{e}L8$J9OGiS`4F-c04xeTF@ic(bOp;Ts)L_{J*l!`_fii%Pw$~=|^8kI7H zQc)B#gm2&8bbdp>|9^e!Ti?6RS?BP+p7(j~;kx#<_rC5!=4)1RvWc)!6vb&`Y`Bi1 z7#S#vo|AZ@ZW0;)R+E z7b!}*`TKkOX(=gr{Q1B_FW+rSOBjs{a1mB-<4t}PHPey&OP8s8c{@d=Z7?y^w+uYn z^KQ2_zg07H-`-Pk;i>XQ<-GG}S(-=8*`b(u=uo2}-`>@!-0T5qPTxe1M;C`ST08IY z;4!);&*pS!!A46)OKwK~Spg-w-s*~qbrlsHJ>z$Cie0unez^4R(dP4-ACH)EGtwE- zUM`C|oo49${vq;kH6=}ZF;qHHJX5cP{f^3E(NnLwvKvCbKkMRP%^^wqsLCQmW^USN zg@tA@&^{W?aU{2ij(>w`1~1;aar0)lnH-+WVLTpIduXcI?W zT68pvhNk8rapvEbN}9X&e2P9-JUr@OT~(E0dP3oIYuZS;liuvCgUr^O zHkH45v$@kvUM6xm-Ktfqtha3W@n}_elEfz`&-BBE32Gl!7A1+2A7V!m7UDBhknokq ztc-_fkH*1qczX1hFIn?5tht~QyU@0%tg(?tC7EMvsCTSQZU6rLZqGA$9zJ|%p1oPs z{Y_q0S%)m`;g5woS#TJenH{)#b^fnkzkFXzv{yzA_uP8YaA~#ZfyhY5=b08lDlRM& z6Jy`#;}U7#X&hYbL|?w3nN;8R@8N}o zg)5qmEY{vJrhPYALihQQL32p=ouaCw3%$NEjTII20`oT-K02-1{`D)@;>EYbZr8KF z;5c(7)MWGj7_*QMRg#D45)u+_+`9G5dh51rQNzQ5_d>>I;kBtCS>0>))`v+6u6w+_ z7j=GjQht-#ker-+(dh6jx8?$m{rpV7#>WRs);^W^w~6?$0<*H+d0+b6dGk!X##HK@ z^z6(|FJaZu(fK^q-{0@;>s#@@`mm#iN4DKUmhhU=`A1PEZ`I!yQ*qFs>C`ue z6&Ei{O-)^L(#Xh&ET)~;Damogf`VJGvNz{1e|^)HUH0*NY_qdEAtLO83#*=8UfbT= z8>_nWC0UF?+6NCEVr{)Adj#w2&tqZb;fFUE(#CB%95+MnMn%n7b5`SG?!(qriP^Jf zOB=Zax~K?m&fgK~(OhtG>!Z`rv9Z-j%FY9CdLwC5o;QD1b=ZLej95leii#Y1qZtg9 z6&2jGXLCsw9}X?uH~zdg^jH7NrGb4^NA1zt-sao6PStEZZwvX-Rvw)t6CAPeisiiF zk&%nRBi~tO&aB07R&&voeP$E6cKs=(G{?$=ZcR6&sIuDH8JwbORe9T=QPh(Qx>kbB z6nQ!g|88zfVEgCKF>_X(ba+>^>)y2#W7AU$V+;L0(og2n%W9$YoV_##q$F+XjiS~JxnJ%58q#T`NBRns_E9Yqjin6=q9jMkvYCI z^B|j;rZ1z3iHY<|gQ>r<{Dr7^>{+ITjE1(h%)EK5baZr1QNQ2oA@9i?zu%CxelA5K z)<1WFuqu21*)u-MyS;+x-oEk8Zyji}7$ZE3!T8wObLT9sZd@RL!jwyZ7HOX@#_w-h z7Bj?2=q~h?{e8pixZzFNTW&K`2M!#Nl#onrE$>lb(?wB`HXNp4{rw6y^E$ zPWdVhk|KC`KGESx_6!XTc?Sd>T$feVRe!3QD~fhsbMuMcvvjE#!q1;+NY540GYUU(Lg4fBEC%Y1|EFVrX4ONH z**u~B!v|)Hg_BcY`W{nbt0@H)5!D@xVZU=?>Mtyt7!E5dtGX`VrF(}s8XFt`T;GLU zf5jo*Ip&x$O3&Ch`p@-k$@QP!a5SLGPRzIZGt%7(YSomkuC8T{jqryLAKc#L%?po+ z@N+M9f35QT+9p0kN)phz8`Ju~zPr0T=Hz!%)kBhde`ne*+gy3(o~B#|1i!w)K_fRe zc^g~X_D`RZd+&TlbZ~rMbqK$&#=5w%Z#;;6^7!1f3p?vftT;uMgqg`zV*mGlelb6{ zQfg{A6^cR01s_J(hlse5aQ_)H0%1Er<9m)4w%0RYQ9 zOfTyZE22tYHh+2@8YM``QPi@%Lsdu(i#*;eF7RBWNHqXkB?->iUJE(o43C|0yJZeUGeGOcy3zAdT_;>gHN)u>LNWY zcJBem7T9#fiJHqp1BXvJ5yD)uK5!0yybv0H_N=1s651z?fPpPtHe9pjDJUo~m**$% zSN#c&BoZnno7L?34Zgo4W+^f9I?C)29{wT$cgYP2T`0 z`SRt1!UV#Ut-ov0{byu3b!J(*sdhj^DChxkx{K;qFRY*hvZ( zX4L1_6rl~@c9H}lwRU|jd;XkXSy?&od*`91c3Q|W5y6)#CY?T=>iMpSnttxaD5T%& zgF7;*X~?cguEF_2Hr&zC@jdhMsnM17L5R+^xNf%$ksT{UT25}obfT0+Nu;2rxL|?B z-2e}&EMmsY>C|RiL~hYY)v^u2OM2z+OOa@wn|j(Xe%bH2xJe#(K7uYq8LnLE*Fr0> zQr*do#pLI!>Wp^FP-QQ!S{eO@C&s7AbyuodN-kMq*=amA&e7?Ia2o-Z)nW1R+|xVe z*d?d+9DP527yzv}dV0noJ4$P4Xw(i}w=X?->Xe|Em>Bl+LFBNuzV^yU{sjWE>gwus zE-D26DcP6sPnTo&=KS6-b7W)o=JFRW^5bPLhp#IR+VvYh&;W^X(2;5` z$7=nCR21zKc_o(YGu+ zrQmnQGyhUWep)=&s6?pmd)F!esq)8<*EkoRJ16ehT9Uo%%#4|{B_$;(#P}Ml1fOp$ z%Qz%-#MmO~F_xQe|0#Ax?jN7)xP5!_H`PeSxme=Pw1H8S%@Rv35VQ=zx%BZODVk{S_sy@0Io183+ zd~#D!U0J!E-7xj^lI`J0$1<|AjN_w&AOap7xGw&;a(i~jhqSu2l5RV8u;J0pYWOTK zHp{XEn&Io~>uV@l4G2O;7^ryg=H1=jD$2|CcS?oDTq4krT5e#V*+MH<sGArY%4zThewOCS}zM5oQN+%~o1sB@rrLBmq z`dw@p^Rnd&dAF6(`2(-&)tn35ySK8rdCQlgva&M8daU?B&LD=i_V)ecZ$CahSBVWi zjg|4YyOPSR>_Z}7UAJeTjvP6{EiP`G6g8ItuyQfB|Jy>p8A^8dxTm+jiTraXy+Yrv z=i54%^Z^a$Kdd}Xr?CDKhmDO5Md9jve*!Q*S$0%+A{tZ!FJd^h&5hf)qX4vDiYAog zxxeP6ygxh?{u7`MEd2iNm%w3FJI0=_%a0MCG|$G0WCZ5 zZn((BS6BDy)u~8IfgeoFqciF=sI$xVZtQfU1<@+2%w-HBYVJv2Oc)Fd4A?b9RAd)y zDX79O^ucW(5ng=oxYbmSPtc!_F?p3^`y#Y-?@zAz8?S{OKFp4Brzp%+8EVbSFXhKu zRDoUr$O4CYgl8`cI-s!OO0+l)BP6(C0&(wGC-&CGO9?4EF``^Qk?{!Fl5Me~3WdjU zdwWOu@de$Z_|?tdtQzy`JWU3`$sJr{C*uzJUjH07s?qWbu0ChY*r;Yncp3aYlE;T4E$W+Lkqy%TF`c4l2*QKNZik>7=@Q z6Sulo3%``K3O@;Xz^m@oqG@#qlpq?m(*u$ z<3Bb3FowgwyMgYw-0I~vHfMuge|dFXdCzwjV061{H|q4Taak$v&N`mydr=5Z6=0a9 zWOsznn(H!5-JV_IMBs?PqLD=41e3=zUr~h{wOb_cHz3o|(8+PDX&AzG0#AaJ+lDx6 zeaBl0TeI!MhlBQ^;{w>_QOA!Tw{}d}51Ms3stCFpyJ@gbcy=T6$0ujhX9AB7gHBXE z>D6?D4tu{0A;>W12!~N^oH!3RcNo~83gB7aLbrV7soj*ie9oKe7l2CAu$(rXe3i9+ z#?_74ycoJA3pVG4p^zpd+NY;;rbD8_5BYr&6(gw~uc3e4c z?ES5!_|Mn{V(dt0L?GI9@`CnmuDG~3GJBce6sWMWGQFyrnix?I8t)**lP$E!zuO$t zC7Y=-?@NL{@a&rgzNZiO_%zzZw;_79KFG~M=+K&)a&Hj@i5rmaaP)4cO^h$QT@ z6w6RR5T3@SI7k4{GfBi{_g_=;M$mG>+U-;-zo<*H0`GM^Nnxb0rJbRqbAnk zwx?}Ua&p%m-F^G^W!e;~V52tXZC}qgW5&lFcd-x+jodGw^9`N zp^5TIb=pH15voAZwum29Y<1awhIR}SHgWmWr@W$S?sWlY^757pe0?XnctYYBMr1x!!&EFnO^> zN$?(y*-M4CJw7|q=JRhXGfEcxGZM&{?sX-&`}8SWbhSWB^^9H?YP^8@7?C>ePGpG)TF4YKLp(c1}(3xT{(p* z*Q{AXw(*0L3$}1yTsM0jKilxwSX#)~&?05!#_i1rHf^u$L#L{L=NgW>u4*UQ*!0f1 zx|TQokr)1a{TJ-Epk}MTmhTrb#({79yBlTvKRq=fh=`s#5*zFD@v(UDK;z0y1&bFi zeioF^z{kf|q9?1MRQRc-So`I5dji_q5pUfvv2;c&gM0rbkqmS%mN1&gyPTCZ@9o>S z-tVhe2URlG9pan2#;x~*E%+>((tYA6mp(TO+6V7f^LQf(Y8j6nDXe2+2Fk19*0!}& z8LD$Bmhif%^$#x3KH-}%MS-2_ZY|Y)`|e$1x(T1+mI4l-MIjAuNh-y@bYG_VMS9HG z3_m}==h<7VoW~IT8T3wexg?d0ebshvF5tun8k(DPV>$lWlR+Cg_cBv@PtGsPMWQe} zqsEEaN)Ie<-0Wpn&RZ@5@dqwiP}5XF!QI`xA$yDZ6#3hvP1CSq&N($Mrl@cn*BERiZOaZNrzyQixma*vQenJ zoWId(Ib==_$pCG& z-7Yc~Hwp@B5YN2(+VrPG>Qi=zX};z+T}(KHRT!xo(0ot^{Nc?fP|^?3Ap@u?SZ0P1 z9Exo){k4f+xNt}qrnDwboSkYa+BF|BO3|10wT2@g9xN6Tzy|zdxMPRHtc5mpt2n2y zi$y{Wc{5gcG4rKMmynI6Awoz^r^r21ZxSMcff@K((dG^}%FS7-vuSDL9yn6t8F-6? z5*|Lj2+(YQXyWszdD9uzuU~I=K}X!TPz(u99YoomG2VuI{!~|8&4dSGpdOyn7DS}| zGgP7&jqhz^-%71!3MT1&>Sdw;nyBkIuzj(A-(x>bUp*a9A-(K)eHSv9$Z2)2IFPI) zrIweMPv2oWnOZt%A~hgK8&E6k(kJ+E`fWmlr_v*x$5bB{OaohKY+_OlNCf;K8DLFY zShz(2Sxm5^^$iM8Zw06W6yss%w0Fmd&zhPm;XD6DT71x0vA6e4K2q2m>{th9=LkSx zA2W3Up$+;edw+ffO-m#+uhMbmjCJz@+@`+DC57Uh{rkbZq4a~`#0HHMxN@h5 zgpg45w~{d~fGrY0Ac7F37?tw1c$v8dq>9D(I1Tr;Q(@Qv4j_Jwjg7fARi*}0#jrY6 z=!XBNbsXYa{0uX=4gmWD1~EY@2JFz^Ifh3gf9uweLbv0^mB?LRUP37$HEN`orZ8`^ z*+Ec@jvpQ-qZF=&y3%mnUKgB;UQff+RMwS&oYtd};|<84|3Z$-Ta6i;nuagGs0ZPS zO~Fh$A28k-+8A_HgTO$I(VyRrB1-%jOm62~hPvyZv!xd--~`AMsqgLS@rDF#)9YMu zfE66%b9s4}lmE@B*BNwLnp=*<``TTxx*iuRs_q0`orRUP{E6=55m3~QzlQteH{DEc zY8S{%jh8U^M^6XWjvqupypKLS1cg)IYcHQZh)xoOetdjVSy^dN9E`u#*!B7OjO)ER zp%cL*NI(z=g}<+$_tM%6aZ@R}#G_daDf+`WUA#Um@D3kr@%I4IjeTXed% z7+cOUO`LisXmE#ywsr>!FA@RwjeeT@wlvhfr*CQwGKC0Fcz)SlCo;4MBO*)O!fxDH zB(^Nba#@x`VBnpiF;(iCO(9`{hDX0#M=g+2vcT@1HK>$yXj}&YcAXni^ht<;M%edm zcdKK|y**H|1+uLO^tA1F35CJ$vzI5HCkMHDtHMdBH8_|ML^q(_C)kZJqk{sdI*O~2H^g&Ipn+6 ztzYjm+~+v(`2{-x=3oxt$xsZ)oQiI;7UYX8@I|0NDgb|OxYp0|?`a}mZIxqFj)l?o z>C+($;?3K%QqL6(x`i?+fv|Qu5bVfciHVCR#K)8Hn`(94j<7JfJ{>FY4bkEXQx9aK zms^-8$wNoADlUgXh=VNU9S(1g!m(YxLyl(y$|KjJ+N^gJZh1# zZuVSW9?AAOB+C=-qyu2%*_o!sE2zTjrJ<#y$}E=6w>`7%&L<`wK#C{8>*(xd%MqnU zhrYhkUb^Qy{%a@37@&ycgI{Pc8vQLN$gFYX|vA-_nvF?2$J%l;YTl`mP)K`9>f^%uyK+mI_ZU zMEL+MiTy|W)P+r8HZhcCMTj5oc=zbhYUgw7vJBnb6|r~-eKJ^jrF27eI94t&O$T(^ z`$HNa4nKDgeHQ}{4EE@|7c_gv9XmER%sfK|(wHCfoY0AJOkA*K7CvEwtaoN$ct?T+uAILm4UjxJ{sPNrIC3&>A=;iCA}_Fo>3j^)eg$p#bd{YmVMnVbPi(j_sB$%mPR zyDcP-&XH_( z^4sv#R0Lxxcs}h%5k{1gojb2S3ka8#oHJ+6s{N9e$KW6mxeb+H8d(WDhw8(sB+DB$ zk5(-&TnAv8*MB*>uh8avhF<)cGvFo7R$TV=a9SYh5(y!>YzMU74z$Q=Zev!#5o(Qs^ox#HpA0Uhf zkAC{4uf@07>eb~$JGi@_?RZpIC;#dvlm3)Qee&d`**6nxx7ZHVSHKdQ(2mM7I@;I8 z-Tm76J2w_V0Lo@!h+KZrLZi;p*4I}B`INAGcwWqxJb#RsmvHm8w=43^UT8}@AGxx8 zrK34#d*9EWug30ig3?3If`IY)jLkwTK`u5w+YeoPHqAYL|M?f+B3JjT9%tV6tdcwK zGn-RdTH)rD)79j@hWdU>d~IxM_>~z3o-rI(wrt+KIp^CpyHglak|&|KnP#Ze7HGbE zV)LAO%Fc;O(s

zV_q=qn1Ydu||P}&3E><8AL|jo28s5Fjr;roKLbsOV7(~HYZyL z*J*A=DQ;J~FBV%Kl%eb0>ksQyKB#rXMrUfwquGTNH|MbcxIsOyhO!g~6O~KzKJXPu zTDug82J!jDRcDwQyTPqWtuQk*G>Y6|4H_UzzV?YHOH_`EAg?78{RU;p1q)W&4%gjV zdU==d&ol3e9*)&*x3xQ(t>7+y;(?eKZd|iqL$)BJl+}|gNtVy;OMaEhFSuf-S~@;- zrp5Pop@6XGw zU+aEl44Nnw>z&=-W@9C@{|aOp8CKCfI&cAo*rr_P8N~Yml4FU-8-B3Z5#U0J;|Gav z+jfxgdq_=?1na2InN2)uGDV`QGZ5U)P>%>~jfigM6@ zE8(4l47xud!6Juk=Ih=s2Gxhp4rRos|0qp972+21AwaYD){UdAZ4t_@Z>=_OK3(%x zv~a=q;O{`{Ctx& zYaYLHe)1pEHx&k&wH;85C@gYo&L(Ay6X68O&FSqOA1Vx$emU+AvS=+7ayHcfg#BZ3 z*i`2aOU}hmVS6Gexm+}I${W0L-D<-w5?TZx;qq3%@k0uEW5Yo2Sq_rHU$2< z;c}lhc!5?yPKI++&-4rG{~cn^C5a6qys>;G5`Dr@2|d<^N9;+n$r7=h(e z34#1XS|2(SkZ(a6IBwl47a*U=N^3j#hbH;M7M#-Yli?fiSxrBE9hIiV|8E*A2HFr@ zhrib=0ZOpLa+&AWNDqFCUt2Mv>*L2L0<3{bNG0a&eWOWA_#T8EvvXPk7_x)ob1kZ&5ge*r_ z*GL58G^lhi0mZ#62$xI&RrLBp{J>7&UExSx}99a=7l3_;>dElNs7u{dq1nVSQwEJ5eTqgbDOU&Q+@?ohW z_*AsC%mz(CToO07J(-R7Bw?zDi2LjgsOD8^t3mS-`8iSEf*vK zp%oZh&fk_CRvC<%J*1)D7L+lunzkbZb!UD$K4}KQYCEAp?osaM%AdwG?7nB$Jf8yPE z-7XeF%}zy$WkE|OewI!;0y==HAWsjY@})9u=g}{W2lFVrvro zG16EVS>G;aWUxXeu0X^yJQAZb*0b0VOp-`FlCm7s%Pr~A#!O*1c7L;rb%ouNA40Co z8ohKWEv?Oza>A^7}9G6{yHzGxzO)2xH|=a#^rGjyo>kz zSdnR0Tm&*w32cR_kfv|CBujYT=-|$B%p?&+i+VB3jMQ>-^LXP%k&`{XGA!ZdsfMhM zfGr}u_2^K7>8Kz+ZOKwtz{0Oy-C6MEjGBjnS+Yt-AH8%wE1w(-RPdKe1$%kCb$tyI_u;Y1EgU^UBsU28yGNzuY!;u0S1DHuAJEe#`$?Y z(q;o3-e>_SZ)vf+*1!RXD^lRq8iyw*xypl2P;drfkC3RSps)YI`uckI3n4?vH9si| z?D2k>wXN--7=lFnF{Uqdf1$eG=mvs=4uN>zJ|LD7?guy2ox68C&Ulp&Lr5bG^%&%hX|X7o zQ3NV`zSRJ?Id^Ss`&>(%`z|VCy8Fa{5F=q#0Qp9UBM|31dTaEVKH}d>777q88a3c^Xy7Of@QF(Bwhg$iT!S<-*c}L!hK=Vu)brZTM007V_kyCc~Fr~VB<13-I618H|X{hFadXbI+$lK4WuMP>_~`6gGkW? zbKsi-kHaulq#)T#ue86n3>*?v&I3n}&Xikw{s{c`j#be-gyx!@7^h30S*Z&4HkwD~ zd$8CnhMUSh?+qdLNY<*st-YMIh{1|Us4B=)#GQnRCZs4K6}h;$BKegQ{Cm-DgosjI z;L&V;d5t&{1L=6fGO#SYn6Lx|7FBl2e%~Rm5eyVzm?0`SV}U3#^Gho!DFNvkbSOTA zA)K3=yDT?PItve3fgUFm%|QUCsMRY^kDAP}{G z`}U-8wXB?aVKRy)Qf`64Aqp*+cLQ)l#KQI*%znI#nxgPtH^}G`B&h-_-0=IjhIHFe zeU&qH9j07_2RTKF@IxRzr0lt-4-YQSvaERbP8=#9Q~bo+Rv>eLv*j2(9ynNuVF!%g z$Z6f^>M(aW&X}Q<*5$4yYAJj;uop|Ksm((EqQbyxm7zQ!)wRe+?_+Hfo*1st8Ba)TB}W`Z4&uTRR=3z7Gx6AQkwG z4s5r)W^GZt6rNQuYfpR+-a_$87)m50c6DVRF zSMzRB(R(Zs=;)PLwpDEJBu^}~g;)7`8KL?+)rC8{R7Si+X zt{~B|)@8)hj1v72);^JX3{I5&z7Zxg4a|FJ&id(sGWZVa>0ZXbprDF}4>@LViM0uT zUj7`^IgAvx&adIYA&p&TNsH*9Prxctj%(4n)WDyhS?_%B*_r7Q5)W1fplMZHUyPNN z^-k!d&gf9@VFL1yGr#<#dpu&<2Oal($L?I9qpisim1rdclH2gJvkuK&-|tseG9bkf z`vt-QGdnvwF~Xu_qH5cP5V?RrW_W~Wz*G_i9-X*Q5g?$CSX>rl`eYAixMOwQU2MeBjd*cL{ItF)m@!Pz^PduE41xTEz6oZqxkBomVk9CFdL9LLIreXV>E!s) zZRgnc!;FsIeh}YQ`QU-+vh#&t^$;DMOG4`GV$7hF&pkUs*6hQD1JkInk$IX%rLGb@YctL0T_X;X26OCOqWVx=)FCQVFZsw^f@dZlzaKKgd1oJ z0+_(^=R#+?w&@m171<$-@QbFJswzelkqFIOzs^j&eOTO_0C8R||87YP!+!S_f*(bQY&>Vj7`W-I*q_2bEM)aL|o z5}PS?^DX4!>z=pJ|8)@$OS*j9K7Ur|X}-PoUKnR|!99u_0VJtI?OvWkx#$wNc+w{b z_k^XqRnA$W^t6MN372%4JWVgTG6bVp`}qNOTts+ZjvP${^NX;uZd#~n%#?-}Wei9JL0T|E>vzAtbs4U}WwB}~FZcjz z<;lg+=2}7e5o2EV{rVO<$wx|0)Y+_X1M@<~JMKJo&t|i^97}lo&(lnV`NT^=_4`b9 zS`(3U>iYxWrD?DK?=9^A(&&Bg|DVg&NXF1%00lsq_YJ7tr!r)&Tr45?S5J}`&%jdlks?YSdCAU(4M3g)m~;gkvM+Z{PK+s$6$vojhP7JQ zav2y25aA2_~+3sn*cVt4Pp&ZK5WjH`i-RuPW7^*Jdr|i0i0Y5h|-w9(<)XC z)COYEJN0%Y;Yc)15(KNMpe@%fcm+g zh)7FwE~srm8!(ZOkR`fpIIvadDXdFw*9VD>+qWoKgEGTMiA?DL#2lcJ$O@CfpX&Rc zvjGH9m119Kh93P8)maGhi^oxh7`W}WC4P{@tQRoTSLKjP-Q5@p*`%;(h=YQi;k5Ih!XB)_rI8r zqGXg zam07;jv7uyDD7WHKRvsQyePcsq!%bs;KITC6^N=Vdx#TQUkv?H;h_B6!&~zy9xii!Zj@Ti!rZ4Z6M? zOG5T;RGAa~ubkjN3>z@!iI$-`pPa%^g@Bbm9L#U6#z!L^|>KIoxa?<022kZCh+H1@z9_AD$q?x z{qmse%N$z{MAm6i?)+lC->oJ?L$l_{0d1o6lmd^ zlNvi(vg23@j4;lq0}yKG63uV>vrAI2n!_(yhU|RHOo3)|cIn1KOR-dF@9a$cc=bHK z9gm0=e6~7l`K6+>9YDt~H09+H9U!R2&a{2kfL4?|N4jL6$Fxv;ObZ<$MQrnT|B^_R zAsGGM9zK%Pv3l}7S&>QafppWBs41d5ki^0E26A}}7Rn1|c zNA-J4ajl8T{bv*3i)=06Q=5ul7Rqug^erVJ^B?pYSjE*FXIVPIPD12!Y*wVY80;Jd z3aD1<_(&jez- z?75hfNp|;yP@hFYSEU?~^Musgh2ZX*L6PlX=Mpgwu$s6f&>lrm#EU|X0>St9!-K&%**M)~cFJ0}WC#{diIq{JxJB@T$VI9hV|?%tCg@7}&$ z^0l>S7dvu0D6G$}NI5H)FQ-4R6T-G_+qUefr=!hvj55U2FFB)nLCSg;&C4n(q+6@Q z-U4t^l$e%33z(7y>uqRh1c^2U_7YsTc+~sKTyGW-BvLDRC1hebk+w(l_JX}ps1JhJ zr4A=VENCG;ZpK~T$iW8X4<4|gzIwjpp^-RIPRUDFVgCI2#MlX*0LKp)qNR=$mE_ZJ z-iV+QcraLUaHd2Ya&S9HxA5Dy)q(SfCm$LK|K_z(snaI~Nb|k}<}=T+(R_$C0W7Kq zjh>W9X6Kg*Lm_-MmIdcCmxRs{pN<-|J_;a%mBT))jQ`RfDd~1p)?0b+G;NJ1On}Qc zBBsd;mj8K?9rppndMxPt0*@D01OTUQE!!B-EX+HUFg0PGE%y$gW}99gJQl>vLVLRZ z`*}V84tB&xKmoyu3!}xXf8EEpGZ==ZUIM$O2c5?iJq(UuVW=<|3H0TTulv98L=2reWarT%3z%o%;bb5Z^B~k+5EzCiB^(?b_oKLU!qWUa zh*b&2;vn`m*02SjE+%KK^Vr#-dEf`x0B81t$4AfXBJ9=J4$v7QGAoXhVP_FLL{oFK zGdM-9Wi{bA>tgEhEqvry^h{$k)b-^Xq5@Ew5>bY<_hEe#t`3L(u=;&?*yyId>$9c* zw-#~Y)j=CffA8(q_b?|@VJO=p0+mnCyT>@H=9LMYTjKTcn)`oAdi7ih=(> z2NIJhSho%k8E&m5#U9gidTM|@-VtvEnW1v6*u+5k; zV+p$GV4i?R9F8-P(8)Poo`lQ)JuGH^WRF+)XM;npSOFsZ`OlExU<&N-&sy9_o@WPO zKbS8ktq^YE z@r$D)q(u&;Ga(}&-;kY48j^6r!~Kq1=7E27yT*KM@8z=>8g+mA#ELVs#F`P9wrVT4 zL9JH?)!=^nkZB;GCuq# z>T*!rLPA8-gGuhN$SIva@jn$j;%pIhPYxtGq9S0DtHCxI#-eUvMX9$ECPt&!G|7Md zK>L4)QTz+!Fy;t|l}%07c|vS#e-daBGN)5n7+vQ2%Ul@!-0jcg5HlcD$=3E_B}IXV zBnl;J`HC2U`Om*tzWW9LQye;DiJb~A`f8j}^4x>SMqu3unTHw*Qj8X8ip<>N9Z6wo zdxv`T&uQ%<2_C?T7)wRIAlMTS(As^Z zRlL!7OLPSk#pgZFR8<)gzb5wb3e3!l+r)~D8brin+0v!YLt*Q$#El@c(o>`f8Dh{% z^vo}U(fus6;8#8^7*))`E9;j~4Szu!GOlk}oJtZ%sjG@G4oSdy6z9Hl@H3tZVkV*@ z))SKeI}MC{I+I{ADm?mjokD_$#7yfgA4|9C%?@Hh<9r8@6)^#WVoLJ3iyT3f;SV8v zJu{1XH130CexUZKLwH2p;!=B^9HnUo3(vb`2AV!-D{j*V@aE*t>8Sz#_QCu=P_|1lAc%GY7{&q zU^*}6?gOk0VvnO`GmeOVV_Df?5~IR!Bjptp%fG0RKnl^u9LKv6wHBM6__MLo+Hnez z=SSEFu$0nJ^%Dh>8y-s#n{*U*2s2J$fUY(Jf1wfBm$Krb0CBW;r;crg}vnwJh6^8A$QxURAT8&GvFef_OKvEEH z2~jT!z=p{4SoMi3?h>tS;@1c|I}H#ryrKUM3NXMpri{kjr9lHM2o6v!T;u!%Tp%FH z^gvev>ZkW5!z*wH2vg2-$mlzix_-)+oB~1Z*xZ7qhF5zw36l~as+@`_yb(UBg`&&8yB6C-f-`eoFIn@GnTup?0<2WGqMi$y_zty2N5CqG9wbYiI~ zl=V6b+E%d8fAIFvg^4sjWm0BZ-}V$Q8Gg?`coVTH4UTET-O3)O`^^?MInwGT9+U9L zm5feKPDs7kiuF5zDfN~=Ww>(sJcI%@&||FFy>F^kS9 zu7jGDXg8B!`N@WZ(0<@0ZlU`zSQD9H7ndYVuQ@q6U~HZh?E{$mTNl^W<|S?o6w<;Y z-^0<-!)^WWaU8~(En*tp6sodnOr8He4%)C88Xdyzql+>6iOv`Y*(5kdi;|R=XCa~= zP}?pp;#KL!QZD!cZesd)n*a3Zu}FrVawUDKR9SgB9TMaU;xK%5{Xz!un4%Nl#m|n8 z4mt{i5?iG7liIoC>$@WMB*^{OsaR*i)6C^1S?Ci@UC+-Aw2IBO>WyMMwJz&`Bnuj$ z7pbT`wZ8o1)se^5Vc-keVeBD77`Qh&3JZ@M=h5EXoq4;A`nxwT@!R-ZIXR*<0trDL zB90ZT(Y%6l(?@GgpEmQ&+ISMQTs7Bz-?D!_B5jIOOA7@nhC+*!<0##~=U+!s>7J+X z)Ck>aAXW~;VI!ley206Y-MV8facS#GS)PIxN^8_x7tQ#G|NT6ib4A<$|{yY=$p3xVZc5YaFdX`gMcYCFkNq zFRX{{VjfME(+rL6A;EP(#uoBs%I0g@M!&YU5~PFUwU zMFzbCri5s5BV;UK$J!97J+vs1?xxsYztQZwaEOtt zh1Q!)oVbACn3`LHWJ_=!CWjFV1mdPM{0dr2=Q9~xK2Hb7Gfq-v#v`BlQWac>Vzm*+ z@eYQ(kPZ1=r;s*x((-{EW8mT0tp6(ZIJ>`*-jI`B)dY z6Y~OT3xxZF3CgV@vYj%>1j4Vbj1$`rZz^fg0*3ye(1O4?(A~&@9lH{7(g%KN0ysfd zRfo|rJntpPrvl13e(${BRJ>Ompzt7um>eRjrMq%8b-i*K^i6W8Bl5z)Msgl&{;1Z; z*Zp9^J*@S%PP6N4lzyLLoP|U;w#&7ie(-bFHxb)=EJfnrr-=vrD@x^Zd&<$(N)^ZDdS0_^XoB`0~}veUqhU{y9)c(yR@aP{#k41xqB62(P%-Khd%~^HD3nxs} zU=66g2?`9%oP?%+5cdM-4--WwTp|ZyNjZ>~SM<8(bd>D+G7FGBC-)kBKm;wTu94h! zc2ZC7I4o7OacF3v&KmuOJ@n;3$3$iZ_j2+jD`R$c_Ta4FXX1V`sXzJp`tkcqzFt!G zV6)z`^P6yd)&iXgjn<2iIOA1IO9aQAj4B=c7J#m5WlQ-vOD za9ZBq;qAu`p6w5UP4wV5FFBBA?Z1%O|La>}s;^qmUhibP?tV!YgsUE%wNqmxYgBZk zU0ubrbo+ef&TXZyVcuQ6!bYY=^inOA^lc!xfZhyy{?n3Z) z*06#3ow##14kIOWK#?wHlm(=R9EG|~P7EDEVZggfPGSnV-~nmKl9XaTcbE?LR>f$I z7>>unw0bGs9)Sk|AgAUgfr^04n@(<9g0nRUCj^ydIiLjED38E`BBQ3Zahc|__zCSC zkXD(tch&ZdbP1y0jns)$7_^Xbgh@0h>tpPo`bQ&FeN_0W>|B!q+Kmumgm{6w5unAU zBZhfhhM#f@_5@*Gjkd$F{j@RaV|FwatPBy^CmqS0LY{f$sC6YqRrkk z?Hv?SWvma_oroB(;oU}|DF_hz(k1xrc|j&I!lFS=WI$Q;;7MOtDKvaQD%*52GBUDD$jh-|WCuN} z?)~V-0RH91M#jkjlpady50B4X{YlXn$7thHte}VImx%&CR$wSqw;JLMPffJt4~pP0 z*1wU-jeC;H@QBZEE!qn2<2>ROl2A4g`S|->c?A)b-9Ii*cE4RrBsSby{mozK=Oo8< z+lA9;W$Dy#f^tC_!lWs?(C!{#K0rVcCKV{98mEV{Nw4_**{3q+qF9Mr3O+>Cu}16G z@sfsA2#-W;ABN+I_Ss|du&N`vkmZ5RJ~g}Fa(4zdZm=$VRw#sI)Q3JyXGCby$O4Lu zP&Nn@vkZf=S7aT@Aw}reHNUu=3GLkWJ>C?B<~XvC?da?%klINJc{KFA_`B%00vz9SuGbzNFV6)*pM`t&JjZNnxi zYZ|W9EoRc!!+5~SWkJBclKaO(A&1OBRXXWUT6@0BB0FQ#FhHS8wV`pws3S71uAjFX z+JpXVcygJs@gkszVE5n3I}{rmiDHyg9l>M0w}Uhn@+2ez)-Z$>Nv6z4^D2DV0A<}a z#wnAe0Tq=ZTu?}79yzz?+ZN?%MKK+!4*O-gYE`ML+;KYLt8SWuvhtY)RDAB~^i^9j zcsFViW+&Mr0RfuDOK*us^KhN~O&HGx15R}3s^|;!GTSL=8 zkbRbe;|TjmFJDA8@2l0sg!0597Z!Nc*|oLrDqi0UGPzkPwI8Sayw6w#52%3IYBMT> z7l-E*x8~RuIY6KA#sP`asse{_m@ksJ_3Z#;?81l)I3|9qIfrxkVo?W9?jHIQGF7wS z;IGa3ZVBT*;x*N>O22aU?loNVZD;kTWzv@m){T3{E34Pk6t-UHYUO0h$o`ybd@Y+J z%wXiZynTTpe^!>(H>->0ZIB&@(~a1ZI{jB{dH;>ar@x;Zcto7>{sRMw141=N#jo1k z+xhYFfUZv8X0#HTeB(*6+~IY#cJ^m9GaOfxXK8q8km9~cvSU-+kB_(3+I)JdSF<>o zWc0|Pf{h!)&NPSqRI;USDSp;cV91JSIr%l}ApN03Z<Rx%bRh8*Z zt51HL$lqD^<<*;J5n;LoTPAi-UI-1dx}JBN2~5D`*x1VjZPkZ+nhV@VTG_vSwUt!i zr6gCaHhO(VUFufBnn`cEryUz&3kyRf>aw)I)Jj~|m7x0ir20BdhCD>o*My#@lUynm zI3Pb(;OY5kgyAVpO)Cl70MrdG6*gniBq2RMY4GXkr};9{VWE?c_LUBP&X^2k2+Ndj z8|v+8ewoFPIRDhd&-zoJM(WmNZw|X6EzHMYQ+ht6`SXkYYywXw;|?=aRNVCX((|je zm6a8p0Ye`1t=5#%VaJS4{&cUZsUF`wS5tF*SK>K*+?n~QJx15H^<|6Bcp>%FzH-}R zblY*_Oh`1d9$WFM&{9Giu=l<1ecjh^p2v9{$0=C+aq)5mvZ;^X^jf*HC#x20 zJj6cw^>8b(@1js%TK%AD0Ai0b=T&hr+sPGzZu8sXS)^o;LGrbf(Z0O0GArA{q;I@C z!u?H@l_6cIz|#4AXK$!DwhQqqe!F1W+t8C9N}PwFg{Ft^$IIUxgb2*IlBRN>`d!y? zd1vSEG5$64@+ZqCXJfT;Mt`XvqaR#HnUL5SbE=i?d{u<;eBp!J<2Qj)vq4oQw0!lw zQRkzZ);s%u8k0EO?)ucO|Es(IL>Jqu54&eACEWZy0&CsVI%wut0-n-1`18@|jm}9N zj#2<$;|)%w=JA^evAgnZtq$E-#Q@63s@uJd`r%yu{J)a-BnDp(|Y z{rb;22~x1N`18(X-Aab2qO_4Wei z9*)kWd3UB(wt?2hNr}S`hQ%x;ttcy)e1Ufv#3$|KB0sW(Ya1~3cxFO)N;AK`bvSA#8G2}0d_hIz7~ZgnoR z)JEp@wsb(+0twdvjc?3mBpiCZeOv158=C$;$j-a+r z?0h#iZKT1`!iW1Kx6(6S^0hKB3*Hsw;UXIVn4{o671^I5(*qX~)r*570z2qiv*riq z=jch;fPq-IapMC04Vex}rVD3&mwDbiYpravEZ^7Xu!f3|5Zmr6tTek?ZR59p*|TvK zPVU9v$xO7}<|P7*qXjOv2mnM`>+*xi*cP$Y|(a_MmkSe50V|$lpFYGeG2kJ;lK@x9UuN&%Tz-YJM7tolp*?XAI z)Y0V|XOSzd;MrR7ejE)KJ7xUSrctyZJ{WKlaGdJxUp&2f_3C%9bX~#jVbxx0h+068 zK8^I$QDQ9kZhmfDihAG#MWI7}?KAr-7E&=cdL%QTKJm|_v*wEDuOybDy*I$NvP zbBmWhyZGac*5LRx{_jOU=$H%@0zX6^KRL}SC35-&`;Eb6%f=+4)APjI+S-P|45r6^ zQvU43t>E-@F5rT9rd4Kjw+NqK;WqJOIq-JIvW}iCXyL&DK8oN1&dG4ka2{EW z7Oa0i-a7|m0Q|0FsBZ`r-R^v*TR*;>vSQULPsNg|A9Tb=fH?gW!=1r>Zjuv^QgyO~C2 z1wvkZpvYnS&BNv#TC-iLJq(xn`@l?r45zm*qF4**?JGnP{BXA?hF+i?D5~8C=H!R; zis=-;bjADQBT{$vIY{5I{QW}*T!5)#I;0bfrkp# zrKd?@A)J*LFK>hCVE4Dne!h_|^IGR;1X6tt?%%%=+&GN?r>~A)zeXRjNIU~vGXvHu zG4dhkAYoSlk|Ah60HizElMZtP{s0IrY|}|cqREit+)Ewb<&It#m85tCC^}WXUz$1`UG;p@8MSOj~>WT*w%~111xDN3=`|iMD4q2w$BzHLyHg~ zbXaO{kt-tMTTLC=6cMr_?vxiP$0K8GvbR?)i0J5aeY#e691l?Va@XA{kvp)u;4LY6 z3*QqCd%^w-p9g^sTt-6WGB^2)uYRmu%isSrb$$vNR0wKX0DB(gg^magswI|79-MUf zc4nCR4&{b)aGQ(akS_UBHx4EWQZEsu*lN}{cIvmZ%$rBZ5qcDaJ0c^$%-kz3-cp;j zopI%cTjwX2)rI4;(>qoIsri&E**x3nY3kn2Ay4d207ArSTrZorp}i{NhtkEp0fWnu z=F{Zhy)f+0EWwQ3$U7oJcWU$GrLp8W@%2lHsUT^+fm^MQ*epfIdIvT1wyBDTL$33o z4T(0!*pKv(E`rLXe^nw&YwxSUWs{~4hh0yX{VMp`Rv{CY%M8PYY}1(fLRQ& z4n022Ve&US_!P03<^~2kMGK|UjbX=#MF28`wpp|9bvi2{^9DK~Z-j!kAP6hHLlk@J z_;8RLk`&+0=}%mS>r~Pijtf_)C4QriFKs~k2)F6}gM?TIK|v3TS;PyA)zIPiRmI#) z;DUkA37a=sIa}e({0anSVk-rrLPB<^xa}Sa!GwqoV0$nd56>F6WL4L$rV1gz8sII6 z5f6QM3m702=;;_37+`#;?|Hq=CwLP#GvR8Yc=Q8HpY_rf$Y0^}6piD$+w%GiZa%)D zYvy;hig*G8?U-alYI*$h>0Sq>@Ro?oFW>+Cz{@KTrxHyXoGbzbjVp;aZN7?>WQ#K} zUb}&>w?LqyPza51dqE!j=>(C2rehxC{gL1xf*<<^YlF{ew2NMHEUiV&$%YL@AK;Uv zRJ!(EsG}xHR$__ommF30KbZHS2Hm+)l=m z5MFWO&HPxdc9Xb-`b`sfmUveI9wAUFm@z78V%RX?txeC$8gVJDq8SwS6@yiL33E~% zji|8@)$Kxfl0l5SKKypK!8kY-_&%0Q$lWP(?3g}IK~Tkbp7kmrdYUR~;TQb^>Nx=< zkqvHb1`~(-%yg9>qCFZ48FpA+k+u;)oTh`-)(0JqBAtHf#!0;jP>3O>DGusqPB}Pu zaC#Fgn_z8lpp-_O0~+w-j)Doikm3PI=gH=^cjp`z$IiDBOar~;o(??N3O5FxWh*>A zfG9?Rzc4ZE%6p)Ox88oFd}$l@FGG|D8F5n!D0&(y#e|w_vT2qqID8O578&fRL{t@x zhI;3kAA|4)loN%~UBu=aXhYkGXrst>q*Mt5)cOIz=@yo3aFeFtp6_=)&`*zhYis5sdZRrsEKdd-c$#Z zL*2CpezUhfdBv6yXhdnE`tpPCsvGGPxXFGLv7dPxJ zP*tl^S!WLW{>eSd5(-}=U|;F%_1k4r9vYDin(+>NFDMn>fMcd-Ztmyd;W4UFnt=jF z3AdDzVCQc#29V@T%>l!rP(Yd@d{Z6cF!fHS0~=V9Bu^;^*#{AU0w8co&EC<_B0iWD zQBNMSYah;3O%|Ml-FGz<-Gp)qk~&H}(oWTi!MxjZnEK z_ypg}Pgp|!MBpRH=TL+(-ez%+Xs`UHVe6%``LTdo)AC537pR;V@7|e^@Hp*mILD(J zY$q4C*kCs&BO|9hhepg>i z!E;3$2NA-fTJ=85{tUdSDm(Tos`8wFd~$m>Y7;?e?LEyP+a}FvsyNgIgVT%Kns2=E z?bS+8j~6dqXccV&PtrSpP1cmV8FF`!BU3VGv2PMFCF0A3U;w;w?E;x!O4N3gl8rXBd5}A)Cm3B+mPxj@;t(<1K{-BO9Ui9N_KI_mGp83N z5g<+v+Y8B-i>d=*YlEm$48)N_A$)SIR`?~P4jYQL+kZtsb8+7?moDdO&tbRE$GTmtt#4KCf$oz61(>oX<}sp%gb;$E zIM8Ti(e!*N=`(@Y1oe7SFe8;*C@mnD#9+cWP?f&-!^~EUz!pL&hhn(C46}0xe0~F4 zuf0n@xmSjZ1e){MGO)6y&8-jBzM3lxFNIQ+8Ht#W>Ys-*ekZma%#pgSj|2S5Z+OsG zABg{m)wAEHlS!(mAU_}C|Fo@A!5*V>Mps8$_AoiGMCXPTcwo})zG|ipq=_aprtdf- zT%vgtYQ4ekJvUnj$kSpghQ0YezYkYbd0o>{g^LJHLe zZz>!!HI6g~53Rin_cXu9oJ^-5i)+kgLx4FqGjfJH+b7uzt=TXzl1_)OC{uK8jF)st z2>yw<1ukFrIs}orHN(STMvtENd(j6|v`@Ij+Csm$jBDhVV~N~Loa?vn0Ok+g-{=2g z^}0{N517(Ch887#c#Bjsaa{OHVVDQz4rsd13`^JGWc~hK4;19((4f8nZ;r~cJs_2c ztLDV=SkDrl5F%}YlwZ88`?vIQDOyK_5FoATd^^Txn3;`To7DcYnxU!vW!gFJ31k;1 zL?NUikgzd;TmBj&w$SK>7-%`AoGo$vsr(I&%C|Qgf``pq_WO6cR0cX9e1+&3`OAml za?Q@e(mIbsY-F^pPQ&LGBSX|*OKCTKM+Q0puHmS4I6ZV?=#5#_a5B*(1CxZllPd<) zVUuukDZ9Rq+-9vqXKjD1p`|Uxh!Z9147k3`?}%uZaA;1%DH*ms3MVH-g`k!f7oIIn zTH=)Q3}GBKcnbKA>9;vhHEyc4;R?ee7DyM|LaghAc;>LY*a=K@wZw!i!K7=&aZR zg-pl|kF98N(3x~OXbbDqsXYUvV+Pi<0SK8rPl`i$4|4O_>pTAp+)Oh$d0`Aa*ijMG{^jOq2=T&ZU%l1r0!`vDZ5jwy!|R zH=vKf<%Qy&peDD{Eufl%z?men{G&5O13f!pVUkT4Ul3lv(mclYqKUeEuyFZ#j25#5 zqu|GhZyP_kjb*?5@YRO?`21@Y1_tVD^Fib$MBRmNP0RsEicfv}aQg~GHogt5k(g64 zl@U>)iIOMd^sqjb3Y07Sdb|ibDDmnc#W|e8*uiLFdNP3=*;dr~kh1!VSuW_wcyQhO zzg&?$Y{FMkwLgTAXNl*vYmhmSpiLk5MMTLU-9JuF)yScu91B-Btw&c+ASTBk*<6Y- z??ad_OaL(ivwD#D0XX`;-2EAa>+Z?O8SK?J#ukf1BKSDy2_cCD)kVluuNrGe!& z97CcQ*uO*~b{GcT*Yo|SnB+HucDSv%ty zlHuXFPyTgB0r}8Y7=04&4?r2;As8YaM8vw6L{?acFe^FvV25Om$n?EH%#%(t=OZIg zf;SPkfsTbxm>A&_n*m?|l;aV-Kfnz_*VzW)hr|k;+otg12rPVX@-u_W+QT9M_(~Q@ zgr}z`s3RaN_Eg==UvuOyGbAEthnE;J9zpY_qYvh^fhG07WDxtm z=v1nYu>b(kV<3%9x2|9-*7bF)gyg*K#s?cKy?+`%F9?UTCeY9Yd2GB76^H6MPRqqL z^HoND6+t;ZoO;_Mw8J*9Z2+9S9E*oJ z(yAdZsN%bQ&U@Z*^+dwvM;KIy@Rl;14Tubr9>VNvlCL@1h9Lc{uG6VT`X}YAPcTu+ z8kq*MRV47{M4!REf3z0zKpcfWFhp)4YOl$2%5(cq5p*_D&dEU;BTI1D?BP*Mpy@pW zd0z_eBAaIhnN|i@qD^_OeHR9GDb>YbW!Mo2Jj>#n4>ssy@jIBmY!$Pk!z&v?^0@^M zt*ujg^S;~mELapzb-MuFJe4$y^WPyJD@Xm3sGPW-aE1ZzZv=}%9n^M$tl}(=f}aUk za$Y4GDcD{JY!5~3>8wCLdPY79fI?YF`w*k@ zZ~_~}Ubr1Zx;-NE4z$$9T#){HNA~M)x$72M29U=n=kRf>nQ{>T`PgYA`RT7_jkoxw z+15{$r_BTBHu=exy>zFF;!gPAW72y;{sJA^HGHfA0*4-!ZA4-Z3)>euxup7whe1eY zr1*)|;`hUfGzvnOaLk*G(b#pd>gHw+P zqJSnWwdUR#goi*Zx=0qAt0^(`gWnba8s%>LSLS0Muk!$^Hfq3#C&Dy+CXd-ZGeD#R+cN{{6)W^ysc>^h-o>ftysZTc60ZACA0+0 zS_>sea*sMsr?9F<{gxEqM$CfU$!>bdsciv|5I0eX!BfJ(rdcFnKR~!w&32rf5+c?o z_=bsj({QGRW%$qD=Xc?X(`e#iuXq4?E4R%_Xb23E>51qZP;Z_rD!;)5naLf>6ac0HxK}Um=%YZEIQPpLFxqJXqk+PSoVEVlP0S!F zQyc0miO$u>-{Dvwjv9&l9Y-CbMwWOIQ5<6CI%6insA@8f(1$c3`t&`SSYGlc(%%p3 zLC)!LdAT;f)D=0Vo!Z1@3A-VZ)0g0&VJ`&-zE17kdk5P);VV4v_O7JFo$3=**ps_P z_I($kFA#J2Zl0u^JXYc;g$+8;TueJR^A~l!mz9+jDPBI`NP~+Y%({hJ_0wku#!9e8 zP&XbIHXE_9y27W$^9HDGbX+={LLw``?CGS7OQBz$|3=kbW)~leRdq$Og4t+&);wF>q;tf$uw_PH57;hrboi% z1v|uGo_$kG?!H^9d$2}z>u*CdGtKS6PuFW&z4zk*p7&ea{^SLac!}j8-{tSpR3nx} zL}k?DxXfDV={X_lR^cyRtk}n49i_>3Fw}b=rCZGc08wLed-PZS7mf0Y(N+31lRV2% z3;Kat9Fe>YBY7pR&AN*i7{UdmbLrw36_kgIkL8XAY++-Iaj`Y#?4QUDIIzHqHhB;6 zfj09qAZE-tyTKxTz;cR-)A-4o;>J5yx-%FfNBBS<0&I&4;Wg4f_uIE^gmMb-$!C^b zAYr1cf_?NRmoxX0wd)iw5Oe`)D!A0deIF0>=TyxD{E1=fBhIxmm>8t*8*#eF@_&mS z;NB43Z9IDE=nbBt4a6@#90k7e3HoyVU!=!i1ClKSC zzThdk=YjQ}C2JLbfLjIAp>WTe*SK^sQ~1!T5Cq|ye+l6Nes&}=q6gYF#8y!#5A^gN zGd3prmzBQ9H|G?{AN(UX=y=Wu?{x;-?8k`1HeQrICXevY?}lX__zC2#PtnI{sji3C5=}bJ zjr4oF5B-nN{jX0hrYHl0|_QHrz{T zuIZh>@5WZ0?>4gRBb}uZ4K|5oai>ZS@~$-aXLH>9PUW(xw-+Hh^y-^+C*jt44c@>H ze4t?#Eag!7iz>{_x%$2@ip_r>GF(%YthI?0XBV~<;#rB@YhjVt;_L=7W<7Q}+Fi$Y z5C8t{iMEbTA(UHbSjTYqT_B(;$NtP^`~)o~}kuDJ*JD_!h$4P&tNf`GtQ%~&^qaHuEl-cHG_?UpH~bO zg94=eQvLilXtG>E8u&4ekt(rxxAk*VhPrskOndOb+H0)#4MAQY;H4qe^4#+wwZ3Hl7z@(3_~hI_++qNylh!GmE@V7Z+OADCr?ZfmAgru(Iz96 zd8tXMySw{@ynF+KyPgg!#d&cS|E6_haJTDC6bMA-=WA8;I&jY1d+>RFupOp-WE4NX zf1i*!UohTs*3K@=+Qud*EG!AJt{ET~eE(nw9NFdYaFtb5RGy}3=UB&qF3UUd75}@3 zn_F2&(O=uh=(Que z`6>9tVW(&fBpcpcBIB~4#$Z_*A#fc@__-P~%5G~`|^dPumU=}MTCdm#|0J#u???;f6ZWKTp)-SaIk z8+1Efxv8cqwF(H1k`G-wQZs%{PBCpJ7r`spEw9vizYpw9MiT&q(#e$7j{-u)jOp3Y#Gm<)0mim`};pyQi$E7}eHh zATiYyQ{PM&PCJfxUBp=)JUfBF9nLAW2n6C`R{B)8NCyNM_eZ6uCTUlRkDPkikCkVe zdjD0&G%n_%q3fRd?5YrE5T-7M&~K7VEzD{2@=~Y#3p&z6URx|aAqy6=AJDqt?cECz zGM@6?+HPf3!Fu+E?Aj(`eU!yt7D1{|R_VKUCWu!gr7G|4I5LU?XA-6fNDH+nkK9KK z3Gnw3-Jizp9IVgCEP5ruBCkJ7l(oHDmQ@A)(x|^IvNf@|8&N>sSYbj#9RPjS$JaMM zHqA&QkWBOceUrI8q7rjTlPb%URaH%KgnqaX`aLp| zob6bk1AFkj`}RFm6bP^CzG8~QY0sWL0v(h6(UQSMFnP(ugGcmJpcaXc z5eSV{g$b3Vm5Mq3jzvlD?Cd0}Aj(Qg(V!5r@7l#BCZ?&Op+ROQa?%*AyJP_BQv)!h;YH7IG%{!J61NX1OiAJ1r~XVDUN59Z zM6Ek}rW;bI9@qo^{{7ojTY2r(jz{(_{C~R|ARDLEB+_Q`8jdLiLF*6%KM9S$3Y0N2 z_{ZX3+Q&sco1(S8D2++aUQ00Yhl;Xt$hL*iqG2|oaK{6>z936p8HVdvo3!_NM$k86=J_9>^fTb$*07T&+eU*OdlTvC54_IrBqA&(}0a-CP3 zxEAZJ#G3f)I-i#rQBD~#dRbdr|MkYK_2=z8_WG4|+{3@pc7CxF(%-+(lJ|a^;95NM z^NMH({@LX*Ffp0fh0Ca6&0$0MYYkvOPbNAxsB%$HkVAN@?BbG-rc#NBVz{`tj)TFb z2$`m8ih5LXYVHYO90Jqs3y0h#KLLtccXRgO(($M2>Cx)~$wyLn7#jbaj;}6oExe5K zjOpXTUnrNn@D2aWGOeYoUWgN}7ohfwl1`4x#icGNQPY z{Q3SX=QK?@Jz&yB18?Pk^gJg$W|{Cz;I!WJ&{=gt4VC5(*8 z!lU}{7y8Ff_AFm>IZkw(XA&m2h&wJ>hn4)W%j+0+D8FN+=%xR@m-?}N`2CN|A={S! z(*MUp_0hC*ilnOf*=1VMh^|iDOU>zI4*WBR`+frVB>QzrX(ZjtqoC>Ci^X2AJGNG# z=&J=eFVo;=B!krJLg{PAf82Jp0p+N{kb&A76MRkJ`+6Z0>oIFu;NLSI>dG+9%t+_^ zd)V{u^Pn-ONS3#kzh}qtg%Nw{`L~H5%!LSEL_`Gq2O+UlmBs(_ltTc8$j!`9vOy&x z!-|n=1r`zcx%^J=KTBodH~+Yrq$MEW%qDFUuob{sq3eOBg(5=Eru0i?9oC5eUr21A?woS1?<-#KpBxw#c0w1FxzvRn%XI?g*T+ zUVf)jEYflA7ov7mAHjh8+`Op(Ge$|6*~-;`6R{rx0o#GE8n^`*x_!DvFPVS>_rvfn zk1v#m?C>s*@@8>LaB2qZk4=za+qS15r}R{c4c0-tUqNef*0!P(#{#(VDWt6%xib+F z4R=IN<+LVjz<^(DT_fw~&!e4NCwu{$a4xk$vmPlk1}Fgz8ziznb>b55{Oq8+5ZLL* zWM%ilqYNdEMi5|n#mCSKp#VWU5b^#-8--7e+NAyqfx4ZMD>)BkI(_j>&%n|r2Y1|wQauKOC z;#raT$AC{kBU;m%>ry+md?7I+{QEUfPn`melnEkS!D!7%kReo_8bWcN1Y~cIq-4uH zr@&iv9TZ{8$~@9~XCDQFR{}cJKvZgZQ#>Jb8mO*AK9A zH3^5Y(UQzv!xk zk);{sPj)`E9nj2oNQYg!0Ybb3)_bO*m%ncH&9;#VDg^;pmg=1f+y8-&u6P0@D?dQK z#D}Q9bl`J(@!j(Z3R6FE8u+wZ}w9`yOm@hzU6R@YfzH%P*5RK{#sY-T2`u+|WWBm~qp1tU_x12M~Ab2k=ggNmwZ z!{-**{~>4`nu-k2x_F?bsd2?%!T4izRpCHpgqfiRVMznL(YHt?tab%;&&S_i4WE0Z zN@83&V!gVm>J#_*=~f>X4oQlRD6ckHWaIzgt#b_YXc}Ut%)T$U{G+d+Ao1M`@<1Ty>B1p z;^D#k0D^{Q1+}rtcVj`F`Pgrl3=O;Kmlui1Odmr(@eQ-=f^4zl$B!ScK)*rQO1Rl@ zlvWb+^TmzMpHGO4l!m`QpIEfHLxGOO=%*vOWO@~^KB#ONA@2Abj_%2@APo(vd`y~} z#l^*SBmXdMdLBpk$f!n~D<#PeNeA4<^IAji);w-;9oIH*dVUN)nPXsqA4jO4+mn=R zdddIx?e_bXGDC(L0kJ4s?G+R}3$gjCRjZT$oDkK#wsU``UwEAxIU2ARkj zi4#rYixW)X#?g zi3thE=_My3ae&?r3S#f>GkFO=Ag7_%%Xudqxfb*2p>PrglP!Oi3~YtuBe9|3^dQ-{ zx_U?pgfM^zl5rKV@l0ahdf1YF!S0h~xdw-xZum}hVwWQu z9MZyt)V{80j>_B7*{QT_|IYZ@MBtjtgKvmt8|=0pTIT{mfYrb?MBQdy64(iQvfw1X4t5n zoX?`gbVt$E4Bz)&rQ0C%;z17|CL;^NobC-$)2YV6$J0A?=>DS3Lm<}nwm1*YRvQAf zj|HKz3yml0$TkWTLart`tq=!;YB$(G4Is#F*|BfeZrmm^-lw*<-?0s6+;2D!^Sf&N zky@rZr*yBbz}cRFY++zm8+p9L6eBCPA@32e8zU1vwlF?@Psy2~BP5N-o}b)Oh@+?< z30{L(xP6ObJmERu#5rK0@DR2$iEi1?QH(-1S+h4SKN>lm+&$9W3`h1}Ld9*_L2h6|JO%_Pm z$NRzX3ay}b@7NLLRD{?EBbI{Hv=@W*yPM3(?=WI&s7C>2y1_)3;aSyfddYIEhQjcu?SB~b-ykdeE|aHBYJ6wn9ka+bXM z0BLJCLPnghzqa+r5VnXb^dv%AI1lAXaKPp-9*xXvuduK>r1ZHXm1692aA2$f*vsos zvAoXzc17pmv=~P}y*oI{O+n5eff5mj!<$xAm;Q1^yqEn*#liV5vvkB_4Y|uovC;3h z>-*djw6zeS^C@iNIEI6sKYu=o4170YBW$5w_{?}LlCW)6c3AKj)i})DWUzt5P!#`I zRyI2oB|Urc%$Y{8S<>JELl!J{THt#b`@yizh-s=pJv|e0fS#&xTZ*+MO92FIGUf0V6Abw|c*Y>`hs975B>dd~4g#9{AK>4Wv5FheK7@r!K0`v? z_%hXNSLVg)!`LC~n+Nj-C4rLe-LvNe0@pBMt7z;ZS87im3|-fBfakzN^sFFzXD+5G z6+**3a1|vx0hZnDwRa6WBsagTr*^iKf9<<2q=4fY~pYTQwV1_v*gFzwT3l5Xg&v0663b<6& zZ?^>jfdG(oUl6OAV4^6%f+hl_Q4fOFI8RTSBT7&G(ITM7u*Io&U;7ucG$F_{E`USC zgl{Xz`^>LSXtP{N#N22+>nyXyzRyD_npl$f1f8GwQwyg|4biZ<1X8rs#V?1d?(Z_h zIo-J|J8{HPcN~k5kw7KYDB;9lpD5X8|5bmhxWlJ>j{|mdmw*eIgRH`clR*Zj6~arW zy4?Eh%rclF#D@nSl5a^wgjRbdV0Xut@Iyy(5FxYie#@4xU>peoia&kAObV0esuj*x zMl{(WjWv8hKAM&FFS@TuD@s?)$5W88kXTXF!ZIoPjQrnT zvL75VY8q~;7VNd;Y_g6)r2T{d_4KJ_6pvY9+)VizBzBY{=b3fXRNQ`|p%$**{tA}+nf)x|I6I=QLF&4bEn2h45NW^nb z2vr)sFaSoMwn*Y_j^ZpxJVHa(P$N0+L2{QyP9&fTh} ztatQsU#o|S-n)sJ1JBv2bJ$s)h=pEcz3)daXe=3W#Nv*;Nuu9Gp|XV(0TP1k--i zu!Yf0zb~+YqPFSK1%?e?3`seU6M@Pq-4}V|5sw3auZ(n`jZ^_{~~;<}153)P-){Ay1j(?Z+8rO546zdeqZXMdYmc=#T!Lts*iqoN*i7162}B zRz2TzBGw|S?&YqPy+^II! zwPdp7bL#_pIo;oP^J{%rHRH(7FOd`DqlWpuCMJt6u5&z95ys0vd3k#u?s*~L_3K>> z^PD-^Y0@FIdo7%3I+r2bwfiw=z{!&zb58~ZS$39(ygRhZ$SAn1Or`afW(xhl@WqHT zy=yfVXnrd#(BS?qw6`Y0MP}X0M`IeiN62sP$SA(FescMOwan60tGEvxI^^kqe`%-b z9Ubi9Jm}z1eUO`i)AyLWp!;9uHe(M(%rP<|?j_-A?D zA#3Z3$vlm@fB&MFF8o^IO|Sp$t>_iSUvEQS$6WT)zti@jC_TUJg5?6wmGk&--@niI z;aS{6td6BI)mJ=g&bTi7a$vLQ?VXY_KT~Up>@1p_LX-0+_aAX~Ztw24If&6mKunjcvmwK(tpV!Ewep%fUTNMl zbl>YSCqkV8cWuJHW+e2-Zauw#48v?eEK^GB*7NHQyFBIR8#t>R`PRKP{)NT`Es=}? zftc#qKg1nJMVp@-GtJK$%+Gf&z&qo*4&)k}94-I8?nj1h+CXQRRN355n`M@+TgPj7!=!d47Q4Xu_4A)SduH2oXT`Pc zmjd_PJ7hjSGDP{gw|UIm79&~FU3FH*t7cB>}W z@_Ct>n1uWL)04~Cx^*k1z2Dno)T7B~+xcxfmT$XaqUdpEZ=CDUxK(afeYxIR${eT9obh+-Z$iyTZ?Qb@V|vSEq)=?P zv^WkM*A4cB6mE8oRl#Z|n_gzUL@}3%OV1@%??{P0N`I!|e=SL-mHXFR#ur z$TF^IX5r$jH}_wvlx2{dlfz+`yP%??V!4>u%hsWk`}d8078GpJzo(N?pWh$fa;@O( zx0elq2Jds1c)i>qZ&pvcyWbosH@X+ALW45`*bLY|@7{ z#XE6v>cr`yBC4qkx-2Wc{NclgUiroHo&k8g-S6Lb;$}U5`m}!bcHeISMT1+55`)g| zc)W7uN>}duXrFVLx9{G4y+`suhV359A3ANb@)FN}3*8a=t5*cACw2kpOI+7#ZBJji zl=1U%b+z~r6~`V%MJcJBUy4zLUf8aFx48P%s*U1vSsEJ~dpWWLV48tCz~{P3|#qA3uM-uIj79!GrDX?bOVfGaH+mdv|nS@oH>p zDr;*q{Zbq_f|t(Ur1L@BgRWjIXn9&CntZtI#IRd)02gruPL`)z^2hrSKT9`{$NY z^fZ^}U)l;Yj>VrnYdKid-`DpdL772r{d(mzy|SvRS+f_cej&eZ(8-9m@{*M z6H=e8kdRQ@zh6XFR@Q0shXd}&o}XiAaQEH6EPiF@n(|{=Om%IJxvJd8jlGL!FI*cC z78X`IX}o7o!$5`*`IvMMAdjeST+IXbFP-n7Ub=s{iwU3RB04&M{`~vClRhawy88OU zA4M#DSYJOcV&S^i$3B1h#KOzVi;Meec#M3A>_+k-wt8aoZtN?*vGL>1ojbR9dTuz> zR`Bc9?m-6!hmMaQXWfS#LA>*;VJ* zz7!w*Dky1M5R6jS@u@!J@#DuYde34(iHeE>4c*VnOFU3_jTFa=YwVeTeOBAQW?Q^? z@tE}$($`Z1$wlb9{rtRl>}T<0ecagft5?sB+WVpo)Fy3a9UdNDiY1g?@Quaz-l5qW zH$E^vb#V$10L3L~*4pLX_Z$*?c6ojBu}#0id}rmEoI1a9Pgz3)FP7-$41=r}x2(4< zkJhC8fThq@YH#e_IPq=jD+qJpQ9fRpWf1o2m7egjWgX=q+;Yc$NH`xkGBon|o%0>r zT6!NJAKT`;D}hOB^Ih$i&t-{9np#asPt1S;T@JP8pR}wzC9q<}EYxkl2+v;J_S!_% znZu)_58u9B!oR`AuduLCqn3+cM;-l}d`ec2Rxg;13qHXxlN~ULL1X96hCPlpHbDsq zOBrX*Ox|^Uhi!fOJQP2*(DPH@RO=-6>Z)DZ+J5LC{8;jpiK;<^KI8Xta+E4h@z%UA4(u@?AAkxSlJFN_hV0 z3%RlPfpeoGxw5GF_&%xeT#R(2gFjcC3=arkEaaqsU3==T&+#1WIevJVx_}h2lCB4I1!Lc;kG_jGd~yGM8xCTsTb<(ePlsJ zm7_TwY`Qb6`us{&Wo5c<=k-i;7Kam50kmNev}NjB4Jj4oeLQ;bpoEu~mzkyIiPNV! zu$1*1eXGtav#q-}8)dtrzdvG*!Z0;s#*Ey#E2GTQ($e_kJy%;;SZHHO?TFi8j=eUF zJGYye#!Akn@d`1lb!-byOAR?k3V5szdM@GE`9z}3i*a`LI<0noqh-h8#FiOM_Gan} zMyb6DyB&Vv0$=#Tb?lap!jE6MvZS-K(+s;{js0uBKHuR1bC)k|{6gyCevy%LMuvKW z8cdJ%rzOt{wo^gfZS(lRU;gNkN^)&Go@M3htUWSTk2!egr?yL~`m0}2belJCmh<=~ z3`BO#{%rL-W>(gRQ9@hT4%KDtSvS_ZZ&F29mn+}pqrZK_4Rfsdqg@f}p2+VoHx~dD zaIHqGq7u*>4KlV5+C84D`AvuS+nEa&f`5JgAOz^==H>>NUxwW)aJK4`+L*ph%s0zJ z|3b{F&#jM|<-hd8K}SIpM!%RCUiKvl;V)ij?;Qm!yoox$Xro(AyW2kB@iht~Jwj** z=y3(#pKUZM^76>5jFmsO_I*w4u4~?SM(D&D6RZNalj`km+BZmIBT>}FwGN^9UP(I1 z>VjL;rhLMMY<7rra_fP5&;$kWR2ME3ahvE$eCyE-rs@!y9I00kbZw zb6mW?=7PD?B@}4^F)_`1nYwB1STF#54=XBC?y6kZL=g#&jNAe)Vs34{%uUWZRZpzu z;u==b9hd#ip5+dlv*gs{#~Mb)7b`1uKK+uh`4`INN&}P6u6VDud&SJd!}Ivblb80- zpFHt@@ZdqI1Fqosy0)VXlf#wRy{MT=rlyPAd`2C-zEz1bW!D)jpR2umu60vZX67(m z)bbVYMTCSHz_?L5v1?|NxAU4FRqo4C6Q~$_Vfil?VEM%B)vq^InORw!e0-@356#}R z*gx*{=>+#TC1<~V|6YB0V2_azMSU99=N2~Sl`<{I?v09%XLomZ_xjoDzJJf}t#P;> zON-)|H}52FxWMw|%zN`)O3y6Yb~+{|NXGIJMYVZ--+t7?Ltw*(1r%Y?<>loGsOb6C zjN~enPcVH9rB}P=0v4+kziEEtVtJL`*I8fd4fiD;?s{YqGzFm4_NN1O2hLs?2ykG5 z$N#vdMomeH0;Hd@ZrwUc$&#)+DOs`~L zB0T~V)Y0dhN1+8ggEEVKj5_2!Xl~dR!YjU{ZB8R z+(gl5+@E#9DV za2Pr(w^6>!3T#WZlPbqilJ4KXAIwj?2Aw>-Km8imf9Ag8#gw%DYl%A!%?905?+p$X zLzUK9(~|GX`u)T6nN;|KH7p>0-0P=)wqVkAOLWOlkSc|VVax7!?@ECOx+)`iH%@gJ z!6Z%6MMKX^?K?F&@v|5d+$hJ44sE}jou+uC>XM)CkJa<>{j3Y?kBGFiwr)N}``M}A z$T!nPTX_F0j+NrubX3}N=+m-8zXdOK3mL!18fY93m-vp+85$aDU6#}7bE3UBoHQ5C zXYul3zLTSGDYA|pmX<0{f2;6He5+;iczG?clsFjaPB6_@xp%1b&sAxXtGfE7cyh5} zw&_U}0K)yIMXz*OU@EZ=bZ(=Y7Bi@&va(#7DZ0}ioqh^URdaZxH#;gOW~QQ|V!?1{ zm_?B4)S}Q^iS8(0K~REaB|D&_R;=s{=kTk;Z zbFV*th-v<9kXwE#ai z+Vbb;R*mi338{H>ieKDKZtAD1iGa&Q(HUp)pk6Xk1;5^30>R+={e%VU@B|WBS`z>5@++mD+R2jw%`Gcu2ONGwoB=uIW35(%rmybKvXO<0xP%Dk`VX zozpX)1U11cN*+FBU^z(-L4qJw`xVA#Zm9;bcRYy}M+fLirKZ+bdW=K`d&%7YbDIte z4SjLXao_#?d<&GBfp6c+z$CzMPBhJl7v9Xlm}#8LQqr}N82~wIikE;?6ng5g1&4%` zf{{q?ui>MVAkIOvIF80__UToc^+@*a+W;b)O0f0N5N1&L5@}CQZ%x{9MIizmMk!I- ztUQ==`bOvpee#k?NKIuH-5Fng=Rlo{0~o!zxw)KkcW|kL&&Ws7fWSa}BYMS&VIfk) z(7DW>oLiBTlOuh9`@i(#;n384^yBD)gN-?K{!0^lCnua-T&xb+E4hACUGs0^rdI6P z4g1&#Hv{r+X=xd3YHewOMq=S~iFAM9FuwK9!bJKYU2$yqD>~kVHTLIA9g>ohWo({Z zmhFcM3KG0`XdiQ|iI-P_&iI$N#gSKhM$p?!>g%JAXuOiP{H~fC^iOHk6YXXD-E3Sy zDod6DEB2z-Xg`p9j*^+#Qoi0UUTr;d6(|&6CN5}mGL2iI1Ku>cm;(L**BV=S` zv{YPtTeiHoI4fu%)4i_)1Afub(QV7mVz z^Qc=yN@|Ych-@YC`xVf zX7hJXqK)ny;wKE#{jE1Igy#IjHpil0*V-6Qd?^~0B$a;_x5&~pYvyfq>nkZc$qIx? z1UAlD{(h5V9~7y@Z+B=*X7es#o!U1^&h@{l87Z^I9P|6feoF3tb~&V`MvIY=(F{L7 zf9s68y1Jnq0|kYJH;?^1NVkR(2iC+wk?{NnE11+#8HKB-v#xe zO4>_L0EL#%4y4_>^I#+U#aFJJ%`0i*ck<*6CiX?kr^{I`{0!MW#Sbar+Uz{S7OO^F6~m~5P4s;nfK zv?HJ(4)@=COHp9Ayz3Xx9&nRkMui`CRtK(tq96!>-lGD(-p{N?$S~v*>@1E&izNQs zl^u5;%(|MAG6li-<7*n@<&RMmr23O4&lcKEeS@f9Y4uTbHqYbh_b9l3Hp%nGS~IHa zI6Yq%4BM%lq7rsqQ4rih>tw>GaCfkxaJkAHj32uL#(UMcMN{4lk*-~4NW5u|LY7|;*5g14wu|J?ibzu_;LUZ5i>@17zMWyJ5l$0n?Gb?D1e`~0%joRVEhxu09 za$H<}AnCyorK(mYpI`5IZ+ zzDVHwRr}jJE5dSebBQn}SGO_tRqQI8fq@QH^naJ07s}IjQCJ!Gf7Z;IGoeR?@iW!$ z!kT5GNC|h&v)yI&`=PQtKb2~_5j%=nx_Y(V^j*4|+%}iN!qT#%tBYab!i5l~mabTl zrrYcQB?A&IS%hz>wAa=)HeD}Mwo!hN6oMDcrl|rhufi-!umCx+-9bY-UZw3Kt|Eko z&nxVcY&QJG`m4}AZw z3Je1;F9-a_`ChHsUC%!@hXa@T)GA$)ubdZNi%=3OjUf z1ZFrQS6f?qVU^8}*dHiOrO<#JOVPV_02WaX; zUjqtSL>9^CmielIY@8c~J^hWd)V;hmjr{0m6&Dx3`7lvbdfE{E%XDo(U8aE_+gGVk zpBvtaT3cI}wzd{(O~S701Z_k~IDKP#Mm;?Rlk@P$m&@)Pd~>VD4e*!cWRli{=;(Qh zOS#TnyvP!(6^NQHqsUe9{M29G>t8=Aa>aL@5274*?%q`gu;Sw4a&Z7`M>S&lvhwX+ zhdq}!y0b&E%&&YqIpI!P5Pmc8*0FXsokuY}3-p zbZUmjdQo91*HdseI*N{tu9Hb+>czr3V{guVng_nd{u2(%7%;`rm)C zbm>y17A0DJ69zv_=VerW5y95;D(&oaJJ`A~j80FAsI~BHjzgw^i6{E!(!plyS(n8y z6Z89T(BWzX`7F&)x&k#?Sfl5o5nF<1qE(R}NLASMRv*N*yS8B$9fr~X(h1#u8qY;_ zlfN^qO7(-jIK_}{X_t955+D8jXb4S+h&qhV-4J&rw%87R`(q3wh&WTT-*epp-e2d1y`@loKKxJOkCG!1}|@%r5W$S4PNB~ia~ zDUTr5f64^ZQpu<&)GjIg_{)X`iv9 z0AC4c=SI19^X?e0L@}^i@0=bAnd!3pF&=6<-lMPcA#7SF1}y&@Gu24>5q0It9C*4m zHXkmsoYh*sY}pKmb^f|(YEV`F(3EF4=Wg`-l>ZNAshj3a)C;&Lo-W$DZ4+v32Vci@pYVth`S*kmgygjE6@H&a2J3d- zJWwYB1XuRx(X|$z|7r?1L{zWp-gRgWynJ~PmUCZA-t88juV26B^39tc_V>upUqrbI zUhJD9!qU-1X^rH(=`nN@=uP4+Kf$S*=pQdf#SP!re+Fv~co`fc`60RgXcD>P5n-dis#OA87l?^b?4R-X01J{j z|J5zR{?|(Gz#E$@<^T+h_YVufXgM7lJBz{(@;hyrAb^fhD z>9p!2Oh9qWpTGOFH619WXEjhz_AkH3-B{VvD_NxE@M}FAxNx(<-qx;N%OuMFTV#9! ziRx4M867&%r+^ge!uhXgjY6-NRITKzd>njy%bkU3ZNQZjT2b(WMT$O){%n)_3e=!k zq;XVL9mh^P`BMUZD0mHme?ERm7@e>OF=oJM zs00|s(~L>)Cra&^n9G;Llad5iA8O%ydTAZ+pYnrpd!|5Cit}`p)qlRh9Wpxgr*i6n z5^t@3@AzH6_@^kojw<0l`OIcG5=1)NIn@8Wr+LTXAC~bK1!kgj6fp$}VF{Ykd zr&;wUQCzR?kG?l2z+j+T3Q9<5O{0`g%kX!ySXu_zrn9M|{kaY3=xWodvk!D-Vaw<7 z^2BuS>+hHG8g}|~;rGae16)+b?DLsL9fj7~L4*$4(o!4Z#dn^C%*Oi9ZG~YX+b_09 ztZU<#e#V|z|JGv4CidJtsEq3;Ad8)UgBgsv+_@{F@4`kV>ci>kcSIM5a8)s_nVUj` z@x$s75))&&z5i($Ov?5zUm^zvoWO7^%_d>AcI7shKHTG2c(U&LPRoJzQX-x|yP~+S zI_lCocoksXa59-FG@Rp88*v`3Pmdd7Bg)9g@U1(v=u!B520SwmMc{CD``4K=jguMK zMP;l~1%60Mlp=lryF(S1d(-9POXE{5W1Bn&nX!eSIx(1fyqmZ86jbK0b#J|Pb@$Lf zMa_wnMmjx1l!P7en?m5meQbi`i?-y1MSh}r(Ryb_;89P9j*gDTBJX2)l_Y{TvmVW{mr7yVh@VMn$O)UOze-p>%G0g(8MIOAsgP%@W8`4D8z4Nd($+p1a(Bbtl{zH+2}qZZ$)F-|6YIpN@JeAa>enMH{?DghuF0a7u#&< zqcvwhvB)$nT!4KF?pl|1>|0*q-7_Eb-&`x`pY8DTPJc!4^GA=EG*e!hwOmUw$lzSE zBofJkGUVOVBR4-nAoj2B_E*Lgtoip(f`@NrZhky7Q=;$({&oMsgM}@RT3cIFCn&7; zDgD#EuaQ$yQc^$ovfV|Hkm3U2@PEHoGS&*8#)jSg2iX(a_NSqli{~6)kv$ciKnBEH z_rn(8c|E}UzU);9YDPdZ`hrCER>})5H zULqk|6tPWJFu^2a9jwfUfwLb1#>yOduVuA=zu?lP)C0Hvm)p56#K+%QSG5lg4hdgq zT~XkNB_spze-b%_WH3p%h0~w2>vyXOfuDP#7Y1PUox*QV#7Q>7PEL&WD#4Fw-;YeE zrU~|?Wd;OgSHaUe-XwzbYCD{Pg4V!tK*{b8A5>FxW!C+7;&nPiOE_rBz7NUur4~x_ zT8n*`P%jERj!csc!6VM7cnCb{+b@w|(u=x%dzD|MyIATWuE%#E;{hiU)DB(>`l