U
    9%e(                  	   @   s   d Z ddlZddlT dddddd	d
ddg	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         z3.30284713436377391275876803314562380904138995349793353854327927560584122005190453639516359942830710966670018467204785635351686739977424359467433521615861420725323528325327484262075464241255915238845599752675z5.71968116660100761711126139862993996586087395735332073427571622004575031474116300529519620938123730851145473473708966080207482581266469342214824842256999042984813905047895479210702109260221361437411947323431z1.817373691447021556327498239690365674922395036495564333152483422755144321726165582817927383239308173567921345318453306994746434073691275094484777905906961689902608644112196725896908619756404253109722911487z2.225720098415113027729407777066107959851146508557282707197601407276891609981857975041980629117682408088391049870215155556508759777242301303584116233925658621288393930286871862273400475179312570274423840384z1.284905763908469090237158152911094998326118243004089814767205283365366806295344912751148770908342968313734983365598490507558486118542820012501924311019152914021365263161630765255610885489295778894976075186z1.194784864491089550288313512105715261520511949410072046160598707069433665315502577054630913744068705636675765090975470830211520433807759520383005773986664564927027147084436553262269459110211221152925732612z1.887798592169701811162407755044329727684473684085359021296200681166304949387789489704203167470111267581371396245317618589339274243008242708014251531496104028712866224020066439049377679709216784954509456421z1.047120495284080266356771429707876318925635710976967218521933416973494842658098540924372852946866518064266495415042404701682127231333265421818300136462287639956713914482701017346851009323172531601894918640z27.18994224087168661137253262213293847994194869430518354305430976149382792035050358791398632888885200049857986258414049540376323785711941636100358982497583832083513086941635049329804685212200507288797531143z22.98606617170543596386921087657586890620262522816912505151109385026401601793265695261528519838471335139902815184172119647103972331571688524963130831190142571659948419307628119985383887599493378056639916701z-14.52355745029148972721475057159027277466990742447812928090237585119628333771623790317247340500885657109757588244418452781201057288244973083036065619788140201636218705414429933685889542661364184694108251449z928.7025342285568142947391505837660251004990092821305668257284426997361966028275685583421197860603126498884545336686124793155581311527995550580229264427202446131740932666832138634013168125809402143796691154z44.09156071394489511956058111704382592976814280267142206420038656267677079165106527905023991931098195638645689862346548644620952311385005058197456514795059492120303477512711977915544927440682508821426093455z27.06937151157322475047810514673785214166495546126621836721252761227988693223045365532546590492054144277076758021938107113029475363320404745738166261217563960235014674118610092944307893857862518964990092301z-0.1517131067785959009100105773467642307652714505278738858933435052480841958820194977792024529753505790737168112841690680826707789862351790813026562962084477640470612184016755250592698408112493759742219150452z1.2697592504953448936553147870155987153192995316950583150964099070426473683793257717694763253547504052174916238334775882730750452652564775997547638617201824468382194146854367480471892602963428122896045019902z-0.1605565385746906274027479290796804815416443377293815624350908400938437090841460493108570147191289893388608611542655654723437248152535114528368009465836614227575701220612124204622383149391870684288862269631z-0.8589704057744383377635810680377758966432299779412615347706079580109151695416961724733492511852267067419573754315098042850381158563024337216458577140500488715469780315833217177634490142748614625281171216863z-24.4696999681556977743346798696005278716053366404081910969773939630714921513545979447344846573458928749188056318362499743519363738988420602151395451271809790360963144464736839412254746645151672423256977064z-150.4250537824178467180140596587297276559507369098408016075078556581098183144824991354438270553996556459548309313163572437508390881131228165837169201254329464271121058839499197583056427233866320456505060735z-0.9870266449903537839933243924396703889570926141447649573078886400405406821549361039745258003422386169330787395654908532996287293003581554257037193284199198069707141161341820684198547572456183525659969145501z-0.5120252357098200185619569646066397109969226134282754042613621553352686662667660613179619804463250686852463876088694806607652218586060613951310588158830695735537073667299449753951774916401887657320950496820z0.1626668736751881173414010598588351680071378194959989602501421568486396547188094121815433431681748079855599166435491745304598838264510649667996119428949951351938178809444268785629011625179962457123195557310z6.8226966159475384888265861863101625999748271395644339126019184429111026830824380070400102213741875804368044342309515353631134074491271890467615882710035471686578162073677173148647065131872116479947620E-6z0.9999795833048243692245661011298447587046967777739649018690797625964167144641997885223596086284160808141316960103823007312948287483205335757162702259309150715669026865777947502665936317953101462202542168429c                  C   s`  t D ]*} | d t_tt}tt}dtt }t||}| t_tdtd  	|sZt
tdtd   	|stt
t|	ttst
t|	tttst
t|	ttst
t|	tttst
t|	ttst
t|	tttst
|| 	ttst
|| 	ttts0t
|| 	tttsJt
tt	ttsbt
t|	ttszt
t|	tt t!st
t"t	tt#st
t"|	tt$st
t%t	tt&st
t%|	tt't(st
t%|j)j	tt'ddst
t%|j*j	tt(ddst
qdt_t+tdd	d  d
ksVt
dt_d S )N   i           g\(.{`)Zabs_epsi  Z02166121184001409826r   ),precsmpdpsmpfabZmpcsqrtpiZaeAssertionError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;   S/var/www/html/Darija-Ai-API/env/lib/python3.8/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rttt|}t|}|d |  d|  | }|d	d  S )
N
    zmpf('z')r   0r   g      ?r   )reprr9   replacefloatintlenNotImplementedErrorround)	r   rsmZnum0cr   nZsnr;   r;   r<   last_digits   s"    
rM   c                  C   s  dt _tdd d } t| }t|}|dks2tttdd }t|}|dksVtdt _td}t|}|d	ksxtttdd d }t|}|d
kst|ttdd d }t|}|dkst|t  jd7  _dtdd  } t  jd8  _t| }t|}|dkst|dt _t  jd7  _dtddd   } t  jd8  _t| }t|
 }|dksxt|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   rM   r   )r   rH   resr;   r;   r<   test_log_hp   s@    
rO   c                  C   s8   dt _ttdd } t| dt j  d dks4td S )Ni  r   r>   l      Fx:^V l   A?x2JWxO )r   r   r"   r   rD   r   )rH   r;   r;   r<   test_exp_hp  s    rP   )!__doc__timeZmpmathr   r   r   r   r   r   r   r    r!   r#   r$   r%   r&   r'   r(   r)   r*   r,   r-   r.   r/   r1   r2   r4   r5   r6   r=   rM   rO   rP   r;   r;   r;   r<   <module>   sr   17