Ë
    èÿæir,  ã                   óÒ   — d dl Z d dlZd dlZd dlmZmZ d dlmZmZ ddl	­ d dl
Z
ddiZddiZ G d	„ d
e«      Z G d„ dee«      Z G d„ dee«      Zedk(  r e
j$                  «        yy)é    N)ÚjitÚtypes)ÚTestCaseÚskip_if_py314é   )Ú*ÚforceobjTÚnopythonc                   ó8   — e Zd Zd„ Zd„ Zd„ Zddefd„Zdefd„Zy)ÚBaseComplexTestc           
      óð   — ddddddt        d«      t        d«      g}t        j                  d	k7  r|t        d
«      gz  }t        j                  ||«      D ��cg c]  \  }}t        ||«      ‘Œ c}}S c c}}w )Nç       €ç        r   éÿÿÿÿç      ø?g      Àú-infú+infÚwin32Únan)ÚfloatÚsysÚplatformÚ	itertoolsÚproductÚcomplex©ÚselfÚrealsÚxÚys       úm/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/numba/tests/test_complex.pyÚbasic_valueszBaseComplexTest.basic_values   sp   € Ø�t˜Q  D¨$Ü�v“¤ f£ð/ˆä�<‰<˜7Ò"Ø”e˜E“l�^Ñ#ˆEÜ*3×*;Ñ*;¸EÀ5Ô*IÔJÑ*I¡$ ! Q”˜˜1•Ð*IÒJÐJùÓJs   ÁA2c           
      ó,  — ddddt         j                   t         j                  ­t        d«      t        d«      g}t        j                  dk7  r|t        d«      gz  }t        j                  ||«      D ��cg c]  \  }}t        ||«      ‘Œ c}}S c c}}w )	Nr   r   r   r   r   r   r   r   )ÚmathÚpir   r   r   r   r   r   r   s       r!   Úmore_valueszBaseComplexTest.more_values   s|   € Ø�t˜Q ¤T§W¡W H¬t¯w©w¨hÜ�v“¤ f£ð/ˆä�<‰<˜7Ò"Ø”e˜E“l�^Ñ#ˆEÜ*3×*;Ñ*;¸EÀ5Ô*IÔJÑ*I¡$ ! Q”˜˜1•Ð*IÒJÐJùÓJs   Á6Bc           
      óè   — ddddt         j                   t         j                  ­t        d«      t        d«      g}t        j                  ||«      D ��cg c]  \  }}t        ||«      ‘Œ c}}S c c}}w )Nr   r   r   r   Úinfr   )r$   r%   r   r   r   r   r   s       r!   Únon_nan_valueszBaseComplexTest.non_nan_values   s`   € Ø�t˜Q ¤T§W¡W H¬t¯w©w¨hÜ�u“œu V›}ð.ˆä*3×*;Ñ*;¸EÀ5Ô*IÔJÑ*I¡$ ! Q”˜˜1•Ð*IÒJÐJùÓJs   ÁA.r   Nc           
      óT  — |D ]r  } t        |ffi |¤Ž|«      }|t        j                  t        j                  fv rdnd}	|D ]2  }
	  ||
«      } ||
«      }d|
›d|	›�}| j                  |||	|||¬«       Œ4 Œt y # t        $ r%}| j                  dt        |«      «       Y d }~Œad }~ww xY w)NÚsingleÚdoubleúmath domain errorú
for input ú with prec )ÚprecÚulpsÚabs_tolÚmsg)r   r   Úfloat32Ú	complex64Ú
ValueErrorÚassertInÚstrÚassertPreciseEqual)r   ÚpyfuncÚx_typesÚx_valuesr1   r2   ÚflagsÚtxÚcfuncr0   ÚvxÚexpectedÚeÚgotr3   s                  r!   Ú	run_unaryzBaseComplexTest.run_unary#   sµ   € ãˆBØ'”C˜˜Ñ' Ñ'¨Ó/ˆEØ!¤e§m¡m´U·_±_Ð%EÑE‘8È8ˆDÛ�ðÙ% b›z�Hñ ˜B“i‘Ú57¹Ð>�Ø×'Ñ'¨¨X¸DØ-1¸7Èð (õ Mñ ñ øô "ò Ø—M‘MÐ"5´s¸1³vÔ>Üûðús   ÁA9Á9	B'ÂB"Â"B'c           	      ó¦  — |D ]‘  \  }} t        ||ffi |¤Ž|«      }t        ||g«      t        t        j                  t        j                  g«      z  rdnd}	|D ]8  \  }
}	  ||
|«      } ||
|«      }d|
|f›d|	›�}| j                  |||	||¬«       Œ: Œ“ y # t
        $ r%}| j                  dt        |«      «       Y d }~Œgd }~wt        $ r Y Œuw xY w)Nr+   r,   r-   r.   r/   )r0   r1   r3   )
r   Úsetr   r4   r5   r6   r7   r8   ÚZeroDivisionErrorr9   )r   r:   Úvalue_typesÚvaluesr1   r=   r>   Útyr?   r0   r@   ÚvyrA   rB   rC   r3   s                   r!   Ú
run_binaryzBaseComplexTest.run_binary3   så   € ã!‰FˆB�Ø*”C˜˜R˜Ñ* EÑ*¨6Ó2ˆEä˜B ˜8“}¤s¬E¯M©M¼5¿?¹?Ð+KÓ'LÒLñ à!ð ó !‘��BðÙ% b¨"›~�Hñ ˜B “m‘Ø68¸"²X¹tÐD�Ø×'Ñ'¨¨X¸DØ-1°sð (õ <ñ !ñ "øô "ò Ø—M‘MÐ"5´s¸1³vÔ>ÜûÜ(ò Ùðús   Á!	BÂ	CÂ!CÃCÃC)	Ú__name__Ú
__module__Ú__qualname__r"   r&   r)   Úenable_pyobj_flagsrD   rL   © ó    r!   r   r      s1   „ òKòKòKð
 9:À4Ø*óMð  <=Ø+ô<rR   r   c                   óV   — e Zd Zefd„Zd„ Zefd„Zd„ Zefd„Zd„ Z	efd„Z
ed„ «       Zy	)
ÚTestComplexc                 ór  — | j                  t        t        j                  t        j                  g| j                  «       |¬«       | j                  t        t        j                  t        j                  gg d¢|¬«       | j                  t        t        j                  t        j                  gddg|¬«       y ©N©r=   )r   r   éýÿÿÿr   g      à¿)
rD   Úreal_usecaser   r5   Ú
complex128r"   Úint8Úint64r4   Úfloat64©r   r=   s     r!   Ú	test_realzTestComplex.test_realJ   ó†   € Ø�‰”|¤e§o¡o´u×7GÑ7GÐ%HØ×(Ñ(Ó*°%ð 	ô 	9à�‰”|¤e§j¡j´%·+±+Ð%>Ú!¨ð 	ô 	0à�‰”|¤e§m¡m´U·]±]Ð%CØ˜T�{¨%ð 	õ 	1rR   c                 ó0   — | j                  t        ¬«       y ©NrW   )r_   Úno_pyobj_flags©r   s    r!   Útest_real_npmzTestComplex.test_real_npmR   ó   € Ø�‰œ^ˆÕ,rR   c                 ór  — | j                  t        t        j                  t        j                  g| j                  «       |¬«       | j                  t        t        j                  t        j                  gg d¢|¬«       | j                  t        t        j                  t        j                  gddg|¬«       y rV   )
rD   Úimag_usecaser   r5   rZ   r"   r[   r\   r4   r]   r^   s     r!   Ú	test_imagzTestComplex.test_imagU   r`   rR   c                 ó0   — | j                  t        ¬«       y rb   )ri   rc   rd   s    r!   Útest_imag_npmzTestComplex.test_imag_npm]   rf   rR   c                 ór  — | j                  t        t        j                  t        j                  g| j                  «       |¬«       | j                  t        t        j                  t        j                  gg d¢|¬«       | j                  t        t        j                  t        j                  gddg|¬«       y rV   )
rD   Úconjugate_usecaser   r5   rZ   r"   r[   r\   r4   r]   r^   s     r!   Útest_conjugatezTestComplex.test_conjugate`   s‰   € Ø�‰Ô(¬5¯?©?¼E×<LÑ<LÐ*MØ×(Ñ(Ó*°%ð 	ô 	9à�‰Ô(¬5¯:©:´u·{±{Ð*CÚ!¨ð 	ô 	0à�‰Ô(¬5¯=©=¼%¿-¹-Ð*HØ˜T�{¨%ð 	õ 	1rR   c                 ó0   — | j                  t        ¬«       y rb   )rn   rc   rd   s    r!   Útest_conjugate_npmzTestComplex.test_conjugate_npmh   s   € Ø×Ñ¤.ÐÕ1rR   c                 ó,  — t        t        j                  | j                  «       | j                  «       «      «      }t        j
                  t        j
                  ft        j                  t        j                  fg}| j                  t        |||¬«       y)zN
        Test complex.__div__ implementation with non-trivial values.
        rW   N)	Úlistr   r   r&   r   rZ   r5   rL   Údiv_usecase©r   r=   rI   rH   s       r!   Útest_divzTestComplex.test_divk   sl   € ô
 ”i×'Ñ'¨×(8Ñ(8Ó(:¸D×<LÑ<LÓ<NÓOÓPˆÜ×(Ñ(¬%×*:Ñ*:Ð;ÜŸ™¬¯©Ð9ð;ˆà�‰œ [°&ÀˆÕFrR   c                 ó0   — | j                  t        ¬«       y rb   )ru   rc   rd   s    r!   Útest_div_npmzTestComplex.test_div_npmu   s   € à�‰œNˆÕ+rR   N)rM   rN   rO   rP   r_   re   ri   rk   rn   rp   ru   r   rw   rQ   rR   r!   rT   rT   H   sL   „ à0ó 1ò-ð 1ó 1ò-ð $6ó 1ò2ð 0ó Gð ñ,ó ñ,rR   rT   c                   óT  — e Zd ZdZd„ Z	 	 d3d„Zd„ Zd„ Zd„ Zd„ Z	e
fd	„Zd
„ Ze
fd„Zd„ Ze
fd„Zd„ Ze
fd„Zd„ Zd„ Zd„ Zd„ Zd„ Ze
fd„Ze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-„ Z0d.„ Z1d/„ Z2d0„ Z3d1„ Z4d2„ Z5y)4Ú	TestCMathz)
    Tests for cmath module support.
    c                 ó†   — | j                  |t        j                  t        j                  g| j	                  «       |¬«       y rb   )rD   r   rZ   r5   r"   )r   r:   r=   s      r!   Úcheck_predicate_funczTestCMath.check_predicate_func   s4   € Ø�‰�v¤× 0Ñ 0´%·/±/ÐBØ×(Ñ(Ó*°%ð 	õ 	9rR   Nc                 óä   — | j                  |t        j                  g|xs | j                  «       |||¬«       | j                  |t        j                  g|xs | j                  «       |||¬«       y )N)r=   r1   r2   )rD   r   rZ   r&   r5   r"   )r   r:   r=   r1   r2   rI   s         r!   Úcheck_unary_funczTestCMath.check_unary_funcƒ   sn   € à�‰�v¤× 0Ñ 0Ð1ØÒ3 ×!1Ñ!1Ó!3¸5ÀtØ&ð 	ô 	(ð 	�‰�v¤§¡Ð0ØÒ4 ×!2Ñ!2Ó!4¸EÈØ&ð 	õ 	(rR   c                 ó8   — | j                  t        t        «       y ©N)r}   Úphase_usecaserP   rd   s    r!   Ú
test_phasezTestCMath.test_phase�   ó   € Ø×ÑœmÔ-?Õ@rR   c                 ó8   — | j                  t        t        «       y r   )r}   r€   rc   rd   s    r!   Útest_phase_npmzTestCMath.test_phase_npm’   ó   € Ø×Ñœm¬^Õ<rR   c                 ó8   — | j                  t        t        «       y r   )r}   Úpolar_usecaserP   rd   s    r!   Ú
test_polarzTestCMath.test_polar•   r‚   rR   c                 ó8   — | j                  t        t        «       y r   )r}   r‡   rc   rd   s    r!   Útest_polar_npmzTestCMath.test_polar_npm˜   r…   rR   c                 ó¨   ‡ ‡— ˆˆ fd„} |t         j                  ‰ j                  «       «        |t         j                  ‰ j	                  «       «       y )Nc                 óî   •— |D �cg c]H  }t        j                  |j                  «      r|j                  dk(  r|j                  |j                  f‘ŒJ }}‰j	                  t
        | | fg|‰¬«       y c c}w )Nr   rW   )r$   ÚisinfÚimagÚrealrL   Úrect_usecase)ÚtpÚseed_valuesÚzrI   r=   r   s       €€r!   Údo_testz$TestCMath.test_rect.<locals>.do_testœ   sg   ø€ Ù0;ó @±¨1Ü!ŸZ™Z¨¯©Ô/°1·6±6¸Q²;ð —v‘v˜qŸv™vÒ&°ˆFð @à�O‰OœL¨B°¨8¨*°fÀEˆOÕJùò@s   †AA2)r   r]   r&   r4   r"   )r   r=   r”   s   `` r!   Ú	test_rectzTestCMath.test_rect›   s9   ù€ õ	Kñ 	”—‘˜t×/Ñ/Ó1Ô2á”—‘˜t×0Ñ0Ó2Õ3rR   c                 ó0   — | j                  t        ¬«       y rb   )r•   rc   rd   s    r!   Útest_rect_npmzTestCMath.test_rect_npm¤   rf   rR   c                 ó8   — | j                  t        t        «       y r   )r{   Úisnan_usecaserP   r^   s     r!   Ú
test_isnanzTestCMath.test_isnan©   ó   € Ø×!Ñ!¤-Ô1CÕDrR   c                 ó8   — | j                  t        t        «       y r   )r{   r™   rc   rd   s    r!   Útest_isnan_npmzTestCMath.test_isnan_npm¬   ó   € Ø×!Ñ!¤-´Õ@rR   c                 ó8   — | j                  t        t        «       y r   )r{   Úisinf_usecaserP   r^   s     r!   Ú
test_isinfzTestCMath.test_isinf¯   r›   rR   c                 ó8   — | j                  t        t        «       y r   )r{   r    rc   rd   s    r!   Útest_isinf_npmzTestCMath.test_isinf_npm²   rž   rR   c                 ó8   — | j                  t        t        «       y r   )r{   Úisfinite_usecaserP   r^   s     r!   Útest_isfinitezTestCMath.test_isfiniteµ   s   € Ø×!Ñ!Ô"2Ô4FÕGrR   c                 ó8   — | j                  t        t        «       y r   )r{   r¥   rc   rd   s    r!   Útest_isfinite_npmzTestCMath.test_isfinite_npm¸   s   € Ø×!Ñ!Ô"2´NÕCrR   c                 ó<   — | j                  t        t        d¬«       y ©Né   )r1   )r}   Úexp_usecaserP   rd   s    r!   Útest_expzTestCMath.test_exp½   ó   € Ø×ÑœkÔ+=ÀAÐÕFrR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   r¬   rc   rd   s    r!   Útest_exp_npmzTestCMath.test_exp_npmÀ   s   € ð 	×Ñœk¬>ÀÐÕBrR   c                 ó8   — | j                  t        t        «       y r   )r}   Úlog_usecaserP   rd   s    r!   Útest_logzTestCMath.test_logÆ   s   € Ø×ÑœkÔ+=Õ>rR   c                 ó8   — | j                  t        t        «       y r   )r}   r²   rc   rd   s    r!   Útest_log_npmzTestCMath.test_log_npmÉ   s   € Ø×Ñœk¬>Õ:rR   c                 ó.  — t        t        j                  | j                  «       | j                  «       «      «      }t        j
                  t        j
                  ft        j                  t        j                  fg}| j                  t        |||d¬«       y )Né   )r=   r1   )	rr   r   r   r&   r   rZ   r5   rL   Úlog_base_usecasert   s       r!   Útest_log_basezTestCMath.test_log_baseÌ   ss   € Ü”i×'Ñ'¨×(8Ñ(8Ó(:¸D×<LÑ<LÓ<NÓOÓPˆÜ×(Ñ(¬%×*:Ñ*:Ð;ÜŸ™¬¯©Ð9ð;ˆà�‰Ô(¨+°vÀUØð 	õ 	 rR   c                 ó0   — | j                  t        ¬«       y rb   )r¹   rc   rd   s    r!   Útest_log_base_npmzTestCMath.test_log_base_npmÓ   s   € à×Ñ¤ÐÕ0rR   c                 ó8   — | j                  t        t        «       y r   )r}   Úlog10_usecaserP   rd   s    r!   Ú
test_log10zTestCMath.test_log10×   r‚   rR   c                 ó8   — | j                  t        t        «       y r   )r}   r½   rc   rd   s    r!   Útest_log10_npmzTestCMath.test_log10_npmÚ   r…   rR   c                 ó8   — | j                  t        t        «       y r   )r}   Úsqrt_usecaserP   rd   s    r!   Ú	test_sqrtzTestCMath.test_sqrtÝ   s   € Ø×ÑœlÔ,>Õ?rR   c                 óÔ   — | j                  t        t        «       t        dd«      D �cg c]  }d|z   ‘Œ
 }}| j	                  t        t
        j                  g|t        ¬«       y c c}w )Né$   é)   é
   rW   )r}   rÂ   rc   ÚrangerD   r   rZ   )r   ÚirI   s      r!   Útest_sqrt_npmzTestCMath.test_sqrt_npmà   s\   € Ø×Ñœl¬NÔ;ô %*¨"¨b¤MÓ2¡M˜q�2˜‘7’( MˆÐ2Ø�‰”|¤e×&6Ñ&6Ð%7Ø¤^ð 	õ 	5ùò 3s   ©A%c                 ó<   — | j                  t        t        d¬«       y rª   )r}   Úacos_usecaserP   rd   s    r!   Ú	test_acoszTestCMath.test_acosê   ó   € Ø×ÑœlÔ,>ÀQÐÕGrR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   rÌ   rc   rd   s    r!   Útest_acos_npmzTestCMath.test_acos_npmí   ó   € Ø×Ñœl¬NÀÐÕCrR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   Úasin_usecaserP   rd   s    r!   Ú	test_asinzTestCMath.test_asinð   rÎ   rR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   rÓ   rc   rd   s    r!   Útest_asin_npmzTestCMath.test_asin_npmó   rÑ   rR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   Úatan_usecaserP   rd   s    r!   Ú	test_atanzTestCMath.test_atanö   s   € Ø×ÑœlÔ,>ÀQÐÕHrR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   rØ   rc   rd   s    r!   Útest_atan_npmzTestCMath.test_atan_npmù   s   € Ø×Ñœl¬NÀÐÕDrR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   Úcos_usecaserP   rd   s    r!   Útest_coszTestCMath.test_cosü   r®   rR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   rÝ   rc   rd   s    r!   Útest_cos_npmzTestCMath.test_cos_npmÿ   s   € Ø×Ñœk¬>ÀÐÕBrR   c                 ó<   — | j                  t        t        d¬«       y ©NÚeps)r2   )r}   Úsin_usecaserP   rd   s    r!   Útest_sinzTestCMath.test_sin  s   € à×ÑœkÔ+=ÀuÐÕMrR   c                 ó<   — | j                  t        t        d¬«       y râ   )r}   rä   rc   rd   s    r!   Útest_sin_npmzTestCMath.test_sin_npm  s   € Ø×Ñœk¬>À5ÐÕIrR   c                 ó<   — | j                  t        t        d¬«       y rª   ©r}   Útan_usecaserP   rd   s    r!   Útest_tanzTestCMath.test_tan	  r®   rR   c                 ó<   — | j                  t        t        d¬«       y rª   ré   rd   s    r!   Útest_tan_npmzTestCMath.test_tan_npm  r®   rR   c                 ó8   — | j                  t        t        «       y r   )r}   Úacosh_usecaserP   rd   s    r!   Ú
test_acoshzTestCMath.test_acosh  r‚   rR   c                 ó8   — | j                  t        t        «       y r   )r}   rï   rc   rd   s    r!   Útest_acosh_npmzTestCMath.test_acosh_npm  r…   rR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   Úasinh_usecaserP   rd   s    r!   Ú
test_asinhzTestCMath.test_asinh  ó   € Ø×ÑœmÔ-?ÀaÐÕHrR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   rô   rc   rd   s    r!   Útest_asinh_npmzTestCMath.test_asinh_npm  ó   € Ø×Ñœm¬^À!ÐÕDrR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   Úatanh_usecaserP   rd   s    r!   Ú
test_atanhzTestCMath.test_atanh  rö   rR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   rû   rc   rd   s    r!   Útest_atanh_npmzTestCMath.test_atanh_npm   rù   rR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   Úcosh_usecaserP   rd   s    r!   Ú	test_coshzTestCMath.test_cosh#  rÎ   rR   c                 ó<   — | j                  t        t        d¬«       y rª   )r}   r   rc   rd   s    r!   Útest_cosh_npmzTestCMath.test_cosh_npm&  rÑ   rR   c                 ó<   — | j                  t        t        d¬«       y râ   )r}   Úsinh_usecaserP   rd   s    r!   Ú	test_sinhzTestCMath.test_sinh)  s   € Ø×ÑœlÔ,>ÈÐÕNrR   c                 ó<   — | j                  t        t        d¬«       y râ   )r}   r  rc   rd   s    r!   Útest_sinh_npmzTestCMath.test_sinh_npm,  s   € Ø×Ñœl¬NÀEÐÕJrR   c                 ó<   — | j                  t        t        d¬«       y rª   ©r}   Útanh_usecaserP   rd   s    r!   Ú	test_tanhzTestCMath.test_tanh/  rÎ   rR   c                 ó<   — | j                  t        t        d¬«       y rª   r
  rd   s    r!   Útest_tanh_npmzTestCMath.test_tanh_npm2  rÎ   rR   )r   NN)6rM   rN   rO   Ú__doc__r{   r}   r�   r„   rˆ   rŠ   rP   r•   r—   rš   r�   r¡   r£   r¦   r¨   r­   r°   r³   rµ   r¹   r   r»   r¾   rÀ   rÃ   rÊ   rÍ   rÐ   rÔ   rÖ   rÙ   rÛ   rÞ   rà   rå   rç   rë   rí   rð   rò   rõ   rø   rü   rþ   r  r  r  r  r  r  rQ   rR   r!   ry   ry   z   sK  „ ñò9ð ?CØ $ó(òAò=òAò=ð 1ó 4ò-ð
  2ó EòAð  2ó EòAð #5ó HòDò
GòCò?ò;ð #5ó  ð ñ1ó ð1òAò=ò@ò5òHòDòHòDòIòEòGòCòNòJòGòGò
Aò=òIòEòIòEòHòDòOòKòHóHrR   ry   Ú__main__)r   r$   r   Únumbar   r   Únumba.tests.supportr   r   Úcomplex_usecasesÚunittestrP   rc   Úobjectr   rT   ry   rM   ÚmainrQ   rR   r!   Ú<module>r     sx   ðÛ Û Û 
ç ß 7Ü Û à  $Ð'Ð Ø˜dÐ#€ô7<�fô 7<ôt/,�/ 8ô /,ôdyH� ô yHðx ˆzÒØ€H‡M�M…Oð rR   