Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73307 - in sandbox/e_float/libs/e_float: build src/e_float/efx src/functions/elementary
From: e_float_at_[hidden]
Date: 2011-07-22 17:55:28


Author: christopher_kormanyos
Date: 2011-07-22 17:55:27 EDT (Fri, 22 Jul 2011)
New Revision: 73307
URL: http://svn.boost.org/trac/boost/changeset/73307

Log:
- Corrected the conversion from double to e_float for efx::e_float. Full conversion now works for round-tripping.
Text files modified:
   sandbox/e_float/libs/e_float/build/vc_libs.txt | 26 +++
   sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp | 30 +++
   sandbox/e_float/libs/e_float/src/functions/elementary/elementary_trans.cpp | 285 +++++++++++++++++++++++++++++++++++++--
   3 files changed, 313 insertions(+), 28 deletions(-)

Modified: sandbox/e_float/libs/e_float/build/vc_libs.txt
==============================================================================
--- sandbox/e_float/libs/e_float/build/vc_libs.txt (original)
+++ sandbox/e_float/libs/e_float/build/vc_libs.txt 2011-07-22 17:55:27 EDT (Fri, 22 Jul 2011)
@@ -1,3 +1,25 @@
 
-TBD: Describe the libs needed for building with various
-TBD: big-number back-ends in Visual Studio.
+# This work is based on an earlier work:
+# "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
+# in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} © ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469
+
+Microsoft Visual C++ x86 gmp build needs these libraries:
+ ./e_float/e_float/gmp/4-2-4/vc9/p4/gmp.lib
+ ./e_float/e_float/gmp/4-2-4/vc9/p4/gmp.pdb
+
+Microsoft Visual C++ x64 gmp build needs these libraries:
+ ./e_float/e_float/gmp/4-2-4/vc9/x64/gmp.lib
+ ./e_float/e_float/gmp/4-2-4/vc9/x64/gmp.pdb
+
+Microsoft Visual C++ x86 mpfr build needs these libraries:
+ ./e_float/e_float/mpfr/2-4-1/vc9/p4/mpfr.lib
+ ./e_float/e_float/mpfr/2-4-1/vc9/p4/mpfr.pdb
+ ./e_float/e_float/gmp/4-2-4/vc9/p4/gmp.lib
+ ./e_float/e_float/gmp/4-2-4/vc9/p4/gmp.pdb
+
+Microsoft Visual C++ x64 mpfr build needs these libraries:
+ ./e_float/e_float/mpfr/2-4-1/vc9/x64/mpfr.lib
+ ./e_float/e_float/mpfr/2-4-1/vc9/x64/mpfr.pdb
+ ./e_float/e_float/gmp/4-2-4/vc9/x64/gmp.lib
+ ./e_float/e_float/gmp/4-2-4/vc9/x64/gmp.pdb
+

Modified: sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp (original)
+++ sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp 2011-07-22 17:55:27 EDT (Fri, 22 Jul 2011)
@@ -113,7 +113,20 @@
     // Scale the UINT64 representation to the fractional part of
     // the double and multiply with the base-2 exponent.
     const int p2 = db.get_exponent() - (std::numeric_limits<double>::digits - 1);
- operator*=(ef::pow2(static_cast<INT64>(p2)));
+
+ if(p2 == 0) { }
+ else if((p2 > 0) && (p2 < 27))
+ {
+ mul_by_int(static_cast<INT32>(1uL << p2));
+ }
+ else if((p2 < 0) && (p2 > -27))
+ {
+ div_by_int(static_cast<INT32>(1uL << p2));
+ }
+ else
+ {
+ operator*=(ef::pow2(static_cast<INT64>(p2)));
+ }
 
     neg = b_neg;
   }
@@ -1452,15 +1465,20 @@
 
   // Add the digits after the decimal point.
 
- for(std::size_t i = static_cast<std::size_t>(1u); i < static_cast<std::size_t>(ef_elem_number); i++)
   {
     std::stringstream ss;
+ ss.width(static_cast<std::streamsize>(ef_elem_digits10));
+ ss.fill(static_cast<char>('0'));
 
- ss << std::setw(static_cast<std::streamsize>(ef_elem_digits10))
- << std::setfill(static_cast<char>('0'))
- << data[i];
+ for(std::size_t i = static_cast<std::size_t>(1u); i < static_cast<std::size_t>(ef_elem_number); i++)
+ {
+ ss << data[i];
 
- str += ss.str();
+ str += ss.str();
+
+ ss.str("");
+ ss.clear();
+ }
   }
 
   // Cut the output to the size of the precision.

Modified: sandbox/e_float/libs/e_float/src/functions/elementary/elementary_trans.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/functions/elementary/elementary_trans.cpp (original)
+++ sandbox/e_float/libs/e_float/src/functions/elementary/elementary_trans.cpp 2011-07-22 17:55:27 EDT (Fri, 22 Jul 2011)
@@ -31,29 +31,274 @@
 
 e_float ef::pow2(const INT64 p)
 {
- // Compute two raised to the power of p, in other words 2^p.
- switch(p)
+ // Create a static const table of p^2 for -128 < p < +128.
+ // Note: The size of this table must be odd-numbered and
+ // symmetric about 0.
+ static const std::tr1::array<e_float, 255u> p2_data =
+ {{
+ e_float("5.877471754111437539843682686111228389093327783860437607543758531392086297273635864257812500000000000e-39"),
+ e_float("1.175494350822287507968736537222245677818665556772087521508751706278417259454727172851562500000000000e-38"),
+ e_float("2.350988701644575015937473074444491355637331113544175043017503412556834518909454345703125000000000000e-38"),
+ e_float("4.701977403289150031874946148888982711274662227088350086035006825113669037818908691406250000000000000e-38"),
+ e_float("9.403954806578300063749892297777965422549324454176700172070013650227338075637817382812500000000000000e-38"),
+ e_float("1.880790961315660012749978459555593084509864890835340034414002730045467615127563476562500000000000000e-37"),
+ e_float("3.761581922631320025499956919111186169019729781670680068828005460090935230255126953125000000000000000e-37"),
+ e_float("7.523163845262640050999913838222372338039459563341360137656010920181870460510253906250000000000000000e-37"),
+ e_float("1.504632769052528010199982767644474467607891912668272027531202184036374092102050781250000000000000000e-36"),
+ e_float("3.009265538105056020399965535288948935215783825336544055062404368072748184204101562500000000000000000e-36"),
+ e_float("6.018531076210112040799931070577897870431567650673088110124808736145496368408203125000000000000000000e-36"),
+ e_float("1.203706215242022408159986214115579574086313530134617622024961747229099273681640625000000000000000000e-35"),
+ e_float("2.407412430484044816319972428231159148172627060269235244049923494458198547363281250000000000000000000e-35"),
+ e_float("4.814824860968089632639944856462318296345254120538470488099846988916397094726562500000000000000000000e-35"),
+ e_float("9.629649721936179265279889712924636592690508241076940976199693977832794189453125000000000000000000000e-35"),
+ e_float("1.925929944387235853055977942584927318538101648215388195239938795566558837890625000000000000000000000e-34"),
+ e_float("3.851859888774471706111955885169854637076203296430776390479877591133117675781250000000000000000000000e-34"),
+ e_float("7.703719777548943412223911770339709274152406592861552780959755182266235351562500000000000000000000000e-34"),
+ e_float("1.540743955509788682444782354067941854830481318572310556191951036453247070312500000000000000000000000e-33"),
+ e_float("3.081487911019577364889564708135883709660962637144621112383902072906494140625000000000000000000000000e-33"),
+ e_float("6.162975822039154729779129416271767419321925274289242224767804145812988281250000000000000000000000000e-33"),
+ e_float("1.232595164407830945955825883254353483864385054857848444953560829162597656250000000000000000000000000e-32"),
+ e_float("2.465190328815661891911651766508706967728770109715696889907121658325195312500000000000000000000000000e-32"),
+ e_float("4.930380657631323783823303533017413935457540219431393779814243316650390625000000000000000000000000000e-32"),
+ e_float("9.860761315262647567646607066034827870915080438862787559628486633300781250000000000000000000000000000e-32"),
+ e_float("1.972152263052529513529321413206965574183016087772557511925697326660156250000000000000000000000000000e-31"),
+ e_float("3.944304526105059027058642826413931148366032175545115023851394653320312500000000000000000000000000000e-31"),
+ e_float("7.888609052210118054117285652827862296732064351090230047702789306640625000000000000000000000000000000e-31"),
+ e_float("1.577721810442023610823457130565572459346412870218046009540557861328125000000000000000000000000000000e-30"),
+ e_float("3.155443620884047221646914261131144918692825740436092019081115722656250000000000000000000000000000000e-30"),
+ e_float("6.310887241768094443293828522262289837385651480872184038162231445312500000000000000000000000000000000e-30"),
+ e_float("1.262177448353618888658765704452457967477130296174436807632446289062500000000000000000000000000000000e-29"),
+ e_float("2.524354896707237777317531408904915934954260592348873615264892578125000000000000000000000000000000000e-29"),
+ e_float("5.048709793414475554635062817809831869908521184697747230529785156250000000000000000000000000000000000e-29"),
+ e_float("1.009741958682895110927012563561966373981704236939549446105957031250000000000000000000000000000000000e-28"),
+ e_float("2.019483917365790221854025127123932747963408473879098892211914062500000000000000000000000000000000000e-28"),
+ e_float("4.038967834731580443708050254247865495926816947758197784423828125000000000000000000000000000000000000e-28"),
+ e_float("8.077935669463160887416100508495730991853633895516395568847656250000000000000000000000000000000000000e-28"),
+ e_float("1.615587133892632177483220101699146198370726779103279113769531250000000000000000000000000000000000000e-27"),
+ e_float("3.231174267785264354966440203398292396741453558206558227539062500000000000000000000000000000000000000e-27"),
+ e_float("6.462348535570528709932880406796584793482907116413116455078125000000000000000000000000000000000000000e-27"),
+ e_float("1.292469707114105741986576081359316958696581423282623291015625000000000000000000000000000000000000000e-26"),
+ e_float("2.584939414228211483973152162718633917393162846565246582031250000000000000000000000000000000000000000e-26"),
+ e_float("5.169878828456422967946304325437267834786325693130493164062500000000000000000000000000000000000000000e-26"),
+ e_float("1.033975765691284593589260865087453566957265138626098632812500000000000000000000000000000000000000000e-25"),
+ e_float("2.067951531382569187178521730174907133914530277252197265625000000000000000000000000000000000000000000e-25"),
+ e_float("4.135903062765138374357043460349814267829060554504394531250000000000000000000000000000000000000000000e-25"),
+ e_float("8.271806125530276748714086920699628535658121109008789062500000000000000000000000000000000000000000000e-25"),
+ e_float("1.654361225106055349742817384139925707131624221801757812500000000000000000000000000000000000000000000e-24"),
+ e_float("3.308722450212110699485634768279851414263248443603515625000000000000000000000000000000000000000000000e-24"),
+ e_float("6.617444900424221398971269536559702828526496887207031250000000000000000000000000000000000000000000000e-24"),
+ e_float("1.323488980084844279794253907311940565705299377441406250000000000000000000000000000000000000000000000e-23"),
+ e_float("2.646977960169688559588507814623881131410598754882812500000000000000000000000000000000000000000000000e-23"),
+ e_float("5.293955920339377119177015629247762262821197509765625000000000000000000000000000000000000000000000000e-23"),
+ e_float("1.058791184067875423835403125849552452564239501953125000000000000000000000000000000000000000000000000e-22"),
+ e_float("2.117582368135750847670806251699104905128479003906250000000000000000000000000000000000000000000000000e-22"),
+ e_float("4.235164736271501695341612503398209810256958007812500000000000000000000000000000000000000000000000000e-22"),
+ e_float("8.470329472543003390683225006796419620513916015625000000000000000000000000000000000000000000000000000e-22"),
+ e_float("1.694065894508600678136645001359283924102783203125000000000000000000000000000000000000000000000000000e-21"),
+ e_float("3.388131789017201356273290002718567848205566406250000000000000000000000000000000000000000000000000000e-21"),
+ e_float("6.776263578034402712546580005437135696411132812500000000000000000000000000000000000000000000000000000e-21"),
+ e_float("1.355252715606880542509316001087427139282226562500000000000000000000000000000000000000000000000000000e-20"),
+ e_float("2.710505431213761085018632002174854278564453125000000000000000000000000000000000000000000000000000000e-20"),
+ e_float("5.421010862427522170037264004349708557128906250000000000000000000000000000000000000000000000000000000e-20"),
+ e_float("1.084202172485504434007452800869941711425781250000000000000000000000000000000000000000000000000000000e-19"),
+ e_float("2.168404344971008868014905601739883422851562500000000000000000000000000000000000000000000000000000000e-19"),
+ e_float("4.336808689942017736029811203479766845703125000000000000000000000000000000000000000000000000000000000e-19"),
+ e_float("8.673617379884035472059622406959533691406250000000000000000000000000000000000000000000000000000000000e-19"),
+ e_float("1.734723475976807094411924481391906738281250000000000000000000000000000000000000000000000000000000000e-18"),
+ e_float("3.469446951953614188823848962783813476562500000000000000000000000000000000000000000000000000000000000e-18"),
+ e_float("6.938893903907228377647697925567626953125000000000000000000000000000000000000000000000000000000000000e-18"),
+ e_float("1.387778780781445675529539585113525390625000000000000000000000000000000000000000000000000000000000000e-17"),
+ e_float("2.775557561562891351059079170227050781250000000000000000000000000000000000000000000000000000000000000e-17"),
+ e_float("5.551115123125782702118158340454101562500000000000000000000000000000000000000000000000000000000000000e-17"),
+ e_float("1.110223024625156540423631668090820312500000000000000000000000000000000000000000000000000000000000000e-16"),
+ e_float("2.220446049250313080847263336181640625000000000000000000000000000000000000000000000000000000000000000e-16"),
+ e_float("4.440892098500626161694526672363281250000000000000000000000000000000000000000000000000000000000000000e-16"),
+ e_float("8.881784197001252323389053344726562500000000000000000000000000000000000000000000000000000000000000000e-16"),
+ e_float("1.776356839400250464677810668945312500000000000000000000000000000000000000000000000000000000000000000e-15"),
+ e_float("3.552713678800500929355621337890625000000000000000000000000000000000000000000000000000000000000000000e-15"),
+ e_float("7.105427357601001858711242675781250000000000000000000000000000000000000000000000000000000000000000000e-15"),
+ e_float("1.421085471520200371742248535156250000000000000000000000000000000000000000000000000000000000000000000e-14"),
+ e_float("2.842170943040400743484497070312500000000000000000000000000000000000000000000000000000000000000000000e-14"),
+ e_float("5.684341886080801486968994140625000000000000000000000000000000000000000000000000000000000000000000000e-14"),
+ e_float("1.136868377216160297393798828125000000000000000000000000000000000000000000000000000000000000000000000e-13"),
+ e_float("2.273736754432320594787597656250000000000000000000000000000000000000000000000000000000000000000000000e-13"),
+ e_float("4.547473508864641189575195312500000000000000000000000000000000000000000000000000000000000000000000000e-13"),
+ e_float("9.094947017729282379150390625000000000000000000000000000000000000000000000000000000000000000000000000e-13"),
+ e_float("1.818989403545856475830078125000000000000000000000000000000000000000000000000000000000000000000000000e-12"),
+ e_float("3.637978807091712951660156250000000000000000000000000000000000000000000000000000000000000000000000000e-12"),
+ e_float("7.275957614183425903320312500000000000000000000000000000000000000000000000000000000000000000000000000e-12"),
+ e_float("1.455191522836685180664062500000000000000000000000000000000000000000000000000000000000000000000000000e-11"),
+ e_float("2.910383045673370361328125000000000000000000000000000000000000000000000000000000000000000000000000000e-11"),
+ e_float("5.820766091346740722656250000000000000000000000000000000000000000000000000000000000000000000000000000e-11"),
+ e_float("1.164153218269348144531250000000000000000000000000000000000000000000000000000000000000000000000000000e-10"),
+ e_float("2.328306436538696289062500000000000000000000000000000000000000000000000000000000000000000000000000000e-10"),
+ e_float("4.656612873077392578125000000000000000000000000000000000000000000000000000000000000000000000000000000e-10"),
+ e_float("9.313225746154785156250000000000000000000000000000000000000000000000000000000000000000000000000000000e-10"),
+ e_float("1.862645149230957031250000000000000000000000000000000000000000000000000000000000000000000000000000000e-9"),
+ e_float("3.725290298461914062500000000000000000000000000000000000000000000000000000000000000000000000000000000e-9"),
+ e_float("7.450580596923828125000000000000000000000000000000000000000000000000000000000000000000000000000000000e-9"),
+ e_float("1.490116119384765625000000000000000000000000000000000000000000000000000000000000000000000000000000000e-8"),
+ e_float("2.980232238769531250000000000000000000000000000000000000000000000000000000000000000000000000000000000e-8"),
+ e_float("5.960464477539062500000000000000000000000000000000000000000000000000000000000000000000000000000000000e-8"),
+ e_float("1.192092895507812500000000000000000000000000000000000000000000000000000000000000000000000000000000000e-7"),
+ e_float("2.384185791015625000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-7"),
+ e_float("4.768371582031250000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-7"),
+ e_float("9.536743164062500000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-7"),
+ e_float("1.907348632812500000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-6"),
+ e_float("3.814697265625000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-6"),
+ e_float("7.629394531250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e-6"),
+ e_float("0.000015258789062500000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.000030517578125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.000061035156250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.000122070312500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.000244140625000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.000488281250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.000976562500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.001953125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.003906250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.007812500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.01562500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.03125000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ e_float("0.06250000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"),
+ ef::eighth(),
+ ef::quarter(),
+ ef::half(),
+ ef::one(),
+ ef::two(),
+ ef::four(),
+ ef::eight(),
+ e_float(16),
+ e_float(32),
+ e_float(64),
+ e_float(128),
+ e_float(256),
+ e_float(512),
+ e_float(1024),
+ e_float(2048),
+ e_float(4096),
+ e_float(8192),
+ e_float(16384),
+ e_float(32768),
+ e_float(65536),
+ e_float(131072),
+ e_float(262144),
+ e_float(524288),
+ e_float(static_cast<UINT32>(1uL << 20u)),
+ e_float(static_cast<UINT32>(1uL << 21u)),
+ e_float(static_cast<UINT32>(1uL << 22u)),
+ e_float(static_cast<UINT32>(1uL << 23u)),
+ e_float(static_cast<UINT32>(1uL << 24u)),
+ e_float(static_cast<UINT32>(1uL << 25u)),
+ e_float(static_cast<UINT32>(1uL << 26u)),
+ e_float(static_cast<UINT32>(1uL << 27u)),
+ e_float(static_cast<UINT32>(1uL << 28u)),
+ e_float(static_cast<UINT32>(1uL << 29u)),
+ e_float(static_cast<UINT32>(1uL << 30u)),
+ e_float(static_cast<UINT32>(1uL << 31u)),
+ e_float(static_cast<UINT64>(1uLL << 32u)),
+ e_float(static_cast<UINT64>(1uLL << 33u)),
+ e_float(static_cast<UINT64>(1uLL << 34u)),
+ e_float(static_cast<UINT64>(1uLL << 35u)),
+ e_float(static_cast<UINT64>(1uLL << 36u)),
+ e_float(static_cast<UINT64>(1uLL << 37u)),
+ e_float(static_cast<UINT64>(1uLL << 38u)),
+ e_float(static_cast<UINT64>(1uLL << 39u)),
+ e_float(static_cast<UINT64>(1uLL << 40u)),
+ e_float(static_cast<UINT64>(1uLL << 41u)),
+ e_float(static_cast<UINT64>(1uLL << 42u)),
+ e_float(static_cast<UINT64>(1uLL << 43u)),
+ e_float(static_cast<UINT64>(1uLL << 44u)),
+ e_float(static_cast<UINT64>(1uLL << 45u)),
+ e_float(static_cast<UINT64>(1uLL << 46u)),
+ e_float(static_cast<UINT64>(1uLL << 47u)),
+ e_float(static_cast<UINT64>(1uLL << 48u)),
+ e_float(static_cast<UINT64>(1uLL << 49u)),
+ e_float(static_cast<UINT64>(1uLL << 50u)),
+ e_float(static_cast<UINT64>(1uLL << 51u)),
+ e_float(static_cast<UINT64>(1uLL << 52u)),
+ e_float(static_cast<UINT64>(1uLL << 53u)),
+ e_float(static_cast<UINT64>(1uLL << 54u)),
+ e_float(static_cast<UINT64>(1uLL << 55u)),
+ e_float(static_cast<UINT64>(1uLL << 56u)),
+ e_float(static_cast<UINT64>(1uLL << 57u)),
+ e_float(static_cast<UINT64>(1uLL << 58u)),
+ e_float(static_cast<UINT64>(1uLL << 59u)),
+ e_float(static_cast<UINT64>(1uLL << 60u)),
+ e_float(static_cast<UINT64>(1uLL << 61u)),
+ e_float(static_cast<UINT64>(1uLL << 62u)),
+ e_float(static_cast<UINT64>(1uLL << 63u)),
+ e_float("1.844674407370955161600000000000000000000000000000000000000000000000000000000000000000000000000000000e19"),
+ e_float("3.689348814741910323200000000000000000000000000000000000000000000000000000000000000000000000000000000e19"),
+ e_float("7.378697629483820646400000000000000000000000000000000000000000000000000000000000000000000000000000000e19"),
+ e_float("1.475739525896764129280000000000000000000000000000000000000000000000000000000000000000000000000000000e20"),
+ e_float("2.951479051793528258560000000000000000000000000000000000000000000000000000000000000000000000000000000e20"),
+ e_float("5.902958103587056517120000000000000000000000000000000000000000000000000000000000000000000000000000000e20"),
+ e_float("1.180591620717411303424000000000000000000000000000000000000000000000000000000000000000000000000000000e21"),
+ e_float("2.361183241434822606848000000000000000000000000000000000000000000000000000000000000000000000000000000e21"),
+ e_float("4.722366482869645213696000000000000000000000000000000000000000000000000000000000000000000000000000000e21"),
+ e_float("9.444732965739290427392000000000000000000000000000000000000000000000000000000000000000000000000000000e21"),
+ e_float("1.888946593147858085478400000000000000000000000000000000000000000000000000000000000000000000000000000e22"),
+ e_float("3.777893186295716170956800000000000000000000000000000000000000000000000000000000000000000000000000000e22"),
+ e_float("7.555786372591432341913600000000000000000000000000000000000000000000000000000000000000000000000000000e22"),
+ e_float("1.511157274518286468382720000000000000000000000000000000000000000000000000000000000000000000000000000e23"),
+ e_float("3.022314549036572936765440000000000000000000000000000000000000000000000000000000000000000000000000000e23"),
+ e_float("6.044629098073145873530880000000000000000000000000000000000000000000000000000000000000000000000000000e23"),
+ e_float("1.208925819614629174706176000000000000000000000000000000000000000000000000000000000000000000000000000e24"),
+ e_float("2.417851639229258349412352000000000000000000000000000000000000000000000000000000000000000000000000000e24"),
+ e_float("4.835703278458516698824704000000000000000000000000000000000000000000000000000000000000000000000000000e24"),
+ e_float("9.671406556917033397649408000000000000000000000000000000000000000000000000000000000000000000000000000e24"),
+ e_float("1.934281311383406679529881600000000000000000000000000000000000000000000000000000000000000000000000000e25"),
+ e_float("3.868562622766813359059763200000000000000000000000000000000000000000000000000000000000000000000000000e25"),
+ e_float("7.737125245533626718119526400000000000000000000000000000000000000000000000000000000000000000000000000e25"),
+ e_float("1.547425049106725343623905280000000000000000000000000000000000000000000000000000000000000000000000000e26"),
+ e_float("3.094850098213450687247810560000000000000000000000000000000000000000000000000000000000000000000000000e26"),
+ e_float("6.189700196426901374495621120000000000000000000000000000000000000000000000000000000000000000000000000e26"),
+ e_float("1.237940039285380274899124224000000000000000000000000000000000000000000000000000000000000000000000000e27"),
+ e_float("2.475880078570760549798248448000000000000000000000000000000000000000000000000000000000000000000000000e27"),
+ e_float("4.951760157141521099596496896000000000000000000000000000000000000000000000000000000000000000000000000e27"),
+ e_float("9.903520314283042199192993792000000000000000000000000000000000000000000000000000000000000000000000000e27"),
+ e_float("1.980704062856608439838598758400000000000000000000000000000000000000000000000000000000000000000000000e28"),
+ e_float("3.961408125713216879677197516800000000000000000000000000000000000000000000000000000000000000000000000e28"),
+ e_float("7.922816251426433759354395033600000000000000000000000000000000000000000000000000000000000000000000000e28"),
+ e_float("1.584563250285286751870879006720000000000000000000000000000000000000000000000000000000000000000000000e29"),
+ e_float("3.169126500570573503741758013440000000000000000000000000000000000000000000000000000000000000000000000e29"),
+ e_float("6.338253001141147007483516026880000000000000000000000000000000000000000000000000000000000000000000000e29"),
+ e_float("1.267650600228229401496703205376000000000000000000000000000000000000000000000000000000000000000000000e30"),
+ e_float("2.535301200456458802993406410752000000000000000000000000000000000000000000000000000000000000000000000e30"),
+ e_float("5.070602400912917605986812821504000000000000000000000000000000000000000000000000000000000000000000000e30"),
+ e_float("1.014120480182583521197362564300800000000000000000000000000000000000000000000000000000000000000000000e31"),
+ e_float("2.028240960365167042394725128601600000000000000000000000000000000000000000000000000000000000000000000e31"),
+ e_float("4.056481920730334084789450257203200000000000000000000000000000000000000000000000000000000000000000000e31"),
+ e_float("8.112963841460668169578900514406400000000000000000000000000000000000000000000000000000000000000000000e31"),
+ e_float("1.622592768292133633915780102881280000000000000000000000000000000000000000000000000000000000000000000e32"),
+ e_float("3.245185536584267267831560205762560000000000000000000000000000000000000000000000000000000000000000000e32"),
+ e_float("6.490371073168534535663120411525120000000000000000000000000000000000000000000000000000000000000000000e32"),
+ e_float("1.298074214633706907132624082305024000000000000000000000000000000000000000000000000000000000000000000e33"),
+ e_float("2.596148429267413814265248164610048000000000000000000000000000000000000000000000000000000000000000000e33"),
+ e_float("5.192296858534827628530496329220096000000000000000000000000000000000000000000000000000000000000000000e33"),
+ e_float("1.038459371706965525706099265844019200000000000000000000000000000000000000000000000000000000000000000e34"),
+ e_float("2.076918743413931051412198531688038400000000000000000000000000000000000000000000000000000000000000000e34"),
+ e_float("4.153837486827862102824397063376076800000000000000000000000000000000000000000000000000000000000000000e34"),
+ e_float("8.307674973655724205648794126752153600000000000000000000000000000000000000000000000000000000000000000e34"),
+ e_float("1.661534994731144841129758825350430720000000000000000000000000000000000000000000000000000000000000000e35"),
+ e_float("3.323069989462289682259517650700861440000000000000000000000000000000000000000000000000000000000000000e35"),
+ e_float("6.646139978924579364519035301401722880000000000000000000000000000000000000000000000000000000000000000e35"),
+ e_float("1.329227995784915872903807060280344576000000000000000000000000000000000000000000000000000000000000000e36"),
+ e_float("2.658455991569831745807614120560689152000000000000000000000000000000000000000000000000000000000000000e36"),
+ e_float("5.316911983139663491615228241121378304000000000000000000000000000000000000000000000000000000000000000e36"),
+ e_float("1.063382396627932698323045648224275660800000000000000000000000000000000000000000000000000000000000000e37"),
+ e_float("2.126764793255865396646091296448551321600000000000000000000000000000000000000000000000000000000000000e37"),
+ e_float("4.253529586511730793292182592897102643200000000000000000000000000000000000000000000000000000000000000e37"),
+ e_float("8.507059173023461586584365185794205286400000000000000000000000000000000000000000000000000000000000000e37"),
+ e_float("1.701411834604692317316873037158841057280000000000000000000000000000000000000000000000000000000000000e38")
+ }};
+
+ if((p > static_cast<INT64>(-128)) && (p < static_cast<INT64>(+128)))
   {
- case static_cast<INT64>(-4):
- return ef::sixteenth();
- case static_cast<INT64>(-3):
- return ef::eighth();
- case static_cast<INT64>(-2):
- return ef::quarter();
- case static_cast<INT64>(-1):
- return ef::half();
- case static_cast<INT64>(0):
- return ef::one();
- case static_cast<INT64>(1):
- return ef::two();
- case static_cast<INT64>(2):
- return ef::four();
- case static_cast<INT64>(3):
- return ef::eight();
- default:
- break;
+ return p2_data[static_cast<std::size_t>(p + ((p2_data.size() - 1u) / 2u))];
   }
 
+ // Compute and return 2^p.
   if(p < static_cast<INT64>(0))
   {
     return ef::pow2(static_cast<INT64>(-p)).calculate_inv();


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk