static const value_type& abcissa()
 {
   static const value_type x={
     SC_(0.991455371120812639206854697526329) ,
     SC_(0.949107912342758524526189684047851) ,
     SC_(0.864864423359769072789712788640926) ,
     SC_(0.741531185599394439863864773280788) ,
     SC_(0.586087235467691130294144838258730) ,
     SC_(0.405845151377397166906606412076961) ,
     SC_(0.207784955007898467600689403773245) ,
     SC_(0.000000000000000000000000000000000)
   };
   return x;
 }
 static const value_type& weights()
 {
   static const value_type w={
     SC_(0.022935322010529224963732008058970) ,
     SC_(0.063092092629978553290700663189204) ,
     SC_(0.104790010322250183839876322541518) ,
     SC_(0.140653259715525918745189590510238) ,
     SC_(0.169004726639267902826583426598550) ,
     SC_(0.190350578064785409913256402421014) ,
     SC_(0.204432940075298892414161999234649) ,
     SC_(0.209482141084727828012999174891714)
   };
   return w;
 }
Пример #3
0
#ifdef _MSC_VER
#  pragma warning (disable : 4224)
#endif

#include <boost/math/special_functions/bessel.hpp>
#include <boost/array.hpp>
#include <boost/lexical_cast.hpp>
#include "../../test/table_type.hpp"
#include "table_helper.hpp"
#include "performance.hpp"
#include <iostream>

typedef double T;
#define SC_(x) static_cast<double>(x)
static const boost::array<boost::array<typename table_type<T>::type, 3>, 8> j0_data = { {
   { { SC_(0.0), SC_(0.0), SC_(1.0) } },
   { { SC_(0.0), SC_(1.0), SC_(0.7651976865579665514497175261026632209093) } },
   { { SC_(0.0), SC_(-2.0), SC_(0.2238907791412356680518274546499486258252) } },
   { { SC_(0.0), SC_(4.0), SC_(-0.3971498098638473722865907684516980419756) } },
   { { SC_(0.0), SC_(-8.0), SC_(0.1716508071375539060908694078519720010684) } },
   { { SC_(0.0), SC_(1e-05), SC_(0.999999999975000000000156249999999565972) } },
   { { SC_(0.0), SC_(1e-10), SC_(0.999999999999999999997500000000000000000) } },
   { { SC_(0.0), SC_(-1e+01), SC_(-0.2459357644513483351977608624853287538296) } },
   } };
static const boost::array<boost::array<T, 3>, 6> j0_tricky = { {
      // Big numbers make the accuracy of std::sin the limiting factor:
   { { SC_(0.0), SC_(1e+03), SC_(0.02478668615242017456133073111569370878617) } },
   { { SC_(0.0), SC_(1e+05), SC_(-0.001719201116235972192570601477073201747532) } },
   // test at the roots:
   { { SC_(0.0), T(2521642.0) / (1024 * 1024), SC_(1.80208819970046790002973759410972422387259992955354630042138e-7) } },
   { { SC_(0.0), T(5788221.0) / (1024 * 1024), SC_(-1.37774249380686777043369399806210229535671843632174587432454e-7) } },
Пример #4
0
void test_digamma(T, const char* name)
{
    //
    // The actual test data is rather verbose, so it's in a separate file
    //
    // The contents are as follows, each row of data contains
    // three items, input value a, input value b and erf(a, b):
    //
#  include "digamma_data.ipp"

    do_test_digamma<T>(digamma_data, name, "Digamma Function: Large Values");

#  include "digamma_root_data.ipp"

    do_test_digamma<T>(digamma_root_data, name, "Digamma Function: Near the Positive Root");

#  include "digamma_small_data.ipp"

    do_test_digamma<T>(digamma_small_data, name, "Digamma Function: Near Zero");

#  include "digamma_neg_data.ipp"

    do_test_digamma<T>(digamma_neg_data, name, "Digamma Function: Negative Values");

    static const boost::array<boost::array<T, 2>, 5> digamma_bugs = {{
            // Test cases from Rocco Romeo:
            {{ static_cast<T>(std::ldexp(1.0, -100)), SC_(-1.26765060022822940149670320537657721566490153286060651209008e30) }},
            {{ static_cast<T>(-std::ldexp(1.0, -100)), SC_(1.26765060022822940149670320537542278433509846713939348790992e30) }},
            {{ static_cast<T>(1), SC_(-0.577215664901532860606512090082402431042159335939923598805767) }},
            {{ static_cast<T>(-1) + static_cast<T>(std::ldexp(1.0, -20)), SC_(-1.04857557721314249602848739817764518743062133735858753112190e6) }},
            {{ static_cast<T>(-1) - static_cast<T>(std::ldexp(1.0, -20)), SC_(1.04857642278181269259522681939281063878220298942888100442172e6) }},
        }
    };
    do_test_digamma<T>(digamma_bugs, name, "Digamma Function: Values near 0");

    static const boost::array<boost::array<T, 2>, 40> digamma_integers = { {
            { 1, SC_(-0.57721566490153286060651209008240243) }, { 2, SC_(0.42278433509846713939348790991759757) }, { 3, SC_(0.92278433509846713939348790991759757) }, { 4, SC_(1.2561176684318004727268212432509309) }, { 5, SC_(1.5061176684318004727268212432509309) }, { 6, SC_(1.7061176684318004727268212432509309) }, { 7, SC_(1.8727843350984671393934879099175976) }, { 8, SC_(2.0156414779556099965363450527747404) }, { 9, SC_(2.1406414779556099965363450527747404) }, { SC_(10.0), SC_(2.2517525890667211076474561638858515) }, { SC_(11.0), SC_(2.3517525890667211076474561638858515) }, { SC_(12.0), SC_(2.4426616799758120167383652547949424) }, { SC_(13.0), SC_(2.5259950133091453500716985881282758) }, { SC_(14.0), SC_(2.6029180902322222731486216650513527) }, { SC_(15.0), SC_(2.6743466616607937017200502364799241) }, { SC_(16.0), SC_(2.7410133283274603683867169031465908) }, { SC_(17.0), SC_(2.8035133283274603683867169031465908) }, { SC_(18.0), SC_(2.8623368577392250742690698443230614) }, { SC_(19.0), SC_(2.9178924132947806298246253998786169) }, { SC_(20.0), SC_(2.9705239922421490508772569788259854) }, { SC_(21.0), SC_(3.0205239922421490508772569788259854) }, { SC_(22.0), SC_(3.0681430398611966699248760264450330) }, { SC_(23.0), SC_(3.1135975853157421244703305718995784) }, { SC_(24.0), SC_(3.1570758461853073418616349197256654) }, { SC_(25.0), SC_(3.1987425128519740085283015863923321) }, { SC_(26.0), SC_(3.2387425128519740085283015863923321) }, { SC_(27.0), SC_(3.2772040513135124700667631248538705) }, { SC_(28.0), SC_(3.3142410883505495071038001618909076) }, { SC_(29.0), SC_(3.3499553740648352213895144476051933) }, { SC_(30.0), SC_(3.3844381326855248765619282407086415) }, { SC_(31.0), SC_(3.4177714660188582098952615740419749) }, { SC_(32.0), SC_(3.4500295305349872421533260901710071) }, { SC_(33.0), SC_(3.4812795305349872421533260901710071) }, { SC_(34.0), SC_(3.5115825608380175451836291204740374) }, { SC_(35.0), SC_(3.5409943255438998981248055910622727) }, { SC_(36.0), SC_(3.5695657541153284695533770196337013) }, { SC_(37.0), SC_(3.5973435318931062473311547974114791) }, { SC_(38.0), SC_(3.6243705589201332743581818244385061) }, { SC_(39.0), SC_(3.6506863483938174848844976139121903) }, { SC_(40.0), SC_(3.6763273740348431259101386395532160) }
        }
    };
    do_test_digamma<T>(digamma_integers, name, "Digamma Function: Integer arguments");

    static const boost::array<boost::array<T, 2>, 41> digamma_half_integers = { {
            { SC_(0.5), SC_(-1.9635100260214234794409763329987556) }, { SC_(1.5), SC_(0.036489973978576520559023667001244433) }, { SC_(2.5), SC_(0.70315664064524318722569033366791110) }, { SC_(3.5), SC_(1.1031566406452431872256903336679111) }, { SC_(4.5), SC_(1.3888709263595289015114046193821968) }, { SC_(5.5), SC_(1.6110931485817511237336268416044190) }, { SC_(6.5), SC_(1.7929113303999329419154450234226009) }, { SC_(7.5), SC_(1.9467574842460867880692911772687547) }, { SC_(8.5), SC_(2.0800908175794201214026245106020880) }, { SC_(9.5), SC_(2.1977378764029495331673303929550292) }, { SC_(10.5), SC_(2.3030010342976863752725935508497661) }, { SC_(11.5), SC_(2.3982391295357816133678316460878613) }, { SC_(12.5), SC_(2.4851956512749120481504403417400352) }, { SC_(13.5), SC_(2.5651956512749120481504403417400352) }, { SC_(14.5), SC_(2.6392697253489861222245144158141093) }, { SC_(15.5), SC_(2.7082352425903654325693420020210058) }, { SC_(16.5), SC_(2.7727513716226234970854710342790703) }, { SC_(17.5), SC_(2.8333574322286841031460770948851310) }, { SC_(18.5), SC_(2.8905002893715412460032199520279881) }, { SC_(19.5), SC_(2.9445543434255953000572740060820421) }, { SC_(20.5), SC_(2.9958363947076465821085560573640934) }, { SC_(21.5), SC_(3.0446168825125246308890438622421422) }, { SC_(22.5), SC_(3.0911285104195013750750903738700492) }, { SC_(23.5), SC_(3.1355729548639458195195348183144936) }, { SC_(24.5), SC_(3.1781261463533075216471943927825787) }, { SC_(25.5), SC_(3.2189424728839197665451535764560481) }, { SC_(26.5), SC_(3.2581581591584295704667222039070285) }, { SC_(27.5), SC_(3.2958940082150333440516278642843870) }, { SC_(28.5), SC_(3.3322576445786697076879915006480234) }, { SC_(29.5), SC_(3.3673453638769153217230792199462690) }, { SC_(30.5), SC_(3.4012436689616610844349436267259300) }, { SC_(31.5), SC_(3.4340305542075627237792059218078972) }, { SC_(32.5), SC_(3.4657765859535944698109519535539290) }, { SC_(33.5), SC_(3.4965458167228252390417211843231597) }, { SC_(34.5), SC_(3.5263965629914819554596316320843538) }, { SC_(35.5), SC_(3.5553820702378587670538345306350784) }, { SC_(36.5), SC_(3.5835510843223658093073556573956418) }, { SC_(37.5), SC_(3.6109483445963384120470816847929021) }, { SC_(38.5), SC_(3.6376150112630050787137483514595687) }, { SC_(39.5), SC_(3.6635890372370310527397223774335947) }, { SC_(40.5), SC_(3.6889054929332335843852919976867593) }
        }
    };
    do_test_digamma<T>(digamma_half_integers, name, "Digamma Function: Half integer arguments");

    BOOST_MATH_CHECK_THROW(boost::math::digamma(T(0)), std::domain_error);
    BOOST_MATH_CHECK_THROW(boost::math::digamma(T(-1)), std::domain_error);
    BOOST_MATH_CHECK_THROW(boost::math::digamma(T(-2)), std::domain_error);
}
Пример #5
0
void test_spots(T, const char* type_name)
{
    BOOST_MATH_STD_USING
    // Function values calculated on http://functions.wolfram.com/
    // Note that Mathematica's EllipticE accepts k^2 as the second parameter.
    static const boost::array<boost::array<T, 3>, 5> data1 = {{
       { { SC_(0.25), SC_(0.5), SC_(0.231195544262270355901990821099667428154924832224446817213200) } },
       { { SC_(-0.25), SC_(0.5), SC_(-0.231195544262270355901990821099667428154924832224446817213200) } },
        { { SC_(0), SC_(0.5), SC_(0) } },
        { { SC_(1), T(0.5), SC_(0.792745183008071035953588061452801838417979005666066982987549) } },
        { { SC_(1), T(0), SC_(0.841470984807896506652502321630298999622563060798371065672751) } },
    }};

    do_test_heuman_lambda<T>(data1, type_name, "Elliptic Integral Jacobi Zeta: Mathworld Data");

#include "heuman_lambda_data.ipp"

    do_test_heuman_lambda<T>(heuman_lambda_data, type_name, "Elliptic Integral Heuman Lambda: Random Data");
}
Пример #6
0
void test_bessel(T, const char* name)
{
    // function values calculated on http://functions.wolfram.com/
    static const boost::array<boost::array<T, 3>, 9> k0_data = {{
        {{ SC_(0.0), SC_(1.0), SC_(0.421024438240708333335627379212609036136219748226660472298970) }},
        {{ SC_(0.0), SC_(2.0), SC_(0.113893872749533435652719574932481832998326624388808882892530) }},
        {{ SC_(0.0), SC_(4.0), SC_(0.0111596760858530242697451959798334892250090238884743405382553) }},
        {{ SC_(0.0), SC_(8.0), SC_(0.000146470705222815387096584408698677921967305368833759024089154) }},
        {{ SC_(0.0), T(std::ldexp(1.0, -15)), SC_(10.5131392267382037062459525561594822400447325776672021972753) }},
        {{ SC_(0.0), T(std::ldexp(1.0, -30)), SC_(20.9103469324567717360787328239372191382743831365906131108531) }},
        {{ SC_(0.0), T(std::ldexp(1.0, -60)), SC_(41.7047623492551310138446473188663682295952219631968830346918) }},
        {{ SC_(0.0), SC_(50.0), SC_(3.41016774978949551392067551235295223184502537762334808993276e-23) }},
        {{ SC_(0.0), SC_(100.0), SC_(4.65662822917590201893900528948388635580753948544211387402671e-45) }},
    }};
    static const boost::array<boost::array<T, 3>, 9> k1_data = {{
        {{ SC_(1.0), SC_(1.0), SC_(0.601907230197234574737540001535617339261586889968106456017768) }},
        {{ SC_(1.0), SC_(2.0), SC_(0.139865881816522427284598807035411023887234584841515530384442) }},
        {{ SC_(1.0), SC_(4.0), SC_(0.0124834988872684314703841799808060684838415849886258457917076) }},
        {{ SC_(1.0), SC_(8.0), SC_(0.000155369211805001133916862450622474621117065122872616157079566) }},
        {{ SC_(1.0), T(std::ldexp(1.0, -15)), SC_(32767.9998319528316432647441316539139725104728341577594326513) }},
        {{ SC_(1.0), T(std::ldexp(1.0, -30)), SC_(1.07374182399999999003003028572687332810353799544215073362305e9) }},
        {{ SC_(1.0), T(std::ldexp(1.0, -60)), SC_(1.15292150460684697599999999999999998169660198868126604634036e18) }},
        {{ SC_(1.0), SC_(50.0), SC_(3.44410222671755561259185303591267155099677251348256880221927e-23) }},
        {{ SC_(1.0), SC_(100.0), SC_(4.67985373563690928656254424202433530797494354694335352937465e-45) }},
    }};
    static const boost::array<boost::array<T, 3>, 9> kn_data = {{
        {{ SC_(2.0), T(std::ldexp(1.0, -30)), SC_(2.30584300921369395150000000000000000234841952009593636868109e18) }},
        {{ SC_(5.0), SC_(10.0), SC_(0.0000575418499853122792763740236992723196597629124356739596921536) }},
        {{ SC_(-5.0), SC_(100.0), SC_(5.27325611329294989461777188449044716451716555009882448801072e-45) }},
        {{ SC_(10.0), SC_(10.0), SC_(0.00161425530039067002345725193091329085443750382929208307802221) }},
        {{ SC_(10.0), T(std::ldexp(1.0, -30)), SC_(3.78470202927236255215249281534478864916684072926050665209083e98) }},
        {{ SC_(-10.0), SC_(1.0), SC_(1.80713289901029454691597861302340015908245782948536080022119e8) }},
        {{ SC_(100.0), SC_(5.0), SC_(7.03986019306167654653386616796116726248616158936088056952477e115) }},
        {{ SC_(100.0), SC_(80.0), SC_(8.39287107246490782848985384895907681748152272748337807033319e-12) }},
        {{ SC_(-1000.0), SC_(700.0), SC_(6.51561979144735818903553852606383312984409361984128221539405e-31) }},
    }};
    static const boost::array<boost::array<T, 3>, 11> kv_data = {{
        {{ SC_(0.5), SC_(0.875), SC_(0.558532231646608646115729767013630967055657943463362504577189) }},
        {{ SC_(0.5), SC_(1.125), SC_(0.383621010650189547146769320487006220295290256657827220786527) }},
        {{ SC_(2.25), T(std::ldexp(1.0, -30)), SC_(5.62397392719283271332307799146649700147907612095185712015604e20) }},
        {{ SC_(5.5), T(3217)/1024, SC_(1.30623288775012596319554857587765179889689223531159532808379) }},
        {{ SC_(-5.5), SC_(10.0), SC_(0.0000733045300798502164644836879577484533096239574909573072142667) }},
        {{ SC_(-5.5), SC_(100.0), SC_(5.41274555306792267322084448693957747924412508020839543293369e-45) }},
        {{ T(10240)/1024, T(1)/1024, SC_(2.35522579263922076203415803966825431039900000000993410734978e38) }},
        {{ T(10240)/1024, SC_(10.0), SC_(0.00161425530039067002345725193091329085443750382929208307802221) }},
        {{ T(144793)/1024, SC_(100.0), SC_(1.39565245860302528069481472855619216759142225046370312329416e-6) }},
        {{ T(144793)/1024, SC_(200.0), SC_(9.11950412043225432171915100042647230802198254567007382956336e-68) }},
        {{ T(-144793)/1024, SC_(50.0), SC_(1.30185229717525025165362673848737761549946548375142378172956e42) }},
    }};
    static const boost::array<boost::array<T, 3>, 5> kv_large_data = {{
        // Bug report https://svn.boost.org/trac/boost/ticket/5560:
        {{ SC_(-1.0), static_cast<T>(ldexp(0.5, -512)), SC_(2.68156158598851941991480499964116922549587316411847867554471e154) }},
        {{ SC_(1.0),  static_cast<T>(ldexp(0.5, -512)), SC_(2.68156158598851941991480499964116922549587316411847867554471e154) }},
        {{ SC_(-1.125), static_cast<T>(ldexp(0.5, -512)), SC_(5.53984048006472105611199242328122729730752165907526178753978e173) }},
        {{ SC_(1.125),  static_cast<T>(ldexp(0.5, -512)), SC_(5.53984048006472105611199242328122729730752165907526178753978e173) }},
        {{ SC_(0.5),  static_cast<T>(ldexp(0.5, -683)), SC_(1.12284149973980088540335945247019177715948513804063794284101e103) }},
    }};

    do_test_cyl_bessel_k<T>(k0_data, name, "Bessel K0: Mathworld Data");
    do_test_cyl_bessel_k<T>(k1_data, name, "Bessel K1: Mathworld Data");
    do_test_cyl_bessel_k<T>(kn_data, name, "Bessel Kn: Mathworld Data");

    do_test_cyl_bessel_k_int<T>(k0_data, name, "Bessel K0: Mathworld Data (Integer Version)");
    do_test_cyl_bessel_k_int<T>(k1_data, name, "Bessel K1: Mathworld Data (Integer Version)");
    do_test_cyl_bessel_k_int<T>(kn_data, name, "Bessel Kn: Mathworld Data (Integer Version)");

    do_test_cyl_bessel_k<T>(kv_data, name, "Bessel Kv: Mathworld Data");
    if(0 != static_cast<T>(ldexp(0.5, -512)))
      do_test_cyl_bessel_k<T>(kv_large_data, name, "Bessel Kv: Mathworld Data (large values)");
#include "bessel_k_int_data.ipp"
    do_test_cyl_bessel_k<T>(bessel_k_int_data, name, "Bessel Kn: Random Data");
#include "bessel_k_data.ipp"
    do_test_cyl_bessel_k<T>(bessel_k_data, name, "Bessel Kv: Random Data");
}
void test_bessel_derivative(T, const char* name)
{
   //
   // The actual test data is rather verbose, so it's in a separate file
   //
   // The contents are as follows, each row of data contains
   // three items, input value a, input value b and J'(a, b):
   // 
    // function values calculated on http://functions.wolfram.com/
    static const boost::array<boost::array<typename table_type<T>::type, 3>, 8> j0_data = {{
       {{ SC_(0), SC_(0), SC_(0) }},
        {{ SC_(0), SC_(1), SC_(-0.440050585744933515959682203718914913127) }},
        {{ SC_(0), SC_(-2), SC_(0.576724807756873387202448242269137086920) }},
        {{ SC_(0), SC_(4), SC_(0.06604332802354913614318542080327502873) }},
        {{ SC_(0), SC_(-8), SC_(0.2346363468539146243812766515904546115488) }},
        {{ SC_(0), SC_(1e-05), SC_(-0.499999999993750000000026041666666612413194e-5) }},
        {{ SC_(0), SC_(1e-10), SC_(-0.499999999999999999999375000000000000000000e-10) }},
        {{ SC_(0), SC_(-1e+01), SC_(0.0434727461688614366697487680258592883062724) }},
    }};
    static const boost::array<boost::array<T, 3>, 6> j0_tricky = {{
        // Big numbers make the accuracy of std::sin the limiting factor:
       {{ SC_(0), SC_(1e+03), SC_(-0.00472831190708952391757607190121691628542) }},
        {{ SC_(0), SC_(1e+05), SC_(-0.0018467575628825677163621239671142157437) }},
        // test at the regular Bessel roots:
        {{ SC_(0), T(2521642)/(1024 * 1024), SC_(-0.519147572225778564548541576612898453392794) }},
        {{ SC_(0), T(5788221)/(1024 * 1024), SC_(0.34026483151709114336072749629487476476084) }},
        {{ SC_(0), T(9074091)/(1024 * 1024), SC_(-0.271452311894657014854145327490965399410) }},
        {{ SC_(0), T(12364320)/(1024 * 1024), SC_(0.2324598316641066033541448467171088144257742) }}
    }};    

    static const boost::array<boost::array<typename table_type<T>::type, 3>, 8> j1_data = {{
        {{ SC_(1), SC_(0), SC_(0.5) }},
        {{ SC_(1), SC_(1), SC_(0.325147100813033035490035322383748307781902) }},
        {{ SC_(1), SC_(-2), SC_(-0.064471624737201025549396666484619917634997) }},
        {{ SC_(1), SC_(4), SC_(-0.38063897785796008825079441325087928479376) }},
        {{ SC_(1), SC_(-8), SC_(0.1423212637808145780432098264031651746248) }},
        {{ SC_(1), SC_(1e-05), SC_(0.499999999981250000000130208333332953559028) }},
        {{ SC_(1), SC_(1e-10), SC_(0.499999999999999999998125000000000000000001) }},
        {{ SC_(1), SC_(-1e+01), SC_(-0.250283039068234478864735739287914682660226) }},
    }};
    static const boost::array<boost::array<T, 3>, 5> j1_tricky = {{
        // Big numbers make the accuracy of std::sin the limiting factor:
        {{ SC_(1), SC_(1e+03), SC_(0.024781957840513085037413155043792491869881) }},
        {{ SC_(1), SC_(1e+05), SC_(-0.0017192195838116010182477650983128728897) }},
        // test at the regular Bessel roots:
        {{ SC_(1), T(4017834)/(1024*1024), SC_(-0.4027594878673806944036073218740057200193405151367) }},
        {{ SC_(1), T(7356375)/(1024*1024), SC_(0.3001157854852247730548242543591186404228210449219) }},
        {{ SC_(1), T(10667654)/(1024*1024), SC_(-0.2497048893045206718888096020236844196915626525879) }},
    }};

    static const boost::array<boost::array<typename table_type<T>::type, 3>, 17> jn_data = {{
        {{ SC_(-1), SC_(1.25), SC_(-0.2374074770153809244011000600949046202003956) }},
        {{ SC_(2), SC_(0), SC_(0) }},
        {{ SC_(-2), SC_(0), SC_(0) }},
        {{ SC_(2), SC_(1e-02), SC_(0.00249995833352864539930612069540679799606337) }},
        {{ SC_(5), SC_(10), SC_(-0.102571922008611714904101858221407144485) }},
        {{ SC_(5), SC_(-10), SC_(-0.102571922008611714904101858221407144485) }},
        {{ SC_(-5), SC_(1e+06), SC_(-0.0003310524513007044105585859534523271988) }},
        {{ SC_(5), SC_(1e+06), SC_(0.0003310524513007044105585859534523271988) }},
        {{ SC_(-5), SC_(-1), SC_(-0.001227850313053782886909720690402218190791576) }},
        {{ SC_(10), SC_(10), SC_(0.08436957863176118824849051273337698304165) }},
        {{ SC_(10), SC_(-10), SC_(-0.08436957863176118824849051273337698304165) }},
        {{ SC_(10), SC_(-5), SC_(-0.00258467784485473925206548854676116157568106) }},
        {{ SC_(-10), SC_(1e+06), SC_(-0.0007259518037193243350387875733893635962) }},
        {{ SC_(10), SC_(1e+06), SC_(-0.0007259518037193243350387875733893635962) }},
        {{ SC_(1e+02), SC_(8e+01), SC_(3.5036060582489177538508950593467499997755e-06) }},
        {{ SC_(1e+03), SC_(1e+05), SC_(-0.0021724469777608393409850758227465776486) }},
        {{ SC_(10), SC_(1e-100), SC_(2.69114445546737213403880070546737213403880070547e-909) }},
    }};
    do_test_cyl_bessel_j_derivative<T>(j0_data, name, "Bessel J0': Mathworld Data");
    do_test_cyl_bessel_j_derivative<T>(j0_tricky, name, "Bessel J0': Mathworld Data (Tricky cases)");
    do_test_cyl_bessel_j_derivative<T>(j1_data, name, "Bessel J1': Mathworld Data");
    do_test_cyl_bessel_j_derivative<T>(j1_tricky, name, "Bessel J1': Mathworld Data (tricky cases)");
    do_test_cyl_bessel_j_derivative<T>(jn_data, name, "Bessel JN': Mathworld Data");

    do_test_cyl_bessel_j_derivative_int<T>(j0_data, name, "Bessel J0': Mathworld Data (Integer Version)");
    do_test_cyl_bessel_j_derivative_int<T>(j0_tricky, name, "Bessel J0': Mathworld Data (Tricky cases) (Integer Version)");
    do_test_cyl_bessel_j_derivative_int<T>(j1_data, name, "Bessel J1': Mathworld Data (Integer Version)");
    do_test_cyl_bessel_j_derivative_int<T>(j1_tricky, name, "Bessel J1': Mathworld Data (tricky cases) (Integer Version)");
    do_test_cyl_bessel_j_derivative_int<T>(jn_data, name, "Bessel JN': Mathworld Data (Integer Version)");

    static const boost::array<boost::array<T, 3>, 21> jv_data = {{
	{{ T(22.5), T(0), SC_(0) }},
	{{ T(2457)/1024, T(1)/1024, SC_(9.35477929043111040277363766198320562099360690e-6) }},
	{{ SC_(5.5), T(3217)/1024, SC_(0.042165579369684463582791278988393873) }},
	{{ SC_(-5.5), T(3217)/1024, SC_(3.361570113176257957139775812778503494) }},
	{{ SC_(-5.5), SC_(1e+04), SC_(0.007593311396019034252155600098309836289) }},
	{{ SC_(5.5), SC_(1e+04), SC_(-0.00245022241637437956702428797044365092) }},
	{{ SC_(5.5), SC_(1e+06), SC_(-0.000279242826717266554062248256927185394) }},
	{{ SC_(5.125), SC_(1e+06), SC_(0.0001830632695189469708211614700642271) }},
	{{ SC_(5.875), SC_(1e+06), SC_(-0.0006474276718101871487286860109203539) }},
	{{ SC_(0.5), SC_(101), SC_(0.070640819172197226936337703929857171981702865) }},
	{{ SC_(-5.5), SC_(1e+04), SC_(0.007593311396019034252155600098309836289) }},
	{{ SC_(-5.5), SC_(1e+06), SC_(-0.0007474243882060190346457525218941411076) }},
	{{ SC_(-0.5), SC_(101), SC_(-0.036238035321276062532981494694583591262302408) }},
	{{ T(-10486074) / (1024*1024), T(1)/512, SC_(-7.0724447469115535625316241941528969321944e35) }},
	{{ T(-10486074) / (1024*1024), SC_(15), SC_(-0.15994088796049823354364759206656917967697690) }},
	{{ T(10486074) / (1024*1024), SC_(1e+02), SC_(-0.05778764167290516644655950658602424434253) }},
	{{ T(10486074) / (1024*1024), SC_(2e+04), SC_(-0.00091101010794789360775314125410690740803) }},
	{{ T(-10486074) / (1024*1024), SC_(1e+02), SC_(-0.057736130385111563671838499496767877709471701) }},
	{{ SC_(1.5), T(8034)/1024, SC_(0.2783550354042687982259490073096357) }},
	{{ SC_(8.5), boost::math::constants::pi<T>() * 4, SC_(-0.194590144622675911618596506265006877277074) }},
	{{ SC_(-8.5), boost::math::constants::pi<T>() * 4, SC_(-0.014516314554743677558496402742690038592728) }},
    }};
    do_test_cyl_bessel_j_derivative<T>(jv_data, name, "Bessel J': Mathworld Data");
    static const boost::array<boost::array<T, 3>, 4> jv_large_data = {{
	{{ SC_(-0.5), static_cast<T>(std::ldexp(0.5, -683)), SC_(-2.8687031947358902542073388638943588627056993e308) }},
	{{ SC_(256), SC_(512), SC_(0.032286467266411904239327492993951594201583145) }},
	{{ SC_(-256), SC_(8), SC_(4.6974301387555891979202431551474684165419e-352) }},
	{{ SC_(-2.5), SC_(4), SC_(-0.3580070651681080294136741901878543615958139) }},
    }};
    if(jv_large_data[0][1] != 0)
      do_test_cyl_bessel_j_derivative<T>(jv_large_data, name, "Bessel J': Mathworld Data (large values)");

#include "bessel_j_derivative_int_data.ipp"
    do_test_cyl_bessel_j_derivative<T>(bessel_j_derivative_int_data, name, "Bessel JN': Random Data");

#include "bessel_j_derivative_data.ipp"
    do_test_cyl_bessel_j_derivative<T>(bessel_j_derivative_data, name, "Bessel J': Random Data");

#include "bessel_j_derivative_large_data.ipp"
    do_test_cyl_bessel_j_derivative<T>(bessel_j_derivative_large_data, name, "Bessel J': Random Data (Tricky large values)");

#include "sph_bessel_derivative_data.ipp"
    do_test_sph_bessel_j_derivative<T>(sph_bessel_derivative_data, name, "Bessel j': Random Data");

    //
    // Some special cases:
    //
    BOOST_CHECK_EQUAL(boost::math::cyl_bessel_j_derivative(T(1), T(0)), T(0.5));
    BOOST_CHECK_EQUAL(boost::math::cyl_bessel_j_derivative(T(-1), T(0)), T(-0.5));
    BOOST_CHECK_EQUAL(boost::math::cyl_bessel_j_derivative(T(2), T(0)), T(0));

    //
    // Special cases that are errors:
    //
    BOOST_CHECK_THROW(boost::math::sph_bessel_derivative(1, T(0)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::sph_bessel_derivative(100000, T(0)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::cyl_bessel_j_derivative(T(-2.5), T(0)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::cyl_bessel_j_derivative(T(-2.5), T(-2)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::cyl_bessel_j_derivative(T(2.5), T(-2)), std::domain_error);
}
Пример #8
0
void test_spots(T, const char* type_name)
{
    // Function values calculated on http://functions.wolfram.com/
    // Note that Mathematica's EllipticE accepts k^2 as the second parameter.
    static const boost::array<boost::array<T, 3>, 10> data1 = {{
        {{ SC_(0), SC_(0), SC_(0) }},
        {{ SC_(-10), SC_(0), SC_(-10) }},
        {{ SC_(-1), SC_(-1), SC_(-0.84147098480789650665250232163029899962256306079837) }},
        {{ SC_(-4), T(900) / 1024, SC_(-3.1756145986492562317862928524528520686391383168377) }},
        {{ SC_(8), T(-600) / 1024, SC_(7.2473147180505693037677015377802777959345489333465) }},
        {{ SC_(1e-05), T(800) / 1024, SC_(9.999999999898274739584436515967055859383969942432E-6) }},
        {{ SC_(1e+05), T(100) / 1024, SC_(99761.153306972066658135668386691227343323331995888) }},
        {{ SC_(1e+10), SC_(-0.5), SC_(9.3421545766487137036576748555295222252286528414669e9) }},
        {{ static_cast<T>(ldexp(T(1), 66)), T(400) / 1024, SC_(7.0886102721911705466476846969992069994308167515242e19) }},
        {{ static_cast<T>(ldexp(T(1), 166)), T(900) / 1024, SC_(7.1259011068364515942912094521783688927118026465790e49) }},
    }};

    do_test_ellint_e2<T>(data1, type_name, "Elliptic Integral E: Mathworld Data");

#include "ellint_e2_data.ipp"

    do_test_ellint_e2<T>(ellint_e2_data, type_name, "Elliptic Integral E: Random Data");

    // Function values calculated on http://functions.wolfram.com/
    // Note that Mathematica's EllipticE accepts k^2 as the second parameter.
    static const boost::array<boost::array<T, 2>, 10> data2 = {{
        {{ SC_(-1), SC_(1) }},
        {{ SC_(0), SC_(1.5707963267948966192313216916397514420985846996876) }},
        {{ T(100) / 1024, SC_(1.5670445330545086723323795143598956428788609133377) }},
        {{ T(200) / 1024, SC_(1.5557071588766556854463404816624361127847775545087) }},
        {{ T(300) / 1024, SC_(1.5365278991162754883035625322482669608948678755743) }},
        {{ T(400) / 1024, SC_(1.5090417763083482272165682786143770446401437564021) }},
        {{ SC_(-0.5), SC_(1.4674622093394271554597952669909161360253617523272) }},
        {{ T(-600) / 1024, SC_(1.4257538571071297192428217218834579920545946473778) }},
        {{ T(-800) / 1024, SC_(1.2927868476159125056958680222998765985004489572909) }},
        {{ T(-900) / 1024, SC_(1.1966864890248739524112920627353824133420353430982) }},
    }};

    do_test_ellint_e1<T>(data2, type_name, "Elliptic Integral E: Mathworld Data");

#include "ellint_e_data.ipp"

    do_test_ellint_e1<T>(ellint_e_data, type_name, "Elliptic Integral E: Random Data");
}
Пример #9
0
#ifdef _MSC_VER
#  pragma warning (disable : 4224)
#endif

#include <boost/math/special_functions/ellint_3.hpp>
#include <boost/array.hpp>
#include <boost/lexical_cast.hpp>
#include "../../test/table_type.hpp"
#include "table_helper.hpp"
#include "performance.hpp"
#include <iostream>

typedef double T;
#define SC_(x) static_cast<double>(x)
static const boost::array<boost::array<T, 4>, 65> data1 = { {
   { { SC_(1.0), SC_(-1.0), SC_(0.0), SC_(-1.557407724654902230506974807458360173087) } },
   { { SC_(0.0), SC_(-4.0), SC_(0.4), SC_(-4.153623371196831087495427530365430979011) } },
   { { SC_(0.0), SC_(8.0), SC_(-0.6), SC_(8.935930619078575123490612395578518914416) } },
   { { SC_(0.0), SC_(0.5), SC_(0.25), SC_(0.501246705365439492445236118603525029757890291780157969500480) } },
   { { SC_(0.0), SC_(0.5), SC_(0.0), SC_(0.5) } },
   { { SC_(-2.0), SC_(0.5), SC_(0.0), SC_(0.437501067017546278595664813509803743009132067629603474488486) } },
   { { SC_(0.25), SC_(0.5), SC_(0.0), SC_(0.510269830229213412212501938035914557628394166585442994564135) } },
   { { SC_(0.75), SC_(0.5), SC_(0.0), SC_(0.533293253875952645421201146925578536430596894471541312806165) } },
   { { SC_(0.75), SC_(0.75), SC_(0.0), SC_(0.871827580412760575085768367421866079353646112288567703061975) } },
   { { SC_(1.0), SC_(0.25), SC_(0.0), SC_(0.255341921221036266504482236490473678204201638800822621740476) } },
   { { SC_(2.0), SC_(0.25), SC_(0.0), SC_(0.261119051639220165094943572468224137699644963125853641716219) } },
   { { T(1023) / 1024, SC_(1.5), SC_(0.0), SC_(13.2821612239764190363647953338544569682942329604483733197131) } },
   { { SC_(0.5), SC_(-1.0), SC_(0.5), SC_(-1.228014414316220642611298946293865487807) } },
   { { SC_(0.5), SC_(1e+10), SC_(0.5), SC_(1.536591003599172091573590441336982730551e+10) } },
   { { SC_(-1e+05), SC_(10.0), SC_(0.75), SC_(0.0347926099493147087821620459290460547131012904008557007934290) } },
   { { SC_(-1e+10), SC_(10.0), SC_(0.875), SC_(0.000109956202759561502329123384755016959364346382187364656768212) } },
Пример #10
0
void test_trigamma(T, const char* name)
{
   typedef typename table_type<T>::type value_type;

   boost::array<boost::array<value_type, 3>, 659> data =
   { { 
      { SC_(1.0), SC_(1.6449340668482264364724151666460252) }, { SC_(2.0), SC_(0.64493406684822643647241516664602519) }, { SC_(3.0), SC_(0.39493406684822643647241516664602519) }, { SC_(4.0), SC_(0.28382295573711532536130405553491408) }, { SC_(5.0), SC_(0.22132295573711532536130405553491408) }, { SC_(6.0), SC_(0.18132295573711532536130405553491408) }, { SC_(7.0), SC_(0.15354517795933754758352627775713630) }, { SC_(8.0), SC_(0.13313701469403142513454668592040161) }, { SC_(9.0), SC_(0.11751201469403142513454668592040161) }, { SC_(10.0), SC_(0.10516633568168574612220100690805593) }, { SC_(11.0), SC_(0.095166335681685746122201006908055927) }, { SC_(12.0), SC_(0.086901872871768390750300180461774936) }, { SC_(13.0), SC_(0.079957428427323946305855736017330491) }, { SC_(14.0), SC_(0.074040268664010336838400114715555343) }, { SC_(15.0), SC_(0.068938227847683806226155216756371670) }, { SC_(16.0), SC_(0.064493783403239361781710772311927225) }, { SC_(17.0), SC_(0.060587533403239361781710772311927225) }, { SC_(18.0), SC_(0.057127325790782614376866481654487779) }, { SC_(19.0), SC_(0.054040906037696194623780061901401359) }, { SC_(20.0), SC_(0.051270822935203119831536294588381969) }, { SC_(21.0), SC_(0.048770822935203119831536294588381969) }, { SC_(22.0), SC_(0.046503249239057995114983006606522558) }, { SC_(23.0), SC_(0.044437133536578656272007799994952310) }, { SC_(24.0), SC_(0.042546774368336690298472828350339834) }, { SC_(25.0), SC_(0.040810663257225579187361717239228723) }, { SC_(26.0), SC_(0.039210663257225579187361717239228723) }, { SC_(27.0), SC_(0.037731373316397176820497811913784936) }, { SC_(28.0), SC_(0.036359631203914323596903847579079860) }, { SC_(29.0), SC_(0.035084120999832690943842623089283942) }, { SC_(30.0), SC_(0.033895060357739944213759388844337450) }, { SC_(31.0), SC_(0.032783949246628833102648277733226339) }, { SC_(32.0), SC_(0.031743366520302090126581680438741427) }, { SC_(33.0), SC_(0.030766804020302090126581680438741427) }, { SC_(34.0), SC_(0.029848530374755717307481588611376873) }, { SC_(35.0), SC_(0.028983478471641530456270515947017011) }, { SC_(36.0), SC_(0.028167151941029285558311332273547623) }, { SC_(37.0), SC_(0.027395547002757680620039727335276018) }, { SC_(38.0), SC_(0.026665086812838031240930888766977990) }, { SC_(39.0), SC_(0.025972566037214762542869946938723143) }, { SC_(40.0), SC_(0.025315103841291028157597100127414793) }, { SC_(41.0), SC_(0.024690103841291028157597100127414793) }, { SC_(42.0), SC_(0.024095219843670564148078956165487369) }, { SC_(43.0), SC_(0.023528326419634282968940634170022516) }, { SC_(44.0), SC_(0.022987493536995018501661023569698017) }, { SC_(45.0), SC_(0.022470964611375183790917221916805455) }, { SC_(46.0), SC_(0.021977137450881356630423394756311627) }, { SC_(47.0), SC_(0.021504547658820865137039651845158508) }, { SC_(48.0), SC_(0.021051854132338293837809230840178880) }, { SC_(49.0), SC_(0.020617826354560516060031453062401102) }, { SC_(50.0), SC_(0.020201333226697125805970645065733047) }, { SC_(51.0), SC_(0.019801333226697125805970645065733047) }, { SC_(52.0), SC_(0.019416865714201931649876834992684219) }, { SC_(53.0), SC_(0.019047043228994831058160858661323273) }, { SC_(54.0), SC_(0.018691044652989135080944767525687815) }, { SC_(55.0), SC_(0.018348109124868421775046276442011546) }, { SC_(56.0), SC_(0.018017530612471727560170243384160307) }, { SC_(57.0), SC_(0.017698653061451319396904937261711327) }, { SC_(58.0), SC_(0.017390866050063199975544518671375839) }, { SC_(59.0), SC_(0.017093600889540013293023710110139216) }, { SC_(60.0), SC_(0.016806327117635388185296045645904801) }, { SC_(61.0), SC_(0.016528549339857610407518267868127023) }, { SC_(62.0), SC_(0.016259804378825629757155462170733849) }, { SC_(63.0), SC_(0.015999658697243944013138812847112621) }, { SC_(64.0), SC_(0.015747706064338930155744003071350465) }, { SC_(65.0), SC_(0.015503565439338930155744003071350465) }, { SC_(66.0), SC_(0.015266879048806385777045778219279459) }, { SC_(67.0), SC_(0.015037310637419792572270755262438320) }, { SC_(68.0), SC_(0.014814543874220861852734110129892096) }, { SC_(69.0), SC_(0.014598280898442315139931341963802130) }, { SC_(70.0), SC_(0.014388240990859874476205234003289633) }, { SC_(71.0), SC_(0.014184159358206813251715438084922286) }, { SC_(72.0), SC_(0.013985786019583524221761063952805643) }, { SC_(73.0), SC_(0.013792884785015622987193162718237741) }, { SC_(74.0), SC_(0.013605232317385673653359422804557876) }, { SC_(75.0), SC_(0.013422617269905761308582213162483370) }, { SC_(76.0), SC_(0.013244839492127983530804435384705592) }, { SC_(77.0), SC_(0.013071709298222166356289199927641880) }, { SC_(78.0), SC_(0.012903046791897322369107550408330023) }, { SC_(79.0), SC_(0.012738681242916388772789338705502935) }, { SC_(80.0), SC_(0.012578450510661942369969277817824679) }, { SC_(81.0), SC_(0.012422200510661942369969277817824679) }, { SC_(82.0), SC_(0.012269784720386069789569948447301893) }, { SC_(83.0), SC_(0.012121063720980953787190412456820037) }, { SC_(84.0), SC_(0.011975904771931744903462730645236352) }, { SC_(85.0), SC_(0.011834181415922674608678150146370139) }, { SC_(86.0), SC_(0.011695773111424404712484378520072561) }, { SC_(87.0), SC_(0.011560564890764588595664475869991436) }, { SC_(88.0), SC_(0.011428447041643172292321894287219604) }, { SC_(89.0), SC_(0.011299314810238213614635943873996463) }, { SC_(90.0), SC_(0.011173068124213721757547192453721246) }, { SC_(91.0), SC_(0.011049611334090264967423735663597789) }, { SC_(92.0), SC_(0.010928852971573660692577702575806459) }, { SC_(93.0), SC_(0.010810705523558537819231766848018180) }, { SC_(94.0), SC_(0.010695085220633344155224367148630967) }, { SC_(95.0), SC_(0.010581911839012701330416761897386060) }, { SC_(96.0), SC_(0.010471108514912978338727011204865284) }, { SC_(97.0), SC_(0.010362601570468533894282566760420840) }, { SC_(98.0), SC_(0.010256320350360127049771991779020053) }, { SC_(99.0), SC_(0.010152197068394279486256789779853040) }, { SC_(100.0), SC_(0.010050166663333571395245668465701423) }, { SC_(101.0), SC_(0.0099501666633335713952456684657014225) }, { SC_(102.0), SC_(0.0098521370583928793062347871795530057) }, { SC_(103.0), SC_(0.0097560201802690807672113346612907989) }, { SC_(104.0), SC_(0.0096617605893557053312607266869294076) }, { SC_(105.0), SC_(0.0095693049680539301833317326040891709) }, { SC_(106.0), SC_(0.0094786020202081251946696010848147945) }, { SC_(107.0), SC_(0.0093896023762067012003655783009059301) }, { SC_(108.0), SC_(0.0093022585033793800369451922409880334) }, { SC_(109.0), SC_(0.0092165246213492017104705694700689662) }, { SC_(110.0), SC_(0.0091323566220225457050838175131629818) }, { SC_(111.0), SC_(0.0090497119939233721513648092487001719) }, { SC_(112.0), SC_(0.0089685497505989666647971605188892799) }, { SC_(113.0), SC_(0.0088888303628438646239808339882770350) }, { SC_(114.0), SC_(0.0088105156945064850327834027093985011) }, { SC_(115.0), SC_(0.0087335689416594551774432980618146291) }, { SC_(116.0), SC_(0.0086579545749297765385018991960301301) }, { SC_(117.0), SC_(0.0085836382847989798678716970557209743) }, { SC_(118.0), SC_(0.0085105869296963427139524918544644910) }, { SC_(119.0), SC_(0.0084387684867201864370205757384058871) }, { SC_(120.0), SC_(0.0083681520048333140410033453168254903) }, { SC_(121.0), SC_(0.0082987075603888695965589008723810458) }, { SC_(122.0), SC_(0.0082304062148523625273696378438993847) }, { SC_(123.0), SC_(0.0081632199745943673647789364195510913) }, { SC_(124.0), SC_(0.0080971217526365380303880315348924886) }, { SC_(125.0), SC_(0.0080320853322411165943838692039871816) }, { SC_(126.0), SC_(0.0079680853322411165943838692039871816) }, { SC_(127.0), SC_(0.0079050971740148631300351667600466424) }, { SC_(128.0), SC_(0.0078430970500146151295391657680446584) }, { SC_(129.0), SC_(0.0077820618937646151295391657680446584) }, { SC_(130.0), SC_(0.0077219693512491412998414312568974918) }, { SC_(131.0), SC_(0.0076627977536160052051668750438797403) }, { SC_(132.0), SC_(0.0076045260911254743503215863077920997) }, { SC_(133.0), SC_(0.0075471339882788260491278305685818151) }, { SC_(134.0), SC_(0.0074906016800646816656126516438263173) }, { SC_(135.0), SC_(0.0074349099892649489857284903606897613) }, { SC_(136.0), SC_(0.0073800403047656348567847317873015583) }, { SC_(137.0), SC_(0.0073259745608209981785840397457790669) }, { SC_(138.0), SC_(0.0072726952172225113119422367727916941) }, { SC_(139.0), SC_(0.0072201852403269011460107097826635698) }, { SC_(140.0), SC_(0.0071684280849001633995172570628250521) }, { SC_(141.0), SC_(0.0071174076767368980933948080832332154) }, { SC_(142.0), SC_(0.0070671083960166123934803168604577010) }, { SC_(143.0), SC_(0.0070175150613607901359917233274285402) }, { SC_(144.0), SC_(0.0069686129145565454296491148869180018) }, { SC_(145.0), SC_(0.0069203876059145701210071395782760264) }, { SC_(146.0), SC_(0.0068728251802308602518038102084781668) }, { SC_(147.0), SC_(0.0068259120633233729183453752300582005) }, { SC_(148.0), SC_(0.0067796350491163295567830632304284166) }, { SC_(149.0), SC_(0.0067339812872463514705887608199097899) }, { SC_(150.0), SC_(0.0066889382711659947299014043945235460) }, { SC_(151.0), SC_(0.0066444938267215502854569599500791016) }, { SC_(152.0), SC_(0.0066006361011831967044736697435092143) }, { SC_(153.0), SC_(0.0065573535527067424108448608792432863) }, { SC_(154.0), SC_(0.0065146349402072763935011042044600833) }, { SC_(155.0), SC_(0.0064724693136260653967056918246321191) }, { SC_(156.0), SC_(0.0064308460045729956776630279328527226) }, { SC_(157.0), SC_(0.0063897546173277622785834750071459507) }, { SC_(158.0), SC_(0.0063491850201838619175140604264327372) }, { SC_(159.0), SC_(0.0063091273371202503168090452045131730) }, { SC_(160.0), SC_(0.0062695719397862840971183684116647889) }, { SC_(161.0), SC_(0.0062305094397862840971183684116647889) }, { SC_(162.0), SC_(0.0061919306812507337711278587862645343) }, { SC_(163.0), SC_(0.0061538267336817656260280264436338377) }, { SC_(164.0), SC_(0.0061161888850611927779720213248864253) }, { SC_(165.0), SC_(0.0060790086352099137773771373272659613) }, { SC_(166.0), SC_(0.0060422776893880588646131336541713791) }, { SC_(167.0), SC_(0.0060059879521257566436812132012754581) }, { SC_(168.0), SC_(0.0059701315212748835395899944411908369) }, { SC_(169.0), SC_(0.0059347006822726159658938493164742836) }, { SC_(170.0), SC_(0.0058996879026080383950805024448661467) }, { SC_(171.0), SC_(0.0058650858264834709210320595382917522) }, { SC_(172.0), SC_(0.0058308872696625687631031241393655869) }, { SC_(173.0), SC_(0.0057970852144976147338981484768453056) }, { SC_(174.0), SC_(0.0057636728051287751468755282757026012) }, { SC_(175.0), SC_(0.0057306433428484210710398828800096431) }, { SC_(176.0), SC_(0.0056979902816239312751215155330708676) }, { SC_(177.0), SC_(0.0056657072237726916057000279297650825) }, { SC_(178.0), SC_(0.0056337879157832888159525096559612586) }, { SC_(179.0), SC_(0.0056022262442771658516803218008924541) }, { SC_(180.0), SC_(0.0055710162321052611046374704541804289) }, { SC_(181.0), SC_(0.0055401520345743969071066062566495647) }, { SC_(182.0), SC_(0.0055096279357984132680235501838801132) }, { SC_(183.0), SC_(0.0054794383451692621993120419119322808) }, { SC_(184.0), SC_(0.0054495777939434865714939523899997060) }, { SC_(185.0), SC_(0.0054200409319397058531574684580526360) }, { SC_(186.0), SC_(0.0053908225243429198779931149153207149) }, { SC_(187.0), SC_(0.0053619174486116214619912649904739118) }, { SC_(188.0), SC_(0.0053333206914838797479016427536355693) }, { SC_(189.0), SC_(0.0053050273460787190416997414408243425) }, { SC_(190.0), SC_(0.0052770326090892730575447625768507695) }, { SC_(191.0), SC_(0.0052493317780643423096223249037205756) }, { SC_(192.0), SC_(0.0052219202487751232640917747543277410) }, { SC_(193.0), SC_(0.0051947935126640121529806636432166299) }, { SC_(194.0), SC_(0.0051679471543725143946515809832794503) }, { SC_(195.0), SC_(0.0051413768493454126835239372379292537) }, { SC_(196.0), SC_(0.0051150783615084633081130233654769197) }, { SC_(197.0), SC_(0.0050890475410170014172342228656851663) }, { SC_(198.0), SC_(0.0050632803220729420495617757529020490) }, { SC_(199.0), SC_(0.0050377727208077650268089954243641447) }, { SC_(200.0), SC_(0.0050125208332291685267206138178390569) }, { SC_(201.0), SC_(0.0049875208332291685267206138178390569) }, { SC_(202.0), SC_(0.0049627689706515095578832088031116987) }, { SC_(203.0), SC_(0.0049382615694163365356304884815745945) }, { SC_(204.0), SC_(0.0049139950257001580309349122724940538) }, { SC_(205.0), SC_(0.0048899658061692083961790491429285021) }, { SC_(206.0), SC_(0.0048661704462643898357983233844514052) }, { SC_(207.0), SC_(0.0048426055485360459768106713908610573) }, { SC_(208.0), SC_(0.0048192677810268859030633260619152243) }, { SC_(209.0), SC_(0.0047961538757014421160810775412051651) }, { SC_(210.0), SC_(0.0047732606269205076136658397948165751) }, { SC_(211.0), SC_(0.0047505848899590563665003069149979810) }, { SC_(212.0), SC_(0.0047281235795662080477293898196946410) }, { SC_(213.0), SC_(0.0047058736685658520491533841237174249) }, { SC_(214.0), SC_(0.0046838321864965977124917869979266868) }, { SC_(215.0), SC_(0.0046619962182897674216366904829472126) }, { SC_(216.0), SC_(0.0046403629029841968429455060589342326) }, { SC_(217.0), SC_(0.0046189294324766522613268503662044658) }, { SC_(218.0), SC_(0.0045976930503067187312030422581537533) }, { SC_(219.0), SC_(0.0045766510504750547298563542689272572) }, { SC_(220.0), SC_(0.0045558007762939492483192720562961611) }, { SC_(221.0), SC_(0.0045351396192691558598895199901804586) }, { SC_(222.0), SC_(0.0045146650180120153427010922348109944) }, { SC_(223.0), SC_(0.0044943744571809139710591800523582715) }, { SC_(224.0), SC_(0.0044742654664511586974763611740377744) }, { SC_(225.0), SC_(0.0044543356195123831872722795413847131) }, { SC_(226.0), SC_(0.0044345825330926301008525264549649601) }, { SC_(227.0), SC_(0.0044150038660082852030531686352453266) }, { SC_(228.0), SC_(0.0043955973182390678691247011703226617) }, { SC_(229.0), SC_(0.0043763606300273104052896750084266937) }, { SC_(230.0), SC_(0.0043572915810007853580937786677772019) }, { SC_(231.0), SC_(0.0043383879893183656983584289513310771) }, { SC_(232.0), SC_(0.0043196477108378274775604678936297597) }, { SC_(233.0), SC_(0.0043010686383051283099029173585524707) }, { SC_(234.0), SC_(0.0042826487005645178731661935286790157) }, { SC_(235.0), SC_(0.0042643858617888585846863922283648949) }, { SC_(236.0), SC_(0.0042462781207295557327171753881657097) }, { SC_(237.0), SC_(0.0042283235099855166634841963591510587) }, { SC_(238.0), SC_(0.0042105200952905781742819673716312524) }, { SC_(239.0), SC_(0.0041928659748188600752776597662361532) }, { SC_(240.0), SC_(0.0041753592785075209880768054394561599) }, { SC_(241.0), SC_(0.0041579981673964098769656943283450488) }, { SC_(242.0), SC_(0.0041407808329841235871290868319176457) }, { SC_(243.0), SC_(0.0041237054965999968198317710747972304) }, { SC_(244.0), SC_(0.0041067704087915665331207344780724764) }, { SC_(245.0), SC_(0.0040899738487270677424730591219854030) }, { SC_(246.0), SC_(0.0040733141236125321323106268021186808) }, { SC_(247.0), SC_(0.0040567895681230747987129005809540301) }, { SC_(248.0), SC_(0.0040403985438479678472795055080959272) }, { SC_(249.0), SC_(0.0040241394387491124882784649253696005) }, { SC_(250.0), SC_(0.0040080106666325337234198336129714134) }, { SC_(251.0), SC_(0.0039920106666325337234198336129714134) }, { SC_(252.0), SC_(0.0039761379027081515707555901882638690) }, { SC_(253.0), SC_(0.0039603908631515882046684145772787342) }, { SC_(254.0), SC_(0.0039447680601082661718292825802158212) }, { SC_(255.0), SC_(0.0039292680291082041717052823322153252) }, { SC_(256.0), SC_(0.0039138893286083964054615299292933721) }, { SC_(257.0), SC_(0.0038986305395458964054615299292933721) }, { SC_(258.0), SC_(0.0038834902649013143527430936168586645) }, { SC_(259.0), SC_(0.0038684671292724458953186599890718729) }, { SC_(260.0), SC_(0.0038535597784577591732960306305351784) }, { SC_(261.0), SC_(0.0038387668790494751496273915772807406) }, { SC_(262.0), SC_(0.0038240871180359844492559936236394259) }, { SC_(263.0), SC_(0.0038095192024133517355446714396175157) }, { SC_(264.0), SC_(0.0037950618588056662116828258151325586) }, { SC_(265.0), SC_(0.0037807138330940041363843868803299874) }, { SC_(266.0), SC_(0.0037664738900537762972957432349045691) }, { SC_(267.0), SC_(0.0037523408130002402014169485037156947) }, { SC_(268.0), SC_(0.0037383134034419633284070872347962260) }, { SC_(269.0), SC_(0.0037243904807420301584360469140120870) }, { SC_(270.0), SC_(0.0037105708817867918394520638292012082) }, { SC_(271.0), SC_(0.0036968534606619633072161241858541575) }, { SC_(272.0), SC_(0.0036832370883358784227510433726844022) }, { SC_(273.0), SC_(0.0036697206523497192532008703623037793) }, { SC_(274.0), SC_(0.0036563030565145410004402000192158538) }, { SC_(275.0), SC_(0.0036429832206149192837797492759690106) }, { SC_(276.0), SC_(0.0036297600801190515151847079536549610) }, { SC_(277.0), SC_(0.0036166325858951489737018262061229300) }, { SC_(278.0), SC_(0.0036035997039339608961822443009762449) }, { SC_(279.0), SC_(0.0035906604150772764595588811210166154) }, { SC_(280.0), SC_(0.0035778137147522549413358367099735918) }, { SC_(281.0), SC_(0.0035650586127114386148052244650756327) }, { SC_(282.0), SC_(0.0035523941327783070688521590277078182) }, { SC_(283.0), SC_(0.0035398193125982356438735362220139396) }, { SC_(284.0), SC_(0.0035273332033947245499655089024070023) }, { SC_(285.0), SC_(0.0035149348697307689855933605191497121) }, { SC_(286.0), SC_(0.0035026233892752442087389437755362926) }, { SC_(287.0), SC_(0.0034903978525741830321532916654086580) }, { SC_(288.0), SC_(0.0034782573628268266237957785233285065) }, { SC_(289.0), SC_(0.0034662010356663327966352846961680126) }, { SC_(290.0), SC_(0.0034542279989450291723970691575609557) }, { SC_(291.0), SC_(0.0034423373925241017050962368151114908) }, { SC_(292.0), SC_(0.0034305283680676120557061729282891812) }, { SC_(293.0), SC_(0.0034188000888407402223415641836841896) }, { SC_(294.0), SC_(0.0034071517295121516540414092605051194) }, { SC_(295.0), SC_(0.0033955824759603908136508312605976734) }, { SC_(296.0), SC_(0.0033840915250842058093417246820282968) }, { SC_(297.0), SC_(0.0033726780846167112877931490793986401) }, { SC_(298.0), SC_(0.0033613413729432992776808022667151271) }, { SC_(299.0), SC_(0.0033500806189232100925089631603685662) }, { SC_(300.0), SC_(0.0033388950617146777494702946890986698) }, { SC_(301.0), SC_(0.0033277839506035666383591835779875587) }, { SC_(302.0), SC_(0.0033167465448354183839249058106339975) }, { SC_(303.0), SC_(0.0033057821134508299886790832589915257) }, { SC_(304.0), SC_(0.0032948899351240864232334297827528127) }, { SC_(305.0), SC_(0.0032840692980049728498262275666863307) }, { SC_(306.0), SC_(0.0032733194995636936238117153387906038) }, { SC_(307.0), SC_(0.0032626398464388271194757761700948030) }, { SC_(308.0), SC_(0.0032520296542882472724747469814561968) }, { SC_(309.0), SC_(0.0032414882476429445232758938864992057) }, { SC_(310.0), SC_(0.0032310149597636805859480485560146067) }, { SC_(311.0), SC_(0.0032206091325004131561873825830697576) }, { SC_(312.0), SC_(0.0032102701161544283131853457968495985) }, { SC_(313.0), SC_(0.0031999972693431199634154575654229056) }, { SC_(314.0), SC_(0.0031897899588673572221401561945811087) }, { SC_(315.0), SC_(0.0031796475595813821318728025494028053) }, { SC_(316.0), SC_(0.0031695694542651815775770101583723190) }, { SC_(317.0), SC_(0.0031595550334992786774007563528924280) }, { SC_(318.0), SC_(0.0031496036955418903065342933569426225) }, { SC_(319.0), SC_(0.0031397148462083987516116241587305265) }, { SC_(320.0), SC_(0.0031298878987530867951646552806731175) }, { SC_(321.0), SC_(0.0031201222737530867951646552806731175) }, { SC_(322.0), SC_(0.0031104173989944955547846123851266845) }, { SC_(323.0), SC_(0.0031007727093606079732869849787766208) }, { SC_(324.0), SC_(0.0030911876467222236314453110434374534) }, { SC_(325.0), SC_(0.0030816616598299815951703529577797793) }, { SC_(326.0), SC_(0.0030721942042086798200224239636969390) }, { SC_(327.0), SC_(0.0030627847420535366080084226840100859) }, { SC_(328.0), SC_(0.0030534327421283526074098946887983099) }, { SC_(329.0), SC_(0.0030441376796655328572611736893931939) }, { SC_(330.0), SC_(0.0030348990362679293613585120362303443) }, { SC_(331.0), SC_(0.0030257162998124656331675111179566988) }, { SC_(332.0), SC_(0.0030165889643555055835148062320940287) }, { SC_(333.0), SC_(0.0030075165300399300282818261188700484) }, { SC_(334.0), SC_(0.0029984985030038849742187540377799493) }, { SC_(335.0), SC_(0.0029895343952911666981959493477587940) }, { SC_(336.0), SC_(0.0029806237247632094694144835424569450) }, { SC_(337.0), SC_(0.0029717660150126425759904472612778067) }, { SC_(338.0), SC_(0.0029629607952783841075703678381958037) }, { SC_(339.0), SC_(0.0029542076003622397148670311202937695) }, { SC_(340.0), SC_(0.0029455059705469753158450943115294879) }, { SC_(341.0), SC_(0.0029368554515158334473329835848858893) }, { SC_(342.0), SC_(0.0029282555942734636706712761692289892) }, { SC_(343.0), SC_(0.0029197059550682381311890423194974479) }, { SC_(344.0), SC_(0.0029112060953159240443714748093613651) }, { SC_(345.0), SC_(0.0029027555815246855370702308937312948) }, { SC_(346.0), SC_(0.0028943539852213879105211865753107949) }, { SC_(347.0), SC_(0.0028860008828791780137655315250251188) }, { SC_(348.0), SC_(0.0028776958558463150217964926658036320) }, { SC_(349.0), SC_(0.0028694384902762265028375813168803925) }, { SC_(350.0), SC_(0.0028612283770587652340466846904159136) }, { SC_(351.0), SC_(0.0028530651117526427850670928536812197) }, { SC_(352.0), SC_(0.0028449482945190164346316256090971660) }, { SC_(353.0), SC_(0.0028368775300562065172762537082707197) }, { SC_(354.0), SC_(0.0028288524275355218155291888895176601) }, { SC_(355.0), SC_(0.0028208726005381711180923093210667042) }, { SC_(356.0), SC_(0.0028129376669932395568941343557820384) }, { SC_(357.0), SC_(0.0028050472491167088158260873920148373) }, { SC_(358.0), SC_(0.0027972009733515007718241729007281265) }, { SC_(359.0), SC_(0.0027893984703085245850634600640501202) }, { SC_(360.0), SC_(0.0027816393747087076997196157425442350) }, { SC_(361.0), SC_(0.0027739233253259916503368996931615189) }, { SC_(362.0), SC_(0.0027662499649312739916326233294135428) }, { SC_(363.0), SC_(0.0027586189402372780818618593112211799) }, { SC_(364.0), SC_(0.0027510299018443328519519411969454398) }, { SC_(365.0), SC_(0.0027434825041870450847740641289584817) }, { SC_(366.0), SC_(0.0027359764054818471114207145324112871) }, { SC_(367.0), SC_(0.0027285112676754032044661921519281434) }, { SC_(368.0), SC_(0.0027210867563938583121587282907368063) }, { SC_(369.0), SC_(0.0027137025408929131325746073077500388) }, { SC_(370.0), SC_(0.0027063582940087098731978400983435274) }, { SC_(371.0), SC_(0.0026990536921095133794067517126605471) }, { SC_(372.0), SC_(0.0026917884150481726451778518935659459) }, { SC_(373.0), SC_(0.0026845621461153480411773894123542452) }, { SC_(374.0), SC_(0.0026773745719934899095154066481569894) }, { SC_(375.0), SC_(0.0026702253827115544809930010889474037) }, { SC_(376.0), SC_(0.0026631142716004433698818899778362926) }, { SC_(377.0), SC_(0.0026560409352491531933314146496334859) }, { SC_(378.0), SC_(0.0026490050734616221475912771688941576) }, { SC_(379.0), SC_(0.0026420063892142606515525324529007643) }, { SC_(380.0), SC_(0.0026350445886141534398232908018401340) }, { SC_(381.0), SC_(0.0026281193808579207528426813835575855) }, { SC_(382.0), SC_(0.0026212304781912265305653479400018095) }, { SC_(383.0), SC_(0.0026143775958689217691827104026536009) }, { SC_(384.0), SC_(0.0026075604521158114473453538183153069) }, { SC_(385.0), SC_(0.0026007787680880336695675760405375292) }, { SC_(386.0), SC_(0.0025940322678350399100803100597650549) }, { SC_(387.0), SC_(0.0025873206782621654704980393947807600) }, { SC_(388.0), SC_(0.0025806437290937794894205133379866304) }, { SC_(389.0), SC_(0.0025740011528370040616386024016490812) }, { SC_(390.0), SC_(0.0025673926847459922390891875814985403) }, { SC_(391.0), SC_(0.0025608180627867548952364591133854568) }, { SC_(392.0), SC_(0.0025542770276025266392726702841653444) }, { SC_(393.0), SC_(0.0025477693224796611665529701592174061) }, { SC_(394.0), SC_(0.0025412946933140466271257158552076682) }, { SC_(395.0), SC_(0.0025348528885780317852076040770118889) }, { SC_(396.0), SC_(0.0025284436592878539290948016415047586) }, { SC_(397.0), SC_(0.0025220667589715596734066065593702826) }, { SC_(398.0), SC_(0.0025157219436374099738336126313585574) }, { SC_(399.0), SC_(0.0025094089717427608488115172297272854) }, { SC_(400.0), SC_(0.0025031276041634114728653862380877857) }, { SC_(401.0), SC_(0.0024968776041634114728653862380877857) }, { SC_(402.0), SC_(0.0024906587373653194211990408795390204) }, { SC_(403.0), SC_(0.0024844707717209046789896896258571809) }, { SC_(404.0), SC_(0.0024783134774822848980662186359489861) }, { SC_(405.0), SC_(0.0024721866271734916425030385555647101) }, { SC_(406.0), SC_(0.0024660899955624567392870653807437986) }, { SC_(407.0), SC_(0.0024600233596334121131131713284736635) }, { SC_(408.0), SC_(0.0024539864985596960025420239022893822) }, { SC_(409.0), SC_(0.0024479791936769585938530581198979943) }, { SC_(410.0), SC_(0.0024420012284567602449670519386819566) }, { SC_(411.0), SC_(0.0024360523884805556048718704990626824) }, { SC_(412.0), SC_(0.0024301324614140570641338923909529743) }, { SC_(413.0), SC_(0.0024242412369819710993869793925553873) }, { SC_(414.0), SC_(0.0024183785069431011992292719545097870) }, { SC_(415.0), SC_(0.0024125440650658111807924356222733288) }, { SC_(416.0), SC_(0.0024067377071038428254433283498099814) }, { SC_(417.0), SC_(0.0024009592307724818786977662196324666) }, { SC_(418.0), SC_(0.0023952084357250665735318270285392980) }, { SC_(419.0), SC_(0.0023894851235298329479280175919421505) }, { SC_(420.0), SC_(0.0023837890976470913367501363996500127) }, { SC_(421.0), SC_(0.0023781201634067285249587531796953642) }, { SC_(422.0), SC_(0.0023724781279860301538143791353151136) }, { SC_(423.0), SC_(0.0023668628003878180741216498614892786) }, { SC_(424.0), SC_(0.0023612739914188974407978175034031103) }, { SC_(425.0), SC_(0.0023557115136688084411538160794088063) }, { SC_(426.0), SC_(0.0023501751814888776453060652143569032) }, { SC_(427.0), SC_(0.0023446648109715640611406659329092186) }, { SC_(428.0), SC_(0.0023391802199300950682761188778603783) }, { SC_(429.0), SC_(0.0023337212278783874955623447491155098) }, { SC_(430.0), SC_(0.0023282876560112491948576104779476722) }, { SC_(431.0), SC_(0.0023228793271848565501848143719444272) }, { SC_(432.0), SC_(0.0023174960658975034459271930197768570) }, { SC_(433.0), SC_(0.0023121376982706173005225290965944153) }, { SC_(434.0), SC_(0.0023068040520300378531949525454367474) }, { SC_(435.0), SC_(0.0023014949564875544706640005184240693) }, { SC_(436.0), SC_(0.0022962102425226978185302972551131960) }, { SC_(437.0), SC_(0.0022909497425647818181936252578065720) }, { SC_(438.0), SC_(0.0022857132905751918847489300454946261) }, { SC_(439.0), SC_(0.0022805007220299155143646594923368520) }, { SC_(440.0), SC_(0.0022753118739023113612106181579726675) }, { SC_(441.0), SC_(0.0022701465846461130141031801414437419) }, { SC_(442.0), SC_(0.0022650046941786637517073676970404326) }, { SC_(443.0), SC_(0.0022598860438643786224102607581980666) }, { SC_(444.0), SC_(0.0022547904764984302608899472788937134) }, { SC_(445.0), SC_(0.0022497178362906549179794692332805327) }, { SC_(446.0), SC_(0.0022446679688496752436959191764695239) }, { SC_(447.0), SC_(0.0022396407211672364253002144568893997) }, { SC_(448.0), SC_(0.0022346359416027523430016192985131504) }, { SC_(449.0), SC_(0.0022296534798680584654505988903498851) }, { SC_(450.0), SC_(0.0022246931870123682655011938774779251) }, { SC_(451.0), SC_(0.0022197549154074299938962556058729868) }, { SC_(452.0), SC_(0.0022148385187328807045613949119727602) }, { SC_(453.0), SC_(0.0022099438519617944801115554570428518) }, { SC_(454.0), SC_(0.0022050707713464218600023009896461977) }, { SC_(455.0), SC_(0.0022002191344041175265201841234155314) }, { SC_(456.0), SC_(0.0021953887999034533555263427999038782) }, { SC_(457.0), SC_(0.0021905796278505139895675862594298863) }, { SC_(458.0), SC_(0.0021857914794753721406719726821563537) }, { SC_(459.0), SC_(0.0021810242172187408788729985969939807) }, { SC_(460.0), SC_(0.0021762777047188002102792478553514026) }, { SC_(461.0), SC_(0.0021715518067981952953454104262398714) }, { SC_(462.0), SC_(0.0021668463894512037039262095002137376) }, { SC_(463.0), SC_(0.0021621613198310691487267192357884082) }, { SC_(464.0), SC_(0.0021574964662374991829200960766562576) }, { SC_(465.0), SC_(0.0021528516981043243910057084428869353) }, { SC_(466.0), SC_(0.0021482268859873166444454124549114468) }, { SC_(467.0), SC_(0.0021436219015521640352612314974430831) }, { SC_(468.0), SC_(0.0021390366175626001416214789193671599) }, { SC_(469.0), SC_(0.0021344709078686853195015285942886297) }, { SC_(470.0), SC_(0.0021299246473952377537966991017876864) }, { SC_(471.0), SC_(0.0021253977121304120408043948917378901) }, { SC_(472.0), SC_(0.0021208899791144231117966821605475330) }, { SC_(473.0), SC_(0.0021164013264284133444884374032938703) }, { SC_(474.0), SC_(0.0021119316331834607455853001256052381) }, { SC_(475.0), SC_(0.0021074807795097261232847428787252865) }, { SC_(476.0), SC_(0.0021030486465457372036171528510244555) }, { SC_(477.0), SC_(0.0020986351164278076788660759496756807) }, { SC_(478.0), SC_(0.0020942400722795892100115563060258602) }, { SC_(479.0), SC_(0.0020898633982017544382113427243308619) }, { SC_(480.0), SC_(0.0020855049792618090927848496389625101) }, { SC_(481.0), SC_(0.0020811647014840313150070718611847323) }, { SC_(482.0), SC_(0.0020768424518395363482667828755735014) }, { SC_(483.0), SC_(0.0020725381182364647758076310014666506) }, { SC_(484.0), SC_(0.0020682515895102925173642410430888445) }, { SC_(485.0), SC_(0.0020639827554142608255399121038087407) }, { SC_(486.0), SC_(0.0020597315066099245517594891045527092) }, { SC_(487.0), SC_(0.0020554977346578169800817299553715207) }, { SC_(488.0), SC_(0.0020512813320082295550809920849078429) }, { SC_(489.0), SC_(0.0020470821919921048574190732458860746) }, { SC_(490.0), SC_(0.0020429002088120412076350726771363621) }, { SC_(491.0), SC_(0.0020387352775334073050944645971696816) }, { SC_(492.0), SC_(0.0020345872940755653349682414605475504) }, { SC_(493.0), SC_(0.0020304561552032010015688099052563877) }, { SC_(494.0), SC_(0.0020263417585177589713609094407410020) }, { SC_(495.0), SC_(0.0020222440024489822335025606725264762) }, { SC_(496.0), SC_(0.0020181627862465539098621158199604115) }, { SC_(497.0), SC_(0.0020140980099718400701118556742788299) }, { SC_(498.0), SC_(0.0020100495744897321307250317123988984) }, { SC_(499.0), SC_(0.0020060173814605874395103738842993516) }, { SC_(500.0), SC_(0.0020020013333322666697142686477741971) },
      { SC_(0.25000000000000000000000000000000000), SC_(17.197329154507110739271319119335224)}, { SC_(0.12500000000000000000000000000000000), SC_(65.388133444988034473142999334395961) }, { SC_(0.062500000000000000000000000000000000), SC_(257.50642004291541426394984152786018) }, { SC_(0.031250000000000000000000000000000000), SC_(1025.5728544782377088851896549789956) }, { SC_(0.015625000000000000000000000000000000), SC_(4097.6081469812325471140472931934309) }, { SC_(0.0078125000000000000000000000000000000), SC_(16385.626348148031663597978251925972) }, { SC_(0.0039062500000000000000000000000000000), SC_(65537.635592296074077546680509110271) }, { SC_(0.0019531250000000000000000000000000000), SC_(262145.64025088744769438583827382756) }, { SC_(0.00097656250000000000000000000000000000), SC_(1.0485776425893921526170408061678298e6) }, { SC_(0.00048828125000000000000000000000000000), SC_(4.1943056437609568090690403869475364e6) }, { SC_(0.00024414062500000000000000000000000000), SC_(1.6777217644347318475117100572465400e7) }, { SC_(0.00012207031250000000000000000000000000), SC_(6.7108865644640644300678883695523690e7) }, { SC_(0.000061035156250000000000000000000000000), SC_(2.6843545764478734348137667988052034e8) }, { SC_(0.000030517578125000000000000000000000000), SC_(1.0737418256448607021411790006489757e9) }, { SC_(0.000015258789062500000000000000000000000), SC_(4.2949672976448973837387528780800407e9) }, { SC_(7.6293945312500000000000000000000000e-6), SC_(1.7179869185644915725104496671656842e10) }, { SC_(3.8146972656250000000000000000000000e-6), SC_(6.8719476737644924895929112616949761e10) }, { SC_(1.9073486328125000000000000000000000e-6), SC_(2.7487790694564492948137685720609220e11) }, { SC_(9.5367431640625000000000000000000000e-7), SC_(1.0995116277776449317741095887303350e12) }, { SC_(4.7683715820312500000000000000000000e-7), SC_(4.3980465111056449329204781693093178e12) }, { SC_(2.3841857910156250000000000000000000e-7), SC_(1.7592186044417644933493663013304205e13) }, { SC_(1.1920928955078125000000000000000000e-7), SC_(7.0368744177665644933780255573728145e13) }, { SC_(5.9604644775390625000000000000000000e-8), SC_(2.8147497671065764493392355188854676e14) }, { SC_(2.9802322387695312500000000000000000e-8), SC_(1.1258999068426256449339952000546077e15) }, { SC_(1.4901161193847656250000000000000000e-8), SC_(4.5035996273704976449340310241398011e15) }, { SC_(7.4505805969238281250000000000000000e-9), SC_(1.8014398509481985644934048936182939e16) }, { SC_(3.7252902984619140625000000000000000e-9), SC_(7.2057594037927937644934057892204642e16) }, { SC_(1.8626451492309570312500000000000000e-9), SC_(2.8823037615171174564493406237021553e17) }, { SC_(9.3132257461547851562500000000000000e-10), SC_(1.1529215046068469776449340646092210e18) }, { SC_(4.6566128730773925781250000000000000e-10), SC_(4.6116860184273879056449340657287237e18) }, { SC_(2.3283064365386962890625000000000000e-10), SC_(1.8446744073709551617644934066288475e19) }, { SC_(1.1641532182693481445312500000000000e-10), SC_(7.3786976294838206465644934066568351e19) }, { SC_(5.8207660913467407226562500000000000e-11), SC_(2.9514790517935282585764493406670829e20) }, { SC_(2.9103830456733703613281250000000000e-11), SC_(1.1805916207174113034256449340667783e21) }, { SC_(1.4551915228366851806640625000000000e-11), SC_(4.7223664828696452136976449340668132e21) }, { SC_(7.2759576141834259033203125000000000e-12), SC_(1.8889465931478580854785644934066831e22) }, { SC_(3.6379788070917129516601562500000000e-12), SC_(7.5557863725914323419137644934066839e22) }, { SC_(1.8189894035458564758300781250000000e-12), SC_(3.0223145490365729367654564493406684e23) }, { SC_(9.0949470177292823791503906250000000e-13), SC_(1.2089258196146291747061776449340668e24) }, { SC_(4.5474735088646411895751953125000000e-13), SC_(4.8357032784585166988247056449340668e24) }, { SC_(2.2737367544323205947875976562500000e-13), SC_(1.9342813113834066795298817644934067e25) }, { SC_(1.1368683772161602973937988281250000e-13), SC_(7.7371252455336267181195265644934067e25) }, { SC_(5.6843418860808014869689941406250000e-14), SC_(3.0948500982134506872478105764493407e26) }, { SC_(2.8421709430404007434844970703125000e-14), SC_(1.2379400392853802748991242256449341e27) }, { SC_(1.4210854715202003717422485351562500e-14), SC_(4.9517601571415210995964968976449341e27) }, { SC_(7.1054273576010018587112426757812500e-15), SC_(1.9807040628566084398385987585644934e28) }, { SC_(3.5527136788005009293556213378906250e-15), SC_(7.9228162514264337593543950337644934e28) }, { SC_(1.7763568394002504646778106689453125e-15), SC_(3.1691265005705735037417580134564493e29) }, { SC_(8.8817841970012523233890533447265625e-16), SC_(1.2676506002282294014967032053776449e30) }, { SC_(4.4408920985006261616945266723632812e-16), SC_(5.0706024009129176059868128215056449e30) }, { SC_(2.2204460492503130808472633361816406e-16), SC_(2.0282409603651670423947251286017645e31) }, { SC_(1.1102230246251565404236316680908203e-16), SC_(8.1129638414606681695789005144065645e31) }, { SC_(5.5511151231257827021181583404541016e-17), SC_(3.2451855365842672678315602057625764e32) }, { SC_(2.7755575615628913510590791702270508e-17), SC_(1.2980742146337069071326240823050256e33) }, { SC_(1.3877787807814456755295395851135254e-17), SC_(5.1922968585348276285304963292200976e33) }, { SC_(6.9388939039072283776476979255676270e-18), SC_(2.0769187434139310514121985316880386e34) }, { SC_(3.4694469519536141888238489627838135e-18), SC_(8.3076749736557242056487941267521538e34) }, { SC_(1.7347234759768070944119244813919067e-18), SC_(3.3230699894622896822595176507008615e35) }, { SC_(8.6736173798840354720596224069595337e-19), SC_(1.3292279957849158729038070602803446e36) }, { SC_(4.3368086899420177360298112034797668e-19), SC_(5.3169119831396634916152282411213783e36) }, { SC_(2.1684043449710088680149056017398834e-19), SC_(2.1267647932558653966460912964485513e37) }, { SC_(1.0842021724855044340074528008699417e-19), SC_(8.5070591730234615865843651857942053e37) }, { SC_(5.4210108624275221700372640043497086e-20), SC_(3.4028236692093846346337460743176821e38) }, { SC_(2.7105054312137610850186320021748543e-20), SC_(1.3611294676837538538534984297270728e39) }, { SC_(1.3552527156068805425093160010874271e-20), SC_(5.4445178707350154154139937189082914e39) }, { SC_(6.7762635780344027125465800054371357e-21), SC_(2.1778071482940061661655974875633166e40) }, { SC_(3.3881317890172013562732900027185678e-21), SC_(8.7112285931760246646623899502532662e40) }, { SC_(1.6940658945086006781366450013592839e-21), SC_(3.4844914372704098658649559801013065e41) }, { SC_(8.4703294725430033906832250067964196e-22), SC_(1.3937965749081639463459823920405226e42) }, { SC_(4.2351647362715016953416125033982098e-22), SC_(5.5751862996326557853839295681620904e42) }, { SC_(2.1175823681357508476708062516991049e-22), SC_(2.2300745198530623141535718272648362e43) }, { SC_(1.0587911840678754238354031258495525e-22), SC_(8.9202980794122492566142873090593446e43) }, { SC_(5.2939559203393771191770156292477623e-23), SC_(3.5681192317648997026457149236237378e44) }, { SC_(2.6469779601696885595885078146238811e-23), SC_(1.4272476927059598810582859694494951e45) }, { SC_(1.3234889800848442797942539073119406e-23), SC_(5.7089907708238395242331438777979805e45) }, { SC_(6.6174449004242213989712695365597028e-24), SC_(2.2835963083295358096932575511191922e46) }, { SC_(3.3087224502121106994856347682798514e-24), SC_(9.1343852333181432387730302044767689e46) }, { SC_(1.6543612251060553497428173841399257e-24), SC_(3.6537540933272572955092120817907075e47) }, { SC_(8.2718061255302767487140869206996285e-25), SC_(1.4615016373309029182036848327162830e48) }, { SC_(4.1359030627651383743570434603498143e-25), SC_(5.8460065493236116728147393308651321e48) }, { SC_(2.0679515313825691871785217301749071e-25), SC_(2.3384026197294446691258957323460528e49) }, { SC_(1.0339757656912845935892608650874536e-25), SC_(9.3536104789177786765035829293842113e49) }, { SC_(5.1698788284564229679463043254372678e-26), SC_(3.7414441915671114706014331717536845e50) }, { SC_(2.5849394142282114839731521627186339e-26), SC_(1.4965776766268445882405732687014738e51) }, { SC_(1.2924697071141057419865760813593170e-26), SC_(5.9863107065073783529622930748058952e51) }, { SC_(6.4623485355705287099328804067965848e-27), SC_(2.3945242826029513411849172299223581e52) }, { SC_(3.2311742677852643549664402033982924e-27), SC_(9.5780971304118053647396689196894324e52) }, { SC_(1.6155871338926321774832201016991462e-27), SC_(3.8312388521647221458958675678757730e53) }, { SC_(8.0779356694631608874161005084957310e-28), SC_(1.5324955408658888583583470271503092e54) }, { SC_(4.0389678347315804437080502542478655e-28), SC_(6.1299821634635554334333881086012367e54) }, { SC_(2.0194839173657902218540251271239327e-28), SC_(2.4519928653854221733733552434404947e55) }, { SC_(1.0097419586828951109270125635619664e-28), SC_(9.8079714615416886934934209737619788e55) }, { SC_(5.0487097934144755546350628178098319e-29), SC_(3.9231885846166754773973683895047915e56) }, { SC_(2.5243548967072377773175314089049159e-29), SC_(1.5692754338466701909589473558019166e57) }, { SC_(1.2621774483536188886587657044524580e-29), SC_(6.2771017353866807638357894232076664e57) }, { SC_(6.3108872417680944432938285222622898e-30), SC_(2.5108406941546723055343157692830666e58) }, { SC_(3.1554436208840472216469142611311449e-30), SC_(1.0043362776618689222137263077132266e59) }, { SC_(1.5777218104420236108234571305655725e-30), SC_(4.0173451106474756888549052308529065e59) }, { SC_(7.8886090522101180541172856528278623e-31), SC_(1.6069380442589902755419620923411626e60) },
      { SC_(-0.5000000000), SC_(8.9348022005446793094172454999380756) }, { SC_(-1.500000000), SC_(9.3792466449891237538616899443825200) }, { SC_(-2.500000000), SC_(9.5392466449891237538616899443825200) }, { SC_(-3.500000000), SC_(9.6208792980503482436576083117294588) }, { SC_(-4.500000000), SC_(9.6702620140997309597069910277788415) }, { SC_(-5.500000000), SC_(9.7033198653394003811945943335639655) }, { SC_(-6.500000000), SC_(9.7269885043926548190644168187710661) }, { SC_(-7.500000000), SC_(9.7447662821704325968421945965488438) }, { SC_(-8.500000000), SC_(9.7586071126202595864615717591786016) }, { SC_(-9.500000000), SC_(9.7696874450302318856305468284306792) }, { SC_(-10.50000000), SC_(9.7787577398148123844967599803581168) }, { SC_(-11.50000000), SC_(9.7863191764877802483908998669365667) }, { SC_(-12.50000000), SC_(9.7927191764877802483908998669365667) }, { SC_(-13.50000000), SC_(9.7982061449377116612852757242753870) }, { SC_(-14.50000000), SC_(9.8029623875060826482056086612551730) }, { SC_(-15.50000000), SC_(9.8071247184113896201098750504331127) }, { SC_(-16.50000000), SC_(9.8107978129935751113862754177425709) }, { SC_(-17.50000000), SC_(9.8140631191160240909781121524364484) }, { SC_(-18.50000000), SC_(9.8169849598757026884945475067096405) }, { SC_(-19.50000000), SC_(9.8196148086593976260356388939548739) },
      { SC_(-0.99902343750000000000000000000000000), SC_(1.0485786445453819054093666757806164e6) }, { SC_(-1.9990234375000000000000000000000000), SC_(1.0485788947897014608301106052600290e6) }, { SC_(-2.9990234375000000000000000000000000), SC_(1.0485790059731858715118158380121717e6) }, { SC_(-3.9990234375000000000000000000000000), SC_(1.0485790685037146291468005792240191e6) }, { SC_(-4.9990234375000000000000000000000000), SC_(1.0485791085193442079759033312640482e6) }, { SC_(-5.9990234375000000000000000000000000), SC_(1.0485791363061664391826604906353499e6) }, { SC_(-6.9990234375000000000000000000000000), SC_(1.0485791567200251382893770121774963e6) }, { SC_(-7.9990234375000000000000000000000000), SC_(1.0485791723488405341606371612842196e6) }, { SC_(-8.9990234375000000000000000000000000), SC_(1.0485791846971991664479297252200281e6) }, { SC_(-9.9990234375000000000000000000000000), SC_(1.0485791946991525775874820980861239e6) }, { SC_(-10.999023437500000000000000000000000), SC_(1.0485792029650829946601990955306663e6) }, { SC_(-11.999023437500000000000000000000000), SC_(1.0485792099106578577646272234105154e6) }, { SC_(-12.999023437500000000000000000000000), SC_(1.0485792158287067176193079741367670e6) }, { SC_(-13.999023437500000000000000000000000), SC_(1.0485792209314593886753540118883170e6) }, { SC_(-14.999023437500000000000000000000000), SC_(1.0485792253764825933424418561922499e6) }, { SC_(-15.999023437500000000000000000000000), SC_(1.0485792292832094741599436510420027e6) }, { SC_(-16.999023437500000000000000000000000), SC_(1.0485792327438146631093348182751076e6) }, { SC_(-17.999023437500000000000000000000000), SC_(1.0485792358305693414284737055180265e6) }, { SC_(-18.999023437500000000000000000000000), SC_(1.0485792386009372194851110066962854e6) }, { SC_(-19.999023437500000000000000000000000), SC_(1.0485792411011813779926686635901794e6) },
      { SC_(-1.0009765625000000000000000000000000), SC_(1.0485786453346669585098368000725210e6)}, { SC_(-2.0009765625000000000000000000000000), SC_(1.0485788950907050310998538089289880e6) }, { SC_(-3.0009765625000000000000000000000000), SC_(1.0485790061295134851948027406034007e6) }, { SC_(-4.0009765625000000000000000000000000), SC_(1.0485790685990070793038292171104670e6) }, { SC_(-5.0009765625000000000000000000000000), SC_(1.0485791085833866557487460417106589e6) }, { SC_(-6.0009765625000000000000000000000000), SC_(1.0485791363521243952566116253382220e6) }, { SC_(-7.0009765625000000000000000000000000), SC_(1.0485791567545946099550113256489222e6) }, { SC_(-8.0009765625000000000000000000000000), SC_(1.0485791723757806110676477942302156e6) }, { SC_(-9.0009765625000000000000000000000000), SC_(1.0485791847187808756018779739003157e6) }, { SC_(-10.000976562500000000000000000000000), SC_(1.0485791947168280366669245397313590e6) }, { SC_(-11.000976562500000000000000000000000), SC_(1.0485792029798236302523575048817360e6) }, { SC_(-12.000976562500000000000000000000000), SC_(1.0485792099231379319842508274674963e6) }, { SC_(-13.000976562500000000000000000000000), SC_(1.0485792158394087991015231685011609e6) }, { SC_(-14.000976562500000000000000000000000), SC_(1.0485792209407379096480891892744762e6) }, { SC_(-15.000976562500000000000000000000000), SC_(1.0485792253846037068979581619480639e6) }, { SC_(-16.000976562500000000000000000000000), SC_(1.0485792292903769133919482794005111e6) }, { SC_(-17.000976562500000000000000000000000), SC_(1.0485792327501870178663179616292787e6) }, { SC_(-18.000976562500000000000000000000000), SC_(1.0485792358362719002281530732844340e6) }, { SC_(-19.000976562500000000000000000000000), SC_(1.0485792386060702710649859237414384e6) }, { SC_(-20.000976562500000000000000000000000), SC_(1.0485792411058261483202152741904670e6) },
   } };
   do_test_trigamma<T>(data, name, "Mathematica Data");
}
Пример #11
0
#ifdef _MSC_VER
#  pragma warning (disable : 4224)
#endif

#include <boost/math/special_functions/bessel.hpp>
#include <boost/array.hpp>
#include <boost/lexical_cast.hpp>
#include "../../test/table_type.hpp"
#include "table_helper.hpp"
#include "performance.hpp"
#include <iostream>

typedef double T;
#define SC_(x) static_cast<double>(x)
static const boost::array<boost::array<T, 3>, 9> k0_data = { {
   { { SC_(0.0), SC_(1.0), SC_(0.421024438240708333335627379212609036136219748226660472298970) } },
   { { SC_(0.0), SC_(2.0), SC_(0.113893872749533435652719574932481832998326624388808882892530) } },
   { { SC_(0.0), SC_(4.0), SC_(0.0111596760858530242697451959798334892250090238884743405382553) } },
   { { SC_(0.0), SC_(8.0), SC_(0.000146470705222815387096584408698677921967305368833759024089154) } },
   { { SC_(0.0), T(std::ldexp(1.0, -15)), SC_(10.5131392267382037062459525561594822400447325776672021972753) } },
   { { SC_(0.0), T(std::ldexp(1.0, -30)), SC_(20.9103469324567717360787328239372191382743831365906131108531) } },
   { { SC_(0.0), T(std::ldexp(1.0, -60)), SC_(41.7047623492551310138446473188663682295952219631968830346918) } },
   { { SC_(0.0), SC_(50.0), SC_(3.41016774978949551392067551235295223184502537762334808993276e-23) } },
   { { SC_(0.0), SC_(100.0), SC_(4.65662822917590201893900528948388635580753948544211387402671e-45) } },
   } };
static const boost::array<boost::array<T, 3>, 9> k1_data = { {
   { { SC_(1.0), SC_(1.0), SC_(0.601907230197234574737540001535617339261586889968106456017768) } },
   { { SC_(1.0), SC_(2.0), SC_(0.139865881816522427284598807035411023887234584841515530384442) } },
   { { SC_(1.0), SC_(4.0), SC_(0.0124834988872684314703841799808060684838415849886258457917076) } },
   { { SC_(1.0), SC_(8.0), SC_(0.000155369211805001133916862450622474621117065122872616157079566) } },
   { { SC_(1.0), T(std::ldexp(1.0, -15)), SC_(32767.9998319528316432647441316539139725104728341577594326513) } },
Пример #12
0
void test_bessel(T, const char* name)
{
    // function values calculated on http://functions.wolfram.com/
    static const boost::array<boost::array<T, 3>, 10> i0_data = {{
        {{ SC_(0), SC_(0), SC_(1) }},
        {{ SC_(0), SC_(1), SC_(1.26606587775200833559824462521471753760767031135496220680814) }},
        {{ SC_(0), SC_(-2), SC_(2.27958530233606726743720444081153335328584110278545905407084) }},
        {{ SC_(0), SC_(4), SC_(11.3019219521363304963562701832171024974126165944353377060065) }},
        {{ SC_(0), SC_(-7), SC_(168.593908510289698857326627187500840376522679234531714193194) }},
        {{ SC_(0), T(1) / 1024, SC_(1.00000023841859331241759166109699567801556273303717896447683) }},
        {{ SC_(0), T(SC_(1)) / (1024*1024), SC_(1.00000000000022737367544324498417583090700894607432256476338) }},
        {{ SC_(0), SC_(-1), SC_(1.26606587775200833559824462521471753760767031135496220680814) }},
        {{ SC_(0), SC_(100), SC_(1.07375170713107382351972085760349466128840319332527279540154e42) }},
        {{ SC_(0), SC_(200), SC_(2.03968717340972461954167312677945962233267573614834337894328e85) }},
    }};
    static const boost::array<boost::array<T, 3>, 10> i1_data = {{
        {{ SC_(1), SC_(0), SC_(0) }},
        {{ SC_(1), SC_(1), SC_(0.565159103992485027207696027609863307328899621621092009480294) }},
        {{ SC_(1), SC_(-2), SC_(-1.59063685463732906338225442499966624795447815949553664713229) }},
        {{ SC_(1), SC_(4), SC_(9.75946515370444990947519256731268090005597033325296730692753) }},
        {{ SC_(1), SC_(-8), SC_(-399.873136782560098219083086145822754889628443904067647306574) }},
        {{ SC_(1), T(SC_(1))/1024, SC_(0.000488281308207663226432087816784315537514225208473395063575150) }},
        {{ SC_(1), T(SC_(1))/(1024*1024), SC_(4.76837158203179210108624277276025646653133998635956784292029E-7) }},
        {{ SC_(1), SC_(-10), SC_(-2670.98830370125465434103196677215254914574515378753771310849) }},
        {{ SC_(1), SC_(100), SC_(1.06836939033816248120614576322429526544612284405623226965918e42) }},
        {{ SC_(1), SC_(200), SC_(2.03458154933206270342742797713906950389661161681122964159220e85) }},
    }};
    static const boost::array<boost::array<T, 3>, 11> in_data = {{
        {{ SC_(-2), SC_(0), SC_(0) }},
        {{ SC_(2), T(SC_(1))/(1024*1024), SC_(1.13686837721624646204093977095674566928522671779753217215467e-13) }},
        {{ SC_(5), SC_(10), SC_(777.188286403259959907293484802339632852674154572666041953297) }},
        {{ SC_(-5), SC_(100), SC_(9.47009387303558124618275555002161742321578485033007130107740e41) }},
        {{ SC_(-5), SC_(-1), SC_(-0.000271463155956971875181073905153777342383564426758143634974124) }},
        {{ SC_(10), SC_(20), SC_(3.54020020901952109905289138244985607057267103782948493874391e6) }},
        {{ SC_(10), SC_(-5), SC_(0.00458004441917605126118647027872016953192323139337073320016447) }},
        {{ SC_(1e+02), SC_(9), SC_(2.74306601746058997093587654668959071522869282506446891736820e-93) }},
        {{ SC_(1e+02), SC_(80), SC_(4.65194832850610205318128191404145885093970505338730540776711e8) }},
        {{ SC_(-100), SC_(-200), SC_(4.35275044972702191438729017441198257508190719030765213981307e74) }},
        {{ SC_(10), SC_(1e-100), SC_(2.69114445546737213403880070546737213403880070546737213403880e-1010) }},
    }};
    static const boost::array<boost::array<T, 3>, 10> iv_data = {{
        {{ SC_(2.25), T(1)/(1024*1024), SC_(2.34379212133481347189068464680335815256364262507955635911656e-15) }},
        {{ SC_(5.5), SC_(3.125), SC_(0.0583514045989371500460946536220735787163510569634133670181210) }},
        {{ T(-5) + T(1)/1024, SC_(2.125), SC_(0.0267920938009571023702933210070984416052633027166975342895062) }},
        {{ SC_(-5.5), SC_(10), SC_(597.577606961369169607937419869926705730305175364662688426534) }},
        {{ SC_(-5.5), SC_(100), SC_(9.22362906144706871737354069133813819358704200689067071415379e41) }},
        {{ T(-10486074)/(1024*1024), T(1)/1024, SC_(1.41474005665181350367684623930576333542989766867888186478185e35) }},
        {{ T(-10486074)/(1024*1024), SC_(50), SC_(1.07153277202900671531087024688681954238311679648319534644743e20) }},
        {{ T(144794)/1024, SC_(100), SC_(2066.27694757392660413922181531984160871678224178890247540320) }},
        {{ T(144794)/1024, SC_(200), SC_(2.23699739472246928794922868978337381373643889659337595319774e64) }},
        {{ T(-144794)/1024, SC_(100), SC_(2066.27694672763190927440969155740243346136463461655104698748) }},
    }};
    static const boost::array<boost::array<T, 3>, 5> iv_large_data = {{
        // Bug report https://svn.boost.org/trac/boost/ticket/5560:
        {{ SC_(-1), static_cast<T>(ldexp(0.5, -512)), SC_(1.86458518280005168582274132886573345934411788365010172356788e-155) }},
        {{ SC_(1),  static_cast<T>(ldexp(0.5, -512)), SC_(1.86458518280005168582274132886573345934411788365010172356788e-155) }},
        {{ SC_(-1.125), static_cast<T>(ldexp(0.5, -512)), SC_(-1.34963720853101363690381585556234820027343435206156667634081e173) }},
        {{ SC_(1.125),  static_cast<T>(ldexp(0.5, -512)), SC_(8.02269390325932403421158766283366891170783955777638875887348e-175) }},
        {{ SC_(0.5), static_cast<T>(ldexp(0.5, -683)), SC_(8.90597649117647254543282704099383321071493400182381039079219e-104) }},
    }};

    do_test_cyl_bessel_i<T>(i0_data, name, "Bessel I0: Mathworld Data");
    do_test_cyl_bessel_i<T>(i1_data, name, "Bessel I1: Mathworld Data");
    do_test_cyl_bessel_i<T>(in_data, name, "Bessel In: Mathworld Data");

    do_test_cyl_bessel_i_int<T>(i0_data, name, "Bessel I0: Mathworld Data (Integer Version)");
    do_test_cyl_bessel_i_int<T>(i1_data, name, "Bessel I1: Mathworld Data (Integer Version)");
    do_test_cyl_bessel_i_int<T>(in_data, name, "Bessel In: Mathworld Data (Integer Version)");

    do_test_cyl_bessel_i<T>(iv_data, name, "Bessel Iv: Mathworld Data");

#include "bessel_i_int_data.ipp"
    do_test_cyl_bessel_i<T>(bessel_i_int_data, name, "Bessel In: Random Data");
#include "bessel_i_data.ipp"
    do_test_cyl_bessel_i<T>(bessel_i_data, name, "Bessel Iv: Random Data");

    if(0 != static_cast<T>(ldexp(0.5, -700)))
      do_test_cyl_bessel_i<T>(iv_large_data, name, "Bessel Iv: Mathworld Data (large values)");
}
Пример #13
0
#ifdef _MSC_VER
#  pragma warning (disable : 4224)
#endif

#include <boost/math/special_functions/jacobi_elliptic.hpp>
#include <boost/array.hpp>
#include <boost/lexical_cast.hpp>
#include "../../test/table_type.hpp"
#include "table_helper.hpp"
#include "performance.hpp"
#include <iostream>

typedef double T;
#define SC_(x) static_cast<double>(x)
static const boost::array<boost::array<T, 5>, 36> data1 = {{
        {{ SC_(0.0), SC_(0.0), SC_(0.0), SC_(1.0), SC_(1.0) }},
        {{ ldexp(T(1), -25), ldexp(T(1), -25), SC_(2.98023223876953080883700663838486782870427050521881839342311e-8), SC_(0.99999999999999955591079014993741669975171697261290223678373), SC_(0.99999999999999999999999999999960556954738949421406900774443) }},
        {{ -ldexp(T(1), -25), ldexp(T(1), -25), SC_(-2.98023223876953080883700663838486782870427050521881839342311e-8), SC_(0.99999999999999955591079014993741669975171697261290223678373), SC_(0.99999999999999999999999999999960556954738949421406900774443) }},
        {{ SC_(0.25), ldexp(T(1), -25), SC_(0.247403959254522927383635623557663763268693729825996390997241), SC_(0.968912421710644784709721529742747886950140086772629513814665), SC_(0.99999999999999997281786831901333837240938011109848356555885) }},
        {{ SC_(-0.25), ldexp(T(1), -25), SC_(-0.247403959254522927383635623557663763268693729825996390997241), SC_(0.968912421710644784709721529742747886950140086772629513814665), SC_(0.99999999999999997281786831901333837240938011109848356555885) }},
        {{ SC_(1.25), ldexp(T(1), -25), SC_(0.948984619355586147780156037971989352776684194861616269831136), SC_(0.315322362395268865789580233344649598639316847638615703458263), SC_(0.99999999999999960006577747263860127231780811081154547949983) }},
        {{ SC_(-1.25), ldexp(T(1), -25), SC_(-0.948984619355586147780156037971989352776684194861616269831136), SC_(0.315322362395268865789580233344649598639316847638615703458263), SC_(0.99999999999999960006577747263860127231780811081154547949983) }},
        {{ SC_(25.0), ldexp(T(1), -25), SC_(-0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }},
        {{ SC_(-25.0), ldexp(T(1), -25), SC_(0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }},
        {{ ldexp(T(1), -25), SC_(0.5), SC_(2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }},
        {{ -ldexp(T(1), -25), SC_(0.5), SC_(-2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }},
        {{ SC_(0.25), SC_(0.5), SC_(0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }},
        {{ SC_(-0.25), SC_(0.5), SC_(-0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }},
        {{ SC_(1.25), SC_(0.5), SC_(0.928561236426319775700204388269999130782711902203415239399579), SC_(0.371179242693370810357222594552131893184749696381729988511999), SC_(0.885688154799196841458565445994481097477880319663264816077719) }},
        {{ SC_(-1.25), SC_(0.5), SC_(-0.928561236426319775700204388269999130782711902203415239399579), SC_(0.371179242693370810357222594552131893184749696381729988511999), SC_(0.885688154799196841458565445994481097477880319663264816077719) }},
        {{ SC_(25.0), SC_(0.5), SC_(-0.969223071486651608400225080456020493867827336842041561445359), SC_(-0.246184154035106463351874891855925292474628176040625311168501), SC_(0.874729477852721764836147376110255133761608728373832418508248) }},
Пример #14
0
void test_spots(T, const char* type_name)
{
    // function values calculated on http://functions.wolfram.com/
    #define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
    static const boost::array<boost::array<T, 4>, 25> data1 = {
        SC_(1), SC_(-1), SC_(0), SC_(-1.557407724654902230506974807458360173087),
        SC_(0), SC_(-4), SC_(0.4), SC_(-4.153623371196831087495427530365430979011),
        SC_(0), SC_(8), SC_(-0.6), SC_(8.935930619078575123490612395578518914416),
        SC_(0), SC_(0.5), SC_(0.25), SC_(0.501246705365439492445236118603525029757890291780157969500480),
        SC_(0), SC_(0.5), SC_(0), SC_(0.5),
        SC_(-2), SC_(0.5), SC_(0), SC_(0.437501067017546278595664813509803743009132067629603474488486),
        SC_(0.25), SC_(0.5), SC_(0), SC_(0.510269830229213412212501938035914557628394166585442994564135),
        SC_(0.75), SC_(0.5), SC_(0), SC_(0.533293253875952645421201146925578536430596894471541312806165),
        SC_(0.75), SC_(0.75), SC_(0), SC_(0.871827580412760575085768367421866079353646112288567703061975),
        SC_(1), SC_(0.25), SC_(0), SC_(0.255341921221036266504482236490473678204201638800822621740476),
        SC_(2), SC_(0.25), SC_(0), SC_(0.261119051639220165094943572468224137699644963125853641716219),
        SC_(1023)/1024, SC_(1.5), SC_(0), SC_(13.2821612239764190363647953338544569682942329604483733197131),
        SC_(0.5), SC_(-1), SC_(0.5), SC_(-1.228014414316220642611298946293865487807),
        SC_(0.5), SC_(1e+10), SC_(0.5), SC_(1.536591003599172091573590441336982730551e+10),
        SC_(-1e+05), SC_(10), SC_(0.75), SC_(0.0347926099493147087821620459290460547131012904008557007934290),
        SC_(-1e+10), SC_(10), SC_(0.875), SC_(0.000109956202759561502329123384755016959364346382187364656768212),
        SC_(-1e+10), SC_(1e+20), SC_(0.875), SC_(1.00000626665567332602765201107198822183913978895904937646809e15),
        SC_(-1e+10), SC_(1608)/1024, SC_(0.875), SC_(0.0000157080616044072676127333183571107873332593142625043567690379),
        1-SC_(1) / 1024, SC_(1e+20), SC_(0.875), SC_(6.43274293944380717581167058274600202023334985100499739678963e21),
        SC_(50), SC_(0.1), SC_(0.25), SC_(0.124573770342749525407523258569507331686458866564082916835900),
        SC_(1.125), SC_(1), SC_(0.25), SC_(1.77299767784815770192352979665283069318388205110727241629752),
        SC_(1.125), SC_(10), SC_(0.25), SC_(0.662467818678976949597336360256848770217429434745967677192487),
        SC_(1.125), SC_(3), SC_(0.25), SC_(-0.142697285116693775525461312178015106079842313950476205580178),
        SC_(257)/256, SC_(1.5), SC_(0.1), SC_(22.2111124684047142809404895720078056163182744133864821626782),
        SC_(257)/256, SC_(21.5), SC_(0.1), SC_(-0.535282720703701002972775208780096689181320029073372524045546),
    };
    #undef SC_

    do_test_ellint_pi3(data1, type_name, "Elliptic Integral PI: Mathworld Data");

#include "ellint_pi3_data.ipp"

    do_test_ellint_pi3(ellint_pi3_data, type_name, "Elliptic Integral PI: Random Data");

#include "ellint_pi3_large_data.ipp"

    do_test_ellint_pi3(ellint_pi3_large_data, type_name, "Elliptic Integral PI: Large Random Data");

    // function values calculated on http://functions.wolfram.com/
    #define SC_(x) static_cast<T>(BOOST_JOIN(x, L))
    static const boost::array<boost::array<T, 3>, 9> data2 = {
        SC_(0), SC_(0.2), SC_(1.586867847454166237308008033828114192951),
        SC_(0), SC_(0.4), SC_(1.639999865864511206865258329748601457626),
        SC_(0), SC_(0), SC_(1.57079632679489661923132169163975144209858469968755291048747),
        SC_(0.5), SC_(0), SC_(2.221441469079183123507940495030346849307),
        SC_(-4), SC_(0.3), SC_(0.712708870925620061597924858162260293305195624270730660081949),
        SC_(-1e+05), SC_(-0.5), SC_(0.00496944596485066055800109163256108604615568144080386919012831),
        SC_(-1e+10), SC_(-0.75), SC_(0.0000157080225184890546939710019277357161497407143903832703317801),
        SC_(1) / 1024, SC_(-0.875), SC_(2.18674503176462374414944618968850352696579451638002110619287),
        SC_(1023)/1024, SC_(-0.875), SC_(101.045289804941384100960063898569538919135722087486350366997),
    };
    #undef SC_

    do_test_ellint_pi2(data2, type_name, "Complete Elliptic Integral PI: Mathworld Data");

#include "ellint_pi2_data.ipp"

    do_test_ellint_pi2(ellint_pi2_data, type_name, "Complete Elliptic Integral PI: Random Data");

    // Special cases, exceptions etc:
    BOOST_CHECK_THROW(boost::math::ellint_3(T(1.0001), T(-1), T(0)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::ellint_3(T(0.5), T(20), T(1.5)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::ellint_3(T(1.0001), T(-1)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::ellint_3(T(0.5), T(1)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::ellint_3(T(0.5), T(2)), std::domain_error);
}
Пример #15
0
void test_bessel(T, const char* name)
{
    BOOST_MATH_STD_USING
    // function values calculated on wolframalpha.com
    static const boost::array<boost::array<T, 3>, 10> i0_prime_data = {{
        {{ SC_(0.0), SC_(0.0), SC_(0.0) }},
        {{ SC_(0.0), SC_(1.0), SC_(0.565159103992485027207696027609863307328899621621) }},
        {{ SC_(0.0), SC_(-2.0), SC_(-1.590636854637329063382254424999666247954478159496) }},
        {{ SC_(0.0), SC_(4.0), SC_(9.75946515370444990947519256731268090005597033325) }},
        {{ SC_(0.0), SC_(-7.0), SC_(-156.039092869955453462390580660711155630031052042) }},
        {{ SC_(0.0), T(1) / 1024, SC_(0.000488281308207663226432087816784315537514225208473395) }},
        {{ SC_(0.0), T(SC_(1.0)) / (1024*1024), SC_(4.76837158203179210108624277276025646653133998635957e-7) }},
        {{ SC_(0.0), SC_(-1.0), SC_(-0.565159103992485027207696027609863307328899621621) }},
        {{ SC_(0.0), SC_(100.0), SC_(1.068369390338162481206145763224295265446122844056e42) }},
        {{ SC_(0.0), SC_(200.0), SC_(2.034581549332062703427427977139069503896611616811e85) }},
    }};
    static const boost::array<boost::array<T, 3>, 10> i1_prime_data = {{
        {{ SC_(1.0), SC_(0.0), SC_(0.5) }},
        {{ SC_(1.0), SC_(1.0), SC_(0.700906773759523308390548597604854230278770689734) }},
        {{ SC_(1.0), SC_(-2.0), SC_(1.484266875017402735746077228311700229308602023038) }},
        {{ SC_(1.0), SC_(4.0), SC_(8.86205566371021801898747204138893227239862401112) }},
        {{ SC_(1.0), SC_(-8.0), SC_(377.579973623984772900011405549855040764360549303) }},
        {{ SC_(1.0), T(SC_(1.0))/1024, SC_(0.500000178813946168551133736709856567600996119560422) }},
        {{ SC_(1.0), T(SC_(1.0))/(1024*1024), SC_(0.500000000000170530256582434815189962442052310320626) }},
        {{ SC_(1.0), SC_(-10.0), SC_(2548.6177980961290060357079567493748381638767230173) }},
        {{ SC_(1.0), SC_(100.0), SC_(1.063068013227692198707659399971251708633941964885e42) }},
        {{ SC_(1.0), SC_(200.0), SC_(2.029514265663064306024535986893764274813192678064e85) }},
    }};
    static const boost::array<boost::array<T, 3>, 11> in_prime_data = {{
        {{ SC_(-2.0), SC_(0.0), SC_(0.0) }},
        {{ SC_(2.0), T(SC_(1.0))/(1024*1024), SC_(2.38418579101598640072416185021877537269848820467704e-7) }},
        {{ SC_(5.0), SC_(10.0), SC_(837.8963945578616177877239800250165373153505679130) }},
        {{ SC_(-5.0), SC_(100.0), SC_(9.434574089052212641696648538570565739509851953166e41) }},
        {{ SC_(-5.0), SC_(-1.0), SC_(0.001379804441262006949232714689824343061461150959112) }},
        {{ SC_(10.0), SC_(20.0), SC_(3.887291476282816593964936516887942731146400030466e6) }},
        {{ SC_(10.0), SC_(-5.0), SC_(-0.0101556299784624552653083645193223022003797137770) }},
        {{ SC_(1e+02), SC_(9.0), SC_(3.0600487816519872979909028718737622834061708443e-92) }},
        {{ SC_(1e+02), SC_(80.0), SC_(7.43545006374466980237328068214707549314834217923e8) }},
        {{ SC_(-100.0), SC_(-200.0), SC_(-4.8578174816088978115191937982677942557681326349558e74) }},
        {{ SC_(10.0), SC_(1e-100), SC_(2.6911444554673721340388007054673721340e-909) }},
    }};
    static const boost::array<boost::array<T, 3>, 10> iv_prime_data = {{
        {{ SC_(2.25), T(1)/(1024*1024), SC_(5.5296993766970839641084373853875345330202883e-9) }},
        {{ SC_(5.5), SC_(3.125), SC_(0.11607917746126037030394881599790144677553715606) }},
        {{ T(-5) + T(1)/1024, SC_(2.125), SC_(0.0001131925559871199041270456478317398625046249903864372470342210384462922281) }},
        {{ SC_(-5.5), SC_(10.0), SC_(659.1902595786901927596924259811320437384361101) }},
        {{ SC_(-5.5), SC_(100.0), SC_(9.191476042191556775282339209385028823905941708e41) }},
        {{ T(-10486074)/(1024*1024), T(1)/1024, SC_(-1.44873720736417608945635957884937466861026978539e39) }},
        {{ T(-10486074)/(1024*1024), SC_(50.0), SC_(1.082410021443599516897183930739816215073642812109e20) }},
        {{ T(144794)/1024, SC_(100.0), SC_(3575.11008553328328036816705258135747714241715202) }},
        {{ T(144794)/1024, SC_(200.0), SC_(2.7358895637426974377937620224627094172800852276956e64) }},
        {{ T(-144794)/1024, SC_(100.0), SC_(3575.11008700037933897402396449269857968451879323) }},
    }};
    static const boost::array<boost::array<T, 3>, 5> iv_prime_large_data = {{
        {{ SC_(-1.0), static_cast<T>(ldexp(0.5, -512)), SC_(0.5) }},
        {{ SC_(1.0),  static_cast<T>(ldexp(0.5, -512)), SC_(0.5) }},
        {{ SC_(1.125),  static_cast<T>(ldexp(0.5, -512)), SC_(2.42025162605150606399395900489934587657244145536315936432966315563638e-20) }},
        {{ SC_(0.5), static_cast<T>(ldexp(0.5, -683)), SC_(3.5741154998461284276309443770923823816821202344841143399486401387635e102) }},
#if LDBL_MAX_10_EXP > 326
        {{ SC_(-1.125), static_cast<T>(ldexp(0.5, -512)), SC_(4.0715272050947359203430409041001937149343363573066460226173390878707e327) }},
#else
        { { SC_(-1.125), static_cast<T>(ldexp(0.5, -512)), std::numeric_limits<T>::has_infinity ? std::numeric_limits<T>::infinity() : boost::math::tools::max_value<T>() } },
#endif
    }};

    do_test_cyl_bessel_i_prime<T>(i0_prime_data, name, "Bessel I'0: Mathworld Data");
    do_test_cyl_bessel_i_prime<T>(i1_prime_data, name, "Bessel I'1: Mathworld Data");
    do_test_cyl_bessel_i_prime<T>(in_prime_data, name, "Bessel I'n: Mathworld Data");

    do_test_cyl_bessel_i_prime_int<T>(i0_prime_data, name, "Bessel I'0: Mathworld Data (Integer Version)");
    do_test_cyl_bessel_i_prime_int<T>(i1_prime_data, name, "Bessel I'1: Mathworld Data (Integer Version)");
    do_test_cyl_bessel_i_prime_int<T>(in_prime_data, name, "Bessel I'n: Mathworld Data (Integer Version)");

    do_test_cyl_bessel_i_prime<T>(iv_prime_data, name, "Bessel I'v: Mathworld Data");

#include "bessel_i_prime_int_data.ipp"
    do_test_cyl_bessel_i_prime<T>(bessel_i_prime_int_data, name, "Bessel I'n: Random Data");
#include "bessel_i_prime_data.ipp"
    do_test_cyl_bessel_i_prime<T>(bessel_i_prime_data, name, "Bessel I'v: Random Data");

    if(0 != static_cast<T>(ldexp(static_cast<T>(0.5), -700)))
      do_test_cyl_bessel_i_prime<T>(iv_prime_large_data, name, "Bessel I'v: Mathworld Data (large values)");
}
Пример #16
0
 static const value_type& abcissa()
 {
   static const value_type x={
     SC_(0.999262104992609834193457486540341),
     SC_(0.995556969790498097908784946893902),
     SC_(0.988035794534077247637331014577406),
     SC_(0.976663921459517511498315386479594),
     SC_(0.961614986425842512418130033660167),
     SC_(0.942974571228974339414011169658471),
     SC_(0.920747115281701561746346084546331),
     SC_(0.894991997878275368851042006782805),
     SC_(0.865847065293275595448996969588340),
     SC_(0.833442628760834001421021108693570),
     SC_(0.797873797998500059410410904994307),
     SC_(0.759259263037357630577282865204361),
     SC_(0.717766406813084388186654079773298),
     SC_(0.673566368473468364485120633247622),
     SC_(0.626810099010317412788122681624518),
     SC_(0.577662930241222967723689841612654),
     SC_(0.526325284334719182599623778158010),
     SC_(0.473002731445714960522182115009192),
     SC_(0.417885382193037748851814394594572),
     SC_(0.361172305809387837735821730127641),
     SC_(0.303089538931107830167478909980339),
     SC_(0.243866883720988432045190362797452),
     SC_(0.183718939421048892015969888759528),
     SC_(0.122864692610710396387359818808037),
     SC_(0.061544483005685078886546392366797),
     SC_(0.000000000000000000000000000000000)
   };
   return x;
 }
Пример #17
0
void test_spots(T, const char* type_name)
{
    // Function values calculated on http://functions.wolfram.com/
    // Note that Mathematica's EllipticF accepts k^2 as the second parameter.
    static const boost::array<boost::array<T, 3>, 19> data1 = {{
        {{ SC_(0.0), SC_(0.0), SC_(0.0) }},
        {{ SC_(-10.0), SC_(0.0), SC_(-10.0) }},
        {{ SC_(-1.0), SC_(-1.0), SC_(-1.2261911708835170708130609674719067527242483502207) }},
        {{ SC_(-4.0), SC_(0.875), SC_(-5.3190556182262405182189463092940736859067548232647) }},
        {{ SC_(8.0), SC_(-0.625), SC_(9.0419973860310100524448893214394562615252527557062) }},
        {{ SC_(1e-05), SC_(0.875), SC_(0.000010000000000127604166668510945638036143355898993088) }},
        {{ SC_(1e+05), T(10)/1024, SC_(100002.38431454899771096037307519328741455615271038) }},
        {{ SC_(1e-20), SC_(1.0), SC_(1.0000000000000000000000000000000000000000166666667e-20) }},
        {{ SC_(1e-20), SC_(1e-20), SC_(1.000000000000000e-20) }},
        {{ SC_(1e+20), T(400)/1024, SC_(1.0418143796499216839719289963154558027005142709763e20) }},
        {{ SC_(1e+50), SC_(0.875), SC_(1.3913251718238765549409892714295358043696028445944e50) }},
        {{ SC_(2.0), SC_(0.5), SC_(2.1765877052210673672479877957388515321497888026770) }},
        {{ SC_(4.0), SC_(0.5), SC_(4.2543274975235836861894752787874633017836785640477) }},
        {{ SC_(6.0), SC_(0.5), SC_(6.4588766202317746302999080620490579800463614807916) }},
        {{ SC_(10.0), SC_(0.5), SC_(10.697409951222544858346795279378531495869386960090) }},
        {{ SC_(-2.0), SC_(0.5), SC_(-2.1765877052210673672479877957388515321497888026770) }},
        {{ SC_(-4.0), SC_(0.5), SC_(-4.2543274975235836861894752787874633017836785640477) }},
        {{ SC_(-6.0), SC_(0.5), SC_(-6.4588766202317746302999080620490579800463614807916) }},
        {{ SC_(-10.0), SC_(0.5), SC_(-10.697409951222544858346795279378531495869386960090) }},
    }};

    do_test_ellint_f<T>(data1, type_name, "Elliptic Integral F: Mathworld Data");

#include "ellint_f_data.ipp"

    do_test_ellint_f<T>(ellint_f_data, type_name, "Elliptic Integral F: Random Data");

    // Function values calculated on http://functions.wolfram.com/
    // Note that Mathematica's EllipticK accepts k^2 as the second parameter.
    static const boost::array<boost::array<T, 2>, 9> data2 = {{
        {{ SC_(0.0), SC_(1.5707963267948966192313216916397514420985846996876) }},
        {{ SC_(0.125), SC_(1.5769867712158131421244030532288080803822271060839) }},
        {{ SC_(0.25), SC_(1.5962422221317835101489690714979498795055744578951) }},
        {{ T(300)/1024, SC_(1.6062331054696636704261124078746600894998873503208) }},
        {{ T(400)/1024, SC_(1.6364782007562008756208066125715722889067992997614) }},
        {{ SC_(-0.5), SC_(1.6857503548125960428712036577990769895008008941411) }},
        {{ SC_(-0.75), SC_(1.9109897807518291965531482187613425592531451316788) }},
        {{ 1-T(1)/8, SC_(2.185488469278223686913080323730158689730428415766) }},
        {{ 1-T(1)/1024, SC_(4.5074135978990422666372495313621124487894807327687) }},
    }};

    do_test_ellint_k<T>(data2, type_name, "Elliptic Integral K: Mathworld Data");

#include "ellint_k_data.ipp"

    do_test_ellint_k<T>(ellint_k_data, type_name, "Elliptic Integral K: Random Data");
}
Пример #18
0
 static const value_type& abcissa()
 {
   static const value_type x={
     SC_(0.995657163025808080735527280689003),
     SC_(0.973906528517171720077964012084452),
     SC_(0.930157491355708226001207180059508),
     SC_(0.865063366688984510732096688423493),
     SC_(0.780817726586416897063717578345042),
     SC_(0.679409568299024406234327365114874),
     SC_(0.562757134668604683339000099272694),
     SC_(0.433395394129247190799265943165784),
     SC_(0.294392862701460198131126603103866),
     SC_(0.148874338981631210884826001129720),
     SC_(0.000000000000000000000000000000000)
   };
   return x;
 }
Пример #19
0
 static const value_type& weights()
 {
   static const value_type w={
     SC_(0.011694638867371874278064396062192),
     SC_(0.032558162307964727478818972459390),
     SC_(0.054755896574351996031381300244580),
     SC_(0.075039674810919952767043140916190),
     SC_(0.093125454583697605535065465083366),
     SC_(0.109387158802297641899210590325805),
     SC_(0.123491976262065851077958109831074),
     SC_(0.134709217311473325928054001771707),
     SC_(0.142775938577060080797094273138717),
     SC_(0.147739104901338491374841515972068),
     SC_(0.149445554002916905664936468389821)
   };
   return w;
 }
Пример #20
0
 static const value_type& weights()
 {
   static const value_type w={
     SC_(0.005377479872923348987792051430128),
     SC_(0.015007947329316122538374763075807),
     SC_(0.025460847326715320186874001019653),
     SC_(0.035346360791375846222037948478360),
     SC_(0.044589751324764876608227299373280),
     SC_(0.053481524690928087265343147239430),
     SC_(0.062009567800670640285139230960803),
     SC_(0.069854121318728258709520077099147),
     SC_(0.076849680757720378894432777482659),
     SC_(0.083080502823133021038289247286104),
     SC_(0.088564443056211770647275443693774),
     SC_(0.093126598170825321225486872747346),
     SC_(0.096642726983623678505179907627589),
     SC_(0.099173598721791959332393173484603),
     SC_(0.100769845523875595044946662617570),
     SC_(0.101330007014791549017374792767493)
   };
   return w;
 }
Пример #21
0
void test_bessel(T, const char* name)
{
   //
   // The actual test data is rather verbose, so it's in a separate file
   //
   // The contents are as follows, each row of data contains
   // three items, input value a, input value b and erf(a, b):
   // 
    // function values calculated on http://functions.wolfram.com/
    static const boost::array<boost::array<typename table_type<T>::type, 3>, 9> y0_data = {{
        {{ SC_(0), SC_(1), SC_(0.0882569642156769579829267660235151628278175230906755467110438) }},
        {{ SC_(0), SC_(2), SC_(0.510375672649745119596606592727157873268139227085846135571839) }},
        {{ SC_(0), SC_(4), SC_(-0.0169407393250649919036351344471532182404925898980149027169321) }},
        {{ SC_(0), SC_(8), SC_(0.223521489387566220527323400498620359274814930781423577578334) }},
        {{ SC_(0), SC_(1e-05), SC_(-7.40316028370197013259676050746759072070960287586102867247159) }},
        {{ SC_(0), SC_(1e-10), SC_(-14.7325162726972420426916696426209144888762342592762415255386) }},
        {{ SC_(0), SC_(1e-20), SC_(-29.3912282502857968601858410375186700783698345615477536431464) }},
        {{ SC_(0), SC_(1e+03), SC_(0.00471591797762281339977326146566525500985900489680197718528000) }},
        {{ SC_(0), SC_(1e+05), SC_(0.00184676615886506410434074102431546125884886798090392516843524) }}
    }};
    static const boost::array<boost::array<typename table_type<T>::type, 3>, 9> y1_data = {{
        {{ SC_(1), SC_(1), SC_(-0.781212821300288716547150000047964820549906390716444607843833) }},
        {{ SC_(1), SC_(2), SC_(-0.107032431540937546888370772277476636687480898235053860525795) }},
        {{ SC_(1), SC_(4), SC_(0.397925710557100005253979972450791852271189181622908340876586) }},
        {{ SC_(1), SC_(8), SC_(-0.158060461731247494255555266187483550327344049526705737651263) }},
        {{ SC_(1), SC_(1e-10), SC_(-6.36619772367581343150789184284462611709080831190542841855708e9) }},
        {{ SC_(1), SC_(1e-20), SC_(-6.36619772367581343075535053490057448139324059868649274367256e19) }},
        {{ SC_(1), SC_(1e+01), SC_(0.249015424206953883923283474663222803260416543069658461246944) }},
        {{ SC_(1), SC_(1e+03), SC_(-0.0247843312923517789148623560971412909386318548648705287583490) }},
        {{ SC_(1), SC_(1e+05), SC_(0.00171921035008825630099494523539897102954509504993494957572726) }}
    }};
    static const boost::array<boost::array<typename table_type<T>::type, 3>, 10> yn_data = {{
        {{ SC_(2), SC_(1e-20), SC_(-1.27323954473516268615107010698011489627570899691226996904849e40) }},
        {{ SC_(5), SC_(10), SC_(0.135403047689362303197029014762241709088405766746419538495983) }},
        {{ SC_(-5), SC_(1e+06), SC_(0.000331052088322609048503535570014688967096938338061796192422114) }},
        {{ SC_(10), SC_(10), SC_(-0.359814152183402722051986577343560609358382147846904467526222) }},
        {{ SC_(10), SC_(1e-10), SC_(-1.18280490494334933900960937719565669877576135140014365217993e108) }},
        {{ SC_(-10), SC_(1e+06), SC_(0.000725951969295187086245251366365393653610914686201194434805730) }},
        {{ SC_(1e+02), SC_(5), SC_(-5.08486391602022287993091563093082035595081274976837280338134e115) }},
        {{ SC_(1e+03), SC_(1e+05), SC_(0.00217254919137684037092834146629212647764581965821326561261181) }},
        {{ SC_(-1e+03), SC_(7e+02), SC_(-1.88753109980945889960843803284345261796244752396992106755091e77) }},
        {{ SC_(-25), SC_(8), SC_(3.45113613777297661997458045843868931827873456761831907587263e8) }}
    }};
    static const boost::array<boost::array<T, 3>, 11> yv_data = {{
        //SC_(2.25), {{ SC_(1) / 1024, SC_(-1.01759203636941035147948317764932151601257765988969544340275e7) }},
        {{ SC_(0.5), T(1) / (1024*1024), SC_(-817.033790261762580469303126467917092806755460418223776544122) }},
        {{ SC_(5.5), SC_(3.125), SC_(-2.61489440328417468776474188539366752698192046890955453259866) }},
        {{ SC_(-5.5), SC_(3.125), SC_(-0.0274994493896489729948109971802244976377957234563871795364056) }},
        {{ SC_(-5.5), SC_(1e+04), SC_(-0.00759343502722670361395585198154817047185480147294665270646578) }},
        {{ T(-10486074) / (1024*1024), T(1)/1024, SC_(-1.50382374389531766117868938966858995093408410498915220070230e38) }},
        {{ T(-10486074) / (1024*1024), SC_(1e+02), SC_(0.0583041891319026009955779707640455341990844522293730214223545) }},
        {{ SC_(141.75), SC_(1e+02), SC_(-5.38829231428696507293191118661269920130838607482708483122068e9) }},
        {{ SC_(141.75), SC_(2e+04), SC_(-0.00376577888677186194728129112270988602876597726657372330194186) }},
        {{ SC_(-141.75), SC_(1e+02), SC_(-3.81009803444766877495905954105669819951653361036342457919021e9) }},
        {{ SC_(8.5), boost::math::constants::pi<T>() * 4, SC_(0.257086543428224355151772807588810984369026142375675714560864) }},
        {{ SC_(-8.5), boost::math::constants::pi<T>() * 4, SC_(0.0436807946352780974532519564114026730332781693877984686758680) }},
    }};
    static const boost::array<boost::array<T, 3>, 7> yv_large_data = {{
        // Bug report https://svn.boost.org/trac/boost/ticket/5560:
        {{ SC_(0.5), static_cast<T>(std::ldexp(0.5, -683)), SC_(-7.14823099969225685526188875418476476336424046896822867989728e102) }},
        {{ SC_(-0.5), static_cast<T>(std::ldexp(0.5, -683)), SC_(8.90597649117647254543282704099383321071493400182381039079219e-104) }},
        {{ SC_(0.0), static_cast<T>(std::ldexp(1.0, -53)), SC_(-23.4611779112897561252987257324561640034037313549011724328997) }},
        {{ SC_(1.0), static_cast<T>(std::ldexp(1.0, -53)), SC_(-5.73416113922265864550047623401604244038331542638719289100990e15) }},
        {{ SC_(2.0), static_cast<T>(std::ldexp(1.0, -53)), SC_(-1.03297463879542177245046832533417970379386617249046560049244e32) }},
        {{ SC_(3.0), static_cast<T>(std::ldexp(1.0, -53)), SC_(-3.72168335868978735639260528876490232745489151562358712422544e48) }},
        {{ SC_(10.0), static_cast<T>(std::ldexp(1.0, -53)), SC_(-4.15729476804920974669173904282420477878640623992500096231384e167) }},
    }};

    do_test_cyl_neumann_y<T>(y0_data, name, "Y0: Mathworld Data");
    do_test_cyl_neumann_y<T>(y1_data, name, "Y1: Mathworld Data");
    do_test_cyl_neumann_y<T>(yn_data, name, "Yn: Mathworld Data");
    do_test_cyl_neumann_y_int<T>(y0_data, name, "Y0: Mathworld Data (Integer Version)");
    do_test_cyl_neumann_y_int<T>(y1_data, name, "Y1: Mathworld Data (Integer Version)");
    do_test_cyl_neumann_y_int<T>(yn_data, name, "Yn: Mathworld Data (Integer Version)");
    do_test_cyl_neumann_y<T>(yv_data, name, "Yv: Mathworld Data");
    if(yv_large_data[0][1] != 0)
      do_test_cyl_neumann_y<T>(yv_large_data, name, "Yv: Mathworld Data (large values)");

#include "bessel_y01_data.ipp"
    do_test_cyl_neumann_y<T>(bessel_y01_data, name, "Y0 and Y1: Random Data");
#include "bessel_yn_data.ipp"
    do_test_cyl_neumann_y<T>(bessel_yn_data, name, "Yn: Random Data");
#include "bessel_yv_data.ipp"
    do_test_cyl_neumann_y<T>(bessel_yv_data, name, "Yv: Random Data");

#include "sph_neumann_data.ipp"
    do_test_sph_neumann_y<T>(sph_neumann_data, name, "y: Random Data");
}
Пример #22
0
 static const value_type& abcissa()
 {
   static const value_type x={
     SC_(0.998002298693397060285172840152271),
     SC_(0.987992518020485428489565718586613),
     SC_(0.967739075679139134257347978784337),
     SC_(0.937273392400705904307758947710209),
     SC_(0.897264532344081900882509656454496),
     SC_(0.848206583410427216200648320774217),
     SC_(0.790418501442465932967649294817947),
     SC_(0.724417731360170047416186054613938),
     SC_(0.650996741297416970533735895313275),
     SC_(0.570972172608538847537226737253911),
     SC_(0.485081863640239680693655740232351),
     SC_(0.394151347077563369897207370981045),
     SC_(0.299180007153168812166780024266389),
     SC_(0.201194093997434522300628303394596),
     SC_(0.101142066918717499027074231447392),
     SC_(0.000000000000000000000000000000000)
   };
   return x;
 }
Пример #23
0
int main()
{
   typedef double T;
#define SC_(x) static_cast<double>(x)
#  include "digamma_data.ipp"
#  include "digamma_root_data.ipp"
#  include "digamma_small_data.ipp"
#  include "digamma_neg_data.ipp"
    static const boost::array<boost::array<T, 2>, 5> digamma_bugs = {{
       // Test cases from Rocco Romeo:
        {{ static_cast<T>(std::ldexp(1.0, -100)), SC_(-1.26765060022822940149670320537657721566490153286060651209008e30) }},
        {{ static_cast<T>(-std::ldexp(1.0, -100)), SC_(1.26765060022822940149670320537542278433509846713939348790992e30) }},
        {{ static_cast<T>(1), SC_(-0.577215664901532860606512090082402431042159335939923598805767) }},
        {{ static_cast<T>(-1) + static_cast<T>(std::ldexp(1.0, -20)), SC_(-1.04857557721314249602848739817764518743062133735858753112190e6) }},
        {{ static_cast<T>(-1) - static_cast<T>(std::ldexp(1.0, -20)), SC_(1.04857642278181269259522681939281063878220298942888100442172e6) }},
    }};
   static const boost::array<boost::array<T, 2>, 40> digamma_integers = { {
      { 1, SC_(-0.57721566490153286060651209008240243) }, { 2, SC_(0.42278433509846713939348790991759757) }, { 3, SC_(0.92278433509846713939348790991759757) }, { 4, SC_(1.2561176684318004727268212432509309) }, { 5, SC_(1.5061176684318004727268212432509309) }, { 6, SC_(1.7061176684318004727268212432509309) }, { 7, SC_(1.8727843350984671393934879099175976) }, { 8, SC_(2.0156414779556099965363450527747404) }, { 9, SC_(2.1406414779556099965363450527747404) }, { SC_(10.0), SC_(2.2517525890667211076474561638858515) }, { SC_(11.0), SC_(2.3517525890667211076474561638858515) }, { SC_(12.0), SC_(2.4426616799758120167383652547949424) }, { SC_(13.0), SC_(2.5259950133091453500716985881282758) }, { SC_(14.0), SC_(2.6029180902322222731486216650513527) }, { SC_(15.0), SC_(2.6743466616607937017200502364799241) }, { SC_(16.0), SC_(2.7410133283274603683867169031465908) }, { SC_(17.0), SC_(2.8035133283274603683867169031465908) }, { SC_(18.0), SC_(2.8623368577392250742690698443230614) }, { SC_(19.0), SC_(2.9178924132947806298246253998786169) }, { SC_(20.0), SC_(2.9705239922421490508772569788259854) }, { SC_(21.0), SC_(3.0205239922421490508772569788259854) }, { SC_(22.0), SC_(3.0681430398611966699248760264450330) }, { SC_(23.0), SC_(3.1135975853157421244703305718995784) }, { SC_(24.0), SC_(3.1570758461853073418616349197256654) }, { SC_(25.0), SC_(3.1987425128519740085283015863923321) }, { SC_(26.0), SC_(3.2387425128519740085283015863923321) }, { SC_(27.0), SC_(3.2772040513135124700667631248538705) }, { SC_(28.0), SC_(3.3142410883505495071038001618909076) }, { SC_(29.0), SC_(3.3499553740648352213895144476051933) }, { SC_(30.0), SC_(3.3844381326855248765619282407086415) }, { SC_(31.0), SC_(3.4177714660188582098952615740419749) }, { SC_(32.0), SC_(3.4500295305349872421533260901710071) }, { SC_(33.0), SC_(3.4812795305349872421533260901710071) }, { SC_(34.0), SC_(3.5115825608380175451836291204740374) }, { SC_(35.0), SC_(3.5409943255438998981248055910622727) }, { SC_(36.0), SC_(3.5695657541153284695533770196337013) }, { SC_(37.0), SC_(3.5973435318931062473311547974114791) }, { SC_(38.0), SC_(3.6243705589201332743581818244385061) }, { SC_(39.0), SC_(3.6506863483938174848844976139121903) }, { SC_(40.0), SC_(3.6763273740348431259101386395532160) }
   } };
   static const boost::array<boost::array<T, 2>, 41> digamma_half_integers = { {
      { SC_(0.5), SC_(-1.9635100260214234794409763329987556) }, { SC_(1.5), SC_(0.036489973978576520559023667001244433) }, { SC_(2.5), SC_(0.70315664064524318722569033366791110) }, { SC_(3.5), SC_(1.1031566406452431872256903336679111) }, { SC_(4.5), SC_(1.3888709263595289015114046193821968) }, { SC_(5.5), SC_(1.6110931485817511237336268416044190) }, { SC_(6.5), SC_(1.7929113303999329419154450234226009) }, { SC_(7.5), SC_(1.9467574842460867880692911772687547) }, { SC_(8.5), SC_(2.0800908175794201214026245106020880) }, { SC_(9.5), SC_(2.1977378764029495331673303929550292) }, { SC_(10.5), SC_(2.3030010342976863752725935508497661) }, { SC_(11.5), SC_(2.3982391295357816133678316460878613) }, { SC_(12.5), SC_(2.4851956512749120481504403417400352) }, { SC_(13.5), SC_(2.5651956512749120481504403417400352) }, { SC_(14.5), SC_(2.6392697253489861222245144158141093) }, { SC_(15.5), SC_(2.7082352425903654325693420020210058) }, { SC_(16.5), SC_(2.7727513716226234970854710342790703) }, { SC_(17.5), SC_(2.8333574322286841031460770948851310) }, { SC_(18.5), SC_(2.8905002893715412460032199520279881) }, { SC_(19.5), SC_(2.9445543434255953000572740060820421) }, { SC_(20.5), SC_(2.9958363947076465821085560573640934) }, { SC_(21.5), SC_(3.0446168825125246308890438622421422) }, { SC_(22.5), SC_(3.0911285104195013750750903738700492) }, { SC_(23.5), SC_(3.1355729548639458195195348183144936) }, { SC_(24.5), SC_(3.1781261463533075216471943927825787) }, { SC_(25.5), SC_(3.2189424728839197665451535764560481) }, { SC_(26.5), SC_(3.2581581591584295704667222039070285) }, { SC_(27.5), SC_(3.2958940082150333440516278642843870) }, { SC_(28.5), SC_(3.3322576445786697076879915006480234) }, { SC_(29.5), SC_(3.3673453638769153217230792199462690) }, { SC_(30.5), SC_(3.4012436689616610844349436267259300) }, { SC_(31.5), SC_(3.4340305542075627237792059218078972) }, { SC_(32.5), SC_(3.4657765859535944698109519535539290) }, { SC_(33.5), SC_(3.4965458167228252390417211843231597) }, { SC_(34.5), SC_(3.5263965629914819554596316320843538) }, { SC_(35.5), SC_(3.5553820702378587670538345306350784) }, { SC_(36.5), SC_(3.5835510843223658093073556573956418) }, { SC_(37.5), SC_(3.6109483445963384120470816847929021) }, { SC_(38.5), SC_(3.6376150112630050787137483514595687) }, { SC_(39.5), SC_(3.6635890372370310527397223774335947) }, { SC_(40.5), SC_(3.6889054929332335843852919976867593) }
   } };

   add_data(digamma_data);
   add_data(digamma_root_data);
   add_data(digamma_small_data);
   add_data(digamma_neg_data);
   add_data(digamma_bugs);
   add_data(digamma_integers);
   add_data(digamma_half_integers);

   unsigned data_total = data.size();

   screen_data([](const std::vector<double>& v){  return boost::math::digamma(v[0]);  }, [](const std::vector<double>& v){ return v[1];  });


#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
   screen_data([](const std::vector<double>& v){  return gsl_sf_psi(v[0]);  }, [](const std::vector<double>& v){ return v[1];  });
#endif
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
   screen_data([](const std::vector<double>& v){  return ::digamma(v[0]);  }, [](const std::vector<double>& v){ return v[1];  });
#endif

   unsigned data_used = data.size();
   std::string function = "digamma[br](" + boost::lexical_cast<std::string>(data_used) + "/" + boost::lexical_cast<std::string>(data_total) + " tests selected)";
   std::string function_short = "digamma";

   double time = exec_timed_test([](const std::vector<double>& v){  return boost::math::digamma(v[0]);  });
   std::cout << time << std::endl;
#if !defined(COMPILER_COMPARISON_TABLES) && (defined(TEST_GSL) || defined(TEST_RMATH))
   report_execution_time(time, std::string("Library Comparison with ") + std::string(compiler_name()) + std::string(" on ") + platform_name(), function, boost_name());
#endif
   report_execution_time(time, std::string("Compiler Comparison on ") + std::string(platform_name()), function_short, compiler_name() + std::string("[br]") + boost_name());
   //
   // Boost again, but with promotion to long double turned off:
   //
#if !defined(COMPILER_COMPARISON_TABLES)
   if(sizeof(long double) != sizeof(double))
   {
      double time = exec_timed_test([](const std::vector<double>& v){  return boost::math::digamma(v[0], boost::math::policies::make_policy(boost::math::policies::promote_double<false>()));  });
      std::cout << time << std::endl;
#if !defined(COMPILER_COMPARISON_TABLES) && (defined(TEST_GSL) || defined(TEST_RMATH))
      report_execution_time(time, std::string("Library Comparison with ") + std::string(compiler_name()) + std::string(" on ") + platform_name(), function, boost_name() + "[br]promote_double<false>");
#endif
      report_execution_time(time, std::string("Compiler Comparison on ") + std::string(platform_name()), function_short, compiler_name() + std::string("[br]") + boost_name() + "[br]promote_double<false>");
   }
#endif


#if defined(TEST_GSL) && !defined(COMPILER_COMPARISON_TABLES)
   time = exec_timed_test([](const std::vector<double>& v){  return gsl_sf_psi(v[0]);  });
   std::cout << time << std::endl;
   report_execution_time(time, std::string("Library Comparison with ") + std::string(compiler_name()) + std::string(" on ") + platform_name(), function, "GSL " GSL_VERSION);
#endif
#if defined(TEST_RMATH) && !defined(COMPILER_COMPARISON_TABLES)
   time = exec_timed_test([](const std::vector<double>& v){  return ::digamma(v[0]);  });
   std::cout << time << std::endl;
   report_execution_time(time, std::string("Library Comparison with ") + std::string(compiler_name()) + std::string(" on ") + platform_name(), function, "Rmath "  R_VERSION_STRING);
#endif

   return 0;
}
Пример #24
0
 static const value_type& weights()
 {
   static const value_type w={
     SC_(0.003073583718520531501218293246031),
     SC_(0.008600269855642942198661787950102),
     SC_(0.014626169256971252983787960308868),
     SC_(0.020388373461266523598010231432755),
     SC_(0.025882133604951158834505067096153),
     SC_(0.031287306777032798958543119323801),
     SC_(0.036600169758200798030557240707211),
     SC_(0.041668873327973686263788305936895),
     SC_(0.046434821867497674720231880926108),
     SC_(0.050944573923728691932707670050345),
     SC_(0.055195105348285994744832372419777),
     SC_(0.059111400880639572374967220648594),
     SC_(0.062653237554781168025870122174255),
     SC_(0.065834597133618422111563556969398),
     SC_(0.068648672928521619345623411885368),
     SC_(0.071054423553444068305790361723210),
     SC_(0.073030690332786667495189417658913),
     SC_(0.074582875400499188986581418362488),
     SC_(0.075704497684556674659542775376617),
     SC_(0.076377867672080736705502835038061),
     SC_(0.076600711917999656445049901530102)
   };
   return w;
 }
Пример #25
0
void test_spots(T, const char* type_name)
{
    BOOST_MATH_STD_USING
    // function values calculated on http://functions.wolfram.com/
    static const boost::array<boost::array<T, 4>, 65> data1 = {{
        {{ SC_(1.0), SC_(-1.0), SC_(0.0), SC_(-1.557407724654902230506974807458360173087) }},
        {{ SC_(0.0), SC_(-4.0), SC_(0.4), SC_(-4.153623371196831087495427530365430979011) }},
        {{ SC_(0.0), SC_(8.0), SC_(-0.6), SC_(8.935930619078575123490612395578518914416) }},
        {{ SC_(0.0), SC_(0.5), SC_(0.25), SC_(0.501246705365439492445236118603525029757890291780157969500480) }},
        {{ SC_(0.0), SC_(0.5), SC_(0.0), SC_(0.5) }},
        {{ SC_(-2.0), SC_(0.5), SC_(0.0), SC_(0.437501067017546278595664813509803743009132067629603474488486) }},
        {{ SC_(0.25), SC_(0.5), SC_(0.0), SC_(0.510269830229213412212501938035914557628394166585442994564135) }},
        {{ SC_(0.75), SC_(0.5), SC_(0.0), SC_(0.533293253875952645421201146925578536430596894471541312806165) }},
        {{ SC_(0.75), SC_(0.75), SC_(0.0), SC_(0.871827580412760575085768367421866079353646112288567703061975) }},
        {{ SC_(1.0), SC_(0.25), SC_(0.0), SC_(0.255341921221036266504482236490473678204201638800822621740476) }},
        {{ SC_(2.0), SC_(0.25), SC_(0.0), SC_(0.261119051639220165094943572468224137699644963125853641716219) }},
        {{ T(1023)/1024, SC_(1.5), SC_(0.0), SC_(13.2821612239764190363647953338544569682942329604483733197131) }},
        {{ SC_(0.5), SC_(-1.0), SC_(0.5), SC_(-1.228014414316220642611298946293865487807) }},
        {{ SC_(0.5), SC_(1e+10), SC_(0.5), SC_(1.536591003599172091573590441336982730551e+10) }},
        {{ SC_(-1e+05), SC_(10.0), SC_(0.75), SC_(0.0347926099493147087821620459290460547131012904008557007934290) }},
        {{ SC_(-1e+10), SC_(10.0), SC_(0.875), SC_(0.000109956202759561502329123384755016959364346382187364656768212) }},
        {{ SC_(-1e+10), SC_(1e+20), SC_(0.875), SC_(1.00000626665567332602765201107198822183913978895904937646809e15) }},
        {{ SC_(-1e+10), T(1608)/1024, SC_(0.875), SC_(0.0000157080616044072676127333183571107873332593142625043567690379) }},
        {{ 1-T(1) / 1024, SC_(1e+20), SC_(0.875), SC_(6.43274293944380717581167058274600202023334985100499739678963e21) }},
        {{ SC_(50.0), SC_(0.125), SC_(0.25), SC_(0.196321043776719739372196642514913879497104766409504746018939) }},
        {{ SC_(1.125), SC_(1.0), SC_(0.25), SC_(1.77299767784815770192352979665283069318388205110727241629752) }},
        {{ SC_(1.125), SC_(10.0), SC_(0.25), SC_(0.662467818678976949597336360256848770217429434745967677192487) }},
        {{ SC_(1.125), SC_(3.0), SC_(0.25), SC_(-0.142697285116693775525461312178015106079842313950476205580178) }},
        {{ T(257)/256, SC_(1.5), SC_(0.125), SC_(22.2699300473528164111357290313578126108398839810535700884237) }},
        {{ T(257)/256, SC_(21.5), SC_(0.125), SC_(-0.535406081652313940727588125663856894154526187713506526799429) }},
        // Bug cases from Rocco Romeo:
        { { SC_(-1E-170), boost::math::constants::pi<T>() / 4, SC_(1E-164), SC_(0.785398163397448309615660845819875721049292349843776455243736) } },
        { { SC_(-1E-170), boost::math::constants::pi<T>() / 4, SC_(-1E-164), SC_(0.785398163397448309615660845819875721049292349843776455243736) } },
        { { -ldexp(T(1.0), -52), boost::math::constants::pi<T>() / 4, SC_(0.9375), SC_(0.866032844934895872810905364370384153285798081574191920571016) } },
        { { -ldexp(T(1.0), -52), boost::math::constants::pi<T>() / 4, SC_(-0.9375), SC_(0.866032844934895872810905364370384153285798081574191920571016) } },
        { { std::numeric_limits<T>::max_exponent > 600 ? -ldexp(T(1), 604) : T(0), -ldexp(T(1), -816), ldexp(T(1), -510), std::numeric_limits<T>::max_exponent > 600 ? SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) : SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) } },
        { { std::numeric_limits<T>::max_exponent > 600 ? -ldexp(T(1), 604) : T(0), -ldexp(T(1), -816), -ldexp(T(1), -510), std::numeric_limits<T>::max_exponent > 600 ? SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) : SC_(-2.28835573409367516299079046268930870596307631872422530813192e-246) } },
        { { -ldexp(T(1), -622), -ldexp(T(1), -800), ldexp(T(1), -132), SC_(-1.49969681389563095481764443762806535353996169623910829793733e-241) } },
        { { -ldexp(T(1), -622), -ldexp(T(1), -800), -ldexp(T(1), -132), SC_(-1.49969681389563095481764443762806535353996169623910829793733e-241) } },
        { { -ldexp(T(1), -562), ldexp(T(1), -140), ldexp(T(1), -256), SC_(7.174648137343063403129495466444370592154941142407760751e-43) } },
        { { -ldexp(T(1), -562), -ldexp(T(1), -140), ldexp(T(1), -256), SC_(-7.17464813734306340312949546644437059215494114240776075e-43) } },
        { { ldexp(T(1), -688), -ldexp(T(1), -243), ldexp(T(1), -193), SC_(-7.07474928033336903711649944600608732865822749854620171e-74) } },
        { { -ldexp(T(1), -688), -ldexp(T(1), -243), ldexp(T(1), -193), SC_(-7.07474928033336903711649944600608732865822749854620171e-74) } },
        // Special cases where k = 0:
        { { SC_(0.5), SC_(1.0), SC_(0.0), SC_(1.17881507892743738986863357869566288974084658835353613038547) } },
        { { SC_(-0.5), SC_(1.0), SC_(0.0), SC_(0.888286691263535380266337576823783210424994266596287990733270) } },
        { { SC_(0.5), SC_(-1.0), SC_(0.0), SC_(-1.17881507892743738986863357869566288974084658835353613038547) } },
        { { SC_(-0.5), SC_(-1.0), SC_(0.0), SC_(-0.888286691263535380266337576823783210424994266596287990733270) } },
        // k == 0 and phi > pi/2:
        { { SC_(0.5), SC_(2.0), SC_(0.0), SC_(3.03379730757207227653600089552126882582809860566558143254794) } },
        { { SC_(-0.5), SC_(2.0), SC_(0.0), SC_(1.57453655812023739911111328195028658229986230310938753315640) } },
        { { SC_(0.5), SC_(-2.0), SC_(0.0), SC_(-3.03379730757207227653600089552126882582809860566558143254794) } },
        { { SC_(-0.5), SC_(-2.0), SC_(0.0), SC_(-1.57453655812023739911111328195028658229986230310938753315640) } },
        // Special cases where k = 1:
        { { SC_(0.5), SC_(1.0), SC_(1.0), SC_(1.4830998734200773326887632776553375078936815318419194718912351) } },
        { { SC_(-0.5), SC_(1.0), SC_(1.0), SC_(1.07048347329000030842347009377117215811122412769516781788253) } },
        { { SC_(0.5), SC_(-1.0), SC_(1.0), SC_(-1.4830998734200773326887632776553375078936815318419194718912) } },
        { { SC_(-0.5), SC_(-1.0), SC_(1.0), SC_(-1.07048347329000030842347009377117215811122412769516781788253) } },
        // special cases where v = 1:
        { { SC_(1.0), SC_(0.5), SC_(0.5), SC_(0.55225234291197632914658859230278152249148960801635386133501) } },
        { { SC_(1.0), SC_(-0.5), SC_(0.5), SC_(-0.55225234291197632914658859230278152249148960801635386133501) } },
        { { SC_(1.0), SC_(2.0), SC_(0.5), SC_(-2.87534521505997989921579168327307068134740792740155171368532) } },
        { { SC_(1.0), SC_(-2.0), SC_(0.5), SC_(2.87534521505997989921579168327307068134740792740155171368532) } },
        { { SC_(1.0), SC_(2.0), ldexp(T(1), -200), SC_(-2.18503986326151899164330610231368254343201774622766316456295) } },
        { { SC_(1.0), SC_(-2.0), ldexp(T(1), -200), SC_(2.18503986326151899164330610231368254343201774622766316456295) } },
        { { SC_(1.0), ldexp(T(1.0), -150), ldexp(T(1), -200), SC_(7.006492321624085354618647916449580656401309709382578858e-46) } },
        { { SC_(1.0), -ldexp(T(1.0), -150), ldexp(T(1), -200), SC_(-7.006492321624085354618647916449580656401309709382578858e-46) } },
        // Previously unsupported region with v > 1 and |phi| > PI/2, this is the only region
        // with high-ish error rates caused by argument reduction by Pi:
        { { SC_(20.0), ldexp(T(1647611), -19), SC_(0.5), SC_(0.000975940902692994840122139131147517258405256880370413541280) } },
        { { SC_(20.0), -ldexp(T(1647611), -19), SC_(0.5), SC_(-0.000975940902692994840122139131147517258405256880370413541280) } },
        { { SC_(1.0) + ldexp(T(1), -6), ldexp(T(889085), -19), SC_(0.5), SC_(-27.1647225624906589308619292363045712770651414487085887109197) } },
        { { SC_(1.0) + ldexp(T(1), -6), -ldexp(T(889085), -19), SC_(0.5), SC_(27.1647225624906589308619292363045712770651414487085887109197) } },
        // Phi = 0:
        { { SC_(1.0), SC_(0.0), SC_(0.5), SC_(0.0) } },
        { { SC_(-1.0), SC_(0.0), SC_(0.5), SC_(0.0) } },
        { { SC_(100.0), SC_(0.0), SC_(0.5), SC_(0.0) } },
        { { SC_(-100.0), SC_(0.0), SC_(0.5), SC_(0.0) } },
    } };

    do_test_ellint_pi3<T>(data1, type_name, "Elliptic Integral PI: Mathworld Data");

#include "ellint_pi3_data.ipp"

    do_test_ellint_pi3<T>(ellint_pi3_data, type_name, "Elliptic Integral PI: Random Data");

#include "ellint_pi3_large_data.ipp"

    do_test_ellint_pi3<T>(ellint_pi3_large_data, type_name, "Elliptic Integral PI: Large Random Data");

    // function values calculated on http://functions.wolfram.com/
    static const boost::array<boost::array<T, 3>, 17> data2 = {{
        {{ SC_(0.0), SC_(0.2), SC_(1.586867847454166237308008033828114192951) }},
        {{ SC_(0.0), SC_(0.4), SC_(1.639999865864511206865258329748601457626) }},
        {{ SC_(0.0), SC_(0.0), SC_(1.57079632679489661923132169163975144209858469968755291048747) }},
        {{ SC_(0.5), SC_(0.0), SC_(2.221441469079183123507940495030346849307) }},
        {{ SC_(-4.0), SC_(0.3), SC_(0.712708870925620061597924858162260293305195624270730660081949) }},
        {{ SC_(-1e+05), SC_(-0.5), SC_(0.00496944596485066055800109163256108604615568144080386919012831) }},
        {{ SC_(-1e+10), SC_(-0.75), SC_(0.0000157080225184890546939710019277357161497407143903832703317801) }},
        {{ T(1) / 1024, SC_(-0.875), SC_(2.18674503176462374414944618968850352696579451638002110619287) }},
        {{ T(1023)/1024, SC_(-0.875), SC_(101.045289804941384100960063898569538919135722087486350366997) }},
        // Bug cases from Rocco Romeo:
        { { SC_(1e-175), T(0), SC_(1.57079632679489661923132169163975144209858469968755291048747) } },
        { { SC_(1e-170), SC_(1E-164), SC_(1.57079632679489661923132169163975144209858469968755291048747) } },
        { { SC_(1e-170), SC_(-1E-164), SC_(1.57079632679489661923132169163975144209858469968755291048747) } },
        { { -1.5f * ldexp(T(1), -52), SC_(-0.9375), SC_(2.48840049140103464299631535211815755485846563527849342319632) } },
        { { -1.5f * ldexp(T(1), -52), SC_(0.9375), SC_(2.48840049140103464299631535211815755485846563527849342319632) } },
        { { ldexp(T(1), -560), ldexp(T(1), -165), SC_(1.57079632679489661923132169163975144209858469968756130722545) } },
        { { ldexp(T(1), -560), -ldexp(T(1), -165), SC_(1.57079632679489661923132169163975144209858469968754451374949) } },
        { { std::numeric_limits<T>::max_exponent > 600 ? -ldexp(T(1), 600) : 0, SC_(0.5), std::numeric_limits<T>::max_exponent > 600 ? SC_(7.71118598318249916481121898327895181916104121635240801895419e-91) : SC_(1.68575035481259604287120365779907698950080089414108904411995) } },
    } };

    do_test_ellint_pi2<T>(data2, type_name, "Complete Elliptic Integral PI: Mathworld Data");

#include "ellint_pi2_data.ipp"

    do_test_ellint_pi2<T>(ellint_pi2_data, type_name, "Complete Elliptic Integral PI: Random Data");

    // Special cases, exceptions etc:
    BOOST_CHECK_THROW(boost::math::ellint_3(T(1.0001), T(-1), T(0)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::ellint_3(T(0.5), T(20), T(1.5)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::ellint_3(T(1.0001), T(-1)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::ellint_3(T(0.5), T(1)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::ellint_3(T(0.5), T(2)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::ellint_3(T(1), T(0.5), T(2)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::ellint_3(T(1), T(-0.5), T(2)), std::domain_error);
    BOOST_CHECK_THROW(boost::math::ellint_3(T(1), T(-0.5), T(-2)), std::domain_error);
}
Пример #26
0
 static const value_type& abcissa()
 {
   static const value_type x={
     SC_(0.998859031588277663838315576545863),
     SC_(0.993128599185094924786122388471320),
     SC_(0.981507877450250259193342994720217),
     SC_(0.963971927277913791267666131197277),
     SC_(0.940822633831754753519982722212443),
     SC_(0.912234428251325905867752441203298),
     SC_(0.878276811252281976077442995113078),
     SC_(0.839116971822218823394529061701521),
     SC_(0.795041428837551198350638833272788),
     SC_(0.746331906460150792614305070355642),
     SC_(0.693237656334751384805490711845932),
     SC_(0.636053680726515025452836696226286),
     SC_(0.575140446819710315342946036586425),
     SC_(0.510867001950827098004364050955251),
     SC_(0.443593175238725103199992213492640),
     SC_(0.373706088715419560672548177024927),
     SC_(0.301627868114913004320555356858592),
     SC_(0.227785851141645078080496195368575),
     SC_(0.152605465240922675505220241022678),
     SC_(0.076526521133497333754640409398838),
     SC_(0.000000000000000000000000000000000)
   };
   return x;
 }
Пример #27
0
void test_spots(T, const char* type_name)
{
    BOOST_MATH_STD_USING
    // Function values calculated on http://functions.wolfram.com/
    // Note that Mathematica's Sn/Cn/Dn accepts k^2 as the second parameter.
    // Arguments here are theta, k, sn, cn, dn
    static const boost::array<boost::array<T, 5>, 36> data1 = {{
        {{ SC_(0.0), SC_(0.0), SC_(0.0), SC_(1.0), SC_(1.0) }},
        {{ ldexp(T(1), -25), ldexp(T(1), -25), SC_(2.98023223876953080883700663838486782870427050521881839342311e-8), SC_(0.99999999999999955591079014993741669975171697261290223678373), SC_(0.99999999999999999999999999999960556954738949421406900774443) }},
        {{ -ldexp(T(1), -25), ldexp(T(1), -25), SC_(-2.98023223876953080883700663838486782870427050521881839342311e-8), SC_(0.99999999999999955591079014993741669975171697261290223678373), SC_(0.99999999999999999999999999999960556954738949421406900774443) }},
        {{ SC_(0.25), ldexp(T(1), -25), SC_(0.247403959254522927383635623557663763268693729825996390997241), SC_(0.968912421710644784709721529742747886950140086772629513814665), SC_(0.99999999999999997281786831901333837240938011109848356555885) }},
        {{ SC_(-0.25), ldexp(T(1), -25), SC_(-0.247403959254522927383635623557663763268693729825996390997241), SC_(0.968912421710644784709721529742747886950140086772629513814665), SC_(0.99999999999999997281786831901333837240938011109848356555885) }},
        {{ SC_(1.25), ldexp(T(1), -25), SC_(0.948984619355586147780156037971989352776684194861616269831136), SC_(0.315322362395268865789580233344649598639316847638615703458263), SC_(0.99999999999999960006577747263860127231780811081154547949983) }},
        {{ SC_(-1.25), ldexp(T(1), -25), SC_(-0.948984619355586147780156037971989352776684194861616269831136), SC_(0.315322362395268865789580233344649598639316847638615703458263), SC_(0.99999999999999960006577747263860127231780811081154547949983) }},
        {{ SC_(25.0), ldexp(T(1), -25), SC_(-0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }},
        {{ SC_(-25.0), ldexp(T(1), -25), SC_(0.132351750097778560056127137329035522219365438979106560464704), SC_(0.991202811863472859528158119981178957382802975691690722810123), SC_(0.99999999999999999222089563757583834413059580275315226870704) }},
        {{ ldexp(T(1), -25), SC_(0.5), SC_(2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }},
        {{ -ldexp(T(1), -25), SC_(0.5), SC_(-2.98023223876953058825550995757802173334628440851964836958219e-8), SC_(0.99999999999999955591079014993744956895610118130967536624417), SC_(0.99999999999999988897769753748438088116649141278818704012037) }},
        {{ SC_(0.25), SC_(0.5), SC_(0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }},
        {{ SC_(-0.25), SC_(0.5), SC_(-0.246781405136141600483623741101255389743847413013817188632739), SC_(0.969071172865559727608777289021929824625726812182428398055476), SC_(0.992358168465276394946615469032829292963938826683866720698130) }},
        {{ SC_(1.25), SC_(0.5), SC_(0.928561236426319775700204388269999130782711902203415239399579), SC_(0.371179242693370810357222594552131893184749696381729988511999), SC_(0.885688154799196841458565445994481097477880319663264816077719) }},
        {{ SC_(-1.25), SC_(0.5), SC_(-0.928561236426319775700204388269999130782711902203415239399579), SC_(0.371179242693370810357222594552131893184749696381729988511999), SC_(0.885688154799196841458565445994481097477880319663264816077719) }},
        {{ SC_(25.0), SC_(0.5), SC_(-0.969223071486651608400225080456020493867827336842041561445359), SC_(-0.246184154035106463351874891855925292474628176040625311168501), SC_(0.874729477852721764836147376110255133761608728373832418508248) }},
        {{ SC_(-25.0), SC_(0.5), SC_(0.969223071486651608400225080456020493867827336842041561445359), SC_(-0.246184154035106463351874891855925292474628176040625311168501), SC_(0.874729477852721764836147376110255133761608728373832418508248) }},
        {{ ldexp(T(1), -25), 1 - ldexp(T(1), -9), SC_(2.98023223876953036939562331632512854347569015560128614888589e-8), SC_(0.99999999999999955591079014993754766348947956082687878223721), SC_(0.99999999999999955764381956001984590118394542979655101564079) }},
        {{ -ldexp(T(1), -25), 1 - ldexp(T(1), -9), SC_(-2.98023223876953036939562331632512854347569015560128614888589e-8), SC_(0.99999999999999955591079014993754766348947956082687878223721), SC_(0.99999999999999955764381956001984590118394542979655101564079) }},
        {{ SC_(0.25), 1 - ldexp(T(1), -9), SC_(0.244928335616519632082236089277654937383208524525331032303082), SC_(0.969541185516180906431546524888118346090913555188425579774305), SC_(0.969661908643964623248878987955178702010392829596222190545649) }},
        {{ SC_(-0.25), 1 - ldexp(T(1), -9), SC_(-0.244928335616519632082236089277654937383208524525331032303082), SC_(0.969541185516180906431546524888118346090913555188425579774305), SC_(0.969661908643964623248878987955178702010392829596222190545649) }},
        {{ SC_(1.25), 1 - ldexp(T(1), -9), SC_(0.848768940045053312079390719205939167551169094157365783446523), SC_(0.528763923140371497228677918580246099580380684604621321430057), SC_(0.531415689278260818860813380561526095359692710060403584603095) }},
        {{ SC_(-1.25), 1 - ldexp(T(1), -9), SC_(-0.848768940045053312079390719205939167551169094157365783446523), SC_(0.528763923140371497228677918580246099580380684604621321430057), SC_(0.531415689278260818860813380561526095359692710060403584603095) }},
        {{ SC_(25.0), 1 - ldexp(T(1), -9), SC_(-0.0252326124525503880903568715488227138184083895871544015366337), SC_(-0.999681606947341709011836635135181960590782564534371631099332), SC_(0.999682849652724146508471774051629114156076052044812654903417) }},
        {{ SC_(-25.0), 1 - ldexp(T(1), -9), SC_(0.0252326124525503880903568715488227138184083895871544015366337), SC_(-0.999681606947341709011836635135181960590782564534371631099332), SC_(0.999682849652724146508471774051629114156076052044812654903417) }},

        // Try modulus > 1
        {{ ldexp(T(1), -25), SC_(1.5), SC_(2.98023223876952981622027157475276613133414644789222481971590e-8), SC_(0.999999999999999555910790149937712522591174851747994454928040), SC_(0.999999999999999000799277837359575841918151654603571877092161) }},
        {{ -ldexp(T(1), -25), SC_(1.5), SC_(-2.98023223876952981622027157475276613133414644789222481971590e-8), SC_(0.999999999999999555910790149937712522591174851747994454928040), SC_(0.999999999999999000799277837359575841918151654603571877092161) }},
        {{ SC_(0.25), SC_(1.5), SC_(0.241830488135945315134822478837394038661484435596992059686086), SC_(0.970318512143270619246031961334217540099946232418710982266812), SC_(0.931888155181641649031244632258710371461078255228024421800363) }},
        {{ SC_(-0.25), SC_(1.5), SC_(-0.241830488135945315134822478837394038661484435596992059686086), SC_(0.970318512143270619246031961334217540099946232418710982266812), SC_(0.931888155181641649031244632258710371461078255228024421800363) }},
        {{ SC_(1.25), SC_(1.5), SC_(0.665875890711922169121186264316618499018039094009893317545462), SC_(0.746062529663971452521312655373498959968622875614588791642250), SC_(-0.0486921028438866868299166778939466685768843580182675008164949) }},
        {{ SC_(-1.25), SC_(1.5), SC_(-0.665875890711922169121186264316618499018039094009893317545462), SC_(0.746062529663971452521312655373498959968622875614588791642250), SC_(-0.0486921028438866868299166778939466685768843580182675008164949) }},
        {{ SC_(25.0), SC_(1.5), SC_(0.618665338981368217712277210270169521641154921220796362724248), SC_(0.785654630447163313102421517325310755764805805534154371583941), SC_(0.372585153048138377269609818284480926623056458773704266654150) }},
        {{ SC_(-25.0), SC_(1.5), SC_(-0.618665338981368217712277210270169521641154921220796362724248), SC_(0.785654630447163313102421517325310755764805805534154371583941), SC_(0.372585153048138377269609818284480926623056458773704266654150) }},

        // Special Values:
        {{ SC_(0.0), SC_(0.5), SC_(0.0), SC_(1.0), SC_(1.0) }},
        {{ SC_(5.0), SC_(0.0), SC_(-0.958924274663138468893154406155993973352461543964601778131672), SC_(0.283662185463226264466639171513557308334422592252215944930359), SC_(1.0) }},
        {{ SC_(5.0), SC_(1.0), SC_(0.999909204262595131210990447534473021089812615990547862736429), SC_(0.0134752822213045573055191382448821552908373539417006868332819), SC_(0.0134752822213045573055191382448821552908373539417006868332819) }},
    }};
    do_test_sn<T>(data1, type_name, "Jacobi Elliptic: Mathworld Data");

#include "jacobi_elliptic.ipp"
    do_test_sn<T>(jacobi_elliptic, type_name, "Jacobi Elliptic: Random Data");
#include "jacobi_elliptic_small.ipp"
    do_test_sn<T>(jacobi_elliptic_small, type_name, "Jacobi Elliptic: Random Small Values");
#include "jacobi_near_1.ipp"
    do_test_sn<T>(jacobi_near_1, type_name, "Jacobi Elliptic: Modulus near 1");
#include "jacobi_large_phi.ipp"
    do_test_sn<T>(jacobi_large_phi, type_name, "Jacobi Elliptic: Large Phi");

    //
    // Sanity checks for all the various derived functions - these are all
    // trivial wrappers around the main three that are tested above - so just
    // use a simple sanity check for each one.
    // Test values are from functions.wolfram.com:
    //
    T tol = boost::math::tools::epsilon<T>() * 100;
    boost::math::policies::policy<> pol;
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_cd(T(0.5), T(0.5)), static_cast<T>(0.905869360370352996327275878479104183407762212476128499788493L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_cd(T(0.5), T(0.5), pol), static_cast<T>(0.905869360370352996327275878479104183407762212476128499788493L), tol);

    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_cn(T(0.5), T(0.5)), static_cast<T>(0.879941022963758342138211939938800035594045353539382810624647L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_cn(T(0.5), T(0.5), pol), static_cast<T>(0.879941022963758342138211939938800035594045353539382810624647L), tol);

    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_cs(T(0.5), T(0.5)), static_cast<T>(1.85218402142505803268146025319200184620073865036147924150565L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_cs(T(0.5), T(0.5), pol), static_cast<T>(1.85218402142505803268146025319200184620073865036147924150565L), tol);

    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_dc(T(0.5), T(0.5)), static_cast<T>(1.10391193669599654696698383614539220889596741980833071370343L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_dc(T(0.5), T(0.5), pol), static_cast<T>(1.10391193669599654696698383614539220889596741980833071370343L), tol);

    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_dn(T(0.5), T(0.5)), static_cast<T>(0.971377398838178842823315157470233933307542433588855341182382L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_dn(T(0.5), T(0.5), pol), static_cast<T>(0.971377398838178842823315157470233933307542433588855341182382L), tol);

    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_ds(T(0.5), T(0.5)), static_cast<T>(2.04464805020871497502900445828888632133468724223115900866414L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_ds(T(0.5), T(0.5), pol), static_cast<T>(2.04464805020871497502900445828888632133468724223115900866414L), tol);

    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_nc(T(0.5), T(0.5)), static_cast<T>(1.13643979983097851593855424992691981204889859711476187519109L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_nc(T(0.5), T(0.5), pol), static_cast<T>(1.13643979983097851593855424992691981204889859711476187519109L), tol);

    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_nd(T(0.5), T(0.5)), static_cast<T>(1.02946599457230050141998045852435702297405263760707971258676L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_nd(T(0.5), T(0.5), pol), static_cast<T>(1.02946599457230050141998045852435702297405263760707971258676L), tol);

    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_ns(T(0.5), T(0.5)), static_cast<T>(2.10489563855842977359275221390569031239706339764770047142101L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_ns(T(0.5), T(0.5), pol), static_cast<T>(2.10489563855842977359275221390569031239706339764770047142101L), tol);

    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_sc(T(0.5), T(0.5)), static_cast<T>(0.539903156723383602910722041849329275299051877814755451255071L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_sc(T(0.5), T(0.5), pol), static_cast<T>(0.539903156723383602910722041849329275299051877814755451255071L), tol);

    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_sd(T(0.5), T(0.5)), static_cast<T>(0.489081727242945953222289853693492188561192086497066116267160L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_sd(T(0.5), T(0.5), pol), static_cast<T>(0.489081727242945953222289853693492188561192086497066116267160L), tol);

    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_sn(T(0.5), T(0.5)), static_cast<T>(0.475082936028536510082218324703870258745078171807428948028252L), tol);
    BOOST_CHECK_CLOSE_FRACTION(boost::math::jacobi_sn(T(0.5), T(0.5), pol), static_cast<T>(0.475082936028536510082218324703870258745078171807428948028252L), tol);

}
Пример #28
0
 static const value_type& weights()
 {
   static const value_type w={
     SC_(0.001987383892330315926507851882843),
     SC_(0.005561932135356713758040236901066),
     SC_(0.009473973386174151607207710523655),
     SC_(0.013236229195571674813656405846976),
     SC_(0.016847817709128298231516667536336),
     SC_(0.020435371145882835456568292235939),
     SC_(0.024009945606953216220092489164881),
     SC_(0.027475317587851737802948455517811),
     SC_(0.030792300167387488891109020215229),
     SC_(0.034002130274329337836748795229551),
     SC_(0.037116271483415543560330625367620),
     SC_(0.040083825504032382074839284467076),
     SC_(0.042872845020170049476895792439495),
     SC_(0.045502913049921788909870584752660),
     SC_(0.047982537138836713906392255756915),
     SC_(0.050277679080715671963325259433440),
     SC_(0.052362885806407475864366712137873),
     SC_(0.054251129888545490144543370459876),
     SC_(0.055950811220412317308240686382747),
     SC_(0.057437116361567832853582693939506),
     SC_(0.058689680022394207961974175856788),
     SC_(0.059720340324174059979099291932562),
     SC_(0.060539455376045862945360267517565),
     SC_(0.061128509717053048305859030416293),
     SC_(0.061471189871425316661544131965264),
     SC_(0.061580818067832935078759824240066)
   };
   return w;
 }
Пример #29
0
void test_bessel(T, const char* name)
{
   //
   // The actual test data is rather verbose, so it's in a separate file
   //
   // The contents are as follows, each row of data contains
   // three items, input value a, input value b and erf(a, b):
   // 
    // function values calculated on http://functions.wolfram.com/
    static const boost::array<boost::array<T, 3>, 8> j0_data = {{
       {{ SC_(0), SC_(0), SC_(1) }},
        {{ SC_(0), SC_(1), SC_(0.7651976865579665514497175261026632209093) }},
        {{ SC_(0), SC_(-2), SC_(0.2238907791412356680518274546499486258252) }},
        {{ SC_(0), SC_(4), SC_(-0.3971498098638473722865907684516980419756) }},
        {{ SC_(0), SC_(-8), SC_(0.1716508071375539060908694078519720010684) }},
        {{ SC_(0), SC_(1e-05), SC_(0.999999999975000000000156249999999565972) }},
        {{ SC_(0), SC_(1e-10), SC_(0.999999999999999999997500000000000000000) }},
        {{ SC_(0), SC_(-1e+01), SC_(-0.2459357644513483351977608624853287538296) }},
    }};
    static const boost::array<boost::array<T, 3>, 6> j0_tricky = {{
        // Big numbers make the accuracy of std::sin the limiting factor:
       {{ SC_(0), SC_(1e+03), SC_(0.02478668615242017456133073111569370878617) }},
        {{ SC_(0), SC_(1e+05), SC_(-0.001719201116235972192570601477073201747532) }},
        // test at the roots:
        {{ SC_(0), SC_(2521642)/(1024 * 1024), SC_(1.80208819970046790002973759410972422387259992955354630042138e-7) }},
        {{ SC_(0), SC_(5788221)/(1024 * 1024), SC_(-1.37774249380686777043369399806210229535671843632174587432454e-7) }},
        {{ SC_(0), SC_(9074091)/(1024 * 1024), SC_(1.03553057441100845081018471279571355857520645127532785991335e-7) }},
        {{ SC_(0), SC_(12364320)/(1024 * 1024), SC_(-3.53017140778223781420794006033810387155048392363051866610931e-9) }}
    }};    

    static const boost::array<boost::array<T, 3>, 8> j1_data = {{
        {{ SC_(1), SC_(0), SC_(0) }},
        {{ SC_(1), SC_(1), SC_(0.4400505857449335159596822037189149131274) }},
        {{ SC_(1), SC_(-2), SC_(-0.5767248077568733872024482422691370869203) }},
        {{ SC_(1), SC_(4), SC_(-6.604332802354913614318542080327502872742e-02) }},
        {{ SC_(1), SC_(-8), SC_(-0.2346363468539146243812766515904546115488) }},
        {{ SC_(1), SC_(1e-05), SC_(4.999999999937500000000260416666666124132e-06) }},
        {{ SC_(1), SC_(1e-10), SC_(4.999999999999999999993750000000000000000e-11) }},
        {{ SC_(1), SC_(-1e+01), SC_(-4.347274616886143666974876802585928830627e-02) }},
    }};
    static const boost::array<boost::array<T, 3>, 5> j1_tricky = {{
        // Big numbers make the accuracy of std::sin the limiting factor:
        {{ SC_(1), SC_(1e+03), SC_(4.728311907089523917576071901216916285418e-03) }},
        {{ SC_(1), SC_(1e+05), SC_(1.846757562882567716362123967114215743694e-03) }},
        // test zeros:
        {{ SC_(1), SC_(4017834)/(1024*1024), SC_(3.53149033321258645807835062770856949751958513973522222203044e-7) }},
        {{ SC_(1), SC_(7356375)/(1024*1024), SC_(-2.31227973111067286051984021150135526024117175836722748404342e-7) }},
        {{ SC_(1), SC_(10667654)/(1024*1024), SC_(1.24591331097191900488116495350277530373473085499043086981229e-7) }},
    }};

    static const boost::array<boost::array<T, 3>, 16> jn_data = {{
        // This first one is a modified test case from https://svn.boost.org/trac/boost/ticket/2733
        {{ SC_(-1), SC_(1.25), SC_(-0.510623260319880467069474837274910375352924050139633057168856) }},
        {{ SC_(2), SC_(0), SC_(0) }},
        {{ SC_(2), SC_(1e-02), SC_(1.249989583365885362413250958437642113452e-05) }},
        {{ SC_(5), SC_(10), SC_(-0.2340615281867936404436949416457777864635) }},
        {{ SC_(5), SC_(-10), SC_(0.2340615281867936404436949416457777864635) }},
        {{ SC_(-5), SC_(1e+06), SC_(7.259643842453285052375779970433848914846e-04) }},
        {{ SC_(5), SC_(1e+06), SC_(-0.000725964384245328505237577997043384891484649290328285235308619) }},
        {{ SC_(-5), SC_(-1), SC_(2.497577302112344313750655409880451981584e-04) }},
        {{ SC_(10), SC_(10), SC_(0.2074861066333588576972787235187534280327) }},
        {{ SC_(10), SC_(-10), SC_(0.2074861066333588576972787235187534280327) }},
        {{ SC_(10), SC_(-5), SC_(1.467802647310474131107532232606627020895e-03) }},
        {{ SC_(-10), SC_(1e+06), SC_(-3.310793117604488741264958559035744460210e-04) }},
        {{ SC_(10), SC_(1e+06), SC_(-0.000331079311760448874126495855903574446020957243277028930713243) }},
        {{ SC_(1e+02), SC_(8e+01), SC_(4.606553064823477354141298259169874909670e-06) }},
        {{ SC_(1e+03), SC_(1e+05), SC_(1.283178112502480365195139312635384057363e-03) }},
        {{ SC_(10), SC_(1e-100), SC_(2.69114445546737213403880070546737213403880070546737213403880e-1010) }},
    }};
    do_test_cyl_bessel_j(j0_data, name, "Bessel J0: Mathworld Data");
    do_test_cyl_bessel_j(j0_tricky, name, "Bessel J0: Mathworld Data (Tricky cases)");
    do_test_cyl_bessel_j(j1_data, name, "Bessel J1: Mathworld Data");
    do_test_cyl_bessel_j(j1_tricky, name, "Bessel J1: Mathworld Data (tricky cases)");
    do_test_cyl_bessel_j(jn_data, name, "Bessel JN: Mathworld Data");

    do_test_cyl_bessel_j_int(j0_data, name, "Bessel J0: Mathworld Data (Integer Version)");
    do_test_cyl_bessel_j_int(j0_tricky, name, "Bessel J0: Mathworld Data (Tricky cases) (Integer Version)");
    do_test_cyl_bessel_j_int(j1_data, name, "Bessel J1: Mathworld Data (Integer Version)");
    do_test_cyl_bessel_j_int(j1_tricky, name, "Bessel J1: Mathworld Data (tricky cases) (Integer Version)");
    do_test_cyl_bessel_j_int(jn_data, name, "Bessel JN: Mathworld Data (Integer Version)");

    static const boost::array<boost::array<T, 3>, 18> jv_data = {{
        //SC_(-2.4), {{ SC_(0), std::numeric_limits<T>::infinity() }},
        {{ SC_(2457)/1024, SC_(1)/1024, SC_(3.80739920118603335646474073457326714709615200130620574875292e-9) }},
        {{ SC_(5.5), SC_(3217)/1024, SC_(0.0281933076257506091621579544064767140470089107926550720453038) }},
        {{ SC_(-5.5), SC_(3217)/1024, SC_(-2.55820064470647911823175836997490971806135336759164272675969) }},
        {{ SC_(-5.5), SC_(1e+04), SC_(2.449843111985605522111159013846599118397e-03) }},
        {{ SC_(5.5), SC_(1e+04), SC_(0.00759343502722670361395585198154817047185480147294665270646578) }},
        {{ SC_(5.5), SC_(1e+06), SC_(-0.000747424248595630177396350688505919533097973148718960064663632) }},
        {{ SC_(5.125), SC_(1e+06), SC_(-0.000776600124835704280633640911329691642748783663198207360238214) }},
        {{ SC_(5.875), SC_(1e+06), SC_(-0.000466322721115193071631008581529503095819705088484386434589780) }},
        {{ SC_(0.5), SC_(101), SC_(0.0358874487875643822020496677692429287863419555699447066226409) }},
        {{ SC_(-5.5), SC_(1e+04), SC_(0.00244984311198560552211115901384659911839737686676766460822577) }},
        {{ SC_(-5.5), SC_(1e+06), SC_(0.000279243200433579511095229508894156656558211060453622750659554) }},
        {{ SC_(-0.5), SC_(101), SC_(0.0708184798097594268482290389188138201440114881159344944791454) }},
        {{ SC_(-10486074) / (1024*1024), SC_(1)/1024, SC_(1.41474013160494695750009004222225969090304185981836460288562e35) }},
        {{ SC_(-10486074) / (1024*1024), SC_(15), SC_(-0.0902239288885423309568944543848111461724911781719692852541489) }},
        {{ SC_(10486074) / (1024*1024), SC_(1e+02), SC_(-0.0547064914615137807616774867984047583596945624129838091326863) }},
        {{ SC_(10486074) / (1024*1024), SC_(2e+04), SC_(-0.00556783614400875611650958980796060611309029233226596737701688) }},
        {{ SC_(-10486074) / (1024*1024), SC_(1e+02), SC_(-0.0547613660316806551338637153942604550779513947674222863858713) }},
        // Bug report https://svn.boost.org/trac/boost/ticket/4812:
        {{ SC_(1.5), SC_(8034)/1024, SC_(0.0339477646369710610146236955872928005087352629422508823945264) }},
    }};
    do_test_cyl_bessel_j(jv_data, name, "Bessel J: Mathworld Data");
    static const boost::array<boost::array<T, 3>, 4> jv_large_data = {{
        // Bug report https://svn.boost.org/trac/boost/ticket/5560:
        {{ SC_(-0.5), static_cast<T>(std::ldexp(0.5, -683)), SC_(7.14823099969225685526188875418476476336424046896822867989728e102) }},
        {{ SC_(256), SC_(512), SC_(0.00671672065717513246956991122723250578101154313313749938944675) }},
        {{ SC_(-256), SC_(8), SC_(1.46866142030022704638298523775638527553596432641223316232692e-353) }},
        {{ SC_(-2.5), SC_(4), SC_(-0.0145679476685218007666785535204236327832335803441449596297004) }},
    }};
    if(jv_large_data[0][1] != 0)
      do_test_cyl_bessel_j(jv_data, name, "Bessel J: Mathworld Data (large values)");

#include "bessel_j_int_data.ipp"
    do_test_cyl_bessel_j(bessel_j_int_data, name, "Bessel JN: Random Data");

#include "bessel_j_data.ipp"
    do_test_cyl_bessel_j(bessel_j_data, name, "Bessel J: Random Data");

#include "bessel_j_large_data.ipp"
    do_test_cyl_bessel_j(bessel_j_large_data, name, "Bessel J: Random Data (Tricky large values)");

#include "sph_bessel_data.ipp"
    do_test_sph_bessel_j(sph_bessel_data, name, "Bessel j: Random Data");
}
Пример #30
0
void test_spots(T, const char* type_name)
{
    BOOST_MATH_STD_USING
    // Function values calculated on http://functions.wolfram.com/
    // Note that Mathematica's EllipticE accepts k^2 as the second parameter.
    static const boost::array<boost::array<T, 3>, 10> data1 = {{
       { { SC_(0.5), SC_(0.5), SC_(0.040348098248931543984282958654503585) } },
        {{ SC_(0), SC_(0.5), SC_(0) }},
        { { SC_(1), SC_(0.5), SC_(0.28991866293419922467977188008516755) } },
        { { SC_(1), T(1), SC_(0.38472018607562056416055864584160775) } },
        { { SC_(-1), T(1), SC_(-0.38472018607562056416055864584160775) } },
        { { SC_(-1), T(0.5), SC_(-0.28991866293419922467977188008516755) } },
        { { SC_(-10), T(0.5), SC_(-5.2996914501577855803123384771117708) } },
        { { SC_(10), SC_(-0.5), SC_(5.2996914501577855803123384771117708) } },
    }};

    do_test_ellint_d2<T>(data1, type_name, "Elliptic Integral E: Mathworld Data");

#include "ellint_d2_data.ipp"

    do_test_ellint_d2<T>(ellint_d2_data, type_name, "Elliptic Integral D: Random Data");

    // Function values calculated on http://functions.wolfram.com/
    // Note that Mathematica's EllipticE accepts k^2 as the second parameter.
    static const boost::array<boost::array<T, 2>, 3> data2 = {{
       { { SC_(0.5), SC_(0.87315258189267554964563356323264341) } },
       { { SC_(1.0) / 1024, SC_(0.78539844427788694671464428063604776) } },
       { { boost::math::tools::root_epsilon<T>(), SC_(0.78539816339744830961566084581987572) } }
    }};

    do_test_ellint_d1<T>(data2, type_name, "Elliptic Integral E: Mathworld Data");

#include "ellint_d_data.ipp"

    do_test_ellint_d1<T>(ellint_d_data, type_name, "Elliptic Integral D: Random Data");

    BOOST_MATH_CHECK_THROW(boost::math::ellint_d(T(1)), std::domain_error);
    BOOST_MATH_CHECK_THROW(boost::math::ellint_d(T(-1)), std::domain_error);
    BOOST_MATH_CHECK_THROW(boost::math::ellint_d(T(1.5)), std::domain_error);
    BOOST_MATH_CHECK_THROW(boost::math::ellint_d(T(-1.5)), std::domain_error);
}