Skip to content

Incorrect results for a couple of real cpp_bin_float functions:ℝ→ℝ #264

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cosurgi opened this issue Aug 9, 2020 · 37 comments
Closed

Comments

@cosurgi
Copy link

cosurgi commented Aug 9, 2020

As requested I am opening another issue for problems with following functions, but only for cpp_bin_float real valued functions:

  • sin, cos, tan with 7e7 ULP error
  • acos with 10000 ULP error
  • erfc with 20000 ULP error
  • lgamma with 70000 ULP error (edited)
  • tgamma with 10000 ULP error
  • fma with 2e5 ULP error

I prepared std::vector<std::string> suspects = {……} so that only these arguments are tested. So I'm sorry that this test program is a little longer. I can push it somewhere via git if you want.

@jzmaddock said
Yes please. Note however that most of those functions have regions that are ill-conditioned. I'm surprised about erf though.

So I do a domain check in the code below, but that's just the domain check via mathematical definition of the function. E.g. acos in (-1,1) range. But if there are some wider ill-conditioned cpp_bin_float ranges then you tell me what are those :)

The last couple tests are done on MPFR types, to show that they have no problems, even when I reduce the tolerance to 4 ULP.

This test is done on g++-10 and Boost 1.71

#include <boost/core/demangle.hpp>
#include <boost/multiprecision/float128.hpp>
#include <boost/multiprecision/mpfr.hpp>
#include <boost/multiprecision/cpp_bin_float.hpp>
#include <iostream>
#include <string>
#include <vector>

// these suspects that I found here were generated with 207 (semi-random) bits, cpp_bin_float<62> that is.
std::vector<std::string> suspects =
{
"-99.99051044261190803828277871209611083521312159772951785429282742447111501770387897764914459929030895961457916310906347977088468929912075917569999182149214394708068576189674558918341062963008880615234375",
"-99.23390959446626271324034474274442251884471237189555648094657059216860706607230983323106368424801631883935026863224574760130807307771805691417887408046384289874060347091955236464855261147022247314453125",
"-98.9601713316877088337177445119470740578579166310219652750338812970411599649857990095222187693902055061636695929602719448563570542635141882380804268308514937244231568502783602525596506893634796142578125",
"-98.273813022182876335674961215978389185880158614907235514650235867554610737475054142604330810869605796963554540686259410168473190820224120735175598211787517991498697167429554610862396657466888427734375",
"-98.1129673249056279651265099215966864727359600855606270412253136392329234530313794427136637055560221800456208046576431258117530821299909173847892873020493030816573110097777998817036859691143035888671875",
"-97.389369764346678086481891064814826474831092962567795459730881505082734698449439138689254963656701672933811803557867845743694253575567006314050085743567864815344037321409587093512527644634246826171875",
"-95.81857221869257960935742769742992913057780233194018961846245753236156690762799658755131314850200998334040944803550122736063078540309929170741814952093887546176985414714266653390950523316860198974609375",
"-92.41884548834482351580942729503268036653297534861723287901036113912045650063200397203449032796157971583666591400004045975989150366281884624802662149806202205909629043834030426296521909534931182861328125",
"-91.1061877200439407432384615462896541336997550990506594144915374189322511915338633133119583121624515660791329437500227666881849937355906834387488978756948848299924981208874896765337325632572174072265625",
"-89.88901025192110738330790618249721807309639606773637313381141814624705166266602211251904155822175375028221083070595793995144725917986725146484809181158549739264727873599980512153706513345241546630859375",
"-89.5353901456268146780894922808504683043625998859211699302844699006615833786787620155903405554436561863769757162466938403503598928733212929892185960036262953160544897368566807926981709897518157958984375",
"-82.1735520704620443988984953466372698685913582823295765947054351112482828444196668754236587930583613773862145085498288866696315110855282598447092727081999454104808966459216890143579803407192230224609375",
"-77.4823796790540815922431050434539860561416780588691652960638531675828303613178820006138086077402642358169796090547340159455478668941626522124178433128328640096781076973542212726897560060024261474609375",
"-76.99175113943655525504236511759596519945485974092039507047416560034531419571148155966846401745208762372457862829213996244244865281367459385377136496207263084289203203258722396640223450958728790283203125",
"-74.61255333976712083091879675534822922304761149616407008730070078988643083933215168414352880237541830345893825991799418214718663934337361280342675580186924961102572229076912435630219988524913787841796875",
"-72.3148104470242378111131793549028166185391566893773764561918781174851603967015597324961371802863065721050633633189851030237069974043738081738156836369644443643193987281136969613726250827312469482421875",
"-65.6435462795664662509771573366666549161813140877948752939617569007726832786509545361560456448812909391572172265680384625360761114969384119631392422215792126281679041976957478254917077720165252685546875",
"-58.1194637727400116282382861620192645168456286573655292854115447804934531033530825341470365817522667175865233641660823248322056381392871614104021682035650111738424306029315857813344337046146392822265625",
"-46.00377253908153163234835861938988189011724937250550191704727440078450345533379528244871632668899992466976676697133833647564925859881415224025606188892635798714896011585295809709350578486919403076171875",
"-44.4018537144116355553957796775986930181198953013070477698158368990850213417187435014923789688670795285241686594695650800353491215038601488478780249088234035183091197307447828279691748321056365966796875",
"-42.178867533615277746638335956312648788666574058754668089030698639143496696692892419393689512323455361357823651939047406700172638876986456164277459200305282980007944015898857514912378974258899688720703125",
"-37.463814793675275461340264701880657547498904997758234907382436644440387185383888069692093701283418496171812743486767600476345326829809773758398740227733327893774352423950091406368301250040531158447265625",
"-36.687894664533810937311533733623204481210731875314969097117453723702620271139130018679051998429836998807714049077719477378387717033200220973951746780027503998765359138900521429604850709438323974609375",
"-28.64389272279336971899833313469911474439779953887602880275372619043693669817718560048422360489311115432830897163631478540521766172994972680472028686375514700446394400490390808045049197971820831298828125",
"-28.0049139189336880614936157837694875795078481812590699169249409778955821694343725412388088298559665974798192998478183283974952859016032716608150750782873554208841915258432209157035686075687408447265625",
"-26.27180763553655086974675201041863634842370354443985880608654015680918608411304588751537996354581477114994399729425244435651959022879036487160686066081892033421442411711410613861517049372196197509765625",
"-25.19589620543179814909094172303432814133713508768451885201830602238490586082017718958403502211165076000022756274322670476508649605244189795114035788739250985098123980510109731767443008720874786376953125",
"-25.13274460509201434480266058335104919728710461006166448957435054060930768882685992519312501100646264865618197931948935269332644328253058412301382409241950447072178054241931022261269390583038330078125",
"-24.3953393891403751990434066978288339384375573172866562212210641433035459991358198899245580781841692398778762926576347126875939333921008840292697330648373870679197772393109744371031410992145538330078125",
"-21.09522851245033636306402211225949554094174191622852088230859853405429426073319491152815162110789708135363180731077163134358817681937892456607698197182937716368487934825992624610080383718013763427734375",
"-18.99938574552839199324805802310536938840417940528040264994230879127715234997780930686638661213255462498806211545865983339025364050801922290465869751649067992947152172522606861093663610517978668212890625",
"-16.1054921663428825424335275871979183815357076427275834397442882246577003003947573289675799854994087290464911637642925175788912463196112911507347146483208575619937297229711248292005620896816253662109375",
"-15.73606255635348930406430675898903077327778525123481926630706457480564768230418298855932815114879596305648746566826709238793635624816065807957821140335105770187602847176577824939158745110034942626953125",
"-13.844342695544957837434025971838094757130400709693375931013384200015240921794309640808969294106787118008983305677558784686668901577262469676705839997599836797663452880868817373993806540966033935546875",
"-12.0108256663021959292221821504924285077679894795415928058870037494381092873899810180946465666595655424900842675906679066861586687873299236208804084527982847696754575839150902538676746189594268798828125",
"-10.00031013274038195290023947364801980860573336384093125993165793242441917674719101901475578381172139328538478579821165445665430869130966779506355287008010477201210008946219431891222484409809112548828125",
"-8.00002606729166538824643828246571667601957528380422187224925264792051768683947293015968599171373933233014603623537359584513425170094804665935239384252086272957156520835297897065174765884876251220703125",
"-6.00136682225492754251204662283943131239849406671099109862729681998415655896338341898554616420963838467993260300566362082682688543052932950197434420055032149531569485301218946915469132363796234130859375",
"-4.03935176182968248850425274573197268040942586626526838633754467790994461640466129194118835598340118294709330113984308095784822410899225766569451949983317611166111493758990036440081894397735595703125",
"-3.0240920288930329988980374744242432174547781269616617810591667842849794114087483433483690367847145810986439948789823331633666322045350227369058242087843354551669750041043016608455218374729156494140625",
"-2.45703434083386998275925378730707853886429974961703191606644158840534757638881189433235828818780863495008551032003814937228673471251368171994648347271862826902977250398407704778946936130523681640625",
"-2.45702409322290866567069073111226123857093891190759763630180185440854570661779988634018746783189304594656392773180501945370983941166634220688688556283277257129456228046393562181037850677967071533203125",
"-1.68169675859976659383108338072526819755655584974521789613087401183387429879714920504893731220566066433092139915659379637884440972895014577991321577305253685830077614582478418014943599700927734375",
"-0.8282564029863776126578656468289904548301926008360850725607385349535211657160850878019333716199903358537998263735956441731642451949396509520995591712819820502493317615488876981544308364391326904296875",
"-0.32136064705709597454683625174723961593146173639012134904467758003590583919808930814050545965484123350604583749902317747452315051081556469722141906597624489046183260398947822977788746356964111328125",
"0.46721644973365601360133602238548895907862098406622072706034309566800215546218584935514980265179575405374460581236738760590882160438856238290914946721340585134019107726999209262430667877197265625",
"0.999846935115256985099472087619410059034039136463602141692454832980536542150610828088069585167055187023555569404437106928970332167071435310425941385031029895284759856366463282029144465923309326171875",
"0.99988767201274738245735086136368521485585806605382659983192152902696406932008939599756249510654260590532728278579290850296943869294248260415662522058393880540656806221733177153510041534900665283203125",
"0.999890658691280253459563000177154110549643009678046768723093809280489994853890555289525263351943778362525321014124545828049510733153266589198126845022007746534298266993801007629372179508209228515625",
"0.999890866630185914587046276951054077223882235976803551094669700127799173507869538140351795204645068157857366025341530654308963466229817646946295966864834393016125968500773524283431470394134521484375",
"0.9998935834632539389432532416679314303104944098437646169936959501208480776770549549396436304932167485457590024069924603839254637269127683893329896050425928226423888389717831159941852092742919921875",
"0.9998937078809612793196456117613076238607542194482800109271476030303818189373028927817720019485705963490501809249485198842139120807378682861591436713538045611728011241581270951428450644016265869140625",
"0.9998938266238835248172237531591128278247832584171582274981000092413549795680158553547781577679123233133582668576009454540078156352860532955582650147430441578411119962765951640903949737548828125",
"1.31807073864746745220380666020953425708782839063532147724215402784222028983184986695417973418596170725423236711281442200052112002936531018527445826575889803824494228567942855079309083521366119384765625",
"2.05118616373376822351059060334033552537053819234188264727312593977696266313461209366740347658511550317741748782578284208029622842257369906721179886195782958121548722463245439939782954752445220947265625",
"14.81907944221615795927300817825273323995258820785195324332346982881369733699449486066221176276821157545838038881434799007345102544573284121878574555603790032496692996577536405311548151075839996337890625",
"28.86382646919547451704802146558570204667176129200120383736328754193446432280602654739983984395786925252355041424685510746821564041731449426350230758472895022277715515457430228707380592823028564453125",
"37.714117388111989956041102504146323181250085280470547904334284311710392522527934075592357284175540227603002107141232187606083931450205311188420619775073138932840188797257496844395063817501068115234375",
"37.755692600976890509060126539791454024057262140474811481640356032121125141911161464415653798084260615297277298486172253135984357874602234962374017127404099967470652021717114621424116194248199462890625",
"43.1803311978604564169383897713532689475466446393217746344408051982016068191582531106463642440364694513352131182034723647935400394961893836912807402147128875424808569505330524407327175140380859375",
"44.8136269782289928625179989261586968859704136307989349216436641020178036768807849394357169505890377033019777761450383475357716008285913212762440013978080310193437274524086433302727527916431427001953125",
"47.7466833592842141724124786289501525735591596956904479800788632710915981013637380490409808488674608936498347095426906680888360693051845194282363447716043526277730768558882346042082644999027252197265625",
"48.5373479167760837984751589435425712042885137507272816756492359179219111789370782710753352832578889227710125612304041008705021198073669031963387872820418281736599974696133585894131101667881011962890625",
"50.2654237499756733391222254122805320113428095281996770142576041928720328847038073008540751164256335141210504687992703586601047641219781397261165193341597270449729040198150187279679812490940093994140625",
"66.475153220534004851292526233200206437375861594380699566663661143294973948983537723870961684073064116387026367864722840661735428670419848958023413614398867727169062380454533922602422535419464111328125",
"81.6813903871233164206231157958374137736575469952408038962124876646551135758586852641465094333999801948744979304163225462391891136623683615941281815737538089523643580758260895890998654067516326904296875",
"90.5055529204410608252721620806883201091798030906746366296219309300593773762484102001340104622297142486139344072193634452555957932797466287389178621999435495602305545848054180169128812849521636962890625",
"91.1061928073599934918157143693445377704705143712968984369886992676466700842560738586081200771883133480499146932659993234293192141302496948118607650536006329505291090331553505166084505617618560791015625",
"91.73096013967822637902416462228509184659994913333375698315287016094450586596998400386341289481248526500038762543132207961366660355580285937087410175116695986753667657609412344754673540592193603515625",
"96.006219145174968389135648559819121058721694089272516452196945753282582422246476865909482984419546829495310684769521880110885806790842600551509460451587668161459176996430642248014919459819793701171875",
"97.389368411290298402830640798173079547959579858387300352046564554983962377373474417232814245397912161320988898124674543550781585423318179803285572760545009906273106192742261555395089089870452880859375",
"98.0989550614355490188345206791598701919776512387165808297572266422581898406437029731615350650185511553954839433926255993281461118980368400993687322616830094970143127941497596111730672419071197509765625",
"98.96015456301280320862779505809196791836643290291948125688893156142059072001012434950259767595461620194995593174473903568075803746371943076148585708991150589920737790095017771818675100803375244140625",
"99.215809318714254781755417250857229813252158084760395373122363660557432217805933289849573751176675695362239479172525090760908689972963504911406316481201661289408832988812037001480348408222198486328125",
"99.526174807950546775689149433642956463205915643028662653550636461692965655300301728228212687122980789586022357026446091170053596694888030662864493749047536713843442601756805743207223713397979736328125"
};

std::vector<std::string> fma_suspects =
{"-65.6435462795664662509771573366666549161813140877948752939617569007726832786509545361560456448812909391572172265680384625360761114969384119631392422215792126281679041976957478254917077720165252685546875",
"-21.09522851245033636306402211225949554094174191622852088230859853405429426073319491152815162110789708135363180731077163134358817681937892456607698197182937716368487934825992624610080383718013763427734375",
"1.31807073864746745220380666020953425708782839063532147724215402784222028983184986695417973418596170725423236711281442200052112002936531018527445826575889803824494228567942855079309083521366119384765625",
"37.755692600976890509060126539791454024057262140474811481640356032121125141911161464415653798084260615297277298486172253135984357874602234962374017127404099967470652021717114621424116194248199462890625",
"0.46721644973365601360133602238548895907862098406622072706034309566800215546218584935514980265179575405374460581236738760590882160438856238290914946721340585134019107726999209262430667877197265625",
"43.1803311978604564169383897713532689475466446393217746344408051982016068191582531106463642440364694513352131182034723647935400394961893836912807402147128875424808569505330524407327175140380859375",
"-0.8282564029863776126578656468289904548301926008360850725607385349535211657160850878019333716199903358537998263735956441731642451949396509520995591712819820502493317615488876981544308364391326904296875",
"-82.1735520704620443988984953466372698685913582823295765947054351112482828444196668754236587930583613773862145085498288866696315110855282598447092727081999454104808966459216890143579803407192230224609375",
"-3.0240920288930329988980374744242432174547781269616617810591667842849794114087483433483690367847145810986439948789823331633666322045350227369058242087843354551669750041043016608455218374729156494140625",
"44.8136269782289928625179989261586968859704136307989349216436641020178036768807849394357169505890377033019777761450383475357716008285913212762440013978080310193437274524086433302727527916431427001953125",
"37.714117388111989956041102504146323181250085280470547904334284311710392522527934075592357284175540227603002107141232187606083931450205311188420619775073138932840188797257496844395063817501068115234375",
"-77.4823796790540815922431050434539860561416780588691652960638531675828303613178820006138086077402642358169796090547340159455478668941626522124178433128328640096781076973542212726897560060024261474609375",
"-1.68169675859976659383108338072526819755655584974521789613087401183387429879714920504893731220566066433092139915659379637884440972895014577991321577305253685830077614582478418014943599700927734375",
"48.5373479167760837984751589435425712042885137507272816756492359179219111789370782710753352832578889227710125612304041008705021198073669031963387872820418281736599974696133585894131101667881011962890625"};


template <typename Type, typename Reference, typename Tol> void test(Tol tolerance)
{
	std::cout << "\n========================\nTesting:\n   " << boost::core::demangle(typeid(Type).name()) << " against:\n   " << boost::core::demangle(typeid(Reference).name()) << "\n";
	for (const auto& str : suspects) {
		//std::cout << str << "\n";
		Type      arg_1(str);
		Reference arg_ref_1(str);
		if ((arg_1 != static_cast<Type>(arg_ref_1)) or (static_cast<Reference>(arg_1) != arg_ref_1)) {
			std::cout << "These are different numbers, cannot work with that. It is because 'suspects' were prepared with 207 semi-random bits, 62 decimal places that is. Some extra cutting and "
			             "casting could be done here to fix this.\n";
			exit(1);
		}
		/* skip extra cutting and casting, I didn't test that.
		if ((arg_1 != static_cast<Type>(arg_ref_1)) or (static_cast<Reference>(arg_1) != arg_ref_1)) {
			arg_1     = static_cast<Type>(arg_ref_1);
			arg_ref_1 = static_cast<Reference>(arg_1);
		}*/

#define TEST_FUNCTION(func)                                                                                                                                  \
	{                                                                                                                                                    \
		Type      val_1     = boost::multiprecision::func(arg_1);                                                                                    \
		Reference val_ref_1 = boost::multiprecision::func(arg_ref_1);                                                                                \
		if (boost::multiprecision::isfinite(val_1) and (boost::multiprecision::isfinite(val_ref_1))) {                                               \
			auto ulp = boost::math::float_distance(static_cast<Type>(val_ref_1), val_1);                                                         \
			if ((ulp > tolerance) or (ulp < -tolerance)) {                                                                                       \
				std::cout << std::setw(7) << #func << " ULP dist = " << std::setw(15) << ulp << "   argument = " << arg_1 /* str */ << "\n"; \
			}                                                                                                                                    \
		} else if ((boost::multiprecision::isfinite(val_1) and (not(boost::multiprecision::isfinite(val_ref_1))))) {                                 \
			std::cout << std::setw(7) << #func << "  : lower precision is a finite value, higher isn't (only the opposite makes sense)"          \
			          << "   argument = " << arg_1 /* str */ << "\n";                                                                            \
		}                                                                                                                                            \
	}

		TEST_FUNCTION(sin)
		TEST_FUNCTION(cos)
		TEST_FUNCTION(tan)
		// acos domain check (-1,1)
		if ((arg_1 > static_cast<Type>(-1)) and (arg_1 < static_cast<Type>(1))) {
			TEST_FUNCTION(acos)
		}
		TEST_FUNCTION(erfc)
		// gamma domain check skip negative integers
		if (not((arg_1 < 0) and (static_cast<Type>(boost::multiprecision::round(arg_1)) == arg_1))) {
			TEST_FUNCTION(tgamma)
			if(boost::multiprecision::tgamma(arg_1) > 0 ) {
				TEST_FUNCTION(lgamma)
			}
		}
		// I just copy that macro, but function fma(…,…,…) uses three args
		for (const auto& str2 : fma_suspects) {
			Type      arg_2(str2);
			Reference arg_ref_2(str2);
			for (const auto& str3 : fma_suspects) {
				Type      arg_3(str3);
				Reference arg_ref_3(str3);
				{
					Type      val_1     = boost::multiprecision::fma(arg_1, arg_2, arg_3);
					Reference val_ref_1 = boost::multiprecision::fma(arg_ref_1, arg_ref_2, arg_ref_3);
					if (boost::multiprecision::isfinite(val_1)) {
						auto ulp = boost::math::float_distance(static_cast<Type>(val_ref_1), val_1);
						if ((ulp > tolerance) or (ulp < -tolerance)) {
							std::cout << std::setw(7) << "fma"
							          << " ULP dist = " << std::setw(15) << ulp << "   argument = " << arg_1 << " , " << arg_2 << " , " << arg_3 /* str, str2, str3 */ << "\n";
						}
					}
				}
			}
		}
	}
	std::cout << "DONE\n";
#undef TEST_FUNCTION
}

int main()
{
	test<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<62>, boost::multiprecision::et_off>, boost::multiprecision::mpfr_float_500>(10000);
	test<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<62>, boost::multiprecision::et_off>,
	     boost::multiprecision::number<boost::multiprecision::cpp_bin_float<124>, boost::multiprecision::et_off>>(10000);
	test<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<62>>, boost::multiprecision::mpfr_float_500>(10000);

	// MPFR works
	test<boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<62, boost::multiprecision::allocate_stack>, boost::multiprecision::et_off>, boost::multiprecision::mpfr_float_500>(4);
	test<boost::multiprecision::mpfr_float_100, boost::multiprecision::mpfr_float_500>(4);

	// we might test these later too. Won't work now, because suspects data was prepared for 62 decimal places.
	//test<boost::multiprecision::float128, boost::multiprecision::mpfr_float_50>(4);
	//test<boost::multiprecision::mpfr_float_50, boost::multiprecision::mpfr_float_100>(4);
}

EDIT: Here's my (fixed lgamma domain) output:

========================
Testing:
   boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<62u, (boost::multiprecision::backends::digit_base_type)10, void, int, 0, 0>, (boost::multiprecision::expression_template_option)0> against:
   boost::multiprecision::number<boost::multiprecision::backends::mpfr_float_backend<500u, (boost::multiprecision::mpfr_allocation_type)1>, (boost::multiprecision::expression_template_option)1>
    cos ULP dist =    -1.05074e+07   argument = -98.9602
    tan ULP dist =     1.01564e+07   argument = -98.9602
    sin ULP dist =    -1.67319e+07   argument = -97.3894
    tan ULP dist =     1.67319e+07   argument = -97.3894
    cos ULP dist =      1.6665e+07   argument = -95.8186
    tan ULP dist =     8.78195e+06   argument = -95.8186
    sin ULP dist =      4.3195e+07   argument = -91.1062
    tan ULP dist =     -4.3195e+07   argument = -91.1062
    cos ULP dist =    -1.82969e+07   argument = -89.5354
    tan ULP dist =    -3.58613e+07   argument = -89.5354
    cos ULP dist =     5.33625e+07   argument = -58.1195
    tan ULP dist =     5.97394e+07   argument = -58.1195
    fma ULP dist =           15802   argument = -28.6439 , 1.31807 , 37.7557
    sin ULP dist =     1.07071e+06   argument = -25.1327
    tan ULP dist =     1.07071e+06   argument = -25.1327
 tgamma ULP dist =          -10271   argument = -15.7361
    fma ULP dist =         -194768   argument = -0.321361 , -65.6435 , -21.0952
   acos ULP dist =          -10075   argument = 0.999891
 lgamma ULP dist =           13963   argument = 1.31807
    fma ULP dist =          -26108   argument = 14.8191 , -3.02409 , 44.8136
    sin ULP dist =         -527053   argument = 50.2654
    tan ULP dist =         -527053   argument = 50.2654
    sin ULP dist =    -1.74569e+06   argument = 81.6814
    tan ULP dist =    -1.74569e+06   argument = 81.6814
    sin ULP dist =    -5.39938e+06   argument = 91.1062
    tan ULP dist =     5.39938e+06   argument = 91.1062
   erfc ULP dist =           20408   argument = 91.731
   erfc ULP dist =           22029   argument = 96.0062
    sin ULP dist =     8.36595e+06   argument = 97.3894
    tan ULP dist =    -8.36595e+06   argument = 97.3894
   erfc ULP dist =           20748   argument = 98.099
    cos ULP dist =    -2.62684e+06   argument = 98.9602
    tan ULP dist =    -1.55465e+06   argument = 98.9602
   erfc ULP dist =           21844   argument = 99.2158
   erfc ULP dist =           22085   argument = 99.5262
DONE

========================
Testing:
   boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<62u, (boost::multiprecision::backends::digit_base_type)10, void, int, 0, 0>, (boost::multiprecision::expression_template_option)0> against:
   boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<124u, (boost::multiprecision::backends::digit_base_type)10, void, int, 0, 0>, (boost::multiprecision::expression_template_option)0>
    cos ULP dist =    -1.05074e+07   argument = -98.9602
    tan ULP dist =     1.01564e+07   argument = -98.9602
    sin ULP dist =    -1.67319e+07   argument = -97.3894
    tan ULP dist =     1.67319e+07   argument = -97.3894
    cos ULP dist =      1.6665e+07   argument = -95.8186
    tan ULP dist =     8.78195e+06   argument = -95.8186
    sin ULP dist =      4.3195e+07   argument = -91.1062
    tan ULP dist =     -4.3195e+07   argument = -91.1062
    cos ULP dist =    -1.82969e+07   argument = -89.5354
    tan ULP dist =    -3.58613e+07   argument = -89.5354
    cos ULP dist =     5.33625e+07   argument = -58.1195
    tan ULP dist =     5.97394e+07   argument = -58.1195
    fma ULP dist =           15802   argument = -28.6439 , 1.31807 , 37.7557
    sin ULP dist =     1.07071e+06   argument = -25.1327
    tan ULP dist =     1.07071e+06   argument = -25.1327
 tgamma ULP dist =          -10271   argument = -15.7361
    fma ULP dist =         -194768   argument = -0.321361 , -65.6435 , -21.0952
   acos ULP dist =          -10075   argument = 0.999891
 lgamma ULP dist =           13963   argument = 1.31807
    fma ULP dist =          -26108   argument = 14.8191 , -3.02409 , 44.8136
    sin ULP dist =         -527053   argument = 50.2654
    tan ULP dist =         -527053   argument = 50.2654
    sin ULP dist =    -1.74569e+06   argument = 81.6814
    tan ULP dist =    -1.74569e+06   argument = 81.6814
    sin ULP dist =    -5.39938e+06   argument = 91.1062
    tan ULP dist =     5.39938e+06   argument = 91.1062
   erfc ULP dist =           20408   argument = 91.731
   erfc ULP dist =           22029   argument = 96.0062
    sin ULP dist =     8.36595e+06   argument = 97.3894
    tan ULP dist =    -8.36595e+06   argument = 97.3894
   erfc ULP dist =           20748   argument = 98.099
    cos ULP dist =    -2.62684e+06   argument = 98.9602
    tan ULP dist =    -1.55465e+06   argument = 98.9602
   erfc ULP dist =           21844   argument = 99.2158
   erfc ULP dist =           22085   argument = 99.5262
DONE

========================
Testing:
   boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<62u, (boost::multiprecision::backends::digit_base_type)10, void, int, 0, 0>, (boost::multiprecision::expression_template_option)0> against:
   boost::multiprecision::number<boost::multiprecision::backends::mpfr_float_backend<500u, (boost::multiprecision::mpfr_allocation_type)1>, (boost::multiprecision::expression_template_option)1>
    cos ULP dist =    -1.05074e+07   argument = -98.9602
    tan ULP dist =     1.01564e+07   argument = -98.9602
    sin ULP dist =    -1.67319e+07   argument = -97.3894
    tan ULP dist =     1.67319e+07   argument = -97.3894
    cos ULP dist =      1.6665e+07   argument = -95.8186
    tan ULP dist =     8.78195e+06   argument = -95.8186
    sin ULP dist =      4.3195e+07   argument = -91.1062
    tan ULP dist =     -4.3195e+07   argument = -91.1062
    cos ULP dist =    -1.82969e+07   argument = -89.5354
    tan ULP dist =    -3.58613e+07   argument = -89.5354
    cos ULP dist =     5.33625e+07   argument = -58.1195
    tan ULP dist =     5.97394e+07   argument = -58.1195
    fma ULP dist =           15802   argument = -28.6439 , 1.31807 , 37.7557
    sin ULP dist =     1.07071e+06   argument = -25.1327
    tan ULP dist =     1.07071e+06   argument = -25.1327
 tgamma ULP dist =          -10271   argument = -15.7361
    fma ULP dist =         -194768   argument = -0.321361 , -65.6435 , -21.0952
   acos ULP dist =          -10075   argument = 0.999891
 lgamma ULP dist =           13963   argument = 1.31807
    fma ULP dist =          -26108   argument = 14.8191 , -3.02409 , 44.8136
    sin ULP dist =         -527053   argument = 50.2654
    tan ULP dist =         -527053   argument = 50.2654
    sin ULP dist =    -1.74569e+06   argument = 81.6814
    tan ULP dist =    -1.74569e+06   argument = 81.6814
    sin ULP dist =    -5.39938e+06   argument = 91.1062
    tan ULP dist =     5.39938e+06   argument = 91.1062
   erfc ULP dist =           20408   argument = 91.731
   erfc ULP dist =           22029   argument = 96.0062
    sin ULP dist =     8.36595e+06   argument = 97.3894
    tan ULP dist =    -8.36595e+06   argument = 97.3894
   erfc ULP dist =           20748   argument = 98.099
    cos ULP dist =    -2.62684e+06   argument = 98.9602
    tan ULP dist =    -1.55465e+06   argument = 98.9602
   erfc ULP dist =           21844   argument = 99.2158
   erfc ULP dist =           22085   argument = 99.5262
DONE

========================
Testing:
   boost::multiprecision::number<boost::multiprecision::backends::mpfr_float_backend<62u, (boost::multiprecision::mpfr_allocation_type)0>, (boost::multiprecision::expression_template_option)0> against:
   boost::multiprecision::number<boost::multiprecision::backends::mpfr_float_backend<500u, (boost::multiprecision::mpfr_allocation_type)1>, (boost::multiprecision::expression_template_option)1>
DONE

========================
Testing:
   boost::multiprecision::number<boost::multiprecision::backends::mpfr_float_backend<100u, (boost::multiprecision::mpfr_allocation_type)1>, (boost::multiprecision::expression_template_option)1> against:
   boost::multiprecision::number<boost::multiprecision::backends::mpfr_float_backend<500u, (boost::multiprecision::mpfr_allocation_type)1>, (boost::multiprecision::expression_template_option)1>
DONE
@cosurgi
Copy link
Author

cosurgi commented Aug 9, 2020

I should have sorted suspects. After sorting I realized that there are 5 duplicates.

EDIT: I fixed this in OP

@ckormanyos
Copy link
Member

I would like to look at a few instances of spurious results for LogGamma[x].

But I have a few questions.

  • Are you dealing with real-valued arguments and results?
  • Are you interested in (the complex-valued) result of:
N[LogGamma[-58.1194637727400116282382861620192645168456286573655292854115447804934531033530825341470365817522667175865233641660823248322056381392871614104021682035650111738424306029315857813344337046146392822265625`206], 200]

I get a complex value for that one.

@ckormanyos
Copy link
Member

The last couple tests are done on MPFR types, to show that they have no problems, even when I reduce the tolerance to 4 ULP.

MPFR can dynamically increase its precision (and the digits in the type at hand) when calculating near singularities. I think most Boost.Math special functions use fixed-width from start to end. So I believe calculations often could get lossy near singularities, unless something like a Taylor series could be found for some of the ranges you suspect.

@cosurgi
Copy link
Author

cosurgi commented Aug 9, 2020

Are you dealing with real-valued arguments and results?

yes, in this test I only work with real valued arguments and results. And thanks, of course lgamma can't work when tgamma is negative! I will edit the code.

(EDIT: OK, I fixed the code in the opening post)

MPFR can dynamically increase its precision [...]

yes, I'm aware of that. We can make these tests pass just by increasing the acceptable ULP error, and this solution is enough for me, because (as I see it) cpp_bin_float is sort of a test/fallback type. I only thought that you would be interested about these (potential) problems.

And also: all other cpp_bin_float common math functions have ULP error < 127. Only these few had problems.

@jzmaddock
Copy link
Collaborator

Many thanks for the test cases, working on some error plots now....

@cosurgi
Copy link
Author

cosurgi commented Aug 9, 2020

Many thanks for the test cases, working on some error plots now....

you are welcome. In a few days I will add a couple more suspects :) I only scanned about a half of the target 2e7 cases for each common math so far.

@cosurgi cosurgi changed the title Incorrect results for a couple of cpp_bin_float functions Incorrect results for a couple of real cpp_bin_float functions:ℝ→ℝ Aug 9, 2020
@jzmaddock
Copy link
Collaborator

OK, some ULP plots coming up....

acos, asin, atan all look good to me, though if we're being picky atan near zero might be improvable:

acos:

cpp_bin_float_acos

asin:

cpp_bin_float_asin

atan:

cpp_bin_float_atan

@jzmaddock
Copy link
Collaborator

sin/cos/tan exhibit the usual high errors near the roots, I do wonder if higher than normal precision for the calculation of N * Pi would be enough to (mostly) squash these:

cos:

cpp_bin_float_cos

sin:

cpp_bin_float_sin

tan:

cpp_bin_float_tan

@jzmaddock
Copy link
Collaborator

Log looks good, though I might have hoped for smaller errors on something that's so crazy-well-conditioned:

cpp_bin_float_log

exp as you would expect gets tougher for larger arguments:

cpp_bin_float_exp

@jzmaddock
Copy link
Collaborator

tgamma behaves much as you would expect, especially for larger arguments:

cpp_bin_float_tgamma

erf looks good, though I wonder if there is low hanging fruit near zero:

cpp_bin_float_erf

erfc has high error for large arguments, but it's ~ e^-x^2 in that domain, so we have the same ill-conditioned issues as exp, but more so:

cpp_bin_float_erfc

@NAThompson
Copy link
Contributor

NAThompson commented Aug 10, 2020

Wow, I'm glad to see these plots work well! (Well, other than the couple bugs you had to fix in #417)

@cosurgi : Note how these plots give a totally different way of understanding accuracy; @jzmaddock notes that erf at zero is inaccurate, but it's only inaccurate relative to the condition number; in fact in absolute terms it is pretty good. Now, there is another philosophy, adopted by MPFR, that for a representable x, f(x) is the correctly rounded value. This generally requires extra precision internally. Now, whether or not that's what you should do for cpp_bin_float is unclear to me, because I don't understand the internals of that class. But generally what you do if you want half-ulp accuracy instead of mere backward stability is that you do some analysis to figure out your extra precision requirements, then you cast the input to a fixed-precision type of the requisite length, perform the algorithm in fixed point, and finally cast back the the floating point type.

I do wonder if higher than normal precision for the calculation of N * Pi would be enough to (mostly) squash these.

This is sort of half-way between the philosophy of MPFR and the backward stability philosophy. I mean, no one would complain if things got a bit more accurate, but at the same time, what is the claimed accuracy in the docs? I believe that the claimed accuracy of cpp_bin_float is the backwards accuracy, not the forwards. Doing the analysis to get half-ulp accuracy is really hard, and in fact you might need custom routines just for cpp_bin_float.

@cosurgi
Copy link
Author

cosurgi commented Aug 10, 2020

Thank you very much for your reply!

Note how these plots give a totally different way of understanding accuracy

yes, thank you. As I see it, the horizontal axis is the x argument and vertical axis is the ULP error drawn with blue dots. What is the green line though?

[...] adopted by MPFR, that for a representable x, f(x) is the correctly rounded value. This generally requires extra precision internally. Now, whether or not that's what you should do for cpp_bin_float is unclear to me.

I fully agree and understand the problems involved.

then you cast the input to a fixed-precision type of the requisite length [...]

You mean for example cpp_bin_float with twice the amount of decimal places? Yeah, that's what I'm doing right now :) I implemented there the RealHP<N> types using boost::mpl vector and mpfr or cpp_bin_float to chose the type from.

[...] perform the algorithm in fixed point

Which fixed-point type do you have in mind? I search multiprecision docs but I see no mention of a fixed point type.

but at the same time, what is the claimed accuracy in the docs?

yes. That's the important point. Write what kind of accuracy to expect, and all problems are solved. Maybe add in docs a more mention about how to obtain the error estimate in a small domain range in which the user is interested in (not the (-100,100) which I tested here ;).

I'm sorry, if I missed this part if it's in docs already.

@NAThompson
Copy link
Contributor

What is the green line though?

The green line is +-|xf'(x)/f(x)|; the condition number of function evaluation.

You mean for example cpp_bin_float with twice the amount of decimal places?

Hopefully when you work out the analysis you don't necessarily use twice the number, just b more bits for some b.

Which fixed-point type do you have in mind? I search multiprecision docs but I see no mention of a fixed point type.

There is no fixed point class currently; I'm just stating the mechanism that is used to solve this problem. I've been agitating for fixed point for a while; but also have expended zero effort towards making it happen, so currently I have what I deserve, which is nothing.

@cosurgi
Copy link
Author

cosurgi commented Aug 10, 2020

I've been agitating for fixed point for a while; but also have expended zero effort towards making it happen, so currently I have what I deserve, which is nothing.

heheh. I also would like to see a fixed point type. We can muster only a finite amount of time though, so we do what we can!

@cosurgi
Copy link
Author

cosurgi commented Aug 10, 2020

Hopefully when you work out the analysis you don't necessarily use twice the number, just b more bits for some b.

In fact extending the RealHP<N> in yade to use fractional multiplies of base precision is only a few lines more of code. I might do that later, thanks for the hint! :)

EDIT: not useful - #264 (comment) , also page 46 in Kahan's paper and page 4 in another Kahan's paper

@cosurgi
Copy link
Author

cosurgi commented Aug 10, 2020

acos, asin, atan all look good to me, though if we're being picky atan near zero might be improvable:

Maybe we could exploit symmetry in acos (a shifted oddness in fact, acos(x)=-acos(-x)+pi), because the errors are large close to 1, but are small close to -1.

I do wonder if higher than normal precision for the calculation of N * Pi would be enough to (mostly) squash these:

I guess so.

@cosurgi
Copy link
Author

cosurgi commented Aug 11, 2020

I'm wondering if Automatic Differentiation in: https://www.boost.org/doc/libs/master/libs/math/doc/html/math_toolkit/autodiff.html
can help here somehow, to increase accuracy of these functions?

@ckormanyos
Copy link
Member

ckormanyos commented Aug 11, 2020

I've been agitating for fixed point for a while; but also have expended zero effort towards making it happen

There was a legitimate effort to move forward on fixed-point in GSoC15. I would like to re-activate this work some day.

John McFarlane has done a lot of work on fixed-point and other UDTs in CNL. As far as I know, this work does not specifically target Boost as backend technology, but the author is Boost-aware.

@pabristow
Copy link
Contributor

pabristow commented Aug 12, 2020 via email

@jzmaddock
Copy link
Collaborator

@NAThompson :

Doing the analysis to get half-ulp accuracy is really hard, and in fact you might need custom routines just for cpp_bin_float.

We've never intended to compete with mpfr/gmp: those guys have way more resources than we do. Besides they've been there and done that at very considerable effort already. That doesn't mean we can't be better though.

@jzmaddock
Copy link
Collaborator

Hopefully when you work out the analysis you don't necessarily use twice the number, just b more bits for some b.

You do for argument reduction unfortunately: if we assume the input is exact, then when you subtract NPI from the input and you can cancel at most B bits for a B-bit precision number, and therefore need an extra B bits in the value of NPI to fill in the missing data. Of course for inexact input this is a complete waste of time and we have no way of knowing what the missing bits should be.

@jzmaddock
Copy link
Collaborator

I'm wondering if Automatic Differentiation in: https://www.boost.org/doc/libs/master/libs/math/doc/html/math_toolkit/autodiff.html can help here somehow, to increase accuracy of these functions?

I'm not seeing how, what did you have in mind?

@NAThompson
Copy link
Contributor

From the graphs, it would appear that the green line is something like a one sigma indicator and two thirds of the values lie within the envelope. Twice that + and – would seem to be a two-sigma indicator when 95% of values lie inside?

I'm trying to decide whether that's a good way to think about it. In fact the process that generates these values is deterministic and can systematically bias in one way or another, but maybe it's not productive to think in this way. The way I think about is as follows: Given an input which is in error by half an ulp, what is the maximum ulp error computed via Taylor series?

@cosurgi
Copy link
Author

cosurgi commented Aug 12, 2020

I'm not seeing how, what did you have in mind?

I had in mind the Taylor series expansion: having derivatives with ULP precision might help.

Now I realize however, that there is nothing to use as an input function for the Taylor series, since the math functions are not there yet to use: they are being implemented.

@pabristow
Copy link
Contributor

Is it realistic to expect only half an ulp? It's not what we see? What we see looks like a statistical distribution?

Computation may be deterministic, but usually involve many instruction steps, each of which may be half a bit 'wrong' up or down. Some may have all 'wrong' ups and others all down, the worst outlier cases.

The plots still look like a good way to tell where to focus efforts to improve - and even more important, perhaps, where not to bother to try.

@NAThompson
Copy link
Contributor

Is it realistic to expect only half an ulp? It's not what we see?

No, not half an ulp output, the assumption is half-ulp accurate input.

@pabristow
Copy link
Contributor

Ah I see - yes half is expected

@cosurgi
Copy link
Author

cosurgi commented Aug 12, 2020

Speaking of Kahan (12 posts up), are you using boost/accumulators/statistics/sum_kahan.hpp to sum the Taylor series?

I have checked that it indeed helps with summations.

@NAThompson
Copy link
Contributor

@cosurgi : Kahan summation can be thought of as an emulation of twice the working precision. Most of the time it makes sense to just use twice the precision instead of using Kahan summation; e.g., it takes ~Cb time for b bit adds, so 2b bits requires 2Cb time, whereas Kahan summation takes 4Cb time for b bits.

IMO, the only goal should be error bound by the condition number under the assumption of half-ulp accurate inputs, making Kahan a bit overkill. Again, maybe that's a sensible solution for parts of certain algorithms, but I don't see it helping in general.

@jzmaddock
Copy link
Collaborator

The PR mentioned above plucks a bit or low hanging fruit from erf, the error plot now looks like:

cpp_bin_float_erf

@cosurgi
Copy link
Author

cosurgi commented Aug 24, 2020

OK, a couple days ago the scanning of 2e7 evaluations was finished, using this code: https://gitlab.com/yade-dev/trunk/-/blob/master/py/high-precision/_RealHPDiagnostics.cpp#L445

This post is quite long, because I am posting more test cases: the worst arguments found. The loop was quite simple (linked above): whenever a larger ULP error was found, the offending arguments were added to the list. So it's not like I saved all which produced ULP error above threshold, just the largest found so far in the loop. I will be posting here only the tail of this list, because I suppose the start won't be that useful, but I can send you more if you want. All numbers have 207 bits of cpp_bin_float<62>.

These are my results:

function cpp_bin_float ULP error
decimal places 62
significand bits 207
------------------------ -----------------------
+ 0
- 0
* 0
/ 0
------------------------ -----------------------
sin 6.43e+07
cos 6.69e+07
tan 7.64e+07
sinh 125
cosh 125
tanh 9
------------------------ -----------------------
asin 106
acos 13526
atan 8
asinh 16
acosh 17 *
atanh 23
atan2 10
------------------------ -----------------------
log 17 *
log10 32 *
log1p 17 *
log2 25 *
logb 0
------------------------ -----------------------
exp 125
exp2 5
expm1 125
------------------------ -----------------------
pow 118
sqrt 0
cbrt 3
hypot 2
------------------------ -----------------------
erf 21
erfc 22496
lgamma 70843
tgamma 10661
------------------------ -----------------------
fmod 0
remainder 4
fma 1.95e+05

[*] - star means that in the first run I found a higher error than reproduced in the code below, but didn't store arguments back then. I could reproduce it, if you need these arguments. I would need to rerun with partially reverted yade commits 67786dfc77db71bcfd29961db0bf1007ea7f3ab0 and 3ffc9d82c6a878bf938efe3b48d8056fef25bb3e (that's just a note for future if needed later).

Also in the code below I didn't add arguments for functions that had error < 4. I can provide them if you want.

So this is the output of the test code provided below:

========================
Testing:
   boost::multiprecision::number<boost::multiprecision::backends::cpp_bin_float<62u, (boost::multiprecision::backends::digit_base_type)10, void, int, 0, 0>, (boost::multiprecision::expression_template_option)0> against:
   boost::multiprecision::number<boost::multiprecision::backends::mpfr_float_backend<500u, (boost::multiprecision::mpfr_allocation_type)1>, (boost::multiprecision::expression_template_option)1>
      acos max ulp error: 13526
     acosh max ulp error: 16
      asin max ulp error: 106
     asinh max ulp error: 16
      atan max ulp error: 8
     atan2 max ulp error: 10
     atanh max ulp error: 23
       cos max ulp error: 6.69276e+07
      cosh max ulp error: 125
       erf max ulp error: 21
      erfc max ulp error: 22496
       exp max ulp error: 125
      exp2 max ulp error: 5
     expm1 max ulp error: 125
       fma max ulp error: 194768
    lgamma max ulp error: 70843
       log max ulp error: 16
     log10 max ulp error: 27
     log1p max ulp error: 16
      log2 max ulp error: 22
       pow max ulp error: 118
 remainder max ulp error: 4
       sin max ulp error: 6.42593e+07
      sinh max ulp error: 125
       tan max ulp error: 7.64367e+07
      tanh max ulp error: 9
    tgamma max ulp error: 10661
DONE

The test code:

#include <boost/core/demangle.hpp>
#include <boost/multiprecision/float128.hpp>
#include <boost/multiprecision/mpfr.hpp>
#include <boost/multiprecision/cpp_bin_float.hpp>
#include <iostream>
#include <string>
#include <vector>
#include <map>

///////////////////////////////////// New test cases: 207 bits, cpp_bin_float<62>
std::vector<std::string> sin_suspects_1={
 "-25.13274460509201434480266058335104919728710461006166448957435054060930768882685992519312501100646264865618197931948935269332644328253058412301382409241950447072178054241931022261269390583038330078125",
 "-31.4159267744117952127377415993877609647408009432313910576645208978973150979796283893173972635501837696538103351730467443705710420954285159221875844972078216550681606378248034161515533924102783203125",
 "-53.407075285545505843727703839562328304525724835826293575131498675963055638999256549291127262294461783993446552621333482884084516671327447972469393528819844003756832362395101654328755103051662445068359375",
 "-65.93470100497084079032049324013992620859946482610191817909130329372001311048467917262257232052983263048354699344727174716756052063718241515720227600095680952989839196387578112990013323724269866943359375",
 "-72.25507242501571303363546950194897807224009411683080675357021467657444496437764791032548277714477190353278549253379595340403737150718445102678729036086935369150897889856111078188405372202396392822265625",
 "-81.6813150018523343778962960578146288527341313606767572624568975425571887699983050883759070175679863872579293333706354869089833457860784832117627044993665263832027800816604212741367518901824951171875",
 "-81.68153003327643611669709258995977817748652512128581751940752093206559687618804680193378414044140314400695927473663038823851591357953803348914605023175369442867653491102686302838264964520931243896484",
 "-94.24778318286859046271165816359027062947441724857421581937843461149398541348064481870434029854524826240455190400462248474506724667739030430973914024483549932323205033934954144569928757846355438232422",
 "-97.38936952869335617296388678072718006636492495476495640264096174466978182347628781065858414797258566663869017929761517194965909384819420325829434138541138281808945409423472483467776328325271606445313",
 "-97.38939078058598302126370024551140062789424681342735225452774704088347890086321463933529769233266843313404967849499223932333076553074062618035688643282105254883607159399616648443043231964111328125",
 "-97.38943307260000345531239056391054673289846499287558450521773581738745462369959042918295942129693364874099807423464156797226285944384043854380028741814207294560067074140619070021784864366054534912109",
 "-97.38947196876958800539480016073674612982541506366917255660152000859946578198460302482843359890225340295011327518610052339800625684976669005716922798247162137009851068381038885490852408111095428466797",
 "-97.38950859486182829080700611826396896016069231462652805267279216733027444962228020850771310037991747320454638665297018680422201997001803823120516811669359204077511815711432063835673034191131591796875",
 "-97.38958947203854384745369736095242760390608379410151387038594035894137920948950887675857715280168403594490358685738674148533381604096333153731601251903445982797437319167244140771799720823764801025391",
 "-97.38960257559537240713892206216635815333243852784183357659636552364990704864817541428633777116895960828755440636245342132317890008909930653612693573418313141188025483518941882721264846622943878173828",
 "-97.38980398770359888201073685342342475794404599314123834473920144836256400429780111329472540538910567261855621292501510693957913492892627234425684917444957791003018465758600541448686271905899047851563",
 "-97.38984237931060894129427804182312614961499613752657082531004562926996997637148118622243300822165842812031656918574431135087038486104205801045638450885121899171410764228795642338809557259082794189453",
 "-97.39034216730376180609976223345518091042689520958621235496697858319611860883429589711557068868000470630822384591698898660364867119541100654873130923209616858896887914287532339585595764219760894775391",
 "-97.39123808981460326787110193113210225329001743954443185889840586770771455766685112973464799694884157011985507119656414336085693772895417119678029476826517770652984207213620493348571471869945526123047",
 "-97.39132109395497060943346393435355731818740894728606547917401556119498248442084452611918642940982922994322776800478805710603689201551837909539481861196638778758495613718793038060539402067661285400391",
 "-97.39317453957673318750855559690670890962422054828273178331599451812318945922977934054501442239768254812254931175768811753457039401322492932303202720438657308071016271977526912451139651238918304443359",
 "-97.39326753063778895816258904530659336716321690394080768679868833933315403407899235193375331543679717956735637481987919637346193603291168604275559148482075666453626483498595689525245688855648040771484",
 "-97.39690209914430581165893559213637195461126544449239808074281566692716969133610783863749662536140137537219916879889532508007644801894124401412653267258999036982448915811261258568265475332736968994141",
 "-97.3971394237023726509441416329602071765393434765566648196727927865507646386274850481914971149775231092712541910131830161695661028238576439901179714592787859360478730508248190744780004024505615234375",
 "-97.39717825866538371443567001333085999914649079030102189627944146360229183587734059982032201438654804134701840607352161063345783111086139849952678433878940441768487512597118893609149381518363952636719",
 "37.69911227585326075971951859619875650938849617876834533458750748452421483981966402388963170590474969490052326736374536948338496721576307787403483940152789749512482475601871101389406248927116394042969",
 "50.26542374997567333912222541228053201134280952819967701425760419287203288470380730085407511642563351412105046879927035866010476412197813972611651933415972704497290401981501872796798124909400939941406",
 "59.62117134990988524584117753744911070848337364788427223585017623030249890563862740007897657201497408908877268016062793299126274735714527967515879638730648669995085264794454360526287928223609924316406",
 "75.47278291453849813225770790838798472187208958462057758419832551400033093536412926440379819468621635279622746278284859680216030079858897710064695380815593154458925662098067732586059719324111938476563",
 "81.68139038712331642062311579583741377365754699524080389621248766465511357585868526414650943339998019487449793041632254623918911366236836159412818157375380895236435807582608958909986540675163269042969",
 "82.67517117638456500713859463508913828190296492870685097812009494869178388826320748212840846194419330771204851488982229094226325653599212273984911301024926618590329963076612784789176657795906066894531",
 "87.96463439383230984052063443206444437841175271437371909059271040398910303665790089264724633841699079573812633929438898350344819050614829342462567019758795953867508421453180744720157235860824584960938",
 "87.96619673971356085468279110533185605210366372444996894801594115622990864067562746946268238326676435192289517010832083446001394233989959053608634334249924755086066929798960245534544810652732849121094",
 "9.424778031761424034922907708699845688366017136891432437294063571801230667417308465495912729494849182106564771279925688986080579022559636093318273757860844316424503430695835959340911358594894409179688",
 "9.4431067156119587674693364012653106925991226868876388292364160313950887399832987626101848182938134660562109990269984206673606402371796519625552301522287382447296000265168913756497204303741455078125",
 "91.10619280735999349181571436934453777047051437129689843698869926764667008425607385860812007718831334804991469326599932342931921413024969481186076505360063295052910903315535051660845056176185607910156",
 "97.38936841129029840283064079817307954795957985838730035204656455498396237737347441723281424539791216132098889812467454355078158542331817980328557276054500990627310619274226155539508908987045288085938"};

std::vector<std::string> cos_suspects_1={
 "-29.84511187204803346304235170548318841443747037693319459203793475435384251276033168378997544785063465167218809226132877360487881358500005884853637490041206178307403584781809513515327125787734985351563",
 "-42.43900313524898104115747543173612827730880271437176484162187198681450156750965842270402561296405532786192631459433339776196225266592754083425580258417496671630771837291362658106663729995489120483398",
 "-48.68290560902911737666336329758467280771199123925400052929954740374497184444137572678657079125763493743463675378473493787242745820063235378829639950897091398279020735273547870747279375791549682617188",
 "-58.11946377274001162823828616201926451684562865736552928541154478049345310335308253414703658175226671758652336416608232483220563813928716141040216820356501117384243060293158578133443370461463928222656",
 "-89.53539029125362935617891989040387323446187187654816459233192065682029855936008018175048850305345746815717711315338591620558617564021966191070526706350061002200914350712679379284963943064212799072266",
 "-95.81857443738515921871387009742527934446784175552335894953736032997811390165925612925609974626158620536882419109122666382343987118384618071204499217728866629220987882753490794129902496933937072753906",
 "-95.81858251252059753617664754763977636607093691195618991498761040123817518291653575594921113889223533916706147643961936308366963379065692457610538733862305018208586904204793199824052862823009490966797",
 "-98.96017266337541766743489763575176510975245179292766917796165704437975081146446942857716076208762446367000702338663023792799437733326085911034283488223423251779233000835489519886323250830173492431641",
 "-98.96018553589112390457199243815169788479045765746968054944165230786469096278268588231031381344975994004289567281010434180388173401334867544439243317956507439963481642664078208326827734708786010742188",
 "-98.96020725339875144716681379954293549118730331461335288816466870412883502728651598636043926545623706880465973130050570931252498445712898971885114665885922819918950332773732725399895571172237396240234",
 "-98.96024476075195987794088333250356191014253111752291557721075222407461737733255845120995558986709454685677406606906844063846082767763051827193131345576178860214307253517773688145098276436328887939453",
 "-98.96026603876669685446036902537639751625023012542111721382373785207093214044386601615555045419567256511771874820291858822440806428840706694609005820251392619951551210544238301736186258494853973388672",
 "-98.96039044891192676468243611682825366626326133297937222419759737268168440385410850245261391845630849488624383408945013370980233428130439546954462270157705484300431075794790558575186878442764282226563",
 "-98.96040204376134330921487032205813464683317940690816197823815231715149514165224341771249183662009522695597765906068027275488630966991290577742264139088792008233479158274548126428271643817424774169922",
 "-98.96065028222800974581350456113015845718970943225265706118224809861414736540894637634645935484395257179726753121057763976154709481676124983540993463481745984634124768675178529520053416490554809570313",
 "-98.96113786384634460592404807384921336974728774301291045189408510260861366307815538560448106489517685843166718632409814359605468557230349942801142559644916394247064761469090399259584955871105194091797",
 "-98.96114110126697747116049049397198479464026631456754374834236733351725157184118782183551520567561211429746239838583036568043305363052656286869483296093314580684809078636732238010154105722904205322266",
 "-98.96191718175340032316726385895110339652335542650420100472071986404490295605691572890290016221193499282744251421558433209230910321766110679290652857345833684531502538739289320801617577672004699707031",
 "-98.96209971763099411231872529691958673027096187301133737218463787213658330433240577247394276482764867446188157958164060377751374177651853000184234562741080078315455970106029326416319236159324645996094",
 "-98.96210616000443497480250087032313966686545036416660370827090529533298274636026570173043896028645277635684922297303081608230289740592202636497547691829427889912557114726610052457544952630996704101563",
 "-98.96378159650145200085760397190390313165726031321663628492879332475859694323927203176406703546287228518918566072300008834750347313661322209075198724261970148149449022501045192257151938974857330322266",
 "-98.96403536812640889973231234445888323824226842573352569361155234949465417575146184408680862518838575453964636271658980554253167599651814159126227076570545950558351055992289957430330105125904083251953",
 "-98.96404371293783706542522786495262261756101225566570051552921808523574340130851939273920554896977013162874654849123144060627982455092152808175117970098040145522123867127817220534780062735080718994141",
 "23.56001733384097430673898452449124609967550567711137449190588321275220790923539875300085651438426352901465501666618015311093140539118070497612557423778854959564056648080310196746722795069217681884766",
 "48.694686536619736321189343880422619996566569661593850181378463735549882680395949201804403613905066889575950857731413662883718477629863687325009165403629060771273362462352451984770596027374267578125",
 "58.11942613276614313333683448017226206826632706330325150871520466118442873016714387567721669148946987585839897131906043493261958954375152497215785915767091837549201960300138125603552907705307006835938",
 "67.54785951045500969642888196379260255329993444670148370951436717516213613316765355339410331162687985218187385961175232915318514519044262535785994607159686737869047634674757318862248212099075317382813",
 "82.67517117638456500713859463508913828190296492870685097812009494869178388826320748212840846194419330771204851488982229094226325653599212273984911301024926618590329963076612784789176657795906066894531",
 "89.53527204946455603582798868528683789770193906998344414214503767558648189392691447977211727567674000341337144375967787950491780018350917716486281244304447357595932999174692668020725250244140625",
 "95.79709356727960238284586202862709617623828487731578575343826269956489079072861077428649033534724325934323460373275656053849648789694680144427169726056696554385497255346137990272836759686470031738281",
 "95.81824542862348017037624418148155145258867949547085088972824196701881869811054023680749963979697373507292982675072186762710282707968988287305402408462497697034382371228389274619985371828079223632813",
 "98.8136988644083857517528459444880200548553953880779003087228086175306710685737172260430433902651458655018727668295878446549069908714210320774854355744146812597084039708761338260956108570098876953125",
 "98.96015456301280320862779505809196791836643290291948125688893156142059072001012434950259767595461620194995593174473903568075803746371943076148585708991150589920737790095017771818675100803375244140625"};

std::vector<std::string> tan_suspects_1={
 "-23.56194483873648869220249664203388136009686625764517415771118553360214429841966000651052196404405142702583830513399558658641061203355333577866900333113446658578164771835616875250707380473613739013672",
 "-29.84511187204803346304235170548318841443747037693319459203793475435384251276033168378997544785063465167218809226132877360487881358500005884853637490041206178307403584781809513515327125787734985351563",
 "-31.4159267744117952127377415993877609647408009432313910576645208978973150979796283893173972635501837696538103351730467443705710420954285159221875844972078216550681606378248034161515533924102783203125",
 "-53.407075285545505843727703839562328304525724835826293575131498675963055638999256549291127262294461783993446552621333482884084516671327447972469393528819844003756832362395101654328755103051662445068359375",
 "-58.11946377274001162823828616201926451684562865736552928541154478049345310335308253414703658175226671758652336416608232483220563813928716141040216820356501117384243060293158578133443370461463928222656",
 "-65.93470100497084079032049324013992620859946482610191817909130329372001311048467917262257232052983263048354699344727174716756052063718241515720227600095680952989839196387578112990013323724269866943359375",
 "-72.25507242501571303363546950194897807224009411683080675357021467657444496437764791032548277714477190353278549253379595340403737150718445102678729036086935369150897889856111078188405372202396392822265625",
 "-81.68153003327643611669709258995977817748652512128581751940752093206559687618804680193378414044140314400695927473663038823851591357953803348914605023175369442867653491102686302838264964520931243896484",
 "-89.53539029125362935617891989040387323446187187654816459233192065682029855936008018175048850305345746815717711315338591620558617564021966191070526706350061002200914350712679379284963943064212799072266",
 "-95.81857443738515921871387009742527934446784175552335894953736032997811390165925612925609974626158620536882419109122666382343987118384618071204499217728866629220987882753490794129902496933937072753906",
 "-97.38936952869335617296388678072718006636492495476495640264096174466978182347628781065858414797258566663869017929761517194965909384819420325829434138541138281808945409423472483467776328325271606445313",
 "-98.96017266337541766743489763575176510975245179292766917796165704437975081146446942857716076208762446367000702338663023792799437733326085911034283488223423251779233000835489519886323250830173492431641",
 "-98.96018553589112390457199243815169788479045765746968054944165230786469096278268588231031381344975994004289567281010434180388173401334867544439243317956507439963481642664078208326827734708786010742188",
 "-98.96020725339875144716681379954293549118730331461335288816466870412883502728651598636043926545623706880465973130050570931252498445712898971885114665885922819918950332773732725399895571172237396240234",
 "-98.96023261318004234958793694546135088364300314843318396193985371304494473353906953887065087557255833293745251315053008423490393669275527973013578944613850157680651209446409666270483285188674926757813",
 "-98.96024476075195987794088333250356191014253111752291557721075222407461737733255845120995558986709454685677406606906844063846082767763051827193131345576178860214307253517773688145098276436328887939453",
 "-98.96029140214035257790225203703487577082708315695647062592651160712116538665859255205918838874052096023860327040906999423947551285998641602339647913409787969261921514174673575325869023799896240234375",
 "-98.96031909761404674324718654219256188486162655562953370493165568855437368597999202170848613725823208502655675349381335393621113660426631770433419593523391013059099796667084092405275441706180572509766",
 "-98.96033459141518283266233980044808763464652808351651054575409949722548993944874424972288131733321219347801016508028545930642351814868891552453580554724692954350444284994381405340391211211681365966797",
 "-98.96042497252764832239459082809727458152008087502917408274440221963766469612554613361052329360210050035061927609001971873031975029473037147252432884386737815449706923143224912564619444310665130615234",
 "-98.96045076239499962388572933850846639806594427125718140014701013695168168343830162121536257967748521595393758929069645945695786329330383302039535174376845054152775083000648237430141307413578033447266",
 "-98.96047598395892442203662778698100487922994611423751375803200290290217913817333940624739505098915833771836564860044629194870213331222788666819881793215594179544992992081375859925174154341220855712891",
 "-98.96048140079309863749420473200420047470194208978141542241621015776258764974237182370498860113230603412622840789984317547342003129285163373193296340420926188955613733710947599320206791162490844726563",
 "-98.96051337243362247302586988172238567634907713920695131203149821523948124454061364545380629457716066355649078329292315262715024893300883074742338415760886210755312153430907073925482109189033508300781",
 "-98.96067180958078509171154836606501305266586819246743344165872435305228540622749171677676951255436421622918798404461310158127825864416412351647476416940839297133221397206881420061108656227588653564453",
 "58.08144296078762469914845115861287454030929293098715110003504200507344606879904015244665611247514571605999848948073271518563886323509008003918427885443259500123508454194620753696653991937637329101563",
 "58.11942613276614313333683448017226206826632706330325150871520466118442873016714387567721669148946987585839897131906043493261958954375152497215785915767091837549201960300138125603552907705307006835938",
 "59.62117134990988524584117753744911070848337364788427223585017623030249890563862740007897657201497408908877268016062793299126274735714527967515879638730648669995085264794454360526287928223609924316406",
 "75.47278291453849813225770790838798472187208958462057758419832551400033093536412926440379819468621635279622746278284859680216030079858897710064695380815593154458925662098067732586059719324111938476563",
 "76.96902057971345305759211935643007487815736602653020634489254554952200931387068569487065815391778404744563595938400647490709923016088680074566680471574396107340559902709742345905397087335586547851563",
 "81.68139038712331642062311579583741377365754699524080389621248766465511357585868526414650943339998019487449793041632254623918911366236836159412818157375380895236435807582608958909986540675163269042969",
 "82.67517117638456500713859463508913828190296492870685097812009494869178388826320748212840846194419330771204851488982229094226325653599212273984911301024926618590329963076612784789176657795906066894531",
 "87.96619673971356085468279110533185605210366372444996894801594115622990864067562746946268238326676435192289517010832083446001394233989959053608634334249924755086066929798960245534544810652732849121094",
 "9.424778031761424034922907708699845688366017136891432437294063571801230667417308465495912729494849182106564771279925688986080579022559636093318273757860844316424503430695835959340911358594894409179688",
 "92.67696704993580497329656235811428302137820558855238043485925186151212202170470278196190638855300455230731257081303711803455622800007542760228569419851978370252301719922627398773329332470893859863281",
 "95.81824542862348017037624418148155145258867949547085088972824196701881869811054023680749963979697373507292982675072186762710282707968988287305402408462497697034382371228389274619985371828079223632813",
 "98.8136988644083857517528459444880200548553953880779003087228086175306710685737172260430433902651458655018727668295878446549069908714210320774854355744146812597084039708761338260956108570098876953125",
 "98.96015456301280320862779505809196791836643290291948125688893156142059072001012434950259767595461620194995593174473903568075803746371943076148585708991150589920737790095017771818675100803375244140625"};

std::vector<std::string> sinh_suspects_1={
   "-96.32351588385226271229614560698094630523137263844164309214000257247889018349147740331302266482211654539707972557296644871502033222108585490726424173484114150413891441981917296288884244859218597412109",
   "-96.33864441413172884048299565844046119882662309565636173696659563650510618311356568311245620000289434654370728619640021559561503466712652228654175424839488126407295587316781393383280374109745025634766",
   "-96.34497750924997908158187854977102628980703930416796455546929732076954788465773426795934511459528392683526987980809608570421841723663758920307380415064461726148449527418193838457227684557437896728516",
   "-96.34694739571612092538978541407302352213317877324322433177365006579898192955427164835676581279108523106650635184762222182066881356582137835002706771086332702231855296126639132126001641154289245605469",
   "-96.34700731895753145311593091841202460633458636589581432641829920763942443974490530233986879314098756015205583395937762772498881558552578196404529386662928796950834675616448521395795978605747222900391",
   "-96.34741889799517634903529927062497660057840750018685647244543897212259730764958312998725878533962436770571176923731651198759068140733709826061960359456170537224319050384480078719207085669040679931641",
   "-96.34743314385231774301431705997052406216367120613657729743082178434387805064697275060203554433062581434175821873042160618909893137826111163737670527245348652770756681107400254404637962579727172851563",
   "-96.3474448882609714597836921791011060997507035949667359695026762652941476425537565966347870431186152702179995588145222197921481104666543533495577499948796132249462242924664678866975009441375732421875",
   "-97.03995146073215690149847537572235430449110959739667172998547491823302438627741595923234286106423258469737534658580622605686595459868989210195998616565139029176492724282354629394831135869026184082031",
   "-97.04046125426553236127790929442434532509508979223815979154943257721642150985924868602498772622764836983615359095084563251542476785724765849769223588545892216091458271076675146105117164552211761474609",
   "-97.04060320152708566696737530151470511914422043942047535199374418718226268182596252837244163456979630339949605097645487889733803632694526900491613226690767980090607247589673534093890339136123657226563",
   "-97.73227686511416761932488984766789649204539334394643651067398727187323367022488380009841457678459845118276603122892118818263762830121570161995291980297971920097974130037243867263896390795707702636719",
   "-97.73287937874576336024449374734225978860600724687960944476465623175902903147638701030819661218389842585604187172875983822820380678995813024280039919519470417849302257273791383340721949934959411621094",
   "-97.73324053356366304640543623941321199932954082139509906467421233443660627841637606282345515941731195596766510256403124481977254840209821439421020048510649390425403248983116100134793668985366821289063",
   "-97.73373204574132488050948554257674988610159291157519250563694855863444884670033025723335452273563169379030733869179082025073712769195788538432479419024611594466085684462797189553384669125080108642578",
   "-97.73375001653193109811321516838035930861460303631271628045009914689500270299610138639314928487517531222126190589091089877394487657547957300436561710151398414377424406218608510243939235806465148925781",
   "83.17738184748644823039665990460374778371489248574480297742203956164175901588054292908783440199439498313588730357014896774904271374042113999618037514479923098722341512356592829746659845113754272460938",
   "96.34040090794071265845254557605996214556494134405521238042632962766339919692025623055742488531646018190087344458206414238773247716779335471882327396139184352320816717707430143491365015506744384765625",
   "96.34438784875215967163522589010416270679104511998021759395670960449874470166184687039044342754660458362023504387133621485522768076121874801657901971239269909999883290119271350704366341233253479003906"};

std::vector<std::string> cosh_suspects_1={
   "-96.32351588385226271229614560698094630523137263844164309214000257247889018349147740331302266482211654539707972557296644871502033222108585490726424173484114150413891441981917296288884244859218597412109",
   "-96.32964453374574290485396350553257547158266042883200288418998089540850242548026030591353844568733259836412320599178376999799054577691385848417255139801279381216343733473905786013347096741199493408203",
   "-96.33864441413172884048299565844046119882662309565636173696659563650510618311356568311245620000289434654370728619640021559561503466712652228654175424839488126407295587316781393383280374109745025634766",
   "-96.34497750924997908158187854977102628980703930416796455546929732076954788465773426795934511459528392683526987980809608570421841723663758920307380415064461726148449527418193838457227684557437896728516",
   "-96.34694739571612092538978541407302352213317877324322433177365006579898192955427164835676581279108523106650635184762222182066881356582137835002706771086332702231855296126639132126001641154289245605469",
   "-96.34700731895753145311593091841202460633458636589581432641829920763942443974490530233986879314098756015205583395937762772498881558552578196404529386662928796950834675616448521395795978605747222900391",
   "-96.34741889799517634903529927062497660057840750018685647244543897212259730764958312998725878533962436770571176923731651198759068140733709826061960359456170537224319050384480078719207085669040679931641",
   "-96.34743314385231774301431705997052406216367120613657729743082178434387805064697275060203554433062581434175821873042160618909893137826111163737670527245348652770756681107400254404637962579727172851563",
   "-96.3474448882609714597836921791011060997507035949667359695026762652941476425537565966347870431186152702179995588145222197921481104666543533495577499948796132249462242924664678866975009441375732421875",
   "-97.03995146073215690149847537572235430449110959739667172998547491823302438627741595923234286106423258469737534658580622605686595459868989210195998616565139029176492724282354629394831135869026184082031",
   "-97.04046125426553236127790929442434532509508979223815979154943257721642150985924868602498772622764836983615359095084563251542476785724765849769223588545892216091458271076675146105117164552211761474609",
   "-97.04060320152708566696737530151470511914422043942047535199374418718226268182596252837244163456979630339949605097645487889733803632694526900491613226690767980090607247589673534093890339136123657226563",
   "-97.73227686511416761932488984766789649204539334394643651067398727187323367022488380009841457678459845118276603122892118818263762830121570161995291980297971920097974130037243867263896390795707702636719",
   "-97.73287937874576336024449374734225978860600724687960944476465623175902903147638701030819661218389842585604187172875983822820380678995813024280039919519470417849302257273791383340721949934959411621094",
   "-97.73324053356366304640543623941321199932954082139509906467421233443660627841637606282345515941731195596766510256403124481977254840209821439421020048510649390425403248983116100134793668985366821289063",
   "83.17738184748644823039665990460374778371489248574480297742203956164175901588054292908783440199439498313588730357014896774904271374042113999618037514479923098722341512356592829746659845113754272460938",
   "96.34040090794071265845254557605996214556494134405521238042632962766339919692025623055742488531646018190087344458206414238773247716779335471882327396139184352320816717707430143491365015506744384765625",
   "96.34438784875215967163522589010416270679104511998021759395670960449874470166184687039044342754660458362023504387133621485522768076121874801657901971239269909999883290119271350704366341233253479003906"};

std::vector<std::string> tanh_suspects_1={
   "-0.2544308054900053133314122837291768293689775517585163429193560851274181233213450872939916961721152188427969182831228111716324232593116627368259241354910876644745271191183633163745980709791183471679688",
   "-0.501558679440297725196600914262342097659761225359274925206221109152027309252028996875491414865862358159174659647248694485971639298725076017989867185191781820581546913473403037642128765583038330078125",
   "-0.5254870185313046318218539390422586166301834427491678136904610436010848014408725995027181069143323739111835688030762286818618543723078353738077206185053125153672226588241755962371826171875",
   "-0.5334869328557927632392100941690320311692992703009181640845672394411788914755777851465311434856802585872816533176596879239430060391824075458771420134757575788522071524866419167665299028158187866210938",
   "-0.5437244749332843336922814518408706738784637831611496231727815594145988320418365818526661980013955592115977842989564755648960526946474926144794765819258188280747867704434383995248936116695404052734375",
   "-0.5471459807646112164783924797256641322893655944673173024269025540549630436900004591739376969161311130502432794171958925460900626788819372636293629806358974454038451851189961416821461170911788940429688",
   "-0.5486632269777326156076938345357730994694994215000695725706748533211160998618126296761524127643682498527127311039898079903747330762726322956921275815874699936271208233762308736913837492465972900390625",
   "-0.6830802954909701088986807081349686611948359410282381542113671065209921033918068019158395448366867788124321594343264674892391717338433275887761616086226961592174633519647386492579244077205657958984375",
   "0.4915943928165972331138619848982754664709789395322188509887014215320771114614567133451843571537137702357309960696190036655257435948385449567256797425195245928534332202630707797652576118707656860351563",
   "0.5098835717622163972517936941086630132989388386137865059050757795346917499469841112773531793720407851957969049424009143600852548534706118231099685782149906476679035449706134386360645294189453125"};

std::vector<std::string> asin_suspects_1={
   "-0.9996984846878474286629140518994473425452362269016230470551420375301701618389981145567582615020435045580164303388160376416959346479849767765103415443465081739737865262895866180770099163055419921875",
   "-0.9997783271065402897886879622588332984694933328602909728868183600455050836862810717128676740998323864612721443171943900218484700916339489470385001620135481345021111199145025238976813852787017822265625",
   "-0.999803145792770215494297455598779221300935884338150902410531420646427753674331743772993721519480664102366100616332639015960239571269570736412762036860089561764175503100204878137446939945220947265625",
   "-0.9998269667678706387735900414434175938187083823013364988557464362526818818052823807482555629022303401790107105035412170553289831866187487301823277415343261252146656037353977808379568159580230712890625",
   "-0.99983588319605322311817215053139115393556954861313664737144108860489801604693824628627092676032710990364350205884510969864723717077562949142966939152028424918350335559580344124697148799896240234375",
   "-0.9998715339618493066867968797501768231476072402029786233071506661389637318848484371369711449423941700461917742049868424016806508659891179436553281515793449726273861566383516219502780586481094360351563",
   "-0.9998958768765755572995351626664448249813600352455643776730108732035132533748860961057166712623649531340578604073763645638385740949401156283420213327574082895791637848326161019940627738833427429199219",
   "0.9991773193001876676451461686882978181191705856746147221599340582357290736163101537935023097686920137247023111204799835481389261618152354199945391289117447848437680857358600405859760940074920654296875",
   "0.999737838761688646162634583570927435909268555545342387891710127395523194903446195532757567516872158975208732725123405481314670937467921311834367240586578652432325764465304018813185393810272216796875",
   "0.999846935115256985099472087619410059034039136463602141692454832980536542150610828088069585167055187023555569404437106928970332167071435310425941385031029895284759856366463282029144465923309326171875",
   "0.9998767043721099747938675230595552530922157142585276421610412467117868666586233785026191365400250291120337281904169607359547456024861209899104298796732466617130999364526644512807251885533332824707031",
   "0.999885344025494764915735556746926372340665078441091382858522967985105316981744306211965628740817305666698454318298178801179182263387531831301437904519215332625747816308603432844392955303192138671875",
   "0.999890658691280253459563000177154110549643009678046768723093809280489994853890555289525263351943778362525321014124545828049510733153266589198126845022007746534298266993801007629372179508209228515625",
   "0.999896886699971121124503591094954471805071081230686087003623658352391902506450999467972202013961351395594552398299514022776427561720302671613592066140452081605960454879777898895554244518280029296875"};

std::vector<std::string> acos_suspects_1={
   "0.9991773193001876676451461686882978181191705856746147221599340582357290736163101537935023097686920137247023111204799835481389261618152354199945391289117447848437680857358600405859760940074920654296875",
   "0.9992538677637626152499775747778843570840686707263780481660889157052454202589161846191910901489879004892346545137129319881701359238145202837375215018586006811198568788867646617291029542684555053710938",
   "0.9998381133952060569745728343079075243618972713337589697676111787950036144574713234694558379549179296167749692634766670125425160153738133298429851982305942097693784997858301721862517297267913818359375",
   "0.999846935115256985099472087619410059034039136463602141692454832980536542150610828088069585167055187023555569404437106928970332167071435310425941385031029895284759856366463282029144465923309326171875",
   "0.99987894416934328542579279861590003134048406864160444650669461563921499427615203609405751844044589713673684411620856229332015809340926852390335993100143642531296706010834896005690097808837890625",
   "0.9998813535163907377844326427614718897352898177465447671042726256541194674829765114502863715688876351645546347897221623126412506683064488518578504537401944476070203560169602496898733079433441162109375",
   "0.9998837740189241290587896099996544798724660126069407478999108765474021710219791026452809434359563010281856408690632068053816618817741565363196317445110476002621824331839661681442521512508392333984375",
   "0.999885344025494764915735556746926372340665078441091382858522967985105316981744306211965628740817305666698454318298178801179182263387531831301437904519215332625747816308603432844392955303192138671875",
   "0.999890658691280253459563000177154110549643009678046768723093809280489994853890555289525263351943778362525321014124545828049510733153266589198126845022007746534298266993801007629372179508209228515625",
   "0.999890866630185914587046276951054077223882235976803551094669700127799173507869538140351795204645068157857366025341530654308963466229817646946295966864834393016125968500773524283431470394134521484375",
   "0.9998935834632539389432532416679314303104944098437646169936959501208480776770549549396436304932167485457590024069924603839254637269127683893329896050425928226423888389717831159941852092742919921875",
   "0.999896886699971121124503591094954471805071081230686087003623658352391902506450999467972202013961351395594552398299514022776427561720302671613592066140452081605960454879777898895554244518280029296875",
   "0.9999840378828650090127992718260020886917740513625137254652909511071548873311743915631140387729142731801306859136851238810169254711194232328656012280387702128355703612427873849810566753149032592773438"};

std::vector<std::string> atan_suspects_1={
   "-0.2068286373044491341330819734271919254464176505825908449370286600467706150900563852838540817220982595572785695742445075631192763368311767847761260766711946263839844162291115026164334267377853393554688",
   "-0.436705203221880275365555472231262512075570481993420279631433836344870760633000294531005279461862598663207364097088811424454904451433847545107665999656178061616440544412398594431579113006591796875",
   "-0.5358209674872293060364725014269841014361964595435664865453692328543997258398315611861357243198098751562684776864809049058278799452324980581068022771583370111869726315489970147609710693359375",
   "-0.5461772925190286553278983432861792925696710925380939662859068292840483331718187329815769933188920416368905192857254289725795143108165337135158154151089771901044639390576662663079332560300827026367188",
   "-1.516178073523721573931771191250147852411623194606940353087775017920875854700377783444713385284774558488260522938482716778250886445555905131175550707488300204587097774755477530561620369553565979003906",
   "0.229985223480546978159672436561847097875403125220457808989925022977735779598109181082287809560376784821915284243618242854170456824134992236343386375338468450950368815455249205115251243114471435546875",
   "0.53694577632503258358047186150776146535815236452828614326472553582785366723603913892465732995431766764311481562532724800714945910210158958434549067960722874316703556729635238298214972019195556640625"};

std::vector<std::string> asinh_suspects_1={
   "-43.65535850716333196639115627078020469953399664544074360429069248449886884038441581482978568577783907842369454926928878858375450942780981612509886608373079883627012470759254370022972580045461654663086",
   "-88.09915439657499073503279889664083676362468174282126697456099574459435041129093674267027810545098310181604294030601209033630456759799213473309892626457256824658650917747593211970524862408638000488281",
   "-89.35051907538245031001265048142679946726328744282003757425901005271901613266045922699823096199208479310982612271718782540238040718655204524627823015904899597427329949184127144690137356519699096679688",
   "-99.11822971275152431357773574456847516340943162990158586745912536922499302072772923814946425593957143658375750694138054637141710474480307392718960163030852058836488172044454358911025337874889373779297",
   "-99.94476351076263122363715077422479253269639374783079139724726147378575140903332924761600974524927821095628743965866805311110704452500337826379119875181330357035922040687125900149112567305564880371094",
   "-99.95994814164539230729681387820326112608447073011491985830783184906247065320337218799848467599046635289027893666522557744990280296390435914901142096908564965208367214533069500248529948294162750244141",
   "-99.99426846427724571823682604834092132771188586877457951258446072196941962962263498994564650328002666891079832371688812585220698319274425558834462020152412231989783042429564829944865778088569641113281",
   "10.62081826723628745369303463368069636954227060023566621044145438751721065021496120383187559046681420175894262085910420506772835867796051588590327699723480332836926531836496678806724958121776580810547",
   "43.08074721505511993457366870791425123212984353266643612505025451937956075974185607227634307058874412163851411770829019884550309090989554450021180524656176549346681126095859326596837490797042846679688",
   "99.99328131376706743599216013156783518669157053956562242929793851093129528803230258627167378403327301708624580225434180790935016021736251916153885670922874515965939057338118800544179975986480712890625"};

std::vector<std::string> acosh_suspects_1= {
   "11.60810706985687920909340391977180872115746085380701304105282263152933093084815547316487302541826429475865527038236592357273916866908345897543292447359674978779944809481605716428020969033241271972656",
   "2.696368008793189149650909316382385404462844083180938840770101282993735631900555384964200639607402520668235039403066357637596248453287452910002008887207701031936760149854137580405222252011299133300781",
   "22.302773052748618147310969642649938391721363706219666389613745031625831708832546208355851721882457805613014927357592352536135584629270107544329429997870023645589743210848610033281147480010986328125",
   "22.35470097140977456966350812661991787484528227314737247190899426799601535340847682039496438690729393316802916994435058951390477333045640104416583394336723691116913803611510047630872577428817749023438",
   "81.98452204668604816343111804998672885964672123222586181365159276508274953538959282862197991558562678520342531304295436263264138978277123070785794257888008662593648523397860117256641387939453125",
   "84.115456051021533874929789940304418397589824369122986824678721904295422709720720079912342399941595891600293097856149776522627438863452160184592720432576761803444842513499679625965654850006103515625",
   "87.393969132999556572397867351449325462190865001555613712834477163663300266879111607978689624706996533863613207598796210661609699622482730276581541369358024397284712136979578644968569278717041015625",
   "91.46161349978360278637715843470812438721510205084958403271734560823204894791371004260633272622269559174589682698531691587351941551214874590381652074823808161018606766035077271226327866315841674804688",
   "96.64053994378215411232418960232611274354953416763689322289022401294315881896186498018372599597836859992535965297722474520420799989267975973616912808661495620549293505963106554190744645893573760986328"};

std::vector<std::string> atanh_suspects_1= {
   "-0.396246255579865155175590592575326243070843894848833364997660822437229730329088478401355027703039961735822919110456130487221088685506058344710004133032050523642586536965382038033567368984222412109375",
   "-0.42333061557010883882354822553928367977775546558862846731428990097251635975746596379890252942322037664035286827503209093208408256255231421014944730660470718734689210549504423397593200206756591796875",
   "-0.4235427175706410733684443839629442797423957962325370776829319822410590233711289212852658896522517974883330016520924853319850776350375399565287422929350749525954228369428733458335045725107192993164063",
   "-0.4579315176748191693813270935524521596995674056698169621864027879472036884032635505766221402684133856262000342020126364812790740321082342162022351028959357645189282015607545872626360505819320678710938",
   "0.4035873334530771572097037245687692233938033930007708971961003930525537229778950328119942524704111991812402448511392718785229731693390913563765677610104283382953804792947494206600822508335113525390625",
   "0.4446188356681540839739546233490822697249066317574359131816572240283918748231259148029876399488080130992220522253344025285771170513400834769736022062818827651434899772553421826160047203302383422851563",
   "0.4454015420814767027863394444599725367794509364122780196053990075316767251680183363762705101972847517897571981030991481955189521632763040820382880129638222994892249317899768357165157794952392578125",
   "0.447888390804228297783829187965384428451246011477731903406599745795729930586720691050761438599705740806759187656635501632973596447935390475180077613724435718102478976021529888384975492954254150390625",
   "0.4507081160711078908365949335726527837465030372901658103007221936098584396133446379988339151368940234052115143034022749778126561349111083418886536806386797367716956497218916410929523408412933349609375",
   "0.4523256645840966226837486004192628862171819006024953318029732200916452146713615732567672542663300025864541539209658315477089277804827934375512188179637651172255302656211028988764155656099319458007813",
   "0.457154218387211472944828530221069855051955371258825743119055564046533103472563598803071398161219436162247638823295892037828083117088586407899947770072134121781270987838752262177877128124237060546875",
   "0.8352896851829538998360041193665823984915026952681915527945548980598554253725191723597339589576962902016509707014357141006335752246874360545350021610833491714828008545268289708474185317754745483398438"};

std::vector<std::vector<std::string>> atan2_suspects_2={
   {"-99.93240353772134696635944540337356310548233332139152190116862811252626477225925178133316245149446495159560461609923291978908651711901119512481834845372362906030377915911344643973279744386672973632813",
    "84.20571388733685147328522852007718601993704764881267407133239069308893680845190944072928684629439606946842456733948783295969551051246382045976892854687080873683779902449941801023669540882110595703125"},
   {"-87.26828256730464361024954424824834418857615140783849730852826779670995702330294402384695134771055842693380199379389595574543710995480032083765284353578469921900069572462399491996620781719684600830078",
    "78.31441160635445319648431233026220007099832307344869679001119975903794844535343028743413952597646052985223338453980147160527514038036423654418382137346310432239951393462717987858923152089118957519531"},
   {"-63.67535571911244848029855702657389032977543908094458655755579341754358325173222571202228846018948538840873860791393670986969544379855314727445716375730161720682045295438555854161677416414022445678711",
    "86.72748305239594935789584970948171790586899554672286357763332024470525325886102060704435440577839172465541826948311157425864643498968061344269834074958103414896420924051767542550805956125259399414063"},
   {"-50.52073117573046379505863195291818771650096505630506385642968860247841278608546778865681533834016680876912192874887480513926592881274699386515284850939858717435750057322962902617291547358036041259766",
    "96.47416365760110526897077989170691686146652579075275343119283080484864810620504633404846274787255366501250858413587188900892848246886864441910430761529663860149794163412195757700828835368156433105469"},
   {"-48.27531685419943103001346034868812592266591222617483677396914812502192211278093206777314991538050974292662618262314565048012526699010946034206229338407814821786199349640256173188390675932168960571289",
    "90.20521065404255992331769900356865241596547737272663289117306666895020711926322267943617274752691759585464623781815047602243908212777190473048574246260961268829847714556535720475949347019195556640625"},
   {"14.24387598049236220653827473829323146789959760029751027715779350303216618789070108287329498629004770050868954788417357688458833697334715362549319124221766245984646670486029051971854642033576965332031",
    "57.55181448699688831676908949120742393690773547630995707783856657682548077695664955544801907333620817555081316606503672351716033244954812836435572252616268436710769695885403507418232038617134094238281"},
   {"21.57772795263140359501296008523029287980340676814970037156118471409727212527771538761298477845568227153351734797277689720143022005614003109817400796155074422935996047989704038627678528428077697753906",
    "94.29992836102026914103151840996140908277881463272884567357182220060097866771476215047563962027219888889680939867596293564172063562200394038076213038347117285746523673850560953724198043346405029296875"},
   {"45.38291091242980164661763772016785908390408055799146700111929065306127584671214083895427053617023518941881355680506006867981779507869875985587797672593357415932874276975894645147491246461868286132813",
    "92.79801836778030321385981316614062451532399687366506954561820985063178879968309667479648357996570028040239955477612702234906645587923152308828502376663463973660919692498794120183447375893592834472656"},
   {"-11.30480246856532176786199324753649251822781472238449364546891268640138712755155887346571608028488143235579467524464712567046429402165630377724334515388713093145614529966280770167941227555274963378906",
    "52.53551049242135586967450784019149838427067525416747614903269943254135841494960050231430688268327768106751327907116335586755859924343980170367240571012462684767976850430670765490503981709480285644531"},
   {"42.96618587760163941351473716021497291972336672027588347438071233228724084215313665835042096353447029743414533847219416745243887855726876564905560129249216907206671001162590073363389819860458374023438",
    "82.83865632444858698269942764669210122001427593041395830413955800024270384103279753664185884028246050427914557283752938329575357760773373261322528797052476833310749593231037124496651813387870788574219"},
   {"-23.36341651117089476965126059877834335705718195246082263009907489201457800942840485456261319028920861992155145266108107899132117468307827661900747709261922594858179591525981777522247284650802612304688",
    "99.88959805289953271889322281709469842909617366916679468082343079111344429998438837364264817887782920404135270167686735246071424494933998980905411333360524080019274273389839891024166718125343322753906"}
};

std::vector<std::string> log_suspects_1={
   "19.70473238157358958631294271966993405552052522080522501959496633033062689553937291658402759938623151729551343768625256837323029494525038494763153777361591682663367885997018902344279922544956207275391",
   "21.78154912147272759075095169166518754096322704725512641574730086455397830569136646221740900398390662337581301728747776802472239656075920762190755998136371831652539909907062565252999775111675262451172",
   "41.21007860177808810771931087947368655312057851879159133632023656928228484400367042013038867215686473879836527948441488329993311246818042545035974468847623478247321759937449314747937023639678955078125",
   "42.48052874210482107391863080587384930245776807356043479685900503403073246176145315951556285218820924190176789095361260634931512339364837418683037188857697194922097283509287990455050021409988403320313",
   "83.40772331744269325039445415160781115326370630110189208830373594866420218182752009836608207526298932345384800462112345315472881988746031556288811809631435716496164478606090142420725896954536437988281",
   "93.49358628634551208918499129325041491871451690589129147080734279701209979553300282753752187139972295302419879630334812093888080683118026728768512406719912678971541597494621100850054062902927398681641",
   "97.63633953296092069092419252620637797667267184368834919112068773032677505485195120468924000612352314298062833888332624103306268552908187925315608348346476530335916188541034443915123119950294494628906",
   "99.64957027222836324588844369224446751331703371109127936422706688863967215200803128550451162815220165495795959657524039067300147567245513261314842280281255836515627577476550413848599418997764587402344",
   "99.99676909051665514282723865416934395445394384060141669872227593339862170930884125993397242527343599386332018735350023007713243093668039031984239460318488067658466988962828736475785262882709503173828",
   "99.99693365239297691788863804841113624378766856832296990441204205269308019773515312328436235761706256474198414516577654131863345055923456705750830638441185407622353864542930068637360818684101104736328",
   "99.99968831235533494122214785158250950465489631646208974209370658710139851913238885322731025082119341397246668765217542443484417935675478426060849348765404635656917076147465195390395820140838623046875"};

std::vector<std::string> log10_suspects_1={
   "2.959190032925426380901069409740621065285920459578532465351692075711931401448009663094767943366082716258465371488494556689328603616801146224403933411354518791085144169272780345636419951915740966796875",
   "80.05539998056558814288663056698478152998132226762801091811280705744175337371115714763106451326350594417935074518720814885242140321239348840899133515924015303639668661439543484448222443461418151855469",
   "82.53948447099344036747459730314552585921302988876048700480340724061677181174490787426043429636206889758308797170733404543073302930966450376525008117794431197538837507998721321200719103217124938964844",
   "83.69430941960451068149933229300298873848378313785675311262250619152103961410318990573686448976150361041990403514218929449752218290495499761868007905567710903640271657977223185298498719930648803710938",
   "84.3358626823985225809813836550271345299711620340134860363679709860510003816229370891508482307640596100392375809297011253823184941228953743216289242694606062382411959532646505977027118206024169921875",
   "86.815822864860425820400100063768802779022377863975537039829327741345830623380811928134327633630420433168936187516693672481245488289574756516335085943544651321257532572417403571307659149169921875",
   "93.49358628634551208918499129325041491871451690589129147080734279701209979553300282753752187139972295302419879630334812093888080683118026728768512406719912678971541597494621100850054062902927398681641",
   "93.73316251513320909850950218631343625099558984181585897760978077383089073279466838392789383121241563867471123696075979088890112592415099714007375292553566711764405361417828999037737958133220672607422",
   "94.69404060695413930254278901969549307912683551249387078199209773508984300056774183360293349615609434830097941998779497775295017849042059896637390378959314528707971736487536418280797079205513000488281",
   "95.19574140416079057339575757537598505293344451557573180243425261278350183010974030802811193624247983681889967334133078618146895340162811884221392365141312390426631129258794317138381302356719970703125",
   "99.64957027222836324588844369224446751331703371109127936422706688863967215200803128550451162815220165495795959657524039067300147567245513261314842280281255836515627577476550413848599418997764587402344",
   "99.78987102483479373218470207753173675982472615779283641917985364124163992691653414577325362711391504131445349382042404311578457770453426349051415588225578254450744142278750814512022770941257476806641",
   "99.99676909051665514282723865416934395445394384060141669872227593339862170930884125993397242527343599386332018735350023007713243093668039031984239460318488067658466988962828736475785262882709503173828",
   "99.99693365239297691788863804841113624378766856832296990441204205269308019773515312328436235761706256474198414516577654131863345055923456705750830638441185407622353864542930068637360818684101104736328",
   "99.9990732389892335090964599073540870179001441867930389201751409964003982129335669311791527420726882836272464337033024068182443816781365348422554148913768781205269053913298193947412073612213134765625",
   "99.99968831235533494122214785158250950465489631646208974209370658710139851913238885322731025082119341397246668765217542443484417935675478426060849348765404635656917076147465195390395820140838623046875"};

std::vector<std::string> log1p_suspects_1={
   "0.3481391561443330288776384781223253285273491338402871528326465297243776365614545188584745056371338052084301195450964079074339760842478419531988868820354125126290828484698636202665511518716812133789063",
   "18.70473238157358958631294271966993405552052522080522501959496633033062689553937291658402759938623151729551343768625256837323029494525038494763153777361591682663367885997018902344279922544956207275391",
   "20.78154912147272759075095169166518754096322704725512641574730086455397830569136646221740900398390662337581301728747776802472239656075920762190755998136371831652539909907062565252999775111675262451172",
   "40.21007860177808810771931087947368655312057851879159133632023656928228484400367042013038867215686473879836527948441488329993311246818042545035974468847623478247321759937449314747937023639678955078125",
   "41.48052874210482107391863080587384930245776807356043479685900503403073246176145315951556285218820924190176789095361260634931512339364837418683037188857697194922097283509287990455050021409988403320313",
   "52.62227676354595022931241752242917899447602138952867842320454099303273661248127342510882996886461466743247610275071840223150783955154814850180865478062053341729714661667571817815769463777542114257813",
   "69.89019734776464890584659220423912003275156239601281094429446596851329899125495085769343351735065369691101645789381530913121503495143311593843408129961594746652406295872594910179032012820243835449219",
   "82.40772331744269325039445415160781115326370630110189208830373594866420218182752009836608207526298932345384800462112345315472881988746031556288811809631435716496164478606090142420725896954536437988281",
   "92.49358628634551208918499129325041491871451690589129147080734279701209979553300282753752187139972295302419879630334812093888080683118026728768512406719912678971541597494621100850054062902927398681641",
   "96.63633953296092069092419252620637797667267184368834919112068773032677505485195120468924000612352314298062833888332624103306268552908187925315608348346476530335916188541034443915123119950294494628906",
   "98.64957027222836324588844369224446751331703371109127936422706688863967215200803128550451162815220165495795959657524039067300147567245513261314842280281255836515627577476550413848599418997764587402344",
   "98.99676909051665514282723865416934395445394384060141669872227593339862170930884125993397242527343599386332018735350023007713243093668039031984239460318488067658466988962828736475785262882709503173828",
   "98.99693365239297691788863804841113624378766856832296990441204205269308019773515312328436235761706256474198414516577654131863345055923456705750830638441185407622353864542930068637360818684101104736328",
   "98.99968831235533494122214785158250950465489631646208974209370658710139851913238885322731025082119341397246668765217542443484417935675478426060849348765404635656917076147465195390395820140838623046875"};

std::vector<std::string> log2_suspects_1={
   "70.89019734776464890584659220423912003275156239601281094429446596851329899125495085769343351735065369691101645789381530913121503495143311593843408129961594746652406295872594910179032012820243835449219",
   "80.05539998056558814288663056698478152998132226762801091811280705744175337371115714763106451326350594417935074518720814885242140321239348840899133515924015303639668661439543484448222443461418151855469",
   "82.53948447099344036747459730314552585921302988876048700480340724061677181174490787426043429636206889758308797170733404543073302930966450376525008117794431197538837507998721321200719103217124938964844",
   "82.67517117638456500713859463508913828190296492870685097812009494869178388826320748212840846194419330771204851488982229094226325653599212273984911301024926618590329963076612784789176657795906066894531",
   "83.67351314519272859899966102704850520221879947193154473663456641368550736494120617520299274593260049882911526932363260909163994476136722599699357992038488120384656654415778120892355218529701232910156",
   "84.97518848517022002854597332019130395717649384673211364185013315786224533761264969206671051442767367235352553472246261658658545240750043375898143387634646911702948623990039322961820289492607116699219",
   "86.815822864860425820400100063768802779022377863975537039829327741345830623380811928134327633630420433168936187516693672481245488289574756516335085943544651321257532572417403571307659149169921875",
   "90.99617028584431012815938339322289293818157649372064824818217574354068152548346508342056214658909481812023242220952597164122030864915709395968633197227665504653627837061691252529271878302097320556641",
   "91.44000514523980485735011946686827048397550672415710436961054381589082098918286708296056498029435461905050570225481013715120150163856142143066128888483438320769307317004148671912844292819499969482422",
   "93.49358628634551208918499129325041491871451690589129147080734279701209979553300282753752187139972295302419879630334812093888080683118026728768512406719912678971541597494621100850054062902927398681641",
   "94.69404060695413930254278901969549307912683551249387078199209773508984300056774183360293349615609434830097941998779497775295017849042059896637390378959314528707971736487536418280797079205513000488281",
   "95.19574140416079057339575757537598505293344451557573180243425261278350183010974030802811193624247983681889967334133078618146895340162811884221392365141312390426631129258794317138381302356719970703125",
   "99.64957027222836324588844369224446751331703371109127936422706688863967215200803128550451162815220165495795959657524039067300147567245513261314842280281255836515627577476550413848599418997764587402344",
   "99.99676909051665514282723865416934395445394384060141669872227593339862170930884125993397242527343599386332018735350023007713243093668039031984239460318488067658466988962828736475785262882709503173828",
   "99.99693365239297691788863804841113624378766856832296990441204205269308019773515312328436235761706256474198414516577654131863345055923456705750830638441185407622353864542930068637360818684101104736328",
   "99.9990732389892335090964599073540870179001441867930389201751409964003982129335669311791527420726882836272464337033024068182443816781365348422554148913768781205269053913298193947412073612213134765625",
   "99.99968831235533494122214785158250950465489631646208974209370658710139851913238885322731025082119341397246668765217542443484417935675478426060849348765404635656917076147465195390395820140838623046875",
   "99.99980639425881139489530425419173716162377231121605478734509506698276741742960896651198428457604619596889548858804799752737675652821704417720153102841036598259077949890638592478353530168533325195313",
   "99.99990380530902530295795905510920235899903286314141323886129322667630484237001660083214385107429306104783040295924530040360957489116975283282852921203740924512015642022788597387261688709259033203125",
   "99.99998403788286500901279927182600208869177405136251372546529095110715488733117439156311403877291427318013068591368512388101692547111942323286560122803877021283557036124278738498105667531490325927734"};

std::vector<std::string> exp_suspects_1={
   "-95.65645304105234649925179995816290972859438595645453791437313687446863256495464202384605154934014312421735004049630907561693417696994998746309870318710918873418048991030815386693575419485569000244141",
   "-95.66190575536958318595527715145668885595375897311815456384192638905117346087436441781791090602057985247336531884554364947037602071746609278742296115265740077461022183857863865341641940176486968994141",
   "-95.66705029774228411107262328857943943744585314959006060483355384668356983269262229309749413667329536008786606671413027928670103538920231318730890911660617382302612687894338705518748611211776733398438",
   "-95.67366893213214378400701332472176825592461314337616870820771703227313627277576777198117690430108238785160127426957824659054660156475579994765425161282872089092525758058371820879983715713024139404297",
   "-95.67510023893840144543310001388915729791942080477097099711968773535442957438409222161386789329351269071616129568019796316002318973854799559756605170966529906508707403745006558892782777547836303710938",
   "-95.68294063648357795130486958405883420372001840863180725740745573052860566018281993004797476637252492152691258147857966232617261924710331752728937331604792010950402691982219494093442335724830627441406",
   "-95.6924388538508054702861917505398281116319198126850113469727348941727572909989966921886224857540697241267064035387603174785900897738890782186842134526889749705780285893297332222573459148406982421875",
   "-95.70007339065080132798771176656224685884053448013665477490599936983476541527917473395708617889145013459559208253559389627363982714220654514000379460109032889029469226560564720784896053373813629150391",
   "-95.70980903517142183408945031994961450097262361623304715950710588016059653015569654783121990561045333565313329613030854858776164599292525127730399216743688398404896200410973960970295593142509460449219",
   "-96.35555541169065398376395875659718577501575910238126864138642340078306816992037639590605661300592779350804585101735354528460328971616576375378988779651988515390949319172619880191632546484470367431641",
   "-96.36323055850501516330205486574246799735292860172982944632735282770718498002597416157405222895448100829543494725658966134954774673081232621359883454928434734455475196845952723379014059901237487792969",
   "83.17738184748644823039665990460374778371489248574480297742203956164175901588054292908783440199439498313588730357014896774904271374042113999618037514479923098722341512356592829746659845113754272460938",
   "96.29919047491362306309629958160281995516904098752768805665615553217147990332629290050044496670752068222517364966759396662094490086525526125828104855807204750465372322665302817767951637506484985351563",
   "96.33022629589096573038423753409311526041407851867139535859650287377915861729807342468215652377097650718868998867281164454388641686974092775922356544355396854072484669195830520038725808262825012207031",
   "96.33992511838100575878263756613646047016215567523147211910088811311618092736124291859397060785179198970252543265878513886038768105455248028684924549970498467528143282656571955158142372965812683105469",
   "96.34040090794071265845254557605996214556494134405521238042632962766339919692025623055742488531646018190087344458206414238773247716779335471882327396139184352320816717707430143491365015506744384765625",
   "96.34139015264380456535555695085892791088241552771742900824431050932008018180040209632115084888804324278632689317610572141650632043838786325900930433481888891114955364436411855422193184494972229003906",
   "96.34388067940791116889513671519139746894913711070695452353854890756311940355545529264689319783086637001017416638825124422883272817058237151842212846815037259693564886120498158561531454324722290039063",
   "96.34438784875215967163522589010416270679104511998021759395670960449874470166184687039044342754660458362023504387133621485522768076121874801657901971239269909999883290119271350704366341233253479003906"};

std::vector<std::string> exp2_suspects_1={
   "-91.59441167269642149218405208370986456044072041256241428327515220328572284947113319797448264947088024003324465796395917599001933223004589531915681703296576627888053723225425528653431683778762817382813",
   "-99.96571331939834889917321725219819829974268141669763448199770525735073408968831357251260959316590950473721805414939655060526517751250331694586007484238888369087322471884249353024642914533615112304688",
   "-99.99950891239458237284601618183596552089658011194924651637654432228235501654357103932649997514292469281683847756268745497576363963487121778290327244216564560601485933677423645349335856735706329345703",
   "-99.99998403788286500901279927182600208869177405136251372546529095110715488733117439156311403877291427318013068591368512388101692547111942323286560122803877021283557036124278738498105667531490325927734",
   "0.8296512474399373727529762592901968520107069175323951835251959450240799075033285470962735100107791899949608098304904975940894075860522071246580279402623279039630938003213600495655555278062820434570313",
   "39.73391475673916436609967570176357994395421236407960379786980771223055992213985212260039861429095774658033707027429213748717586731906594325029259679384271172850745523774662615323904901742935180664063",
   "5.776598116830618301630141805848232662820314152495163201299141696449089722580080998496919084610472379537765514022359926287098789520560980223670654286872584145867345895020150692289462313055992126464844",
   "6.725380659067228714424244894543902925860836981590418791523954463562278834123037986176255760638527169447837906052804398859633833858712164212725241288911874403899995855660165489098289981484413146972656",
   "70.89019734776464890584659220423912003275156239601281094429446596851329899125495085769343351735065369691101645789381530913121503495143311593843408129961594746652406295872594910179032012820243835449219",
   "82.67517117638456500713859463508913828190296492870685097812009494869178388826320748212840846194419330771204851488982229094226325653599212273984911301024926618590329963076612784789176657795906066894531"};

std::vector<std::string> expm1_suspects_1={
   "70.65358109405981056773157015379688249667687393591345516566300425922281050224352992022750930889667548823797451995750055551354619169846225455653928915127524407408313167344715566287050023674964904785156",
   "70.65624471413120698492890837192826759765098948481303803689266227148924520325584847730835942747007725755102400208373244639777690286524469791256370367614293362531693865058457504346733912825584411621094",
   "70.6827551346251228060187894394831204173995642864014359258386831604641049474797439392172771150905149311382133072366205249278393790413275855947816537356759888748036768646443306352011859416961669921875",
   "70.68826291216654223658002975663073664169167121494804699138390717360127637727057923455433779766595301024215430724376918471285600257448040310350666428050569187798574111170069045329000800848007202148438",
   "83.0938209614240731983785208324753255834694699158000276014791841520591994304420196227178619237921334954700560779696651584224086431771340684165043097964050019220427767407954888767562806606292724609375",
   "83.09647201916547439620195135082331732974713406348365093666875446727471037594143004244589723166377475262928909431932332102725412070017653200990117205611771298342377312096118657791521400213241577148438",
   "83.10049731943770083302318844566183611268163500452512260517833245654907279631872027137350970264246320250084912886864304407308555582867296944820779098527289106834725629369131638668477535247802734375",
   "83.10873478688318693335213022995796789790362650313035981996365414268517391706583685623136315873980249335402713103487256194465067360276294749973990867203471274732989870770438756153453141450881958007813",
   "83.12709006281946261154336045385324676950370168409192545784109909092989251463887696209129519185025292623306375333145560740093168072266821543953072864459703594048819996764621009788243100047111511230469",
   "83.12826148237932199792362582090761543326244166498519024368077642047237599027757945278548707108924916219737814687764932376308618639646636743764915760998083891922597055135213395260507240891456604003906",
   "83.13733544136372348195499560418506781348168297662732888116929653927814035975468734877505360708640378005155178911405505961916881789925321788731329124194638970643880804267666917439782992005348205566406",
   "83.15274410756235043070195622386749641184875758384909220272677230420202893845601614428701498051670329598441427604618720526825162030667378511084091467169226145504309921641095115774078294634819030761719",
   "83.157495068090761277814093328091523798949160377934222709193584248759987347217442604840646723126914989458618113943545297152485701431661558555722678401277907049571336273174892994575202465057373046875",
   "83.16853006160512805693288491040049734867642944475839193805462386231159733805917858011040244278117241545244139030963286431700568111626892335256112170930789241575162296093992608803091570734977722167969",
   "83.17738184748644823039665990460374778371489248574480297742203956164175901588054292908783440199439498313588730357014896774904271374042113999618037514479923098722341512356592829746659845113754272460938",
   "83.86483168266489337249065710050427633267903992154757221461841140323195889635224867294836038588759938040910008515866876636177337637274669471836481397922770467676448213900641803775215521454811096191406",
   "96.29919047491362306309629958160281995516904098752768805665615553217147990332629290050044496670752068222517364966759396662094490086525526125828104855807204750465372322665302817767951637506484985351563",
   "96.31234527436687955665290611879742634800341339223151547758563330694474242893376290110266171786433450799555472004188334334659568411999281664205514365992719864710547295061360273393802344799041748046875",
   "96.31692324159570674747248253703755670079594553520732110481751651676117828848787829767829526796012073554999566878061905361936927750202947919528354367066381709703432045799331717716995626688003540039063",
   "96.32237993945550646198519634420156669169127972600878759420706220835146014705661622469016599515877784012978097967349033978728010668349972789528545605259245257793662697842762554500950500369071960449219",
   "96.33022629589096573038423753409311526041407851867139535859650287377915861729807342468215652377097650718868998867281164454388641686974092775922356544355396854072484669195830520038725808262825012207031",
   "96.33992511838100575878263756613646047016215567523147211910088811311618092736124291859397060785179198970252543265878513886038768105455248028684924549970498467528143282656571955158142372965812683105469",
   "96.34040090794071265845254557605996214556494134405521238042632962766339919692025623055742488531646018190087344458206414238773247716779335471882327396139184352320816717707430143491365015506744384765625",
   "96.34139015264380456535555695085892791088241552771742900824431050932008018180040209632115084888804324278632689317610572141650632043838786325900930433481888891114955364436411855422193184494972229003906",
   "96.34388067940791116889513671519139746894913711070695452353854890756311940355545529264689319783086637001017416638825124422883272817058237151842212846815037259693564886120498158561531454324722290039063",
   "96.34438784875215967163522589010416270679104511998021759395670960449874470166184687039044342754660458362023504387133621485522768076121874801657901971239269909999883290119271350704366341233253479003906"};

std::vector<std::vector<std::string>> pow_suspects_2={
   {"99.99998403788286500901279927182600208869177405136251372546529095110715488733117439156311403877291427318013068591368512388101692547111942323286560122803877021283557036124278738498105667531490325927734",
    "-62.32360479056377808925576296372205847769212136887749069151100287357482794103280445979456202281486677012867445195406337582208762623707484776619224607336883006432175224897918042188393883407115936279297"},
   {"99.99990380530902530295795905510920235899903286314141323886129322667630484237001660083214385107429306104783040295924530040360957489116975283282852921203740924512015642022788597387261688709259033203125",
    "88.01480575958066832044412817532837561896404522920896966380796854773651261215877368364113022542440347392679893102108995805340205475872548808628867950704245643562748102617376844136742874979972839355469"},
   {"99.99980639425881139489530425419173716162377231121605478734509506698276741742960896651198428457604619596889548858804799752737675652821704417720153102841036598259077949890638592478353530168533325195313",
    "96.47211274978923721126274278616321758894721719777915826592373706880748294684891048674348065613301448211077447447555831793168182822225066145069120308442344634758044974454094244720181450247764587402344"},
   {"99.9990732389892335090964599073540870179001441867930389201751409964003982129335669311791527420726882836272464337033024068182443816781365348422554148913768781205269053913298193947412073612213134765625",
    "-15.82927754397900268366035184694624577709309060351575133367230217829813567947518767496385813398244779259880155373483777504068580903055502829697661566637564579387506547014652369398390874266624450683594"},
   {"99.99213062797302624916670368849944218950084406648442387631611851662078421059807670722570686919730089139543908606747341775898285600919890006693530326942166778754830791520191723975585773587226867675781",
    "95.97138806764898937027952795022876121046927913403519842708655582873043213583629846710578825314981790098146371803489395987765430687716823118993615669597784483121558074536494586936896666884422302246094"},
   {"99.98338515452891755117976184334977986652695640290751405363764560573991765519185227109337668877767897656698842796898694417606841681736305098818755462330995980669082201508501839271048083901405334472656",
    "28.88628623541926637013336137670683164255786753607890054351811753809217349173306533391541803184083883956051169785983302013735905218070855292185097864151365550273997673258463692036457359790802001953125"},
   {"99.84372113549565577646321244832475643734217387208201611655891108731122365701979343791306075519603107572190503015974808088243096631429701845861063464155891366202597025925058460416039451956748962402344",
    "43.94008058657801122557094809278216276297498215664503914211476804380787446232297980444872602913935351760520640777096341194484933062626148740299038016091687539966051390116774655325571075081825256347656"},
   {"99.02195429042758616011952277596202612354781894874618268253708658651344061672083026279007409932845837447050391439979455413297111125402918653962934300134290027195840822038519490888575091958045959472656",
    "-96.85458508129806896735670228855937497079897657547944797116258422849530987038371548772868146743921373797158571150159054073938249000941034184635056181146426629150793241596062443932169117033481597900391"},
   {"96.39682078910717057124087294165472422039914745197556670923472439083564630828741535016056081716943217538856770388035987111359765686091992748246442502349765784393914591632324118108954280614852905273438",
    "98.89396172339341999154269732461406110412849742570007793096202893889346396127463667441159209262235829647762683995939486929437345835361152329029224596028413847266860803308929916966008022427558898925781"},
   {"96.22715328202139042988384198067132198745009825067737464956693543578271339752041102897722736804263967680333691235131937907423675361841497221758515582951155084654587534842562490666750818490982055664063",
    "-97.9496103046631397018846483571047561184847734174409349854024100018154845922165948036311534942607181472646230157447733275720664323108890305403426734570833389614818997870315797626972198486328125"},
   {"95.84334210680356633450492226742701287941215747176348238214185728685932026652178970427637090790441599713092567823695900319973096700095750097086097026794276743772403592824815632411628030240535736083984",
    "91.59475087964650587374525040843857461589561086983556911662457628718704596562965738578714960371358748391256624798816784167499533186067225499691215988041398285120567313022377220477210357785224914550781"},
   {"94.05683021709671860507630959353720529627955206248098682416904300520291071542724806518529228729342134136753738312073286933382496459856910499665265335327325870807060881340078140055993571877479553222656",
    "80.99476216997588624957286704908552732026981626050983079978893322381847621978283630454972289441681561436601679911855018236972657533287893065568944040132143882262591438880861005600308999419212341308594"},
   {"82.67517117638456500713859463508913828190296492870685097812009494869178388826320748212840846194419330771204851488982229094226325653599212273984911301024926618590329963076612784789176657795906066894531",
    "-62.32360479056377808925576296372205847769212136887749069151100287357482794103280445979456202281486677012867445195406337582208762623707484776619224607336883006432175224897918042188393883407115936279297"},
   {"70.89019734776464890584659220423912003275156239601281094429446596851329899125495085769343351735065369691101645789381530913121503495143311593843408129961594746652406295872594910179032012820243835449219",
    "-99.07315480616290100100036939799521335665658169092034024546229152731023344707633632537264060330788356284245609309829126595723198690718570967481980133951702886785893598098340362412272952497005462646484"},
   {"24.21090398418579784243915574366207085720532754581993316275340352099801067785855275749519566159280908664927844675262794345849623588631181025396933497365066078211431888078664087515790015459060668945313",
    "99.07794445843679462099142263044615498596520514596004489677107222275751319319487109222026365465016165898754408258157626967274132579230081146761555615797953698109870601662407807452837005257606506347656"},
   {"66.4442953199429928562433480496235659672647375173900991454817463646080385897933564850390571170742033314107780406403250920861149522177434975192258123809414295524167215489796944893896579742431640625",
    "-65.29065659903603484132631387674148215804443975744822390782447400795858997579089646773636410904186700730651884950496244494212021285603921690142428976483328736295577710002646654174895957112312316894531"},
   {"45.38291091242980164661763772016785908390408055799146700111929065306127584671214083895427053617023518941881355680506006867981779507869875985587797672593357415932874276975894645147491246461868286132813",
    "92.79801836778030321385981316614062451532399687366506954561820985063178879968309667479648357996570028040239955477612702234906645587923152308828502376663463973660919692498794120183447375893592834472656"},
   {"9.725028954748037904786466690834818076438930019773791111201181649984356370639619226567585887058031512492595602683347312010443377337931481776671044075052153084432263185910017000423977151513099670410156",
    "92.89897067306036451031867215150221030216470241454400431613362734596614279667447871007176199567588330250156177691607112873240081458622391613689153495074442176649906488528074532950995489954948425292969"},
   {"78.32043025534613205424238111957972612755260689592967203339503816001827150036425687693851914285664719219325464984221371789237220694250991750225451865293256555099546400988685945776524022221565246582031",
    "55.91773883325422650220195431929527862558959394033563447904410866784483931369633651853027028041114810105130297673972386197983924886872092502453114702361950581971719587137670259835431352257728576660156"},
   {"65.44342143113292527343222166730154211188801211123201520942030189554248516248146455876014405526074298208884486444387189785599677935633469308039021562638760877612942312708810277399607002735137939453125",
    "-98.99317975408283794830595471176103372595911323413305990681236340869097716077029377497826650939648237410494048374899223215404417947539888205011250100515608722350109627274861168189090676605701446533203"},
   {"83.77575887652585632132817179546130974783846422096195347972546535716555796920607596752840969945473932483363239248613522342500942752922758591544971008340528389481648152692372377714491449296474456787109",
    "-69.84391758960531899888423488024409473281761535833699914226291079617569558891890435530257207530566677537220017404164186752906678110224627666054508198066190131176808608692851976229576393961906433105469"},
   {"89.76067471448291762859037890357233226676013024006614091585931108917128806705940121444674107474713882693444673081199525118481380254448910532220132120295071607475601016545851962291635572910308837890625",
    "94.78844874919068327943264245456754427412086898169618870286055946790608964600940265237768886614775741710628040889354309934517535696403436486819242772249397845866353273791560241079423576593399047851563"},
   {"46.11726957560614499960950381792318773285105951389395785559793068428478267745592203789263190579015369331916136971796043726822592836028251772955530577140581343330294483706666142097674310207366943359375",
    "95.67594747697993293228532122079878818623271466838331357372583974935629606406386178055083966587278136993835944759855659779336278984127575919099493361326177879623566813194202040904201567173004150390625"},
   {"76.41586839889208317986220958021821013011467136763028819235609509054505451175913805918875578164851021657499269132613449244853793265476086999490390251736563999784487832833690390543779358267784118652344",
    "92.86876881884911429504700738198448301447976463408606683465584157695674622078996374008619726835724712493120851658549088628168264320825397086384576558994183786499912458545225035777548328042030334472656"},
   {"82.766862481000637369517361588030768716767892640690714613858040098563452478929871399284747628442404587142371118778486484373222224817045145320047683900799751106902579778079598327167332172393798828125",
    "-46.94903474947938116555962259113728211255832392597198917411485192238168285262687906269853396132840678986297314752879713231930944411675977272203487063322536798409476133109308193525066599249839782714844"},
   {"91.97097694159320474267783246316985098877755715196266187038619034239512832453522578105697094094609468058540513434003581641449373565626872787595677580012763980329276725100839939841534942388534545898438",
    "95.78603294783330529536257819973078697140267961924984421043231033824946107237241048291967888998296310803819611362363093393560960080407161160432680283865103550156039347029945929534733295440673828125"},
   {"76.85423240014607783001527286046181000124497808911981412066700459277452765353816237878553966231022629091628603449675085630608010441972417614582924338135533589883192917557863665933837182819843292236328",
    "-77.92376357856301771607126834235634521860412090612566812188565698703674688233749311104722811590359942948461558751180636970780699266999519028476282443892190289523938528937208047864260151982307434082031"},
   {"96.20001976183077525775731327626590609628250619618110811006821121815080933620809078056424759614516113915747509897947182631956128873461186381555030490997773966470492379432499774338793940842151641845703",
    "96.96387802346115200242834410461127666073201030366018833610243312256738838159477031119081142237159234547966229878882999292641449343150051209310571714917945378587466054298715789627749472856521606445313"}
};

std::vector<std::string> erf_suspects_1={
   "-0.5539733378830852359562573803092999361636612063128457229684596708998519079363670929778260873667446365820891433039884981336264197468229258716870371978459166651450468199513466061034705489873886108398438",
   "-0.6010960672639998303555770694462260242750210186750499199131535979353398075751195109805849344640340721963986318876381507269904329752064993407621943047080898729715020545327774925681296736001968383789063",
   "-1.049152704704096346244703454138650180036676280020333763078943049033410492259845400735862682765699062557904479370141993370438190487458395098905551338317982486194462898865253919211681932210922241210938",
   "-1.050350747331947717140071296030809272264033065836679672982071080257325430453977498123684893866746132252499097187174053060728832527111291028006107586256830680121812648941670431668171659111976623535156",
   "-1.080147562391256383278499787612536031840825722125595037849225641902746033071947852073961963610202999952702357572850791131876643633418061907811133545199389570899695112160543430945836007595062255859375",
   "-1.086553475999670066729997231345199348437019491391793879132449227585747925522093539636495739473401737673907024299986626026657216222845422680161615941984700552157619424242795957979978993535041809082031",
   "-1.0921676904189003286911613071793188242087293873519224447462720642200618490874842617293830980320803797754429378589816393058130431733299936309227056132806731036932745837475522421300411224365234375",
   "-1.12030234813931210844550309821632764940834843769620812483615085405491279276573889376262037693530572213391523972216436029506661286289320279605031341479078380550526983228110111667774617671966552734375",
   "-1.124915687373457355741497975735004993710817268317973725363804198314150228199663195231998170719908337359438867653066866910089042223200542740746082368096625769783233894649754347483394667506217956542969",
   "-1.134660640202316492842320381273277259267853027733996315943220486053575177436408508293044287170747123354155233622491354449359725775277794426113436230824285921294988788154967096488690003752708435058594",
   "-1.144075642941986326393040824445616242135449130655522395488177981565916380113098834180531790100375036516076468833712524724178230668348783834209481655237443956324785987455072699958691373467445373535156",
   "-1.161394017685949078377895688164608932326465626073578062712028433600166387792143740951767726267156880741628376540068290929575278329295391364022929230246964721557159649911739052186021581292152404785156",
   "-1.173552823799557956389635185880086485712921635606535970458265721536572706056294652273854744926562478692275536345056089192771703865522718503399681051134508511825382814919294105493463575839996337890625",
   "-1.205810512888591337349520636423313354842279115314987120708307863233856235465281589797769091531894439376059779415778473068871550926562999285798579460143432169009353183142252419202122837305068969726563",
   "-1.211519095171567378499129241931332998833357775220224116771817995191309386968535177625584242941491871786214639785907470629648761394167060932978069843397646179836840696353306157106999307870864868164063",
   "-1.253474363344210046481710905057541262635755494764175278281876969784154395326079094898625343869390438657821224792121394010235097554993560638915829953160358884367217569000274579593678936362266540527344",
   "-1.303592392841294829224535377763699707640319980195363528185113852442985584704298466331919657326472639982372267963823969980707370658948934776336758283583602200913012514327249391499208286404609680175781",
   "-1.427757412033620532736609253588787603315733059261558503274120406216014418220019578986893379650644672009365025446437341019583281018361483692430126176571270984983971774617828032205579802393913269042969",
   "1.049133980854901256072671048164332286100713050408894292940346107991728127721715141230620913360895250428866279907652566784766311313455327240963109477519162726763188309142549314856296405196189880371094",
   "1.059599698776883180351526464606399219659683649667487009656703908605880964465644936751240587834536943957915861090424241884196901436614908158044484261140830014735411679360765901947161182761192321777344",
   "1.061545256354566443614390596758761472659480509007650734566408875360132225816557196949628591560110926681932975432053867603446756975019635999437675537222925791890765223612902445893269032239913940429688",
   "1.080682039671111657850677763480699361672233318632499507190647296793198128049546897471316650145195149599317727757243734081939663003190102598657117781245226508131385134703350558993406593799591064453125"};

std::vector<std::string> erfc_suspects_1={
   "90.56796490222393737059303376258818541467781146708509329719403251243885144140330624294394490496386054315499701927623406212492475578381023728613109961521407663973329271733803125243866816163063049316406",
   "90.61753630316726310512927834155402728734140969709728102018648548978240419776997415369132668944990885296746190672994996358955429885099357755302339340961750928067977572943902941915439441800117492675781",
   "90.8121795909997009127898207764473820567199758575628068358260946666704371602765483861303001492441169925352201343100890078335744149057039527061681901585910177930605069462899336940608918666839599609375",
   "90.95700779730010276595644995128464426682684440462741244451804469093856475237572407936059095097273520941707335043108092860834526624384352255089403993801308655024751015361061945441178977489471435546875",
   "90.95717335128578368970842195081082500575531855090712779605252042706196394439219264789959593857385407702459601661940914205017713440882075262572925033318880247510535008714782634342554956674575805664063",
   "90.95720225856467668477607874422837154519754206758029808020359614374076495514579220811624717609049356609110263628620061194837841406506526259307406723978178271885000616414629348582820966839790344238281",
   "91.00658970041504892998434771141903998137786025841759541953083431557503973256138675977726333215059521096015411673226194431048254704730674819746085784200606425475496563670674277091166004538536071777344",
   "91.10172305250870345925036490413042656627529303497209847952621591091080139409952391925560937607710487459221110752448411828289717715559711387449115225448470294609959463372206300846301019191741943359375",
   "91.73096013967822637902416462228509184659994913333375698315287016094450586596998400386341289481248526500038762543132207961366660355580285937087410175116695986753667657609412344754673540592193603515625",
   "92.87622983769064367433575578036309098114354899604020033294504115980263907195895611636706579384815017106382457310516323774686796427006172928405251047480199641211487393555046310211764648556709289550781",
   "92.97337805905246447325817011791968139705091968587913510807475725163756053573902221903502897487934210336743801236611172023103724432848986198700222681623376414731391159662621248571667820215225219726563",
   "94.15094696503134169274910401270028841427919892667361885902384281279212644635482246956422119792699005951936264844628072181408114754782458641142780532038577358039041498294352550146868452429771423339844",
   "94.89885961704242451108861408281213389641538796125773760230844635988417430834712963495106173645695652009959529473230531843575880751004181345914644729407623702449950386927923773328075185418128967285156",
   "95.31438988410098729095127598393006821192308595128215804816854348652826465033228189141936395818126275705559318183569046679179119119721225241587501073965290015847784399483089146087877452373504638671875",
   "96.00621914517496838913564855981912105872169408927251645219694575328258242224647686590948298441954682949531068476952188011088580679084260055150946045158766816145917699643064224801491945981979370117188",
   "97.37540107582395317193199545370696704473541629141767611715447066911302836196371723962354252529868768836339067004711820637855263157915323637911045189352554992843688519421618821070296689867973327636719",
   "97.69156760949828673396221381506423096905014758738770951724921388660219277896130463147997118170357541128381717484588183483875748589182169065584831765411187403085752078979453472129534929990768432617188",
   "98.052789895468124768771041783996015821252882670772556271558076648246043423110605187674836149497413852313896165469399789386551390693062469749382043608643653997969380498034297488629817962646484375",
   "98.09895506143554901883452067915987019197765123871658082975722664225818984064370297316153506501855115539548394339262559932814611189803684009936873226168300949701431279414975961117306724190711975097656",
   "98.72549991036381735840514741343404680053359366364059495085316188713935336385658689773377739506353230302964896912942050158080912369813507387799300567778340104391557319196692787954816594719886779785156",
   "99.21580931871425478175541725085722981325215808476039537312236366055743221780593328984957375117667569536223947917252509076090868997296350491140631648120166128940883298881203700148034840822219848632813",
   "99.52617480795054677568914943364295646320591564302866265355063646169296565530030172822821268712298078958602235702644609117005359669488803066286449374904753671384344260175680574320722371339797973632813"};

std::vector<std::string> lgamma_suspects_1={
   "1.265821119205776727864467875676776955677914660602432233921985683850562385285742458531321640040438093925293109288973464320896903941029356078076772489313049619395756817397113991319201886653900146484375",
   "1.288089327928814351836419078633326725230429086479423265387873251554426123201018625433850357250405808910344372920582653166098857584063310279394926369743034651584381866662454285687999799847602844238281",
   "1.360104638202105310734632174282167327273346658760932445571482458040685911637685830051367214018720314249959673508447762480634381276962362990848628548652383632054305162562002351478440687060356140136719",
   "1.378424806057298669727131869630311004118285453795334908324960430182654754836979454998008362772837731770343816136885776546317933558066276678720251800165827427927661696926975309906993061304092407226563",
   "1.418422631982314588614839747284149878221278310423183730233804680164118856051321458926513790021666801587127836139004421628689574399376567880359349060842297441309076133642008699098369106650352478027344",
   "1.439770337656263147575748153451157685841733578956184526685482790826515265187643080064356582839833473809244270790131966600355405628117561247510628467028038498338668449427757423109142109751701354980469",
   "1.455580838550618075123522796434086890414229074478633281746627407688650737052437534579715058226281212707071158208483013103755653768144289922673481272251339230846406413988347594568040221929550170898438",
   "1.486320457895152886338080944082846051359679475272469583396198412178299744860783756622093579954284491643838955016989666618067386378546060469442586939617928493270401779646761042386060580611228942871094",
   "1.569997270503329264649863434884784631532893531937283045766131397030875024704005770314311130070046885969749143576941760684185102404688854554990442901713334941356595142458729696954833343625068664550781",
   "1.583830148029094926125929391015648126699950671967076054842293237921081383830973840046186129917972737989209512385540741266208244247183926211401473523422206494916039676290608895214973017573356628417969",
   "1.615344844312193123418001212925198247481256217259795516153717203077450353992227685788223451344666446321998881771677588042183849480312399605901636779963305884681365465205260534276021644473075866699219",
   "1.639701719366380831605989951428175913934383049594064548434865442411662309372581899632353583311257127476157738418559375177696408630796764754739554003735426209896128280085747519478900358080863952636719",
   "1.718631954020548670761031072760800776351128448404248196903765165582881248904691800096372889585100523573305470664425887063251328343191590538173495771533806728437882016535809270862955600023269653320313",
   "1.729084894765394785741070644590959721014506399421337228670785759617881324472512748521942363498683235471999808900523999946525167426521790710598264962651660666802938548514134708966594189405441284179688",
   "1.741057493137736551249031670187642203607392666163203922614278022994558913333246836656540285040926531204219639115219206772688161133923582125657339825642722487639840744932939742284361273050308227539063",
   "1.747509646057646341400158450680312992955902863318568542548188818929444026043790044322935026269450838577666063613149521959778065458727995243509412581602891644970074191967057686269981786608695983886719",
   "1.748940736130510362522525628951281524877568805795597339522470642183391641094169555335705656856735735791022886322208256542116231517282737253744514136581052378286230131188005998410517349839210510253906",
   "2.295986398977995943532090611383928968846094258837951711037552082705985389758421346446676792322726885933613720323151546842059767241455563431768562715034013991307476620917782383912708610296249389648438",
   "2.309023585364904624727314630892410059379308086710183868953299485466589085827336210331211297667769055808230039598210535576391638606023115837322570330308356477237718973327673666062764823436737060546875",
   "2.338784506624049260470113560097122277287914909469062833466795466508113403216933960470737783329899038446840242972005386278875702052768205661392525497927634187036310953189399697293993085622787475585938",
   "2.377434380383018268863375831400218152417469173022387784513775902815897741738535893557635621919393255414662442591326585878997531729411744869424785424702421658162132533931298894458450376987457275390625",
   "2.410820627379563813161958007362149033419874737509772586697255960890877125065130312799822540853099288290962335154422079602723570205945255517423367064636690113152081571534779413923388347029685974121094",
   "2.423810271320741408889901957235061194051529320215288311724213691294068761415355645670367596222571749622986477455521300249794665220990407672667458153714074734017686063580754307622555643320083618164063",
   "2.437889235264117469002254849078586221983478270451860769958313436149539558930996979100924455142980488908127937143963650439499640741319583101971452450110034826206983904484104641596786677837371826171875",
   "2.444157844719308314027718266589067225383281699577139267713243344861831412981385164353152538947482057543075948288037673222458997852582810410380045992982463203468598833545399884314974769949913024902344",
   "2.44587424254292343102287788384217751133399439677643713677744676099356662353366938372639914718257122650860415291666634166518467425301587671197824931418164456052577460098973460844717919826507568359375",
   "2.448768926440148215670906076249923989290990976696795447798547421037851976543778736108811126054042403028917160437568902846330676883237562298619325426061476050874909926591271869256161153316497802734375",
   "2.449704287120995528515722757648412700028800208377683796819524450737226422201397907799773340016360411202582433584580300265711437724736507819734529620802562256947493279923833142674993723630905151367188",
   "2.485399532808285577900499184958668300064532805164875170086589602436740433788080051226651169622934880977008763035765974380500770475043500999606443408716211727069525516675696508173132315278053283691406",
   "2.5598475247127593649401092172796775374193331848468211447713620400015104612400424885953045119729166770633959337380116500384140678300757656110109656456225797789560960637800235417671501636505126953125",
   "2.612737982042608659895165943131283813819198683580242031050051437133171799908371243170870186472969977288915902769765705711934376955432006286682649286667508585404323673273552230966743081808090209960938",
   "2.662834975890742089567882895503373125407817746405519963494888954133642568124485382177816379440152332031210245960073361163024524620399703508042382197374202369103551868434465177415404468774795532226563"};

std::vector<std::string> tgamma_suspects_1={
   "-13.84434269554495783743402597183809475713040070969337593101338420001524092179430964080896929410678711800898330567755878468666890157726246967670583999759983679766345288086881737399380654096603393554688",
   "-15.73606255635348930406430675898903077327778525123481926630706457480564768230418298855932815114879596305648746566826709238793635624816065807957821140335105770187602847176577824939158745110034942626953",
   "-24.39533938914037519904340669782883393843755731728665622122106414330354599913581988992455807818416923987787629265763471268759393339210088402926973306483738706791977723931097443710314109921455383300781",
   "-25.19589620543179814909094172303432814133713508768451885201830602238490586082017718958403502211165076000022756274322670476508649605244189795114035788739250985098123980510109731767443008720874786376953",
   "-47.88303854273925823483142223656735276505087279783272096163311650548788217824815078186409479602238745376122600465627946452227560053191342896775101387161210434177845141068274870121967978775501251220703",
   "-52.03637051426932415173647649187724950327604911497517507759111120638907133676632819184012985205908494633945720848706234357629684292455081570650890240619024289204716526846539181860862299799919128417969",
   "-71.02072541096740305629511041693479341822683859793986326988836614463723656194095756744343661844137805072599665154479671038573027745764553081534074093279439133467173528302396334765944629907608032226563",
   "-73.44841476833961465767528152788719426256347555429650082041461486725337740795909803013093850112281068248209060674158730502537769915870088224152377438282358318292521170977948941072099842131137847900391",
   "-89.8910591651547714075653773592373993036088925276834538617392589867196611784662944400385934013096043745502068022052148020060788633420044964769258099753578114717023073154678058926947414875030517578125",
   "-98.01144898514223000155143466523712975541719997074105071839714610754772355948033107028161716128939425021593424611057085265112245117093342405441705078378910473099229483384675631896243430674076080322266",
   "-99.04666355763885039980101496401654151552584472062957762913938830846589153127871730643033881618766902973442971025305892882297547641240367805238961396777998922734582987192908376528066582977771759033203",
   "-99.81775605439772318944319031496873800133455722556498752803736733927534393262150683970060783197361865169803969390225489662577102692126006059902779709569744519986368713748703385135740973055362701416016",
   "-99.935215006915102204089361713296653451849628458977595384726990638834028961915895973798603212520564584965579999452976079291371776573727941908909871061392096551478925192668611998669803142547607421875",
   "-99.94919446560380251221271760228870820850883028046882945679967288893560694706374946698641270377353963457186081380114996190429038723718657241836002711180803157083041288188951511983759701251983642578125",
   "47.74668335928421417241247862895015257355915969569044798007886327109159810136373804904098084886746089364983470954269066808883606930518451942823634477160435262777307685588823460420826449990272521972656",
   "65.66461344984839614140017317521446464889859147551598750152047387142379383784285741586227164001415839772032864543093214946205392767528906182791989761238256312477976073260776956885820254683494567871094",
   "66.47515322053400485129252623320020643737586159438069956666366114329497394898353772387096168407306411638702636786472284066173542867041984895802341361439886772716906238045453392260242253541946411132813",
   "90.50555292044106082527216208068832010917980309067463662962193093005937737624841020013401046222971424861393440721936344525559579327974662873891786219994354956023055458480541801691288128495216369628906",
   "93.60286464473754735539098106085798595532252005735293545355980549129435857110566941314183866575828348960466515525578954902754804185368998028742682726986343820507752155890557332895696163177490234375"};

std::vector<std::vector<std::string>> remainder_suspects_2={
   {"-99.99949983371109390083803876741917190058773967252023620170814443062954650781090327117007179404785117866735140365081793283492837225454077790768997193537188895254980147697665415762457996606826782226563",
    "-37.46461229500675312839362420632310174645278730423004395031570542596726540828900763940518006204083169615140113282756602553722272313516782267815485340647434899321883278178191289953247178345918655395508"},
   {"95.19378996318507545226448546777466836590596236886580089520834912298744868719203320133504681765447786471531362527821873423779826686794525628932990895608686122324540446193452680745394900441169738769531",
    "-36.39617624101530302894445523770836902255961879720596471110196335220558162119525184133861154385223284594299183431441952022917624367414147089758387568215420547750472285430944907602679450064897537231445"}
};

std::vector<std::vector<std::string>> fma_suspects_3 ={
 {"-99.99998403788286500901279927182600208869177405136251372546529095110715488733117439156311403877291427318013068591368512388101692547111942323286560122803877021283557036124278738498105667531490325927734",
  "-62.32360479056377808925576296372205847769212136887749069151100287357482794103280445979456202281486677012867445195406337582208762623707484776619224607336883006432175224897918042188393883407115936279297",
  "-68.477384654446740773948721258950786933168795207147634942754832709909232301282068538202471430648261722687166520341207175980033449167006640796820982872543923970776180709663094603456556797027587890625"},
 {"-99.97863896082516754893590643223596927712042635067157870264803874111273647527952281320363015487072410161881896439046495042562488536207389830899097119038119028835813473232718706640298478305339813232422",
  "0.5378916974379889950973345532133114259714533903848795018800253027823466304778371781446423783291172266366048351473146271455393393092733725724967852634691828069089108987910208270477596670389175415039063",
  "55.93244077795920010599620976525562201807076827739131046388583392988389936591419829226786653743254007868988211462465432253268252674882669946986310847110161390514926349482038858695887029170989990234375"},
 {"-99.93730962642329869565852153741585030920196575271247086042617057098791548301703760938341467470210230377606266527672885263830405466565440097004494967672066202922509514650073469965718686580657958984375",
  "-0.9096759385458036953018566242700420688944973662509170738281935466872328156938607227195714616167355168819591161445924005412706862657666071840659667516465452369572169954992091334133874624967575073242188",
  "-98.36323376829600789044064113576072512294382381486346205695625918173618074435923608782203739958265237919876281055396524743302847387548741203968913871228356218270015565163788551217294298112392425537109"},
 {"-99.92921475103066297806474371877762672369099602825746323755466821019950748113635775448695488307909402916574426248736995152509209742524590332410484460142970447008199663674332668961142189800739288330078",
  "0.7477104984070327097167622682884199277948933220404673367082629639066868213446845055257644415970262200031793698252368361093929004832618849509228290667049821407487419921977789272204972803592681884765625",
  "74.86138555829141298444718172713148639749259870988202645376658335918490939371572514001287775449971956922526144581603202279705407003456216981133599824000768134524275154717543045990169048309326171875"},
 {"-98.70962578994408723045157916436644170306417893092872649497370719117068626825178422304525943287968336345696830876188523735853934776399717642404867528895602064474210091127304167457623407244682312011719",
  "0.8948018674445464031790583269868278379189207272036318180450762548050116375166463630271347134211460439387886388812375602704336957260894136303551995998552865579141885055136640403361525386571884155273438",
  "88.41687430183951550095466846447763356832918441925357862690344047397205144812560946408292596197967457714928576096271055875267459110998575221064430911564286454150732308399085468408884480595588684082031"},
 {"-98.19141900908955301685393092243492073925521897284267357435659695290289639043862800663963301458596875073825518131544254337868564005724107631730950233858709933452979523593739941134117543697357177734375",
  "0.1768222565039872234818096504821376380635039860379477862828403169975080603885405455960836570416737920257428360053864859243831523588904787188874212540528124627987882622193183124181814491748809814453125",
  "17.35792113704959498296819003995796163630075677900536847019322186777545174495697204219009191777077804826579558163538820250531184655193661222166755078557700924229284522581906458071898669004440307617188"},
 {"-96.41653640104629063221746653318192220461746657588174179489576701193155734848969589841727459498867129915411448466263209366175591640109806258977615488993353663142032994315400173945818096399307250976563",
  "-0.4114601627472705274833211822776253934913695763949409133451024060493553849293358878139952843389719672252740579002637319792050899370393277750880737643536713265147303220103935927909333258867263793945313",
  "-39.73120716659900926625457540521005570697291385439285533398825944921638119114539469508407370465364632448930062207856462777155433766983295109816454345262087554681556395008712456728972028940916061401367"},
 {"-93.34452605018188476031075891302298300787781666335386619796238613944646588107779871468725907948817915885892430516578442546719232978810946029583571720899503037106176295267800924193579703569412231445313",
  "-0.95593626338643037259946189249638492189885343507798795465543169870314283140810015819045439868852778542402736520963708093173582568003745378288269733524278666710050078592075806227512657642364501953125",
  "-89.204807763822900713947606915991369004164960166419711144986856538760291783173747479331995115925732749557056376121443975495209911941831348598878842695914285175484703671600072993896901607513427734375"},
 {"-92.41884097668964703162085816744780154206096510788599459006193593379194021418115692249283689146925541508391575197557645172179413151464865688032400646821532490650732971637637547246413305401802062988281",
  "0.46721644973365601360133602238548895907862098406622072706034309566800215546218584935514980265179575405374460581236738760590882160438856238290914946721340585134019107726999209262430667877197265625",
  "43.1803311978604564169383897713532689475466446393217746344408051982016068191582531106463642440364694513352131182034723647935400394961893836912807402147128875424808569505330524407327175140380859375"},
 {"-1.476969570634975829272113848746629387182035423718208732476833842529269454374984888722796701733209070795057708932088115990244348671756253139294594580938727203375457341927301513351267203688621520996094",
  "-32.32413967465502274481843771145054141826105787185973636003840547150490466453617571638888892808919661157566229250430432197979947824215503544615815442076766313465006896787912182844593189656734466552734",
  "-47.74272546976998846977612871540603433981901105217982198929351168063345623855575040819207707636100213080537336900188091190151782219953237093412211138897178825583975797508529126389476004987955093383789"},
 {"-1.421783360964730047598490848880447742252522406951848566475325490929698846740576931609680686436973061553113778205492201410142984651049591772804075455604641130703119644707044244569260627031326293945313",
  "-62.21235642291868318487652607108693419099596572359424965055403738193404809896257031400040934304536303988045384281863372836858930278848754121048169652049403109293421176850813480996293947100639343261719",
  "-88.45325705790103651508622037577547245129559551942473032128500032542673461287623121490274115473850131484511700521356168733984088571057122340474637392372784144888367419135022373666288331151008605957031"},
 {"10.52245479364171710124369182483549042655136301022143807909380221850222188213062076314405700476567987026117275039463792102765481840902407337036543231727100223367107889593796699045924469828605651855469",
  "3.899511171406791275550558018501650776776903364057999896046815060959830732986920473695844331137014979502956586356918292761640683806812259268842953700335981847375707576297543255350319668650627136230469",
  "-41.03276964664330652408881234871744899356348066079963137497630022879307039732592718312913783255765999635493347005675998657349450599411549557269066633331285862172979617135126773064257577061653137207031"},
 {"82.67517117638456500713859463508913828190296492870685097812009494869178388826320748212840846194419330771204851488982229094226325653599212273984911301024926618590329963076612784789176657795906066894531",
  "-62.32360479056377808925576296372205847769212136887749069151100287357482794103280445979456202281486677012867445195406337582208762623707484776619224607336883006432175224897918042188393883407115936279297",
  "-68.477384654446740773948721258950786933168795207147634942754832709909232301282068538202471430648261722687166520341207175980033449167006640796820982872543923970776180709663094603456556797027587890625"},
 {"36.05741188605105496381185948571826860229314628197615497900521522548421103305333644375526061061637728176161247261271955636219287849379960312505073369310248828896806050359202799882041290402412414550781",
  "2.649908661821448076905981974826927552507882568720685261029173129399148047505624376769393045021870206014243496940218507507063309770120533697133009658276918727544055331968309019430307671427726745605469",
  "-91.90577770397457501268407247300176268271378634483502361617933964332893725129072640231094324355410183712688672511130921176960517026741452740173522523527921364088974498507411681202938780188560485839844"},
 {"11.3242842338660983214924819426554332856486000481948026288635777965507331621360057331000781059093199104735856758376368301139834893296570042626847869528806098983475525443509468459524214267730712890625",
  "7.524284310567224813543066395350885093685243963318013367039104123578026594613516449999167722804781573598555134572267419802767254927967240447082362701146167441616438575913150543783558532595634460449219",
  "-83.68432517181279528203539270190807138205872082842354170708161105702315724358469510368322445222345742032079812951458685232501959307861712088506081924144213828866897819658277057897066697478294372558594"},
 {"0.493799557155946150005298715246120324666313018949980154106549877930576277047666547781834488310141280276859622444185761516769112702729533321560232520107362329427058700304087324184365570545196533203125",
  "-75.35945893969068531451523687981508345033925142964694992241666126288927718210985522960397438456747686245331633286857640992298888450092644061854919823375434674290855585621073942093062214553356170654297",
  "36.99847977856174571470997406356122222861850160202213580177537171893794992256030953703602231395996377932582453334591073735036269357897604741229401496666182367180700230058221222861902788281440734863281"},
 {"-17.40449516503741957127097699371304945436346798720946473371159686838289417694583796080258639748261860010503805615386331160812114633773215972475851224990775272753046332141479979327414184808731079101563",
  "5.148097930948806778985271318046031457560449913873469738578819415862067432360074676264370543580305393843993846820545426370609012191340927548545686205756475065879046448813483038975391536951065063476563",
  "89.53758782010343114929087302327921042595771617438992263945256894157397052220060957193795102045400029448717596564115980387081319046602802584257768575706795769484150349093454224203014746308326721191406"},
 {"2.051186163733768223510590603340335525370538192341882647273125939776962663134612093667403476585115503177417487825782842080296228422573699067211798861957829581215487224632454399397829547524452209472656",
  "37.71411738811198995604110250414632318125008528047054790433428431171039252252793407559235728417554022760300210714123218760608393145020531118842061977507313893284018879725749684439506381750106811523438",
  "-77.48237967905408159224310504345398605614167805886916529606385316758283036131788200061380860774026423581697960905473401594554786689416265221241784331283286400967810769735422127268975600600242614746094"},
 {"-12.37637050444309445921915004019541094002697301585299664811627770679257963528776226126001988470292210234136090788743240565291450559412597762325371199557413160819221986663762891112128272652626037597656",
  "-6.516576136190587759199849543706132991724045125249555172135013169126177502461313991672702729646326097338000747155697926341492409732556424399969875262756138046627354953876931631384650245308876037597656",
  "-80.66607139641551247506377870829021713675658898380255649925836838780412468195462411115635310410211077813960795395750088924424955205412427199906644870531067544180622852501016950554912909865379333496094"},
 {"28.86382646919547451704802146558570204667176129200120383736328754193446432280602654739983984395786925252355041424685510746821564041731449426350230758472895022277715515457430228707380592823028564453125",
  "-1.68169675859976659383108338072526819755655584974521789613087401183387429879714920504893731220566066433092139915659379637884440972895014577991321577305253685830077614582478418014943599700927734375",
  "48.53734791677608379847515894354257120428851375072728167564923591792191117893707827107533528325788892277101256123040410087050211980736690319633878728204182817365999746961335858941311016678810119628906"},
 {"14.81907944221615795927300817825273323995258820785195324332346982881369733699449486066221176276821157545838038881434799007345102544573284121878574555603790032496692996577536405311548151075839996337891",
  "-3.024092028893032998898037474424243217454778126961661781059166784284979411408748343348369036784714581098643994878982333163366632204535022736905824208784335455166975004104301660845521837472915649414063",
  "44.81362697822899286251799892615869688597041363079893492164366410201780367688078493943571695058903770330197777614503834753577160082859132127624400139780803101934372745240864333027275279164314270019531"},
 {"-0.32136064705709597454683625174723961593146173639012134904467758003590583919808930814050545965484123350604583749902317747452315051081556469722141906597624489046183260398947822977788746356964111328125",
  "-65.64354627956646625097715733666665491618131408779487529396175690077268327865095453615604564488129093915721722656803846253607611149693841196313924222157921262816790419769574782549170777201652526855469",
  "-21.09522851245033636306402211225949554094174191622852088230859853405429426073319491152815162110789708135363180731077163134358817681937892456607698197182937716368487934825992624610080383718013763427734"}
};

template <typename Type, typename Reference> void check_args(const Type& arg_1, const Reference& arg_ref_1)
{
	if ((arg_1 != static_cast<Type>(arg_ref_1)) or (static_cast<Reference>(arg_1) != arg_ref_1)) {
		std::cout << std::setprecision(1500) << arg_1 << "\n";
		std::cout << std::setprecision(1500) << arg_ref_1 << "\n";
		std::cout << "These are different numbers, cannot work with that. It is because 'suspects' were prepared with 207 semi-random bits, 62 decimal places that is. Some extra cutting and "
		             "casting could be done here to fix this.\n";
		exit(1);
	}
}

template <typename Type, typename Reference> void test()
{
	using boost::multiprecision::abs;
	std::cout << "\n========================\nTesting:\n   " << boost::core::demangle(typeid(Type).name()) << " against:\n   " << boost::core::demangle(typeid(Reference).name()) << "\n";
	std::map<std::string, Type> errors;

#define EVAL_FUNC_1(func)                                                                                                                                     \
	Type      arg_1(args);                                                                                                                                \
	Reference arg_ref_1(static_cast<Reference>(arg_1));                                                                                                   \
	check_args(arg_1, arg_ref_1);                                                                                                                         \
	Type      val     = boost::multiprecision::func(arg_1);                                                                                               \
	Reference val_ref = boost::multiprecision::func(arg_ref_1);

#define EVAL_FUNC_2(func)                                                                                                                                     \
	Type      arg_1(args[0]);                                                                                                                             \
	Reference arg_ref_1(static_cast<Reference>(arg_1));                                                                                                   \
	Type      arg_2(args[1]);                                                                                                                             \
	Reference arg_ref_2(static_cast<Reference>(arg_2));                                                                                                   \
	check_args(arg_1, arg_ref_1);                                                                                                                         \
	check_args(arg_2, arg_ref_2);                                                                                                                         \
	Type      val     = boost::multiprecision::func(arg_1, arg_2);                                                                                        \
	Reference val_ref = boost::multiprecision::func(arg_ref_1, arg_ref_2);

#define EVAL_FUNC_3(func)                                                                                                                                     \
	Type      arg_1(args[0]);                                                                                                                             \
	Reference arg_ref_1(static_cast<Reference>(arg_1));                                                                                                   \
	Type      arg_2(args[1]);                                                                                                                             \
	Reference arg_ref_2(static_cast<Reference>(arg_2));                                                                                                   \
	Type      arg_3(args[2]);                                                                                                                             \
	Reference arg_ref_3(static_cast<Reference>(arg_3));                                                                                                   \
	check_args(arg_1, arg_ref_1);                                                                                                                         \
	check_args(arg_2, arg_ref_2);                                                                                                                         \
	check_args(arg_3, arg_ref_3);                                                                                                                         \
	Type      val     = boost::multiprecision::func(arg_1, arg_2, arg_3);                                                                                 \
	Reference val_ref = boost::multiprecision::func(arg_ref_1, arg_ref_2, arg_ref_3);

#define TEST_FUNC(func, count)                                                                                                                                \
	errors[#func] = 0;                                                                                                                                    \
	for (const auto& args : func##_suspects_##count) {                                                                                                    \
		EVAL_FUNC_##count(func);                                                                                                                      \
		if (boost::multiprecision::isfinite(val) and (boost::multiprecision::isfinite(val_ref))) {                                                    \
			auto ulp = abs(boost::math::float_distance(static_cast<Type>(val_ref), val));                                                         \
			if (ulp > errors[#func]) {                                                                                                            \
				errors[#func] = ulp;                                                                                                          \
			/*	std::cout << std::setw(7) << #func << " ULP dist = " << std::setw(15) << ulp << "   argument = " << arg_1 str << "\n";*/      \
			}                                                                                                                                     \
		} else if ((boost::multiprecision::isfinite(val) and (not(boost::multiprecision::isfinite(val_ref))))) {                                      \
			std::cout << std::setw(7) << #func << "  : lower precision is a finite value, higher isn't (only the opposite makes sense)"           \
			          << "   argument = " << arg_1 /* str */ << "\n";                                                                             \
		}                                                                                                                                             \
	}

	TEST_FUNC(sin,1);
	TEST_FUNC(cos,1);
	TEST_FUNC(tan,1);
	TEST_FUNC(sinh,1);
	TEST_FUNC(cosh,1);
	TEST_FUNC(tanh,1);
	TEST_FUNC(asin,1);
	TEST_FUNC(acos,1);
	TEST_FUNC(atan,1);
	TEST_FUNC(asinh,1);
	TEST_FUNC(acosh,1);
	TEST_FUNC(atanh,1);
	TEST_FUNC(log,1);
	TEST_FUNC(log10,1);
	TEST_FUNC(log1p,1);
	TEST_FUNC(log2,1);
	TEST_FUNC(exp,1);
	TEST_FUNC(exp2,1);
	TEST_FUNC(expm1,1);
	TEST_FUNC(erf,1);
	TEST_FUNC(erfc,1);
	TEST_FUNC(lgamma,1);
	TEST_FUNC(tgamma,1);
	TEST_FUNC(atan2,2);
	TEST_FUNC(pow,2);
	TEST_FUNC(remainder,2);
	TEST_FUNC(fma,3);

#undef TEST_FUNC
	for(const auto& a : errors) {
		std::cout << std::setw(10) << a.first << " max ulp error: " << a.second << "\n";
	}
	std::cout << "DONE\n";
}

int main()
{
	test<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<62>, boost::multiprecision::et_off>, boost::multiprecision::mpfr_float_500>();
	// uncomment for more testing.
	//test<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<62>, boost::multiprecision::et_off>,
	//     boost::multiprecision::number<boost::multiprecision::cpp_bin_float<124>, boost::multiprecision::et_off>>();
	//test<boost::multiprecision::number<boost::multiprecision::cpp_bin_float<62>>, boost::multiprecision::mpfr_float_500>();

	//// MPFR works
	//test<boost::multiprecision::number<boost::multiprecision::mpfr_float_backend<62, boost::multiprecision::allocate_stack>, boost::multiprecision::et_off>, boost::multiprecision::mpfr_float_500>();
	//test<boost::multiprecision::mpfr_float_100, boost::multiprecision::mpfr_float_500>();

	// we might test these later too. Won't work now, because suspects data was prepared for 62 decimal places.
	//test<boost::multiprecision::float128, boost::multiprecision::mpfr_float_50>(4);
	//test<boost::multiprecision::mpfr_float_50, boost::multiprecision::mpfr_float_100>(4);
}

@jzmaddock
Copy link
Collaborator

This PR: #270 addresses a large chunk of this issue by improving the sin/cos/tan/asin/acos/atan functions.

ULP plots now look like this:

cpp_bin_float_tan
cpp_bin_float_acos
cpp_bin_float_asin
cpp_bin_float_atan
cpp_bin_float_cos
cpp_bin_float_sin

Note that argument reduction in sin/cos/tan is still capped to 1/epsilon as beyond that the calculation fails without performing an expensive further-extended division. In addition to support arguments up to 2^N, we need > 2^N bit precision during argument reduction - and since the exponent type could be a 64 bit type - that would mean 2^64 bit temporaries for the reduction which would very likely take "forever" to process, even if the machine has enough memory :( @NAThompson : I did try making too large arguments a hard error with an exception being raised, but it broke the tanh-sinh tests - I had no idea that these were calling trig functions with such large arguments - even though the integral is no doubt zero in that region.

@NAThompson
Copy link
Contributor

NAThompson commented Sep 5, 2020

I did try making too large arguments a hard error with an exception being raised, but it broke the tanh-sinh tests - I had no idea that these were calling trig functions with such large arguments - even though the integral is no doubt zero in that region.

Oh yeah; that's how tanh-sinh works. I'm not 100% convinced that the integrands will be zero there since we have so many domain transformations. But nonetheless it looks like this'll be a big improvement.

@cosurgi
Copy link
Author

cosurgi commented Sep 8, 2020

How about using acos(x) == -acos(-x) + pi to improve acos results?

@jzmaddock
Copy link
Collaborator

How about using acos(x) == -acos(-x) + pi to improve acos results?

No that would make things far worse: currently we're at about 10eps accuracy near x = 1. What you can't see from the plot above is that very close to 1 we use an expansion in terms of 2F1 which is actually deadly accurate.... but leaving that aside, the result for acos(1-x) and x small, is a very small number, so trying to calculate it by adding PI to something would be a dead loss. In contrast computation near -1 produces a result near PI which is dead easy to get accurate - in fact we use the relation you gave to compute it - that's why computation near -1 is accurate! :) Currently arguments near 1 are handled via Newton's method, but it's fundamentally ill conditioned as we're mapping floating point values which are epsilon apart from one another to results which are std::numeric_limits<T>::min() spaced from each other. Hope that makes sense.

@cosurgi
Copy link
Author

cosurgi commented Sep 8, 2020

Ah, I get it. The ulp errors are large because everything is very close to zero around 1. So the solution would be to use something else than Newton's method. I can't recall now anything that would help with this epsilon ill-conditioning here. Hmm.. something of higher order maybe...

@jzmaddock
Copy link
Collaborator

This should be addressed in the last release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants