1jZddlZddlZddlZddlZddlmcmZddl m Z m Z m Z m Z mZejd5ejeejdjdkp,ejeejdjejkZdddn #1swxYwYejd peZejedZGdd ZGd d ZGd d ZGddZ GddZ!GddZ"ddZ#ddZ$GddZ%GddZ&GddZ'dS)N) assert_raises assert_equalassert_array_equalassert_almost_equalassert_array_max_ulpignore)alllinuxzInadequate C99 complex supportreasoncreZdZdZedZejddZ dS)TestCexpc t}tj}||ddtjddd||ddtjdtjddtjdt tjdtjdz}||dd|j|jddS)NrF)check_complex_valuenpexpcossincomplexrealimag)selfcheckfrefs w/builddir/build/BUILD/cloudlinux-venv-1.0.11/venv/lib64/python3.11/site-packages/numpy/core/tests/test_umath_complex.py test_simplezTestCexp.test_simple!s# F aArvayy!U+++ aArvayy"&))U333fQii'"&))RVAYY777 aAsx511111c t}tj|tjdddd|tjdddd|dtjtjtj|dtjtjtj|dtjtjtj|tjdtjd|tj dtjtj|tj dtjztjtj|tjdtjtj|tjdtjztj tjfd}|dfd}|dfd}|dfd }|d|tjdtjtj|tjdtjtj|tjtjtjtj|tjtj tjtj|tjtjtjtjdS) NrrF?c Rd}tjd5tjttj tj}|jdks |jdkrt||j|jfz ddddS#1swxYwYdS)Nz0cexp(-inf, inf) is (%f, %f), expected (+-0, +-0)rinvalidr)rerrstatearrayrinfrrAssertionErrordummymsgformzrs r_check_ninf_infz5TestCexp.test_special_values.._check_ninf_infHHGX... E EAbhww7788996Q;;!&A++(AFAF3C)CDDD#. E E E E E E E E E E E E E E E E E EA5BB #B c d}tjd5tjttjtj}tj|jrtj|jst||j|jfz ddddS#1swxYwYdS)Nz1cexp(inf, inf) is (%f, %f), expected (+-inf, nan)rr$) rr&r'rr(isinfrisnanrr)r*s r_check_inf_infz4TestCexp.test_special_values.._check_inf_infRsIGX... E EAbhwrvrv667788x''Erx/?/?E(AFAF3C)CDDDE E E E E E E E E E E E E E E E E E EBB77B;>B;c Rd}tjd5tjttj tj}|jdks |jdkrt||j|jfz ddddS#1swxYwYdS)Nz0cexp(-inf, nan) is (%f, %f), expected (+-0, +-0)rr$r) rr&r'rr(nanrrr)r*s r_check_ninf_nanz5TestCexp.test_special_values.._check_ninf_nan\r/r0c d}tjd5tjttjtj}tj|jrtj|j st||j|j fz ddddS#1swxYwYdS)Nz2cexp(-inf, nan) is (%f, %f), expected (+-inf, nan)rr$) rr&r'rr(r7r2rr3rr)r*s r_check_inf_nanz4TestCexp.test_special_values.._check_inf_nanfsJGX... E EAbhwrvrv667788x''Erx/?/?E(AFAF3C)CDDDE E E E E E E E E E E E E E E E E E Er5)rrrPZERONZEROr(r7pi)rrr.r4r8r:rs @rtest_special_valueszTestCexp.test_special_values+s$ F a1aE*** a1aE*** a!RVRVRV,,, aRVRVRV,,, a!RVRVRV,,, a"&!RVQ''' a26'1bh111 a26'4"%<28<<< a"&!RVRV,,, a"&$,888 E E E E E  E E E E E t E E E E E  E E E E E t aBFBF+++ aRVRV,,, a"&"&"&111 a"&"&"&111 a00000rz)cexp(nan + 0I) is wrong on most platformsr crt}tj}||tjdtjddS)Nr)rrrr7)rrrs rtest_special_values2zTestCexp.test_special_values2{s2$ F aBFA&&&&&rN) __name__ __module__ __qualname__r platform_skipr>pytestmarkskipr@rrrr ss222L1L1]L1^ [HII''JI'''rrceZdZdZeejej dkddZ dS)TestClogctjddg}tjtj|dtj|zz}tj|}t ||dS)N??@?)rr'logabsanglerrxy_rys rrzTestClog.test_simplesa HdD\ " "fRVAYY"rx{{"22 F1IIAs#####rarmv5telz See gh-413.r cbg}g}tjd5tjtjgt}t tj tj}tttj |dddn #1swxYwYtjd5ttj ||dddn #1swxYwY| || |tjd5tjdgt}t tj d}tttj |dddn #1swxYwYtjd5ttj ||dddn #1swxYwY| || |tjt dtjgt}t tjdtjz}ttj ||| || |tjt dtjgt}ttj ||| || |tjd 5tjt d tj gt}t tj tj }dddn #1swxYwYtjd 5ttj ||dddn #1swxYwY| || |tjd 5tjtjd tj zzgt}dddn #1swxYwYtjd 5ttj ||dddn #1swxYwY| || |tjtj d zgt}t tjtj}ttj ||| || |tjtjd zgt}t tjd}ttj ||| || |tjt tj tjgt}t tjd tjz}ttj ||| || |tjt tjtjgt}t tjd tjz}ttj ||| || |tjt tjtj gt}t tjtj }ttj ||| || |tjt tj tj gt}ttj ||| || |tjt tj dgt}t tj tj }ttj ||| || |tjt tj tjgt}t tjtj }ttj ||| || |tjt tj tj gt}t tj tj }ttj ||| || |tj|t}tj|t}tjd5tt|D]T}ttj ||||U ddddS#1swxYwYdS)Nraise)dividedtyperrr?r!r$?rNr"?)rr&r'r<rr(r=rFloatingPointErrorrOrappendr7rangelenconj)rxlylrSrUxayais rr>zTestClog.test_special_valuess  [ ( ( ( 9 9"(7333A''A ,bfa 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9[ ) ) ) . . q 1 - - - . . . . . . . . . . . . . . . !  ! [ ( ( ( 9 9!G,,,A##A ,bfa 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9[ ) ) ) . . q 1 - - - . . . . . . . . . . . . . . . !  !  Hga(() 9 9 9 BFC"%K ( (BF1IIq))) !  ! Hgb"&))*' : : :BF1IIq))) !  ! [ ) ) ) ( ('"bf--.g>>>A''A ( ( ( ( ( ( ( ( ( ( ( ( ( ( ([ * * * . . q 1 - - - . . . . . . . . . . . . . . . !  ! [ ) ) ) @ @"&2;./w???A @ @ @ @ @ @ @ @ @ @ @ @ @ @ @[ * * * . . q 1 - - - . . . . . . . . . . . . . . . !  !  Hrvgl^7 3 3 3 BFBE " "BF1IIq))) !  !  Hbfrk]' 2 2 2 BFA  BF1IIq))) !  !  Hgrvgrv../w ? ? ? BFD25L ) )BF1IIq))) !  !  Hgbfbf--.g > > > BFD25L ) )BF1IIq))) !  !  Hgbfbf--.g > > > BFBF # #BF1IIq))) !  ! Hgrvgrv../w ? ? ?BF1IIq))) !  !  Hgbfa(() 9 9 9 BFBF # #BF1IIq))) !  !  Hgbfbf--.g > > > BFBF # #BF1IIq))) !  !  Hgbfbf--.g > > > BFBF # #BF1IIq))) !  ! Xb ( ( ( Xb ( ( ( [ ) ) ) H H3r77^^ H H#BF2a5::<<$8$8"Q%**,,GGGG H H H H H H H H H H H H H H H H H H HsA,BBB2#C!!C%(C%+AFFF/#GG"%G"AN44N8;N8#PP P 7RRR0#SS#&S#$A2n$$n(+n(N) rArBrCrrDrErFskipifplatformmachiner>rHrrrJrJsz$$$  [((**j8OODHDHPO]DHDHDHrrJc0eZdZdZdZedZdS) TestCsqrtcttjdddddtjdz}|}ttjdd||dttjdddddS)Nrrr\Fr!)rrsqrt)rrresiress rrzTestCsqrt.test_simpleslBGQ1a000271::~BGQ4u=== BGRAq11111rctjtjtdd}d}t |dd|j|jddS)NrcNtjtj|SN)rrprc)r-s rrz*TestCsqrt.test_simple_conjugate..f%s7271::&& &rF)rrcrprrrr)rrrs rtest_simple_conjugatezTestCsqrt.test_simple_conjugate"sVgbggamm,,-- ' ' ' Aq!SXsx?????rct}tj}||tjddd||tjddd||dtjtjtj||dtjtjtj||tjtjtjtj||tjtjtjtj||tjtjtjtj||tj tjtjtj||tj tjtjtj||dtjtjtj||dtjtjtj||dtjtjtj||tj dtjtj||tjdtjtjd}|d||tjtjtjtj||tjdtjtj||tjdtjtj||tjtjtjtjdS)Nrrr!cd}tjtjttj tj}tjd5tj|jrtj |j st||j|j fz ddddS#1swxYwYdS)Nz3csqrt(-inf, nan) is (%f, %f), expected (nan, +-inf)rr$) rrpr'rr(r7r&r3rr2rr))r+r,r-s rr8z6TestCsqrt.test_special_values.._check_ninf_nanNsKG"&"&!9!9::;;AX... E E((ERXaf-=-=E(AFAF3C)CDDDE E E E E E E E E E E E E E E E E E Es!ACCC)rrrpr;r<r(r7)rrrr8s rr>zTestCsqrt.test_special_values-sp$ G a1a### a1a### a!RVRVRV,,, aRVRVRV,,, a262626222 a262626222 a26262626222 a26'262626222 a26'262626222 a!RVRVRV,,, aRVRVRV,,, a!RVRVRV,,, a"&!RXrv... aBFBH--- E E E  a000 aq"&"&111 aq"&"&111 a"&"&"&11111rN)rArBrCrrvrDr>rHrrrmrmsP 2 2 2@@@1212]121212rrmc,eZdZdZdZdZdZdZdS)TestCpowc:tjd|_dSNrr$rseterrolderrrs r setup_methodzTestCpow.setup_methodei111 rc2tjdi|jdSNrHr}rs rteardown_methodzTestCpow.teardown_methodh    DK     rctjdddtjtjg}|dz}tj|d}t ||dS)N??@rMro)rr'r(r7powerrrRs rrzTestCpow.test_simpleksN HdD$7 8 81f HQNNAs#####rc tjddddtjtjgtjgdt t t }dddd ttjtjttjtjg}fd |D}|D]#}t||||d |z $dS) NrrNro@Gz?rrN?rrorLgF̛? hx?X‚?SLJ#4?4C?c2g|]}||zSrHrH).0rhrSrUs r z(TestCpow.test_scalar..s%(((qtqt|(((rLoop %d err_msg rr'r(r7listrarbrr)rlxp_rn_rrhrSrUs @@r test_scalarzTestCpow.test_scalarqs HaQ2626B C C HBBB C C %A--   " 3 4 BFBF # # BFBF # #  )((((R((( I IA AA a H H H H H I Irc tjddddtjtjg}tjgd}t t t |}dddd ttjtjttjtjg}||z}|D]#}t||||d |z $dS) NrrNrorrrLrrrrrr)rrSrUrrrrhs r test_arrayzTestCpow.test_arrays HaQ2626B C C HBBB C C %A--   " 3 4 BFBF # # BFBF # #  1f I IA AA a H H H H H I IrN)rArBrCrrrrrrHrrrzrzdsg222!!!$$$ III(IIIIIrrzc,eZdZdZdZdZdZdZdS)TestCabsc:tjd|_dSr|r}rs rrzTestCabs.setup_methodrrc2tjdi|jdSrr}rs rrzTestCabs.teardown_methodrrcJtjdddtjtjg}tjtjddtjdtjtjg}tj|}t ||dS)NrrrMg@ro)rr'r(r7rprPrrRs rrzTestCabs.test_simplesq HdD$7 8 8h Q BFBFCDD F1IIAs#####rc>tjdgt}ttj|tj|tjtdtjgt}ttj|tj|tjttjtjgt}ttj|tj|tjttjtjgt}ttj|tj|dS)NrLrZr) rr'rrrPrr<r(r7)rrSs r test_fabszTestCabs.test_fabss  HdV7 + + +26!99bgajj111 Hga**+7 ; ; ;26!99bgajj111 Hgbfbh//0 @ @ @26!99bgajj111 Hgbfbh//0 @ @ @26!99bgajj11111rcgg}}|tj|tjttjtjtjtj|tj|tj ttjtj tjtj|tj|tjttjtjtjtj|tj |tjttjtj tjtjd}d}tj|t}t|t|cxkrt|ksnJt||D]#\}}|||}t||||$dS)NcNtjtj|Sru)rrPrc)as rrz%TestCabs.test_cabs_inf_nan..fs6"'!**%% %rcFtjt||Sru)rrPr)rbs rgz%TestCabs.test_cabs_inf_nan..gs6'!Q--(( (rrZ) r`rr7check_real_valuerPr(r'rrbzip) rrSrUrrrfxiyirs rtest_cabs_inf_nanzTestCabs.test_cabs_inf_nans21  "&"&"&999  "&"&"&"&999  "&"&"&999 "& "&"&"&999 & & & ) ) )Xaw ' ' '2ww#a&&****CFF******!Qii - -FB!B))C QB , , , , - -rN)rArBrCrrrrrrHrrrrs_222!!!$$$ 2 2 2!-!-!-!-!-rrcbeZdZdZejddZdZdS)TestCargc\ttjddddttjdddtjzdttjdddtjzdttjtjtjtjdS)NrrFr\r^)rncu_argrr=r;rs rrzTestCarg.test_simplesx1aE2221aRUE:::1abeU;;;28RXrx@@@@@rz;Complex arithmetic with signed zero fails on most platformsr cttjtjtjtjdttjtjtjtj dttjtjtjtjttjtjtjtjttjdtjtjdttjdtjtjdttjdtjtjdttjdtjtj dttjtjddtjzdttjtjddtjzdttjtjddtjzdttjtjddtjzddS)NFrr!r\)rrrrr<r;r=rs r test_zerozTestCarg.test_zeros| 28RXuEEE28RXvuEEE 28RXrx@@@28RXrx@@@ 1bh%@@@1bh%@@@ 2rx"%???2rx"%??? 28Qbe UCCC28Qbe UCCC 28RrueDDD28RuEEEEErcttjtj dtjdttjtj dtj dttjtjdtjdttjtjdtjdttjdtjdtjzdttjdtj dtjzdttjtj tjdtjzdttjtj tj dtjzdttjtjtjdtjzdttjtjtj d tjzdttjtjd tjdttjd tjtjdttjtjtjtjdttjtjtjtjddS) NrFr!r\rr"gr^gпr) rrrrr(r=r;r<r7rs rr>zTestCarg.test_special_valuessBF7Q>>>BF7B>>> 26Arx???262rx??? 1rvbe UCCC1rvgtbe|UCCC BF7RVdRUlEJJJBF7RVGURU]EJJJ 26BFTBE\5III26BF7EBEM5III 26265AAA26265AAA2626265AAA2626265AAAAArN) rArBrCrrErFrGrr>rHrrrrsyAAA [LNNFFNNF8BBBBBrrTctjt||g}|rt|||dSt |||dSru)rr'rrr)rx1y1rSexactz1s rrrs` 72r??# $ $B &QQrUUAAAbEE1%%%%%rc2tjt||g}t||}tjd5|rt |||nt |||ddddS#1swxYwYdSr|)rr'rr&rr)rrrx2y2rrz2s rrr#s 72r??# $ $B RB X & & &++  + 2 # # # # "r * * * ++++++++++++++++++s 6B  BBceZdZejdgdejdejejgdZ dS)TestSpecialComplexAVXstride)r!rroastypectjttjtjttjtjttjtjttjtjtdtjttjdtddtdtjttjdg |}tjtjtjtjtjtjtjdtjtjg |jj}tjttjtjttjtjttjtjttjtjttj tjttjtjtddttjtjttjtjg |}ttj|dd||dd|tj d5ttj |dd||dd|ddddS#1swxYwYdS)NrZrr$) rr'rr7r(rr[rrPr&square)rrrarrabs_truesq_trues rrz TestSpecialComplexAVX.test_array-sh0000000000,,,,00,,.6<===8RVRVRVRVRVRVRQSQWY[Y_`hkhphvwww(GBFRV44#BFRV44#BFRV44#BFRV44#RVGRV44#BFRV44#BB//#BFBF33#BFBF335=CDDD RVC&M**HXXvX,>??? [ * * * F F 3xxx=11788V83D E E E F F F F F F F F F F F F F F F F F Fs5MMMN rArBrCrErF parametrizer complex64 complex128rrHrrrr,ss [X'7'7'788 [X bm'DEEFFFE98FFFrrceZdZejdgdejdgdejdejejgdZ dS)TestComplexAbsoluteAVX arraysize)rrorrr rrrr!rrorrrctj||}tj||jj}t tj|dd||dd|dS)NrZ)ronesrr[rrP)rrrrrrs rrz!TestComplexAbsoluteAVX.test_arrayHse giv...79CHN;;;RVC&M**HXXvX,>?????rNrrHrrrrGs [[*R*R*RSS [X'<'<'<== [X bm'DEE@@FE>=TS@@@rrceZdZejdgdejdejejgejdgddZ dS)TestComplexAbsoluteMixedDTypesrrrfunc)rPr conjugatec |ddddddddd |fd g }tjgd | }tt|}|d }||dd|}|d } || dd|} t | j|jd t | j|jd dS)N) template_id@Rv&(=?h V V V^c d d dT""   F1XXvX;     ! ! # # F1XXvX;  QVQVQ///QVQVQ/////rNrrHrrrrRs [X'<'<'<== [X bm'DEE [V%C%C%CDD00EDFE>=000rr)T)(sysrjrEnumpyrnumpy.core._multiarray_umathcore_multiarray_umathr numpy.testingrrrrrr&rrr(rrOr<r=functions_seem_flaky startswithxfail_complex_testsrFrirDrrJrmrzrrrrrrrrHrrrs  *********R[XMM#RVGGBFA$6$677<AL &wwrx';'; < < ARU JMMMMMMMMMMMMMMM<227;;;S?S ""#6*J#LL b'b'b'b'b'b'b'b'HMHMHMHMHMHMHMHMH`K2K2K2K2K2K2K2K2`3I3I3I3I3I3I3I3Ij<-<-<-<-<-<-<-<-|ABABABABABABABABH&&&&++++FFFFFFFF6@@@@@@@@0000000000sABB"B