Merge pull request #8925 from savuor:fix/softfloat_comments

pull/8939/head
Alexander Alekhin 8 years ago
commit 3ea02e4fcc
  1. 48
      modules/core/include/opencv2/core/softfloat.hpp
  2. 783
      modules/core/src/softfloat.cpp
  3. 7
      modules/ts/include/opencv2/ts/ts_gtest.h

@ -1,46 +1,8 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Copyright (C) 2015, Itseez Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html
// This file is based on files from package issued with the following license:
/*============================================================================

@ -1,46 +1,8 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
// Copyright (C) 2009, Willow Garage Inc., all rights reserved.
// Copyright (C) 2013, OpenCV Foundation, all rights reserved.
// Copyright (C) 2015, Itseez Inc., all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html
// This file is based on files from package issued with the following license:
/*============================================================================
@ -4185,77 +4147,78 @@ float64_t ui64_to_f64( uint64_t a )
#define EXPTAB_SCALE 6
#define EXPTAB_MASK ((1 << EXPTAB_SCALE) - 1)
static const softdouble EXPPOLY_32F_A0(.9670371139572337719125840413672004409288e-2);
static const double expTab[] = {
1.0,
1.0108892860517004600204097905619,
1.0218971486541166782344801347833,
1.0330248790212284225001082839705,
1.0442737824274138403219664787399,
1.0556451783605571588083413251529,
1.0671404006768236181695211209928,
1.0787607977571197937406800374385,
1.0905077326652576592070106557607,
1.1023825833078409435564142094256,
1.1143867425958925363088129569196,
1.126521618608241899794798643787 ,
1.1387886347566916537038302838415,
1.151189229952982705817759635202 ,
1.1637248587775775138135735990922,
1.1763969916502812762846457284838,
1.1892071150027210667174999705605,
1.2021567314527031420963969574978,
1.2152473599804688781165202513388,
1.2284805361068700056940089577928,
1.2418578120734840485936774687266,
1.2553807570246910895793906574423,
1.2690509571917332225544190810323,
1.2828700160787782807266697810215,
1.2968395546510096659337541177925,
1.3109612115247643419229917863308,
1.3252366431597412946295370954987,
1.3396675240533030053600306697244,
1.3542555469368927282980147401407,
1.3690024229745906119296011329822,
1.3839098819638319548726595272652,
1.3989796725383111402095281367152,
1.4142135623730950488016887242097,
1.4296133383919700112350657782751,
1.4451808069770466200370062414717,
1.4609177941806469886513028903106,
1.476826145939499311386907480374 ,
1.4929077282912648492006435314867,
1.5091644275934227397660195510332,
1.5255981507445383068512536895169,
1.5422108254079408236122918620907,
1.5590044002378369670337280894749,
1.5759808451078864864552701601819,
1.5931421513422668979372486431191,
1.6104903319492543081795206673574,
1.628027421857347766848218522014 ,
1.6457554781539648445187567247258,
1.6636765803267364350463364569764,
1.6817928305074290860622509524664,
1.7001063537185234695013625734975,
1.7186192981224779156293443764563,
1.7373338352737062489942020818722,
1.7562521603732994831121606193753,
1.7753764925265212525505592001993,
1.7947090750031071864277032421278,
1.8142521755003987562498346003623,
1.8340080864093424634870831895883,
1.8539791250833855683924530703377,
1.8741676341102999013299989499544,
1.8945759815869656413402186534269,
1.9152065613971472938726112702958,
1.9360617934922944505980559045667,
1.9571441241754002690183222516269,
1.9784560263879509682582499181312,
// .9670371139572337719125840413672004409288e-2
static const softdouble EXPPOLY_32F_A0 = float64_t::fromRaw(0x3f83ce0f3e46f431);
static const uint64_t expTab[] = {
0x3ff0000000000000, // 1.000000
0x3ff02c9a3e778061, // 1.010889
0x3ff059b0d3158574, // 1.021897
0x3ff0874518759bc8, // 1.033025
0x3ff0b5586cf9890f, // 1.044274
0x3ff0e3ec32d3d1a2, // 1.055645
0x3ff11301d0125b51, // 1.067140
0x3ff1429aaea92de0, // 1.078761
0x3ff172b83c7d517b, // 1.090508
0x3ff1a35beb6fcb75, // 1.102383
0x3ff1d4873168b9aa, // 1.114387
0x3ff2063b88628cd6, // 1.126522
0x3ff2387a6e756238, // 1.138789
0x3ff26b4565e27cdd, // 1.151189
0x3ff29e9df51fdee1, // 1.163725
0x3ff2d285a6e4030b, // 1.176397
0x3ff306fe0a31b715, // 1.189207
0x3ff33c08b26416ff, // 1.202157
0x3ff371a7373aa9cb, // 1.215247
0x3ff3a7db34e59ff7, // 1.228481
0x3ff3dea64c123422, // 1.241858
0x3ff4160a21f72e2a, // 1.255381
0x3ff44e086061892d, // 1.269051
0x3ff486a2b5c13cd0, // 1.282870
0x3ff4bfdad5362a27, // 1.296840
0x3ff4f9b2769d2ca7, // 1.310961
0x3ff5342b569d4f82, // 1.325237
0x3ff56f4736b527da, // 1.339668
0x3ff5ab07dd485429, // 1.354256
0x3ff5e76f15ad2148, // 1.369002
0x3ff6247eb03a5585, // 1.383910
0x3ff6623882552225, // 1.398980
0x3ff6a09e667f3bcd, // 1.414214
0x3ff6dfb23c651a2f, // 1.429613
0x3ff71f75e8ec5f74, // 1.445181
0x3ff75feb564267c9, // 1.460918
0x3ff7a11473eb0187, // 1.476826
0x3ff7e2f336cf4e62, // 1.492908
0x3ff82589994cce13, // 1.509164
0x3ff868d99b4492ed, // 1.525598
0x3ff8ace5422aa0db, // 1.542211
0x3ff8f1ae99157736, // 1.559004
0x3ff93737b0cdc5e5, // 1.575981
0x3ff97d829fde4e50, // 1.593142
0x3ff9c49182a3f090, // 1.610490
0x3ffa0c667b5de565, // 1.628027
0x3ffa5503b23e255d, // 1.645755
0x3ffa9e6b5579fdbf, // 1.663677
0x3ffae89f995ad3ad, // 1.681793
0x3ffb33a2b84f15fb, // 1.700106
0x3ffb7f76f2fb5e47, // 1.718619
0x3ffbcc1e904bc1d2, // 1.737334
0x3ffc199bdd85529c, // 1.756252
0x3ffc67f12e57d14b, // 1.775376
0x3ffcb720dcef9069, // 1.794709
0x3ffd072d4a07897c, // 1.814252
0x3ffd5818dcfba487, // 1.834008
0x3ffda9e603db3285, // 1.853979
0x3ffdfc97337b9b5f, // 1.874168
0x3ffe502ee78b3ff6, // 1.894576
0x3ffea4afa2a490da, // 1.915207
0x3ffefa1bee615a27, // 1.936062
0x3fff50765b6e4540, // 1.957144
0x3fffa7c1819e90d8, // 1.978456
};
// 1 / ln(2) == 1.4426950408889634073599246810019
static const float64_t exp_prescale = float64_t(1.4426950408889634073599246810019) * float64_t(1 << EXPTAB_SCALE);
// 1 / ln(2) * (1 << EXPTAB_SCALE) == 1.4426950408889634073599246810019 * (1 << EXPTAB_SCALE)
static const float64_t exp_prescale = float64_t::fromRaw(0x3ff71547652b82fe) * float64_t(1 << EXPTAB_SCALE);
static const float64_t exp_postscale = float64_t::one()/float64_t(1 << EXPTAB_SCALE);
static const float64_t exp_max_val(3000*(1 << EXPTAB_SCALE)); // log10(DBL_MAX) < 3000
@ -4266,10 +4229,10 @@ float32_t f32_exp( float32_t x)
if(x.isInf()) return (x == float32_t::inf()) ? x : float32_t::zero();
static const float64_t
A4 = float64_t(1.000000000000002438532970795181890933776) / EXPPOLY_32F_A0,
A3 = float64_t(.6931471805521448196800669615864773144641) / EXPPOLY_32F_A0,
A2 = float64_t(.2402265109513301490103372422686535526573) / EXPPOLY_32F_A0,
A1 = float64_t(.5550339366753125211915322047004666939128e-1) / EXPPOLY_32F_A0;
A4 = float64_t::one() / EXPPOLY_32F_A0,
A3 = float64_t::fromRaw(0x3fe62e42fef9277b) / EXPPOLY_32F_A0, // .6931471805521448196800669615864773144641 / EXPPOLY_32F_A0,
A2 = float64_t::fromRaw(0x3fcebfbe081585e7) / EXPPOLY_32F_A0, // .2402265109513301490103372422686535526573 / EXPPOLY_32F_A0,
A1 = float64_t::fromRaw(0x3fac6af0d93cf576) / EXPPOLY_32F_A0; // .5550339366753125211915322047004666939128e-1 / EXPPOLY_32F_A0;
float64_t x0;
if(expF32UI(x.v) > 127 + 10)
@ -4284,7 +4247,7 @@ float32_t f32_exp( float32_t x)
x0 = (x0 - f64_roundToInt(x0, round_near_even, false)) * exp_postscale;
return (buf * EXPPOLY_32F_A0 * float64_t(expTab[val0 & EXPTAB_MASK]) * ((((x0 + A1)*x0 + A2)*x0 + A3)*x0 + A4));
return (buf * EXPPOLY_32F_A0 * float64_t::fromRaw(expTab[val0 & EXPTAB_MASK]) * ((((x0 + A1)*x0 + A2)*x0 + A3)*x0 + A4));
}
float64_t f64_exp(float64_t x)
@ -4294,12 +4257,12 @@ float64_t f64_exp(float64_t x)
if(x.isInf()) return (x == float64_t::inf()) ? x : float64_t::zero();
static const float64_t
A5 = float64_t(.99999999999999999998285227504999) / EXPPOLY_32F_A0,
A4 = float64_t(.69314718055994546743029643825322) / EXPPOLY_32F_A0,
A3 = float64_t(.24022650695886477918181338054308) / EXPPOLY_32F_A0,
A2 = float64_t(.55504108793649567998466049042729e-1) / EXPPOLY_32F_A0,
A1 = float64_t(.96180973140732918010002372686186e-2) / EXPPOLY_32F_A0,
A0 = float64_t(.13369713757180123244806654839424e-2) / EXPPOLY_32F_A0;
A5 = float64_t::one() / EXPPOLY_32F_A0,
A4 = float64_t::fromRaw(0x3fe62e42fefa39f1) / EXPPOLY_32F_A0, // .69314718055994546743029643825322 / EXPPOLY_32F_A0
A3 = float64_t::fromRaw(0x3fcebfbdff82a45a) / EXPPOLY_32F_A0, // .24022650695886477918181338054308 / EXPPOLY_32F_A0
A2 = float64_t::fromRaw(0x3fac6b08d81fec75) / EXPPOLY_32F_A0, // .55504108793649567998466049042729e-1 / EXPPOLY_32F_A0
A1 = float64_t::fromRaw(0x3f83b2a72b4f3cd3) / EXPPOLY_32F_A0, // .96180973140732918010002372686186e-2 / EXPPOLY_32F_A0
A0 = float64_t::fromRaw(0x3f55e7aa1566c2a4) / EXPPOLY_32F_A0; // .13369713757180123244806654839424e-2 / EXPPOLY_32F_A0
float64_t x0;
if(expF64UI(x.v) > 1023 + 10)
@ -4314,7 +4277,7 @@ float64_t f64_exp(float64_t x)
x0 = (x0 - f64_roundToInt(x0, round_near_even, false)) * exp_postscale;
return buf * EXPPOLY_32F_A0 * float64_t(expTab[val0 & EXPTAB_MASK]) * (((((A0*x0 + A1)*x0 + A2)*x0 + A3)*x0 + A4)*x0 + A5);
return buf * EXPPOLY_32F_A0 * float64_t::fromRaw(expTab[val0 & EXPTAB_MASK]) * (((((A0*x0 + A1)*x0 + A2)*x0 + A3)*x0 + A4)*x0 + A5);
}
#undef EXPTAB_SCALE
@ -4325,266 +4288,267 @@ float64_t f64_exp(float64_t x)
#define LOGTAB_SCALE 8
static const double CV_DECL_ALIGNED(16) icvLogTab[] = {
0.0000000000000000000000000000000000000000, 1.000000000000000000000000000000000000000,
.00389864041565732288852075271279318258166, .9961089494163424124513618677042801556420,
.00778214044205494809292034119607706088573, .9922480620155038759689922480620155038760,
.01165061721997527263705585198749759001657, .9884169884169884169884169884169884169884,
.01550418653596525274396267235488267033361, .9846153846153846153846153846153846153846,
.01934296284313093139406447562578250654042, .9808429118773946360153256704980842911877,
.02316705928153437593630670221500622574241, .9770992366412213740458015267175572519084,
.02697658769820207233514075539915211265906, .9733840304182509505703422053231939163498,
.03077165866675368732785500469617545604706, .9696969696969696969696969696969696969697,
.03455238150665972812758397481047722976656, .9660377358490566037735849056603773584906,
.03831886430213659461285757856785494368522, .9624060150375939849624060150375939849624,
.04207121392068705056921373852674150839447, .9588014981273408239700374531835205992509,
.04580953603129420126371940114040626212953, .9552238805970149253731343283582089552239,
.04953393512227662748292900118940451648088, .9516728624535315985130111524163568773234,
.05324451451881227759255210685296333394944, .9481481481481481481481481481481481481481,
.05694137640013842427411105973078520037234, .9446494464944649446494464944649446494465,
.06062462181643483993820353816772694699466, .9411764705882352941176470588235294117647,
.06429435070539725460836422143984236754475, .9377289377289377289377289377289377289377,
.06795066190850773679699159401934593915938, .9343065693430656934306569343065693430657,
.07159365318700880442825962290953611955044, .9309090909090909090909090909090909090909,
.07522342123758751775142172846244648098944, .9275362318840579710144927536231884057971,
.07884006170777602129362549021607264876369, .9241877256317689530685920577617328519856,
.08244366921107458556772229485432035289706, .9208633093525179856115107913669064748201,
.08603433734180314373940490213499288074675, .9175627240143369175627240143369175627240,
.08961215868968712416897659522874164395031, .9142857142857142857142857142857142857143,
.09317722485418328259854092721070628613231, .9110320284697508896797153024911032028470,
.09672962645855109897752299730200320482256, .9078014184397163120567375886524822695035,
.10026945316367513738597949668474029749630, .9045936395759717314487632508833922261484,
.10379679368164355934833764649738441221420, .9014084507042253521126760563380281690141,
.10731173578908805021914218968959175981580, .8982456140350877192982456140350877192982,
.11081436634029011301105782649756292812530, .8951048951048951048951048951048951048951,
.11430477128005862852422325204315711744130, .8919860627177700348432055749128919860627,
.11778303565638344185817487641543266363440, .8888888888888888888888888888888888888889,
.12124924363286967987640707633545389398930, .8858131487889273356401384083044982698962,
.12470347850095722663787967121606925502420, .8827586206896551724137931034482758620690,
.12814582269193003360996385708858724683530, .8797250859106529209621993127147766323024,
.13157635778871926146571524895989568904040, .8767123287671232876712328767123287671233,
.13499516453750481925766280255629681050780, .8737201365187713310580204778156996587031,
.13840232285911913123754857224412262439730, .8707482993197278911564625850340136054422,
.14179791186025733629172407290752744302150, .8677966101694915254237288135593220338983,
.14518200984449788903951628071808954700830, .8648648648648648648648648648648648648649,
.14855469432313711530824207329715136438610, .8619528619528619528619528619528619528620,
.15191604202584196858794030049466527998450, .8590604026845637583892617449664429530201,
.15526612891112392955683674244937719777230, .8561872909698996655518394648829431438127,
.15860503017663857283636730244325008243330, .8533333333333333333333333333333333333333,
.16193282026931324346641360989451641216880, .8504983388704318936877076411960132890365,
.16524957289530714521497145597095368430010, .8476821192052980132450331125827814569536,
.16855536102980664403538924034364754334090, .8448844884488448844884488448844884488449,
.17185025692665920060697715143760433420540, .8421052631578947368421052631578947368421,
.17513433212784912385018287750426679849630, .8393442622950819672131147540983606557377,
.17840765747281828179637841458315961062910, .8366013071895424836601307189542483660131,
.18167030310763465639212199675966985523700, .8338762214983713355048859934853420195440,
.18492233849401198964024217730184318497780, .8311688311688311688311688311688311688312,
.18816383241818296356839823602058459073300, .8284789644012944983818770226537216828479,
.19139485299962943898322009772527962923050, .8258064516129032258064516129032258064516,
.19461546769967164038916962454095482826240, .8231511254019292604501607717041800643087,
.19782574332991986754137769821682013571260, .8205128205128205128205128205128205128205,
.20102574606059073203390141770796617493040, .8178913738019169329073482428115015974441,
.20421554142869088876999228432396193966280, .8152866242038216560509554140127388535032,
.20739519434607056602715147164417430758480, .8126984126984126984126984126984126984127,
.21056476910734961416338251183333341032260, .8101265822784810126582278481012658227848,
.21372432939771812687723695489694364368910, .8075709779179810725552050473186119873817,
.21687393830061435506806333251006435602900, .8050314465408805031446540880503144654088,
.22001365830528207823135744547471404075630, .8025078369905956112852664576802507836991,
.22314355131420973710199007200571941211830, .8000000000000000000000000000000000000000,
.22626367865045338145790765338460914790630, .7975077881619937694704049844236760124611,
.22937410106484582006380890106811420992010, .7950310559006211180124223602484472049689,
.23247487874309405442296849741978803649550, .7925696594427244582043343653250773993808,
.23556607131276688371634975283086532726890, .7901234567901234567901234567901234567901,
.23864773785017498464178231643018079921600, .7876923076923076923076923076923076923077,
.24171993688714515924331749374687206000090, .7852760736196319018404907975460122699387,
.24478272641769091566565919038112042471760, .7828746177370030581039755351681957186544,
.24783616390458124145723672882013488560910, .7804878048780487804878048780487804878049,
.25088030628580937353433455427875742316250, .7781155015197568389057750759878419452888,
.25391520998096339667426946107298135757450, .7757575757575757575757575757575757575758,
.25694093089750041913887912414793390780680, .7734138972809667673716012084592145015106,
.25995752443692604627401010475296061486000, .7710843373493975903614457831325301204819,
.26296504550088134477547896494797896593800, .7687687687687687687687687687687687687688,
.26596354849713793599974565040611196309330, .7664670658682634730538922155688622754491,
.26895308734550393836570947314612567424780, .7641791044776119402985074626865671641791,
.27193371548364175804834985683555714786050, .7619047619047619047619047619047619047619,
.27490548587279922676529508862586226314300, .7596439169139465875370919881305637982196,
.27786845100345625159121709657483734190480, .7573964497041420118343195266272189349112,
.28082266290088775395616949026589281857030, .7551622418879056047197640117994100294985,
.28376817313064456316240580235898960381750, .7529411764705882352941176470588235294118,
.28670503280395426282112225635501090437180, .7507331378299120234604105571847507331378,
.28963329258304265634293983566749375313530, .7485380116959064327485380116959064327485,
.29255300268637740579436012922087684273730, .7463556851311953352769679300291545189504,
.29546421289383584252163927885703742504130, .7441860465116279069767441860465116279070,
.29836697255179722709783618483925238251680, .7420289855072463768115942028985507246377,
.30126133057816173455023545102449133992200, .7398843930635838150289017341040462427746,
.30414733546729666446850615102448500692850, .7377521613832853025936599423631123919308,
.30702503529491181888388950937951449304830, .7356321839080459770114942528735632183908,
.30989447772286465854207904158101882785550, .7335243553008595988538681948424068767908,
.31275571000389684739317885942000430077330, .7314285714285714285714285714285714285714,
.31560877898630329552176476681779604405180, .7293447293447293447293447293447293447293,
.31845373111853458869546784626436419785030, .7272727272727272727272727272727272727273,
.32129061245373424782201254856772720813750, .7252124645892351274787535410764872521246,
.32411946865421192853773391107097268104550, .7231638418079096045197740112994350282486,
.32694034499585328257253991068864706903700, .7211267605633802816901408450704225352113,
.32975328637246797969240219572384376078850, .7191011235955056179775280898876404494382,
.33255833730007655635318997155991382896900, .7170868347338935574229691876750700280112,
.33535554192113781191153520921943709254280, .7150837988826815642458100558659217877095,
.33814494400871636381467055798566434532400, .7130919220055710306406685236768802228412,
.34092658697059319283795275623560883104800, .7111111111111111111111111111111111111111,
.34370051385331840121395430287520866841080, .7091412742382271468144044321329639889197,
.34646676734620857063262633346312213689100, .7071823204419889502762430939226519337017,
.34922538978528827602332285096053965389730, .7052341597796143250688705234159779614325,
.35197642315717814209818925519357435405250, .7032967032967032967032967032967032967033,
.35471990910292899856770532096561510115850, .7013698630136986301369863013698630136986,
.35745588892180374385176833129662554711100, .6994535519125683060109289617486338797814,
.36018440357500774995358483465679455548530, .6975476839237057220708446866485013623978,
.36290549368936841911903457003063522279280, .6956521739130434782608695652173913043478,
.36561919956096466943762379742111079394830, .6937669376693766937669376693766937669377,
.36832556115870762614150635272380895912650, .6918918918918918918918918918918918918919,
.37102461812787262962487488948681857436900, .6900269541778975741239892183288409703504,
.37371640979358405898480555151763837784530, .6881720430107526881720430107526881720430,
.37640097516425302659470730759494472295050, .6863270777479892761394101876675603217158,
.37907835293496944251145919224654790014030, .6844919786096256684491978609625668449198,
.38174858149084833769393299007788300514230, .6826666666666666666666666666666666666667,
.38441169891033200034513583887019194662580, .6808510638297872340425531914893617021277,
.38706774296844825844488013899535872042180, .6790450928381962864721485411140583554377,
.38971675114002518602873692543653305619950, .6772486772486772486772486772486772486772,
.39235876060286384303665840889152605086580, .6754617414248021108179419525065963060686,
.39499380824086893770896722344332374632350, .6736842105263157894736842105263157894737,
.39762193064713846624158577469643205404280, .6719160104986876640419947506561679790026,
.40024316412701266276741307592601515352730, .6701570680628272251308900523560209424084,
.40285754470108348090917615991202183067800, .6684073107049608355091383812010443864230,
.40546510810816432934799991016916465014230, .6666666666666666666666666666666666666667,
.40806588980822172674223224930756259709600, .6649350649350649350649350649350649350649,
.41065992498526837639616360320360399782650, .6632124352331606217616580310880829015544,
.41324724855021932601317757871584035456180, .6614987080103359173126614987080103359173,
.41582789514371093497757669865677598863850, .6597938144329896907216494845360824742268,
.41840189913888381489925905043492093682300, .6580976863753213367609254498714652956298,
.42096929464412963239894338585145305842150, .6564102564102564102564102564102564102564,
.42353011550580327293502591601281892508280, .6547314578005115089514066496163682864450,
.42608439531090003260516141381231136620050, .6530612244897959183673469387755102040816,
.42863216738969872610098832410585600882780, .6513994910941475826972010178117048346056,
.43117346481837132143866142541810404509300, .6497461928934010152284263959390862944162,
.43370832042155937902094819946796633303180, .6481012658227848101265822784810126582278,
.43623676677491801667585491486534010618930, .6464646464646464646464646464646464646465,
.43875883620762790027214350629947148263450, .6448362720403022670025188916876574307305,
.44127456080487520440058801796112675219780, .6432160804020100502512562814070351758794,
.44378397241030093089975139264424797147500, .6416040100250626566416040100250626566416,
.44628710262841947420398014401143882423650, .6400000000000000000000000000000000000000,
.44878398282700665555822183705458883196130, .6384039900249376558603491271820448877805,
.45127464413945855836729492693848442286250, .6368159203980099502487562189054726368159,
.45375911746712049854579618113348260521900, .6352357320099255583126550868486352357320,
.45623743348158757315857769754074979573500, .6336633663366336633663366336633663366337,
.45870962262697662081833982483658473938700, .6320987654320987654320987654320987654321,
.46117571512217014895185229761409573256980, .6305418719211822660098522167487684729064,
.46363574096303250549055974261136725544930, .6289926289926289926289926289926289926290,
.46608972992459918316399125615134835243230, .6274509803921568627450980392156862745098,
.46853771156323925639597405279346276074650, .6259168704156479217603911980440097799511,
.47097971521879100631480241645476780831830, .6243902439024390243902439024390243902439,
.47341577001667212165614273544633761048330, .6228710462287104622871046228710462287105,
.47584590486996386493601107758877333253630, .6213592233009708737864077669902912621359,
.47827014848147025860569669930555392056700, .6198547215496368038740920096852300242131,
.48068852934575190261057286988943815231330, .6183574879227053140096618357487922705314,
.48310107575113581113157579238759353756900, .6168674698795180722891566265060240963855,
.48550781578170076890899053978500887751580, .6153846153846153846153846153846153846154,
.48790877731923892879351001283794175833480, .6139088729016786570743405275779376498801,
.49030398804519381705802061333088204264650, .6124401913875598086124401913875598086124,
.49269347544257524607047571407747454941280, .6109785202863961813842482100238663484487,
.49507726679785146739476431321236304938800, .6095238095238095238095238095238095238095,
.49745538920281889838648226032091770321130, .6080760095011876484560570071258907363420,
.49982786955644931126130359189119189977650, .6066350710900473933649289099526066350711,
.50219473456671548383667413872899487614650, .6052009456264775413711583924349881796690,
.50455601075239520092452494282042607665050, .6037735849056603773584905660377358490566,
.50691172444485432801997148999362252652650, .6023529411764705882352941176470588235294,
.50926190178980790257412536448100581765150, .6009389671361502347417840375586854460094,
.51160656874906207391973111953120678663250, .5995316159250585480093676814988290398126,
.51394575110223428282552049495279788970950, .5981308411214953271028037383177570093458,
.51627947444845445623684554448118433356300, .5967365967365967365967365967365967365967,
.51860776420804555186805373523384332656850, .5953488372093023255813953488372093023256,
.52093064562418522900344441950437612831600, .5939675174013921113689095127610208816705,
.52324814376454775732838697877014055848100, .5925925925925925925925925925925925925926,
.52556028352292727401362526507000438869000, .5912240184757505773672055427251732101617,
.52786708962084227803046587723656557500350, .5898617511520737327188940092165898617512,
.53016858660912158374145519701414741575700, .5885057471264367816091954022988505747126,
.53246479886947173376654518506256863474850, .5871559633027522935779816513761467889908,
.53475575061602764748158733709715306758900, .5858123569794050343249427917620137299771,
.53704146589688361856929077475797384977350, .5844748858447488584474885844748858447489,
.53932196859560876944783558428753167390800, .5831435079726651480637813211845102505695,
.54159728243274429804188230264117009937750, .5818181818181818181818181818181818181818,
.54386743096728351609669971367111429572100, .5804988662131519274376417233560090702948,
.54613243759813556721383065450936555862450, .5791855203619909502262443438914027149321,
.54839232556557315767520321969641372561450, .5778781038374717832957110609480812641084,
.55064711795266219063194057525834068655950, .5765765765765765765765765765765765765766,
.55289683768667763352766542084282264113450, .5752808988764044943820224719101123595506,
.55514150754050151093110798683483153581600, .5739910313901345291479820627802690582960,
.55738115013400635344709144192165695130850, .5727069351230425055928411633109619686801,
.55961578793542265941596269840374588966350, .5714285714285714285714285714285714285714,
.56184544326269181269140062795486301183700, .5701559020044543429844097995545657015590,
.56407013828480290218436721261241473257550, .5688888888888888888888888888888888888889,
.56628989502311577464155334382667206227800, .5676274944567627494456762749445676274945,
.56850473535266865532378233183408156037350, .5663716814159292035398230088495575221239,
.57071468100347144680739575051120482385150, .5651214128035320088300220750551876379691,
.57291975356178548306473885531886480748650, .5638766519823788546255506607929515418502,
.57511997447138785144460371157038025558000, .5626373626373626373626373626373626373626,
.57731536503482350219940144597785547375700, .5614035087719298245614035087719298245614,
.57950594641464214795689713355386629700650, .5601750547045951859956236323851203501094,
.58169173963462239562716149521293118596100, .5589519650655021834061135371179039301310,
.58387276558098266665552955601015128195300, .5577342047930283224400871459694989106754,
.58604904500357812846544902640744112432000, .5565217391304347826086956521739130434783,
.58822059851708596855957011939608491957200, .5553145336225596529284164859002169197397,
.59038744660217634674381770309992134571100, .5541125541125541125541125541125541125541,
.59254960960667157898740242671919986605650, .5529157667386609071274298056155507559395,
.59470710774669277576265358220553025603300, .5517241379310344827586206896551724137931,
.59685996110779382384237123915227130055450, .5505376344086021505376344086021505376344,
.59900818964608337768851242799428291618800, .5493562231759656652360515021459227467811,
.60115181318933474940990890900138765573500, .5481798715203426124197002141327623126338,
.60329085143808425240052883964381180703650, .5470085470085470085470085470085470085470,
.60542532396671688843525771517306566238400, .5458422174840085287846481876332622601279,
.60755525022454170969155029524699784815300, .5446808510638297872340425531914893617021,
.60968064953685519036241657886421307921400, .5435244161358811040339702760084925690021,
.61180154110599282990534675263916142284850, .5423728813559322033898305084745762711864,
.61391794401237043121710712512140162289150, .5412262156448202959830866807610993657505,
.61602987721551394351138242200249806046500, .5400843881856540084388185654008438818565,
.61813735955507864705538167982012964785100, .5389473684210526315789473684210526315789,
.62024040975185745772080281312810257077200, .5378151260504201680672268907563025210084,
.62233904640877868441606324267922900617100, .5366876310272536687631027253668763102725,
.62443328801189346144440150965237990021700, .5355648535564853556485355648535564853556,
.62652315293135274476554741340805776417250, .5344467640918580375782881002087682672234,
.62860865942237409420556559780379757285100, .5333333333333333333333333333333333333333,
.63068982562619868570408243613201193511500, .5322245322245322245322245322245322245322,
.63276666957103777644277897707070223987100, .5311203319502074688796680497925311203320,
.63483920917301017716738442686619237065300, .5300207039337474120082815734989648033126,
.63690746223706917739093569252872839570050, .5289256198347107438016528925619834710744,
.63897144645792069983514238629140891134750, .5278350515463917525773195876288659793814,
.64103117942093124081992527862894348800200, .5267489711934156378600823045267489711934,
.64308667860302726193566513757104985415950, .5256673511293634496919917864476386036961,
.64513796137358470073053240412264131009600, .5245901639344262295081967213114754098361,
.64718504499530948859131740391603671014300, .5235173824130879345603271983640081799591,
.64922794662510974195157587018911726772800, .5224489795918367346938775510204081632653,
.65126668331495807251485530287027359008800, .5213849287169042769857433808553971486762,
.65330127201274557080523663898929953575150, .5203252032520325203252032520325203252033,
.65533172956312757406749369692988693714150, .5192697768762677484787018255578093306288,
.65735807270835999727154330685152672231200, .5182186234817813765182186234817813765182,
.65938031808912778153342060249997302889800, .5171717171717171717171717171717171717172,
.66139848224536490484126716182800009846700, .5161290322580645161290322580645161290323,
.66341258161706617713093692145776003599150, .5150905432595573440643863179074446680080,
.66542263254509037562201001492212526500250, .5140562248995983935742971887550200803213,
.66742865127195616370414654738851822912700, .5130260521042084168336673346693386773547,
.66943065394262923906154583164607174694550, .5120000000000000000000000000000000000000,
.67142865660530226534774556057527661323550, .5109780439121756487025948103792415169661,
.67342267521216669923234121597488410770900, .5099601593625498007968127490039840637450,
.67541272562017662384192817626171745359900, .5089463220675944333996023856858846918489,
.67739882359180603188519853574689477682100, .5079365079365079365079365079365079365079,
.67938098479579733801614338517538271844400, .5069306930693069306930693069306930693069,
.68135922480790300781450241629499942064300, .5059288537549407114624505928853754940711,
.68333355911162063645036823800182901322850, .5049309664694280078895463510848126232742,
.68530400309891936760919861626462079584600, .5039370078740157480314960629921259842520,
.68727057207096020619019327568821609020250, .5029469548133595284872298624754420432220,
.68923328123880889251040571252815425395950, .5019607843137254901960784313725490196078,
.69314718055994530941723212145818, 5.0e-01,
static const uint64_t CV_DECL_ALIGNED(16) icvLogTab[] = {
0, 0x3ff0000000000000, // 0.000000, 1.000000
0x3f6ff00aa2b10bc0, 0x3fefe01fe01fe020, // 0.003899, 0.996109
0x3f7fe02a6b106788, 0x3fefc07f01fc07f0, // 0.007782, 0.992248
0x3f87dc475f810a76, 0x3fefa11caa01fa12, // 0.011651, 0.988417
0x3f8fc0a8b0fc03e3, 0x3fef81f81f81f820, // 0.015504, 0.984615
0x3f93cea44346a574, 0x3fef6310aca0dbb5, // 0.019343, 0.980843
0x3f97b91b07d5b11a, 0x3fef44659e4a4271, // 0.023167, 0.977099
0x3f9b9fc027af9197, 0x3fef25f644230ab5, // 0.026977, 0.973384
0x3f9f829b0e783300, 0x3fef07c1f07c1f08, // 0.030772, 0.969697
0x3fa1b0d98923d97f, 0x3feee9c7f8458e02, // 0.034552, 0.966038
0x3fa39e87b9febd5f, 0x3feecc07b301ecc0, // 0.038319, 0.962406
0x3fa58a5bafc8e4d4, 0x3feeae807aba01eb, // 0.042071, 0.958801
0x3fa77458f632dcfc, 0x3fee9131abf0b767, // 0.045810, 0.955224
0x3fa95c830ec8e3eb, 0x3fee741aa59750e4, // 0.049534, 0.951673
0x3fab42dd711971be, 0x3fee573ac901e574, // 0.053245, 0.948148
0x3fad276b8adb0b52, 0x3fee3a9179dc1a73, // 0.056941, 0.944649
0x3faf0a30c01162a6, 0x3fee1e1e1e1e1e1e, // 0.060625, 0.941176
0x3fb075983598e471, 0x3fee01e01e01e01e, // 0.064294, 0.937729
0x3fb16536eea37ae0, 0x3fede5d6e3f8868a, // 0.067951, 0.934307
0x3fb253f62f0a1416, 0x3fedca01dca01dca, // 0.071594, 0.930909
0x3fb341d7961bd1d0, 0x3fedae6076b981db, // 0.075223, 0.927536
0x3fb42edcbea646f0, 0x3fed92f2231e7f8a, // 0.078840, 0.924188
0x3fb51b073f06183f, 0x3fed77b654b82c34, // 0.082444, 0.920863
0x3fb60658a93750c3, 0x3fed5cac807572b2, // 0.086034, 0.917563
0x3fb6f0d28ae56b4b, 0x3fed41d41d41d41d, // 0.089612, 0.914286
0x3fb7da766d7b12cc, 0x3fed272ca3fc5b1a, // 0.093177, 0.911032
0x3fb8c345d6319b20, 0x3fed0cb58f6ec074, // 0.096730, 0.907801
0x3fb9ab42462033ac, 0x3fecf26e5c44bfc6, // 0.100269, 0.904594
0x3fba926d3a4ad563, 0x3fecd85689039b0b, // 0.103797, 0.901408
0x3fbb78c82bb0eda1, 0x3fecbe6d9601cbe7, // 0.107312, 0.898246
0x3fbc5e548f5bc743, 0x3feca4b3055ee191, // 0.110814, 0.895105
0x3fbd4313d66cb35d, 0x3fec8b265afb8a42, // 0.114305, 0.891986
0x3fbe27076e2af2e5, 0x3fec71c71c71c71c, // 0.117783, 0.888889
0x3fbf0a30c01162a6, 0x3fec5894d10d4986, // 0.121249, 0.885813
0x3fbfec9131dbeaba, 0x3fec3f8f01c3f8f0, // 0.124703, 0.882759
0x3fc0671512ca596e, 0x3fec26b5392ea01c, // 0.128146, 0.879725
0x3fc0d77e7cd08e59, 0x3fec0e070381c0e0, // 0.131576, 0.876712
0x3fc14785846742ac, 0x3febf583ee868d8b, // 0.134995, 0.873720
0x3fc1b72ad52f67a0, 0x3febdd2b899406f7, // 0.138402, 0.870748
0x3fc2266f190a5acb, 0x3febc4fd65883e7b, // 0.141798, 0.867797
0x3fc29552f81ff523, 0x3febacf914c1bad0, // 0.145182, 0.864865
0x3fc303d718e47fd2, 0x3feb951e2b18ff23, // 0.148555, 0.861953
0x3fc371fc201e8f74, 0x3feb7d6c3dda338b, // 0.151916, 0.859060
0x3fc3dfc2b0ecc629, 0x3feb65e2e3beee05, // 0.155266, 0.856187
0x3fc44d2b6ccb7d1e, 0x3feb4e81b4e81b4f, // 0.158605, 0.853333
0x3fc4ba36f39a55e5, 0x3feb37484ad806ce, // 0.161933, 0.850498
0x3fc526e5e3a1b437, 0x3feb2036406c80d9, // 0.165250, 0.847682
0x3fc59338d9982085, 0x3feb094b31d922a4, // 0.168555, 0.844884
0x3fc5ff3070a793d3, 0x3feaf286bca1af28, // 0.171850, 0.842105
0x3fc66acd4272ad50, 0x3feadbe87f94905e, // 0.175134, 0.839344
0x3fc6d60fe719d21c, 0x3feac5701ac5701b, // 0.178408, 0.836601
0x3fc740f8f54037a4, 0x3feaaf1d2f87ebfd, // 0.181670, 0.833876
0x3fc7ab890210d909, 0x3fea98ef606a63be, // 0.184922, 0.831169
0x3fc815c0a14357ea, 0x3fea82e65130e159, // 0.188164, 0.828479
0x3fc87fa06520c910, 0x3fea6d01a6d01a6d, // 0.191395, 0.825806
0x3fc8e928de886d40, 0x3fea574107688a4a, // 0.194615, 0.823151
0x3fc9525a9cf456b4, 0x3fea41a41a41a41a, // 0.197826, 0.820513
0x3fc9bb362e7dfb83, 0x3fea2c2a87c51ca0, // 0.201026, 0.817891
0x3fca23bc1fe2b563, 0x3fea16d3f97a4b02, // 0.204216, 0.815287
0x3fca8becfc882f18, 0x3fea01a01a01a01a, // 0.207395, 0.812698
0x3fcaf3c94e80bff2, 0x3fe9ec8e951033d9, // 0.210565, 0.810127
0x3fcb5b519e8fb5a4, 0x3fe9d79f176b682d, // 0.213724, 0.807571
0x3fcbc286742d8cd6, 0x3fe9c2d14ee4a102, // 0.216874, 0.805031
0x3fcc2968558c18c0, 0x3fe9ae24ea5510da, // 0.220014, 0.802508
0x3fcc8ff7c79a9a21, 0x3fe999999999999a, // 0.223144, 0.800000
0x3fccf6354e09c5dc, 0x3fe9852f0d8ec0ff, // 0.226264, 0.797508
0x3fcd5c216b4fbb91, 0x3fe970e4f80cb872, // 0.229374, 0.795031
0x3fcdc1bca0abec7d, 0x3fe95cbb0be377ae, // 0.232475, 0.792570
0x3fce27076e2af2e5, 0x3fe948b0fcd6e9e0, // 0.235566, 0.790123
0x3fce8c0252aa5a5f, 0x3fe934c67f9b2ce6, // 0.238648, 0.787692
0x3fcef0adcbdc5936, 0x3fe920fb49d0e229, // 0.241720, 0.785276
0x3fcf550a564b7b37, 0x3fe90d4f120190d5, // 0.244783, 0.782875
0x3fcfb9186d5e3e2a, 0x3fe8f9c18f9c18fa, // 0.247836, 0.780488
0x3fd00e6c45ad501c, 0x3fe8e6527af1373f, // 0.250880, 0.778116
0x3fd0402594b4d040, 0x3fe8d3018d3018d3, // 0.253915, 0.775758
0x3fd071b85fcd590d, 0x3fe8bfce8062ff3a, // 0.256941, 0.773414
0x3fd0a324e27390e3, 0x3fe8acb90f6bf3aa, // 0.259958, 0.771084
0x3fd0d46b579ab74b, 0x3fe899c0f601899c, // 0.262965, 0.768769
0x3fd1058bf9ae4ad5, 0x3fe886e5f0abb04a, // 0.265964, 0.766467
0x3fd136870293a8b0, 0x3fe87427bcc092b9, // 0.268953, 0.764179
0x3fd1675cababa60e, 0x3fe8618618618618, // 0.271934, 0.761905
0x3fd1980d2dd4236f, 0x3fe84f00c2780614, // 0.274905, 0.759644
0x3fd1c898c16999fa, 0x3fe83c977ab2bedd, // 0.277868, 0.757396
0x3fd1f8ff9e48a2f2, 0x3fe82a4a0182a4a0, // 0.280823, 0.755162
0x3fd22941fbcf7965, 0x3fe8181818181818, // 0.283768, 0.752941
0x3fd2596010df7639, 0x3fe8060180601806, // 0.286705, 0.750733
0x3fd2895a13de86a3, 0x3fe7f405fd017f40, // 0.289633, 0.748538
0x3fd2b9303ab89d24, 0x3fe7e225515a4f1d, // 0.292553, 0.746356
0x3fd2e8e2bae11d30, 0x3fe7d05f417d05f4, // 0.295464, 0.744186
0x3fd31871c9544184, 0x3fe7beb3922e017c, // 0.298367, 0.742029
0x3fd347dd9a987d54, 0x3fe7ad2208e0ecc3, // 0.301261, 0.739884
0x3fd3772662bfd85a, 0x3fe79baa6bb6398b, // 0.304147, 0.737752
0x3fd3a64c556945e9, 0x3fe78a4c8178a4c8, // 0.307025, 0.735632
0x3fd3d54fa5c1f70f, 0x3fe77908119ac60d, // 0.309894, 0.733524
0x3fd404308686a7e3, 0x3fe767dce434a9b1, // 0.312756, 0.731429
0x3fd432ef2a04e813, 0x3fe756cac201756d, // 0.315609, 0.729345
0x3fd4618bc21c5ec2, 0x3fe745d1745d1746, // 0.318454, 0.727273
0x3fd49006804009d0, 0x3fe734f0c541fe8d, // 0.321291, 0.725212
0x3fd4be5f957778a0, 0x3fe724287f46debc, // 0.324119, 0.723164
0x3fd4ec9732600269, 0x3fe713786d9c7c09, // 0.326940, 0.721127
0x3fd51aad872df82d, 0x3fe702e05c0b8170, // 0.329753, 0.719101
0x3fd548a2c3add262, 0x3fe6f26016f26017, // 0.332558, 0.717087
0x3fd5767717455a6c, 0x3fe6e1f76b4337c7, // 0.335356, 0.715084
0x3fd5a42ab0f4cfe1, 0x3fe6d1a62681c861, // 0.338145, 0.713092
0x3fd5d1bdbf5809ca, 0x3fe6c16c16c16c17, // 0.340927, 0.711111
0x3fd5ff3070a793d3, 0x3fe6b1490aa31a3d, // 0.343701, 0.709141
0x3fd62c82f2b9c795, 0x3fe6a13cd1537290, // 0.346467, 0.707182
0x3fd659b57303e1f2, 0x3fe691473a88d0c0, // 0.349225, 0.705234
0x3fd686c81e9b14ae, 0x3fe6816816816817, // 0.351976, 0.703297
0x3fd6b3bb2235943d, 0x3fe6719f3601671a, // 0.354720, 0.701370
0x3fd6e08eaa2ba1e3, 0x3fe661ec6a5122f9, // 0.357456, 0.699454
0x3fd70d42e2789235, 0x3fe6524f853b4aa3, // 0.360184, 0.697548
0x3fd739d7f6bbd006, 0x3fe642c8590b2164, // 0.362905, 0.695652
0x3fd7664e1239dbce, 0x3fe63356b88ac0de, // 0.365619, 0.693767
0x3fd792a55fdd47a2, 0x3fe623fa77016240, // 0.368326, 0.691892
0x3fd7bede0a37afbf, 0x3fe614b36831ae94, // 0.371025, 0.690027
0x3fd7eaf83b82afc3, 0x3fe6058160581606, // 0.373716, 0.688172
0x3fd816f41da0d495, 0x3fe5f66434292dfc, // 0.376401, 0.686327
0x3fd842d1da1e8b17, 0x3fe5e75bb8d015e7, // 0.379078, 0.684492
0x3fd86e919a330ba0, 0x3fe5d867c3ece2a5, // 0.381749, 0.682667
0x3fd89a3386c1425a, 0x3fe5c9882b931057, // 0.384412, 0.680851
0x3fd8c5b7c858b48a, 0x3fe5babcc647fa91, // 0.387068, 0.679045
0x3fd8f11e873662c7, 0x3fe5ac056b015ac0, // 0.389717, 0.677249
0x3fd91c67eb45a83d, 0x3fe59d61f123ccaa, // 0.392359, 0.675462
0x3fd947941c2116fa, 0x3fe58ed2308158ed, // 0.394994, 0.673684
0x3fd972a341135158, 0x3fe5805601580560, // 0.397622, 0.671916
0x3fd99d958117e08a, 0x3fe571ed3c506b3a, // 0.400243, 0.670157
0x3fd9c86b02dc0862, 0x3fe56397ba7c52e2, // 0.402858, 0.668407
0x3fd9f323ecbf984b, 0x3fe5555555555555, // 0.405465, 0.666667
0x3fda1dc064d5b995, 0x3fe54725e6bb82fe, // 0.408066, 0.664935
0x3fda484090e5bb0a, 0x3fe5390948f40feb, // 0.410660, 0.663212
0x3fda72a4966bd9ea, 0x3fe52aff56a8054b, // 0.413247, 0.661499
0x3fda9cec9a9a0849, 0x3fe51d07eae2f815, // 0.415828, 0.659794
0x3fdac718c258b0e4, 0x3fe50f22e111c4c5, // 0.418402, 0.658098
0x3fdaf1293247786b, 0x3fe5015015015015, // 0.420969, 0.656410
0x3fdb1b1e0ebdfc5b, 0x3fe4f38f62dd4c9b, // 0.423530, 0.654731
0x3fdb44f77bcc8f62, 0x3fe4e5e0a72f0539, // 0.426084, 0.653061
0x3fdb6eb59d3cf35d, 0x3fe4d843bedc2c4c, // 0.428632, 0.651399
0x3fdb9858969310fb, 0x3fe4cab88725af6e, // 0.431173, 0.649746
0x3fdbc1e08b0dad0a, 0x3fe4bd3edda68fe1, // 0.433708, 0.648101
0x3fdbeb4d9da71b7b, 0x3fe4afd6a052bf5b, // 0.436237, 0.646465
0x3fdc149ff115f026, 0x3fe4a27fad76014a, // 0.438759, 0.644836
0x3fdc3dd7a7cdad4d, 0x3fe49539e3b2d067, // 0.441275, 0.643216
0x3fdc66f4e3ff6ff7, 0x3fe4880522014880, // 0.443784, 0.641604
0x3fdc8ff7c79a9a21, 0x3fe47ae147ae147b, // 0.446287, 0.640000
0x3fdcb8e0744d7ac9, 0x3fe46dce34596066, // 0.448784, 0.638404
0x3fdce1af0b85f3eb, 0x3fe460cbc7f5cf9a, // 0.451275, 0.636816
0x3fdd0a63ae721e64, 0x3fe453d9e2c776ca, // 0.453759, 0.635236
0x3fdd32fe7e00ebd5, 0x3fe446f86562d9fb, // 0.456237, 0.633663
0x3fdd5b7f9ae2c683, 0x3fe43a2730abee4d, // 0.458710, 0.632099
0x3fdd83e7258a2f3e, 0x3fe42d6625d51f87, // 0.461176, 0.630542
0x3fddac353e2c5954, 0x3fe420b5265e5951, // 0.463636, 0.628993
0x3fddd46a04c1c4a0, 0x3fe4141414141414, // 0.466090, 0.627451
0x3fddfc859906d5b5, 0x3fe40782d10e6566, // 0.468538, 0.625917
0x3fde24881a7c6c26, 0x3fe3fb013fb013fb, // 0.470980, 0.624390
0x3fde4c71a8687704, 0x3fe3ee8f42a5af07, // 0.473416, 0.622871
0x3fde744261d68787, 0x3fe3e22cbce4a902, // 0.475846, 0.621359
0x3fde9bfa659861f5, 0x3fe3d5d991aa75c6, // 0.478270, 0.619855
0x3fdec399d2468cc0, 0x3fe3c995a47babe7, // 0.480689, 0.618357
0x3fdeeb20c640ddf4, 0x3fe3bd60d9232955, // 0.483101, 0.616867
0x3fdf128f5faf06ec, 0x3fe3b13b13b13b14, // 0.485508, 0.615385
0x3fdf39e5bc811e5b, 0x3fe3a524387ac822, // 0.487909, 0.613909
0x3fdf6123fa7028ac, 0x3fe3991c2c187f63, // 0.490304, 0.612440
0x3fdf884a36fe9ec2, 0x3fe38d22d366088e, // 0.492693, 0.610979
0x3fdfaf588f78f31e, 0x3fe3813813813814, // 0.495077, 0.609524
0x3fdfd64f20f61571, 0x3fe3755bd1c945ee, // 0.497455, 0.608076
0x3fdffd2e0857f498, 0x3fe3698df3de0748, // 0.499828, 0.606635
0x3fe011fab125ff8a, 0x3fe35dce5f9f2af8, // 0.502195, 0.605201
0x3fe02552a5a5d0fe, 0x3fe3521cfb2b78c1, // 0.504556, 0.603774
0x3fe0389eefce633b, 0x3fe34679ace01346, // 0.506912, 0.602353
0x3fe04bdf9da926d2, 0x3fe33ae45b57bcb2, // 0.509262, 0.600939
0x3fe05f14bd26459c, 0x3fe32f5ced6a1dfa, // 0.511607, 0.599532
0x3fe0723e5c1cdf40, 0x3fe323e34a2b10bf, // 0.513946, 0.598131
0x3fe0855c884b450e, 0x3fe3187758e9ebb6, // 0.516279, 0.596737
0x3fe0986f4f573520, 0x3fe30d190130d190, // 0.518608, 0.595349
0x3fe0ab76bece14d1, 0x3fe301c82ac40260, // 0.520931, 0.593968
0x3fe0be72e4252a82, 0x3fe2f684bda12f68, // 0.523248, 0.592593
0x3fe0d163ccb9d6b7, 0x3fe2eb4ea1fed14b, // 0.525560, 0.591224
0x3fe0e44985d1cc8b, 0x3fe2e025c04b8097, // 0.527867, 0.589862
0x3fe0f7241c9b497d, 0x3fe2d50a012d50a0, // 0.530169, 0.588506
0x3fe109f39e2d4c96, 0x3fe2c9fb4d812ca0, // 0.532465, 0.587156
0x3fe11cb81787ccf8, 0x3fe2bef98e5a3711, // 0.534756, 0.585812
0x3fe12f719593efbc, 0x3fe2b404ad012b40, // 0.537041, 0.584475
0x3fe1422025243d44, 0x3fe2a91c92f3c105, // 0.539322, 0.583144
0x3fe154c3d2f4d5e9, 0x3fe29e4129e4129e, // 0.541597, 0.581818
0x3fe1675cababa60e, 0x3fe293725bb804a5, // 0.543867, 0.580499
0x3fe179eabbd899a0, 0x3fe288b01288b013, // 0.546132, 0.579186
0x3fe18c6e0ff5cf06, 0x3fe27dfa38a1ce4d, // 0.548392, 0.577878
0x3fe19ee6b467c96e, 0x3fe27350b8812735, // 0.550647, 0.576577
0x3fe1b154b57da29e, 0x3fe268b37cd60127, // 0.552897, 0.575281
0x3fe1c3b81f713c24, 0x3fe25e22708092f1, // 0.555142, 0.573991
0x3fe1d610fe677003, 0x3fe2539d7e9177b2, // 0.557381, 0.572707
0x3fe1e85f5e7040d0, 0x3fe2492492492492, // 0.559616, 0.571429
0x3fe1faa34b87094c, 0x3fe23eb79717605b, // 0.561845, 0.570156
0x3fe20cdcd192ab6d, 0x3fe23456789abcdf, // 0.564070, 0.568889
0x3fe21f0bfc65beeb, 0x3fe22a0122a0122a, // 0.566290, 0.567627
0x3fe23130d7bebf42, 0x3fe21fb78121fb78, // 0.568505, 0.566372
0x3fe2434b6f483933, 0x3fe21579804855e6, // 0.570715, 0.565121
0x3fe2555bce98f7cb, 0x3fe20b470c67c0d9, // 0.572920, 0.563877
0x3fe26762013430df, 0x3fe2012012012012, // 0.575120, 0.562637
0x3fe2795e1289b11a, 0x3fe1f7047dc11f70, // 0.577315, 0.561404
0x3fe28b500df60782, 0x3fe1ecf43c7fb84c, // 0.579506, 0.560175
0x3fe29d37fec2b08a, 0x3fe1e2ef3b3fb874, // 0.581692, 0.558952
0x3fe2af15f02640ad, 0x3fe1d8f5672e4abd, // 0.583873, 0.557734
0x3fe2c0e9ed448e8b, 0x3fe1cf06ada2811d, // 0.586049, 0.556522
0x3fe2d2b4012edc9d, 0x3fe1c522fc1ce059, // 0.588221, 0.555315
0x3fe2e47436e40268, 0x3fe1bb4a4046ed29, // 0.590387, 0.554113
0x3fe2f62a99509546, 0x3fe1b17c67f2bae3, // 0.592550, 0.552916
0x3fe307d7334f10be, 0x3fe1a7b9611a7b96, // 0.594707, 0.551724
0x3fe3197a0fa7fe6a, 0x3fe19e0119e0119e, // 0.596860, 0.550538
0x3fe32b1339121d71, 0x3fe19453808ca29c, // 0.599008, 0.549356
0x3fe33ca2ba328994, 0x3fe18ab083902bdb, // 0.601152, 0.548180
0x3fe34e289d9ce1d3, 0x3fe1811811811812, // 0.603291, 0.547009
0x3fe35fa4edd36ea0, 0x3fe1778a191bd684, // 0.605425, 0.545842
0x3fe37117b54747b5, 0x3fe16e0689427379, // 0.607555, 0.544681
0x3fe38280fe58797e, 0x3fe1648d50fc3201, // 0.609681, 0.543524
0x3fe393e0d3562a19, 0x3fe15b1e5f75270d, // 0.611802, 0.542373
0x3fe3a5373e7ebdf9, 0x3fe151b9a3fdd5c9, // 0.613918, 0.541226
0x3fe3b68449fffc22, 0x3fe1485f0e0acd3b, // 0.616030, 0.540084
0x3fe3c7c7fff73205, 0x3fe13f0e8d344724, // 0.618137, 0.538947
0x3fe3d9026a7156fa, 0x3fe135c81135c811, // 0.620240, 0.537815
0x3fe3ea33936b2f5b, 0x3fe12c8b89edc0ac, // 0.622339, 0.536688
0x3fe3fb5b84d16f42, 0x3fe12358e75d3033, // 0.624433, 0.535565
0x3fe40c7a4880dce9, 0x3fe11a3019a74826, // 0.626523, 0.534447
0x3fe41d8fe84672ae, 0x3fe1111111111111, // 0.628609, 0.533333
0x3fe42e9c6ddf80bf, 0x3fe107fbbe011080, // 0.630690, 0.532225
0x3fe43f9fe2f9ce67, 0x3fe0fef010fef011, // 0.632767, 0.531120
0x3fe4509a5133bb0a, 0x3fe0f5edfab325a2, // 0.634839, 0.530021
0x3fe4618bc21c5ec2, 0x3fe0ecf56be69c90, // 0.636907, 0.528926
0x3fe472743f33aaad, 0x3fe0e40655826011, // 0.638971, 0.527835
0x3fe48353d1ea88df, 0x3fe0db20a88f4696, // 0.641031, 0.526749
0x3fe4942a83a2fc07, 0x3fe0d24456359e3a, // 0.643087, 0.525667
0x3fe4a4f85db03ebb, 0x3fe0c9714fbcda3b, // 0.645138, 0.524590
0x3fe4b5bd6956e273, 0x3fe0c0a7868b4171, // 0.647185, 0.523517
0x3fe4c679afccee39, 0x3fe0b7e6ec259dc8, // 0.649228, 0.522449
0x3fe4d72d3a39fd00, 0x3fe0af2f722eecb5, // 0.651267, 0.521385
0x3fe4e7d811b75bb0, 0x3fe0a6810a6810a7, // 0.653301, 0.520325
0x3fe4f87a3f5026e8, 0x3fe09ddba6af8360, // 0.655332, 0.519270
0x3fe50913cc01686b, 0x3fe0953f39010954, // 0.657358, 0.518219
0x3fe519a4c0ba3446, 0x3fe08cabb37565e2, // 0.659380, 0.517172
0x3fe52a2d265bc5aa, 0x3fe0842108421084, // 0.661398, 0.516129
0x3fe53aad05b99b7c, 0x3fe07b9f29b8eae2, // 0.663413, 0.515091
0x3fe54b2467999497, 0x3fe073260a47f7c6, // 0.665423, 0.514056
0x3fe55b9354b40bcd, 0x3fe06ab59c7912fb, // 0.667429, 0.513026
0x3fe56bf9d5b3f399, 0x3fe0624dd2f1a9fc, // 0.669431, 0.512000
0x3fe57c57f336f190, 0x3fe059eea0727586, // 0.671429, 0.510978
0x3fe58cadb5cd7989, 0x3fe05197f7d73404, // 0.673423, 0.509960
0x3fe59cfb25fae87d, 0x3fe04949cc1664c5, // 0.675413, 0.508946
0x3fe5ad404c359f2c, 0x3fe0410410410410, // 0.677399, 0.507937
0x3fe5bd7d30e71c73, 0x3fe038c6b78247fc, // 0.679381, 0.506931
0x3fe5cdb1dc6c1764, 0x3fe03091b51f5e1a, // 0.681359, 0.505929
0x3fe5ddde57149923, 0x3fe02864fc7729e9, // 0.683334, 0.504931
0x3fe5ee02a9241675, 0x3fe0204081020408, // 0.685304, 0.503937
0x3fe5fe1edad18918, 0x3fe0182436517a37, // 0.687271, 0.502947
0x3fe60e32f44788d8, 0x3fe0101010101010, // 0.689233, 0.501961
0x3fe62e42fefa39ef, 0x3fe0000000000000, // 0.693147, 0.500000
};
static const float64_t ln_2(0.69314718055994530941723212145818);
// 0.69314718055994530941723212145818
static const float64_t ln_2 = float64_t::fromRaw(0x3fe62e42fefa39ef);
float32_t f32_log(float32_t x)
{
@ -4598,12 +4562,12 @@ float32_t f32_log(float32_t x)
float64_t buf; buf.v = packToF64UI(0, 1023, ((uint64_t)x.v << 29) & ((1LL << (52 - LOGTAB_SCALE)) - 1));
buf -= float64_t::one();
float64_t tab0(icvLogTab[2*h0]);
float64_t tab1(icvLogTab[2*h0+1]);
float64_t tab0 = float64_t::fromRaw(icvLogTab[2*h0]);
float64_t tab1 = float64_t::fromRaw(icvLogTab[2*h0+1]);
float64_t x0 = buf * tab1;
//if last elements of icvLogTab
if(h0 == 255) x0 += float64_t(-1./512);
if(h0 == 255) x0 += float64_t(-float64_t::one() / float64_t(512));
float64_t y0 = ln_2 * float64_t(expF32UI(x.v) - 127) + tab0 + x0*x0*x0/float64_t(3) - x0*x0/float64_t(2) + x0;
@ -4617,14 +4581,14 @@ float64_t f64_log(float64_t x)
if(x == float64_t::zero()) return -float64_t::inf();
static const float64_t
A7(1.0),
A6(-0.5),
A5(0.333333333333333314829616256247390992939472198486328125),
A4(-0.25),
A3(0.2),
A2(-0.1666666666666666574148081281236954964697360992431640625),
A1(0.1428571428571428769682682968777953647077083587646484375),
A0(-0.125);
A7(1),
A6(-float64_t::one() / float64_t(2)),
A5( float64_t::one() / float64_t(3)),
A4(-float64_t::one() / float64_t(4)),
A3( float64_t::one() / float64_t(5)),
A2(-float64_t::one() / float64_t(6)),
A1( float64_t::one() / float64_t(7)),
A0(-float64_t::one() / float64_t(8));
//first 8 bits of mantissa
int h0 = (x.v >> (52 - LOGTAB_SCALE)) & ((1 << LOGTAB_SCALE) - 1);
@ -4632,12 +4596,12 @@ float64_t f64_log(float64_t x)
float64_t buf; buf.v = packToF64UI(0, 1023, x.v & ((1LL << (52 - LOGTAB_SCALE)) - 1));
buf -= float64_t::one();
float64_t tab0(icvLogTab[2*h0]);
float64_t tab1(icvLogTab[2*h0 + 1]);
float64_t tab0 = float64_t::fromRaw(icvLogTab[2*h0]);
float64_t tab1 = float64_t::fromRaw(icvLogTab[2*h0 + 1]);
float64_t x0 = buf * tab1;
//if last elements of icvLogTab
if(h0 == 255) x0 += float64_t(-1./512);
if(h0 == 255) x0 += float64_t(-float64_t::one()/float64_t(512));
float64_t xq = x0*x0;
return ln_2 * float64_t( expF64UI(x.v) - 1023) + tab0 + (((A0*xq + A2)*xq + A4)*xq + A6)*xq +
@ -4651,8 +4615,8 @@ float64_t f64_log(float64_t x)
float32_t f32_cbrt(float32_t x)
{
//special cases
if(x.isNaN()) return float32_t::nan();
if(x.isInf()) return x;
if (x.isNaN()) return float32_t::nan();
if (x.isInf()) return x;
int s = signF32UI(x.v);
int ex = expF32UI(x.v) - 127;
@ -4663,22 +4627,23 @@ float32_t f32_cbrt(float32_t x)
/* 0.125 <= fr < 1.0 */
/* Use quartic rational polynomial with error < 2^(-24) */
const float64_t A1(45.2548339756803022511987494);
const float64_t A2(192.2798368355061050458134625);
const float64_t A3(119.1654824285581628956914143);
const float64_t A4(13.43250139086239872172837314);
const float64_t A5(0.1636161226585754240958355063);
const float64_t A6(14.80884093219134573786480845);
const float64_t A7(151.9714051044435648658557668);
const float64_t A8(168.5254414101568283957668343);
const float64_t A9(33.9905941350215598754191872);
const float64_t A10(1.0);
const float64_t A1 = float64_t::fromRaw(0x4046a09e6653ba70); // 45.2548339756803022511987494
const float64_t A2 = float64_t::fromRaw(0x406808f46c6116e0); // 192.2798368355061050458134625
const float64_t A3 = float64_t::fromRaw(0x405dca97439cae14); // 119.1654824285581628956914143
const float64_t A4 = float64_t::fromRaw(0x402add70d2827500); // 13.43250139086239872172837314
const float64_t A5 = float64_t::fromRaw(0x3fc4f15f83f55d2d); // 0.1636161226585754240958355063
const float64_t A6 = float64_t::fromRaw(0x402d9e20660edb21); // 14.80884093219134573786480845
const float64_t A7 = float64_t::fromRaw(0x4062ff15c0285815); // 151.9714051044435648658557668
const float64_t A8 = float64_t::fromRaw(0x406510d06a8112ce); // 168.5254414101568283957668343
const float64_t A9 = float64_t::fromRaw(0x4040fecbc9e2c375); // 33.9905941350215598754191872
const float64_t A10 = float64_t::one();
fr = ((((A1 * fr + A2) * fr + A3) * fr + A4) * fr + A5)/
((((A6 * fr + A7) * fr + A8) * fr + A9) * fr + A10);
/* fr *= 2^ex * sign */
// checks for "+0" and "-0", reset sign bit
float32_t y; y.v = ((x.v & ((1u << 31) - 1)) != 0) ? packToF32UI(s, ex+127, (uint32_t)(fracF64UI(fr.v) >> 29)) : 0;
float32_t y; y.v = ((x.v & ((1u << 31) - 1)) != 0) ? packToF32UI(s, ex + 127, (uint32_t)(fracF64UI(fr.v) >> 29)) : 0;
return y;
}

@ -10334,12 +10334,7 @@ class TypeWithoutFormatter<T, kConvertibleToInteger> {
// T is not an enum, printing it as an integer is the best we can do
// given that it has no user-defined printer.
static void PrintValue(const T& value, ::std::ostream* os) {
// MSVC warns about implicitly converting from double and float to int for
// possible loss of data, so we need to temporarily disable the
// warning.
GTEST_DISABLE_MSC_WARNINGS_PUSH_(4244)
const internal::BiggestInt kBigInt = value;
GTEST_DISABLE_MSC_WARNINGS_POP_()
const internal::BiggestInt kBigInt = static_cast<internal::BiggestInt>(value);
*os << kBigInt;
}
};

Loading…
Cancel
Save