a
    ›¬<bÝ(  ã                   @   s¤   d Z ddlZddlT g d¢ZdZdZdZdZd	Zd
Z	dZ
dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdd„ Zd d!„ Zd"d#„ Zd$d%„ Z dS )&z¢
Check that the output from irrational functions is accurate for
high-precision input, from 5 to 200 digits. The reference values were
verified with Mathematica.
é    N)Ú*)	é   é   é   é#   é9   éP   éd   é–   éÈ   zÐ3.30284713436377391275876803314562380904138995349793353854327927560584122005190453639516359942830710966670018467204785635351686739977424359467433521615861420725323528325327484262075464241255915238845599752675zÐ5.71968116660100761711126139862993996586087395735332073427571622004575031474116300529519620938123730851145473473708966080207482581266469342214824842256999042984813905047895479210702109260221361437411947323431zÎ1.817373691447021556327498239690365674922395036495564333152483422755144321726165582817927383239308173567921345318453306994746434073691275094484777905906961689902608644112196725896908619756404253109722911487zÎ2.225720098415113027729407777066107959851146508557282707197601407276891609981857975041980629117682408088391049870215155556508759777242301303584116233925658621288393930286871862273400475179312570274423840384zÎ1.284905763908469090237158152911094998326118243004089814767205283365366806295344912751148770908342968313734983365598490507558486118542820012501924311019152914021365263161630765255610885489295778894976075186zÎ1.194784864491089550288313512105715261520511949410072046160598707069433665315502577054630913744068705636675765090975470830211520433807759520383005773986664564927027147084436553262269459110211221152925732612zÎ1.887798592169701811162407755044329727684473684085359021296200681166304949387789489704203167470111267581371396245317618589339274243008242708014251531496104028712866224020066439049377679709216784954509456421zÎ1.047120495284080266356771429707876318925635710976967218521933416973494842658098540924372852946866518064266495415042404701682127231333265421818300136462287639956713914482701017346851009323172531601894918640zÎ27.18994224087168661137253262213293847994194869430518354305430976149382792035050358791398632888885200049857986258414049540376323785711941636100358982497583832083513086941635049329804685212200507288797531143zÎ22.98606617170543596386921087657586890620262522816912505151109385026401601793265695261528519838471335139902815184172119647103972331571688524963130831190142571659948419307628119985383887599493378056639916701zÏ-14.52355745029148972721475057159027277466990742447812928090237585119628333771623790317247340500885657109757588244418452781201057288244973083036065619788140201636218705414429933685889542661364184694108251449zÎ928.7025342285568142947391505837660251004990092821305668257284426997361966028275685583421197860603126498884545336686124793155581311527995550580229264427202446131740932666832138634013168125809402143796691154zÎ44.09156071394489511956058111704382592976814280267142206420038656267677079165106527905023991931098195638645689862346548644620952311385005058197456514795059492120303477512711977915544927440682508821426093455zÎ27.06937151157322475047810514673785214166495546126621836721252761227988693223045365532546590492054144277076758021938107113029475363320404745738166261217563960235014674118610092944307893857862518964990092301zÐ-0.1517131067785959009100105773467642307652714505278738858933435052480841958820194977792024529753505790737168112841690680826707789862351790813026562962084477640470612184016755250592698408112493759742219150452zÏ1.2697592504953448936553147870155987153192995316950583150964099070426473683793257717694763253547504052174916238334775882730750452652564775997547638617201824468382194146854367480471892602963428122896045019902zÐ-0.1605565385746906274027479290796804815416443377293815624350908400938437090841460493108570147191289893388608611542655654723437248152535114528368009465836614227575701220612124204622383149391870684288862269631zÐ-0.8589704057744383377635810680377758966432299779412615347706079580109151695416961724733492511852267067419573754315098042850381158563024337216458577140500488715469780315833217177634490142748614625281171216863zÎ-24.4696999681556977743346798696005278716053366404081910969773939630714921513545979447344846573458928749188056318362499743519363738988420602151395451271809790360963144464736839412254746645151672423256977064zÏ-150.4250537824178467180140596587297276559507369098408016075078556581098183144824991354438270553996556459548309313163572437508390881131228165837169201254329464271121058839499197583056427233866320456505060735zÐ-0.9870266449903537839933243924396703889570926141447649573078886400405406821549361039745258003422386169330787395654908532996287293003581554257037193284199198069707141161341820684198547572456183525659969145501zÐ-0.5120252357098200185619569646066397109969226134282754042613621553352686662667660613179619804463250686852463876088694806607652218586060613951310588158830695735537073667299449753951774916401887657320950496820zÏ0.1626668736751881173414010598588351680071378194959989602501421568486396547188094121815433431681748079855599166435491745304598838264510649667996119428949951351938178809444268785629011625179962457123195557310zÌ6.8226966159475384888265861863101625999748271395644339126019184429111026830824380070400102213741875804368044342309515353631134074491271890467615882710035471686578162073677173148647065131872116479947620E-6zÏ0.9999795833048243692245661011298447587046967777739649018690797625964167144641997885223596086284160808141316960103823007312948287483205335757162702259309150715669026865777947502665936317953101462202542168429c                  C   s`  t D ]*} | d t_ttƒ}ttƒ}dttƒ }t||ƒ}| t_tdƒtd   	|¡sZJ ‚t
dtd    	|¡stJ ‚t|ƒ 	ttƒ¡sŠJ ‚t|ƒ 	tttƒ¡s¢J ‚t|ƒ 	ttƒ¡s¸J ‚t|ƒ 	tttƒ¡sÐJ ‚t|ƒ 	ttƒ¡sæJ ‚t|ƒ 	tttƒ¡sþJ ‚||  	ttƒ¡sJ ‚||  	tttƒ¡s0J ‚||  	tttƒ¡sJJ ‚ttƒ 	ttƒ¡sbJ ‚t|ƒ 	ttƒ¡szJ ‚t|ƒ 	ttt ƒ¡s”J ‚t!tƒ 	tt"ƒ¡s¬J ‚t!|ƒ 	tt#ƒ¡sÄJ ‚t$tƒ 	tt%ƒ¡sÜJ ‚t$|ƒ 	tt&t'ƒ¡söJ ‚t$|ƒj(j	tt&ƒddsJ ‚t$|ƒj)j	tt'ƒddsJ ‚qdt_t*tdƒƒd	d … d
ksVJ ‚dt_d S )Né   iè  é   é   é   g\Æ(.{`)Zabs_epsiÌ  éìÿÿÿZ02166121184001409826r   )+ÚprecsÚmpÚdpsÚmpfÚaÚbZmpcÚsqrtÚpiZaeÚeZeulerÚsqrt_aÚsqrt_abi_realÚsqrt_abi_imagÚlogÚlog_aÚlog_abi_realÚlog_abi_imagÚexpÚexp_aÚexp_abi_realÚexp_abi_imagÚpow_a_bÚpow_a_abi_realÚpow_a_abi_imagÚpow_abi_abi_realÚpow_abi_abi_imagÚsinÚsin_aÚ	sin_1000aÚsin_abi_realÚsin_abi_imagÚcosÚcos_aÚ	cos_1000aÚtanÚtan_aÚtan_abi_realÚtan_abi_imagÚrealÚimagÚstr)r   ZaaZbbZa1000Úabi© r:   úd/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/mpmath/tests/test_hp.pyÚtest_hpŸ   s<    


r<   c           	      C   sÌ   t | ƒ}t| ƒ}d}| |d | … d¡}| dd¡ dd¡}d}|D ]}|dkr\|d7 }qF qbqFtt|ƒƒdt|ƒ|   }|d| d kr’t‚tt|ƒƒ}t|ƒ}|d | … d|  | }|d	d … S )
Né
   Ú zmpf('z')r   Ú0r   g      à?r   )Úreprr8   ÚreplaceÚfloatÚintÚlenÚNotImplementedErrorÚround)	r   ÚrÚsÚmZnum0Úcr   ÚnZsnr:   r:   r;   Úlast_digitsÐ   s"    
rL   c                  C   s‚  dt _tdƒd d } t| ƒ}t|ƒ}|dks2J ‚ttdƒd ƒ}t|ƒ}|dksVJ ‚dt _tdƒ}t|ƒ}|d	ksxJ ‚ttdƒd d ƒ}t|ƒ}|d
ks¤J |ƒ‚ttdƒd d ƒ}t|ƒ}|dksÐJ |ƒ‚t  jd7  _dtdƒd  } t  jd8  _t| ƒ}t|ƒ}|dksJ |ƒ‚dt _t  jd7  _dtdƒdd   } t  jd8  _t| ƒ}t|
 ƒ}|dksxJ |ƒ‚dt _d S )NiÐ  r=   i˜:  r   Z43804441768333470331r   Z53749808140753263288i'  Z13401856601359655561Z54020631943060007154r	   Z36539088351652334666r   l    d(	 Z37216724048322957404Z39947338773774122415r   )r   r   r   r   rL   )r   rG   Úresr:   r:   r;   Útest_log_hpç   s@    
rN   c                  C   s8   dt _ttdƒd ƒ} t| dt j  ƒd dks4J ‚d S )Ni   r   r=   l      Fµx:^V l   A?x2JWšxO )r   r   r!   r   rC   )rG   r:   r:   r;   Útest_exp_hp  s    rO   )!Ú__doc__ÚtimeZmpmathr   r   r   r   r   r   r   r   r    r"   r#   r$   r%   r&   r'   r(   r)   r+   r,   r-   r.   r0   r1   r3   r4   r5   r<   rL   rN   rO   r:   r:   r:   r;   Ú<module>   sr   ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ17