U
    iâËd¹R  ã                   @   sð  d dl Z d dlZ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mZmZ d dlmZmZmZ d dlZd dlmZ eƒ Zde_eƒ Zdd	„ Zd
d„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Z dd„ Z!dd„ Z"dd„ Z#dd„ Z$d d!„ Z%d"d#„ Z&d$d%„ Z'd&d'„ Z(d(d)„ Z)d*d+„ Z*d,d-„ Z+d.d/„ Z,d0d1„ Z-d2d3„ Z.d4d5„ Z/d6d7„ Z0d8d9„ Z1d:d;„ Z2d<d=„ Z3d>d?„ Z4d@dA„ Z5dBdC„ Z6dDdE„ Z7dFdG„ Z8dHdI„ Z9dJdK„ Z:dLdM„ Z;dNdO„ Z<dPdQ„ Z=dRdS„ Z>dTdU„ Z?G dVdW„ dWeƒZ@eAdXk�rìe B¡  dS )Yé    N)Úcompile_isolatedÚFlags)ÚutilsÚtypes)ÚIS_WIN32Ú	IS_32BITS)ÚTestCaseÚCompilationCacheÚtag)Únumpy_supportTc                 C   s
   t  | ¡S ©N)ÚmathÚsin©Úx© r   úQ/home/sam/Atlas/atlas_env/lib/python3.8/site-packages/numba/tests/test_mathlib.pyr      s    r   c                 C   s
   t  | ¡S r   )r   Úcosr   r   r   r   r      s    r   c                 C   s
   t  | ¡S r   )r   Útanr   r   r   r   r      s    r   c                 C   s
   t  | ¡S r   )r   Úsinhr   r   r   r   r   !   s    r   c                 C   s
   t  | ¡S r   )r   Úcoshr   r   r   r   r   %   s    r   c                 C   s
   t  | ¡S r   )r   Útanhr   r   r   r   r   )   s    r   c                 C   s
   t  | ¡S r   )r   Úasinr   r   r   r   r   -   s    r   c                 C   s
   t  | ¡S r   )r   Úacosr   r   r   r   r   1   s    r   c                 C   s
   t  | ¡S r   )r   Úatanr   r   r   r   r   5   s    r   c                 C   s   t  | |¡S r   )r   Úatan2)Úyr   r   r   r   r   9   s    r   c                 C   s
   t  | ¡S r   )r   Úasinhr   r   r   r   r   =   s    r   c                 C   s
   t  | ¡S r   )r   Úacoshr   r   r   r   r   A   s    r   c                 C   s
   t  | ¡S r   )r   Úatanhr   r   r   r   r   E   s    r   c                 C   s
   t  | ¡S r   ©r   Úsqrtr   r   r   r   r!   I   s    r!   c                 C   s
   t  | ¡S r   )Únpr!   r   r   r   r   Únpy_sqrtM   s    r#   c                 C   s
   t  | ¡S r   )r   Úexpr   r   r   r   r$   Q   s    r$   c                 C   s
   t  | ¡S r   )r   Úexpm1r   r   r   r   r%   U   s    r%   c                 C   s
   t  | ¡S r   )r   Úlogr   r   r   r   r&   Y   s    r&   c                 C   s
   t  | ¡S r   )r   Úlog1pr   r   r   r   r'   ]   s    r'   c                 C   s
   t  | ¡S r   )r   Úlog10r   r   r   r   r(   a   s    r(   c                 C   s
   t  | ¡S r   )r   Úfloorr   r   r   r   r)   e   s    r)   c                 C   s
   t  | ¡S r   )r   Úceilr   r   r   r   r*   i   s    r*   c                 C   s
   t  | ¡S r   )r   Útruncr   r   r   r   r+   m   s    r+   c                 C   s
   t  | ¡S r   )r   Úisnanr   r   r   r   r,   q   s    r,   c                 C   s
   t  | ¡S r   )r   Úisinfr   r   r   r   r-   u   s    r-   c                 C   s
   t  | ¡S r   )r   Úisfiniter   r   r   r   r.   y   s    r.   c                 C   s   t  | |¡S r   )r   Úhypot©r   r   r   r   r   r/   }   s    r/   c                 C   s
   t  | ¡S r   )r   Údegreesr   r   r   r   r1   �   s    r1   c                 C   s
   t  | ¡S r   )r   Úradiansr   r   r   r   r2   …   s    r2   c                 C   s
   t  | ¡S r   )r   Úerfr   r   r   r   r3   ‰   s    r3   c                 C   s
   t  | ¡S r   )r   Úerfcr   r   r   r   r4   �   s    r4   c                 C   s
   t  | ¡S r   )r   Úgammar   r   r   r   r5   ‘   s    r5   c                 C   s
   t  | ¡S r   )r   Úlgammar   r   r   r   r6   •   s    r6   c                 C   s   t  | |¡S r   )r   Úpowr0   r   r   r   r7   ™   s    r7   c                 C   s   t  | |¡S r   )r   Úgcdr0   r   r   r   r8   œ   s    r8   c                 C   s   t  | |¡S r   )r   Úcopysignr0   r   r   r   r9   Ÿ   s    r9   c                 C   s
   t  | ¡S r   )r   Úfrexpr   r   r   r   r:   £   s    r:   c                 C   s   t  | |¡S r   )r   Úldexp)r   Úer   r   r   r;   §   s    r;   c                   C   s   t jt jfS r   )r   Úpir<   r   r   r   r   Úget_constants«   s    r>   c                   @   sB  e Zd Zdd„ Zdd„ Zedfdd„Zedfdd	„Zefd
d„Zefdd„Z	dd„ Z
e ejdkd¡efdd„ƒZdd„ Zefdd„Zdd„ Zefdd„Zdd„ Zefdd„Zd d!„ Zefd"d#„Zd$d%„ Zefd&d'„Zd(d)„ Zefd*d+„Zd,d-„ Zefd.d/„Zd0d1„ Zefd2d3„Zd4d5„ Z efd6d7„Z!d8d9„ Z"efd:d;„Z#d<d=„ Z$efd>d?„Z%d@dA„ Z&efdBdC„Z'dDdE„ Z(efdFdG„Z)dHdI„ Z*efdJdK„Z+dLdM„ Z,efdNdO„Z-dPdQ„ Z.efdRdS„Z/dTdU„ Z0efdVdW„Z1dXdY„ Z2efdZd[„Z3d\d]„ Z4efd^d_„Z5d`da„ Z6efdbdc„Z7ddde„ Z8efdfdg„Z9dhdi„ Z:djdk„ Z;dldm„ Z<dndo„ Z=dpdq„ Z>drds„ Z?dtdu„ Z@efdvdw„ZAdxdy„ ZBefdzd{„ZCd|d}„ ZDefd~d„ZEd€d�„ ZFefd‚dƒ„ZGd„d…„ ZHefd†d‡„ZIdˆd‰„ ZJefdŠd‹„ZKdŒd�„ ZLefdŽd�„ZMd�d‘„ ZNefd’d“„ZOefd”d•„ZPd–d—„ ZQd˜d™„ ZRefdšd›„ZSdœd�„ ZTefdždŸ„ZUd d¡„ ZVefd¢d£„ZWd¤d¥„ ZXd¦S )§ÚTestMathLibc                 C   s   t ƒ | _d S r   )r	   Úccache©Úselfr   r   r   ÚsetUp±   s    zTestMathLib.setUpc                 C   s   |   tt¡ d S r   )Zrun_nullary_funcr>   Úno_pyobj_flagsrA   r   r   r   Útest_constants´   s    zTestMathLib.test_constantsÚexactc                 K   sx   t ||ƒD ]h\}}| jj||f|d�}	|	j}
|
|ƒ}||ƒ}|tjkrJdn|}d|f }| j||f||dœ|—Ž q
d S )N©ÚflagsÚsingleúfor input %r©ÚprecÚmsg©Úzipr@   ÚcompileÚentry_pointr   Úfloat32ÚassertPreciseEqual)rB   ÚpyfuncÚx_typesÚx_valuesrH   rL   ÚkwargsZtxZvxÚcrÚcfuncÚgotÚexpectedÚactual_precrM   r   r   r   Ú	run_unary·   s    
ÿzTestMathLib.run_unaryc                 C   s|   t |||ƒD ]j\}}}	| jj|||f|d�}
|
j}|||	ƒ}|||	ƒ}|tjkrTdn|}d||	f }| j||||d� qd S )NrG   rI   zfor inputs (%r, %r)rK   rN   )rB   rT   rU   rV   Úy_valuesrH   rL   Útyr   r   rX   rY   rZ   r[   r\   rM   r   r   r   Ú
run_binaryÃ   s    

zTestMathLib.run_binaryc                 C   st   t jt jt jt jt jt jt jt jt jt jt jt jg}ddddddt	dƒdt	dƒt	dƒdt	dƒg}|  
||||¡ d S )Nr   Úinfç        Únan)r   Úint16Úint32Úint64Úuint16Úuint32Úuint64rR   Úfloat64Úfloatr]   )rB   rT   rH   rU   rV   r   r   r   Úcheck_predicate_funcÎ   s(          ý    þz TestMathLib.check_predicate_funcc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S ©Néþÿÿÿéÿÿÿÿé   é   çš™™™™™¹?çš™™™™™É?)r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   ©rB   rH   rT   rU   rV   r   r   r   Útest_sinØ   s       þzTestMathLib.test_sinc                 C   s   | j td� d S ©NrG   )ru   rD   rA   r   r   r   Útest_sin_npmà   s    zTestMathLib.test_sin_npmÚwin32z'not exactly equal on win32 (issue #597)c                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S rm   )r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Útest_cosã   s       þzTestMathLib.test_cosc                 C   s   | j td� d S rv   )ry   rD   rA   r   r   r   Útest_cos_npmí   s    zTestMathLib.test_cos_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S rm   )r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Útest_tanð   s       þzTestMathLib.test_tanc                 C   s   | j td� d S rv   )r{   rD   rA   r   r   r   Útest_tan_npmø   s    zTestMathLib.test_tan_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S )Nrp   rq   rr   rs   )r!   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú	test_sqrtû   s       þzTestMathLib.test_sqrtc                 C   s   | j td� d S rv   )r}   rD   rA   r   r   r   Útest_sqrt_npm  s    zTestMathLib.test_sqrt_npmc                 C   sh   t }ddddddddg}tjtjg}| j||||dd� tjtjtjtjtj	tj
g}|  ||||¡ d S )Nrp   rq   rr   rs   rI   ©rL   )r#   r   rd   rg   r]   re   rf   rh   ri   rR   rj   ©rB   rH   rT   rV   rU   r   r   r   Útest_npy_sqrt  s      þzTestMathLib.test_npy_sqrtc                 C   s   | j td� d S rv   )r�   rD   rA   r   r   r   Útest_npy_sqrt_npm  s    zTestMathLib.test_npy_sqrt_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S rm   )r$   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Útest_exp  s       þzTestMathLib.test_expc                 C   s   | j td� d S rv   )rƒ   rD   rA   r   r   r   Útest_exp_npm  s    zTestMathLib.test_exp_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S rm   )r%   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú
test_expm1  s       þzTestMathLib.test_expm1c                 C   s   | j td� d S rv   )r…   rD   rA   r   r   r   Útest_expm1_npm'  s    zTestMathLib.test_expm1_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S ©	Nrq   é
   éd   iè  i † i@B rr   gš™™™™™ñ?)r&   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Útest_log*  s       þzTestMathLib.test_logc                 C   s   | j td� d S rv   )rŠ   rD   rA   r   r   r   Útest_log_npm2  s    zTestMathLib.test_log_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S r‡   )r'   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú
test_log1p5  s       þzTestMathLib.test_log1pc                 C   s   | j td� d S rv   )rŒ   rD   rA   r   r   r   Útest_log1p_npm=  s    zTestMathLib.test_log1p_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S r‡   )r(   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú
test_log10@  s       þzTestMathLib.test_log10c                 C   s   | j td� d S rv   )rŽ   rD   rA   r   r   r   Útest_log10_npmH  s    zTestMathLib.test_log10_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S ©Nrq   ç      ð?)r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú	test_asinK  s       þzTestMathLib.test_asinc                 C   s   | j td� d S rv   )r’   rD   rA   r   r   r   Útest_asin_npmS  s    zTestMathLib.test_asin_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S r�   )r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú	test_acosV  s       þzTestMathLib.test_acosc                 C   s   | j td� d S rv   )r”   rD   rA   r   r   r   Útest_acos_npm^  s    zTestMathLib.test_acos_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S rm   )r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú	test_atana  s       þzTestMathLib.test_atanc                 C   s   | j td� d S rv   )r–   rD   rA   r   r   r   Útest_atan_npmi  s    zTestMathLib.test_atan_npmc                 C   s`   t }tjtjtjtjtjtjtjtj	g}ddddddddg}dd„ |D ƒ}|  
|||||¡ d S )	Nrn   ro   rp   rq   rr   rs   c                 S   s   g | ]}|d  ‘qS ©rp   r   ©Ú.0r   r   r   r   Ú
<listcomp>r  s     z*TestMathLib.test_atan2.<locals>.<listcomp>)r   r   rd   re   rf   rg   rh   ri   rR   rj   r`   ©rB   rH   rT   rU   rV   r^   r   r   r   Ú
test_atan2l  s       þzTestMathLib.test_atan2c                 C   s   | j td� d S rv   )r�   rD   rA   r   r   r   Útest_atan2_npmu  s    zTestMathLib.test_atan2_npmc                 C   sT   t }tjtjtjtjtjtjtjtj	g}ddddddddg}| j
||||dd� d S )Nrq   r‘   Údoubler   )r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú
test_asinhx  s       þzTestMathLib.test_asinhc                 C   s   | j td� d S rv   )r    rD   rA   r   r   r   Útest_asinh_npm€  s    zTestMathLib.test_asinh_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S r�   )r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú
test_acoshƒ  s       þzTestMathLib.test_acoshc                 C   s   | j td� d S rv   )r¢   rD   rA   r   r   r   Útest_acosh_npm‹  s    zTestMathLib.test_acosh_npmc                 C   sT   t }tjtjtjtjtjtjtjtj	g}ddddddddg}| j
||||dd� d S )Nr   rr   rŸ   r   )r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú
test_atanhŽ  s       þzTestMathLib.test_atanhc                 C   s   | j td� d S rv   )r¤   rD   rA   r   r   r   Útest_atanh_npm–  s    zTestMathLib.test_atanh_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S r�   )r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú	test_sinh™  s       þzTestMathLib.test_sinhc                 C   s   | j td� d S rv   )r¦   rD   rA   r   r   r   Útest_sinh_npm¡  s    zTestMathLib.test_sinh_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S r�   )r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú	test_cosh¤  s       þzTestMathLib.test_coshc                 C   s   | j td� d S rv   )r¨   rD   rA   r   r   r   Útest_cosh_npm¬  s    zTestMathLib.test_cosh_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S )Nr   rr   )r   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú	test_tanh¯  s       þzTestMathLib.test_tanhc                 C   s   | j td� d S rv   )rª   rD   rA   r   r   r   Útest_tanh_npm·  s    zTestMathLib.test_tanh_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S ©Nr   rr   gffffffþ?)r)   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú
test_floorº  s       þzTestMathLib.test_floorc                 C   s   | j td� d S rv   )r­   rD   rA   r   r   r   Útest_floor_npmÂ  s    zTestMathLib.test_floor_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S r¬   )r*   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú	test_ceilÅ  s       þzTestMathLib.test_ceilc                 C   s   | j td� d S rv   )r¯   rD   rA   r   r   r   Útest_ceil_npmÍ  s    zTestMathLib.test_ceil_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S r¬   )r+   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Ú
test_truncÐ  s       þzTestMathLib.test_truncc                 C   s   | j td� d S rv   )r±   rD   rA   r   r   r   Útest_trunc_npmØ  s    zTestMathLib.test_trunc_npmc                 C   s   | j ttd� d S rv   )rl   r,   Úenable_pyobj_flagsrA   r   r   r   Ú
test_isnanÛ  s    zTestMathLib.test_isnanc                 C   s   | j ttd� d S rv   )rl   r,   rD   rA   r   r   r   Útest_isnan_npmÞ  s    zTestMathLib.test_isnan_npmc                 C   s   | j ttd� d S rv   )rl   r-   r³   rA   r   r   r   Ú
test_isinfá  s    zTestMathLib.test_isinfc                 C   s   | j ttd� d S rv   )rl   r-   rD   rA   r   r   r   Útest_isinf_npmä  s    zTestMathLib.test_isinf_npmc                 C   s   | j ttd� d S rv   )rl   r.   r³   rA   r   r   r   Útest_isfiniteç  s    zTestMathLib.test_isfinitec                 C   s   | j ttd� d S rv   )rl   r.   rD   rA   r   r   r   Útest_isfinite_npmê  s    zTestMathLib.test_isfinite_npmc              
   C   s  t }tjtjtjtjg}ddddddddg}d	d
„ |D ƒ}d}|  ||||||¡ dd„ }tjtjfD ]¢}| jj|||f|d�}	|	j	}
t
 |¡j}|t |¡jd ƒ}|
||ƒ}| j||||ƒdd� |  t |¡¡ t ¡ �$ t dt¡ |  td|||¡ W 5 Q R X qfd S )Nrq   rp   é   é   é   é   gáz®GáÊ?gÃõ(\�ÂÕ?c                 S   s   g | ]}|d  ‘qS r˜   r   r™   r   r   r   r›   ò  s     z*TestMathLib.test_hypot.<locals>.<listcomp>rI   c                 S   s   t  | |  ||  ¡S r   r    r0   r   r   r   Únaive_hypotù  s    z+TestMathLib.test_hypot.<locals>.naive_hypotrG   g      >@r   Úerrorz overflow encountered in .*scalar)r/   r   rf   ri   rR   rj   r`   r@   rP   rQ   r   Zas_dtypeÚtyper"   ZfinfoÚmaxrS   Ú
assertTruer.   ÚwarningsÚcatch_warningsÚsimplefilterÚRuntimeWarningZassertRaisesRegexp)rB   rH   rT   rU   rV   r^   rL   r¾   ÚflttyrX   rY   ÚdtÚvalZnb_ansr   r   r   Ú
test_hypotí  s4     ÿ

  þzTestMathLib.test_hypotc                 C   s   | j td� d S rv   )rÊ   rD   rA   r   r   r   Útest_hypot_npm
  s    zTestMathLib.test_hypot_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S r�   )r1   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Útest_degrees  s       þzTestMathLib.test_degreesc                 C   s   | j td� d S rv   )rÌ   rD   rA   r   r   r   Útest_degrees_npm  s    zTestMathLib.test_degrees_npmc                 C   sP   t }tjtjtjtjtjtjtjtj	g}ddddddddg}|  
||||¡ d S r�   )r2   r   rd   re   rf   rg   rh   ri   rR   rj   r]   rt   r   r   r   Útest_radians  s       þzTestMathLib.test_radiansc                 C   s   | j td� d S rv   )rÎ   rD   rA   r   r   r   Útest_radians_npm   s    zTestMathLib.test_radians_npmc              	   C   sN   t }dddddddtdƒg}tjtjgt|ƒd  }| j||||d	dd
� d S )Nr‘   ç      ð¿ç       €rb   ç      à?r¼   ra   rp   rŸ   ©rL   Zulps)r3   rk   r   rR   rj   Úlenr]   r€   r   r   r   Útest_erf#  s     ÿzTestMathLib.test_erfc                 C   s   | j td� d S rv   )rÕ   rD   rA   r   r   r   Útest_erf_npm*  s    zTestMathLib.test_erf_npmc              	   C   sN   t }dddddddtdƒg}tjtjgt|ƒd  }| j||||d	d
d� d S )Nr‘   rÐ   rÑ   rb   rÒ   r¼   ra   rp   rŸ   r»   rÓ   )r4   rk   r   rR   rj   rÔ   r]   r€   r   r   r   Ú	test_erfc-  s     ÿzTestMathLib.test_erfcc                 C   s   | j td� d S rv   )r×   rD   rA   r   r   r   Útest_erfc_npm4  s    zTestMathLib.test_erfc_npmc                 C   s|   t }ddddg}tjtjgt|ƒd  }| j||||ddd� d	d
dddtdƒg}tjgt|ƒ }| j||||ddd� d S )Nr‘   çÍÌÌÌÌÌì¿g      à¿rÒ   rp   rŸ   rº   rÓ   çš™™™™™¹¿rr   ç      @g333333$@g      I@ra   é   )r5   r   rR   rj   rÔ   r]   rk   r€   r   r   r   Ú
test_gamma7  s     ÿzTestMathLib.test_gammac                 C   s   | j td� d S rv   )rÝ   rD   rA   r   r   r   Útest_gamma_npmA  s    zTestMathLib.test_gamma_npmc              	   C   sL   t }dddddddtdƒg}tjtjgt|ƒd	  }| j||||d
d� d S )Nr‘   rÙ   rÚ   rr   g      i@g    _ BgêŒ 9Y>)Fra   rp   rŸ   r   )r6   rk   r   rR   rj   rÔ   r]   r€   r   r   r   Útest_lgammaD  s    zTestMathLib.test_lgammac                 C   s   | j td� d S rv   )rß   rD   rA   r   r   r   Útest_lgamma_npmJ  s    zTestMathLib.test_lgamma_npmc                 C   s`   t }tjtjtjtjtjtjtjtj	g}ddddddddg}dd„ |D ƒ}|  
|||||¡ d S )	Nrn   ro   rp   rq   rr   rs   c                 S   s   g | ]}|d  ‘qS r˜   r   r™   r   r   r   r›   S  s     z(TestMathLib.test_pow.<locals>.<listcomp>)r7   r   rd   re   rf   rg   rh   ri   rR   rj   r`   rœ   r   r   r   Útest_powM  s       þzTestMathLib.test_powc                 C   sv   ddl m}m}m} t}|ttjƒf|ddƒžŽ }|ttjƒf|ddƒžŽ }t	|||ƒŽ \}}	}
|  
|||	|
|¡ d S )Nr   )ÚproductÚrepeatÚchain)rn   ro   r   rq   rp   é   rˆ   rp   )r   rq   rp   rå   é	   é   )Ú	itertoolsrâ   rã   rä   r8   Úsortedr   Zsigned_domainZunsigned_domainrO   r`   )rB   rH   râ   rã   rä   rT   Zsigned_argsZunsigned_argsrU   rV   r^   r   r   r   Útest_gcdV  s    ÿÿÿÿzTestMathLib.test_gcdc                 C   s   | j td� d S rv   )rê   rD   rA   r   r   r   Útest_gcd_npmb  s    zTestMathLib.test_gcd_npmc                 C   s   | j td� d S rv   )rá   rD   rA   r   r   r   Útest_pow_npme  s    zTestMathLib.test_pow_npmc              
   C   sd   t }tjtjg}ddddddtdƒtdƒtd	ƒg	}ttt |||¡Ž ƒ\}}}|  	|||||¡ d S )
Nrn   ro   rÑ   rb   rq   rp   ú-infra   rc   )
r9   r   rR   rj   rk   ÚlistrO   rè   râ   r`   )rB   rH   rT   Zvalue_typesÚvaluesrU   rV   r^   r   r   r   Útest_copysignh  s    ÿÿzTestMathLib.test_copysignc                 C   s   | j td� d S rv   )rð   rD   rA   r   r   r   Útest_copysign_npmq  s    zTestMathLib.test_copysign_npmc                 C   sF   t }tjtjg}ddddtdƒtdƒtdƒg}| j||||dd	� d S )
Ng      ÀrÑ   rb   g      @rí   ra   rc   rF   r   )r:   r   rR   rj   rk   r]   rt   r   r   r   Ú
test_frexpt  s      ÿzTestMathLib.test_frexpc                 C   s   | j td� d S rv   )rò   rD   rA   r   r   r   Útest_frexp_npm{  s    zTestMathLib.test_frexp_npmc                 C   sŠ   t }tjtjfD ]t}| jj||tjf|d�}|j}ddddddtdƒd	ftd
ƒd	ftdƒd	ff	D ]"}d|f }|  	||Ž ||Ž ¡ q`qd S )NrG   )rÛ   rn   )rÛ   rq   )rb   r   )rb   rq   )rÑ   r   )rÑ   rq   ra   r   rí   rc   rJ   )
r;   r   rR   rj   r@   rP   re   rQ   rk   rS   )rB   rH   rT   rÇ   rX   rY   ÚargsrM   r   r   r   Ú
test_ldexp~  s     
 

ý
zTestMathLib.test_ldexpc                 C   s   | j td� d S rv   )rõ   rD   rA   r   r   r   Útest_ldexp_npmŠ  s    zTestMathLib.test_ldexp_npmN)YÚ__name__Ú
__module__Ú__qualname__rC   rE   r³   r]   r`   rl   ru   rw   ÚunittestZskipIfÚsysÚplatformry   rz   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´   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?   ¯   s°   ÿ
 ÿ

ÿ	
		r?   Ú__main__)Crè   r   rû   rÃ   Únumpyr"   Znumba.core.compilerr   r   Z
numba.corer   r   Znumba.core.configr   r   Znumba.tests.supportr   r	   r
   rú   Znumba.npr   r³   Zenable_pyobjectrD   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/   r1   r2   r3   r4   r5   r6   r7   r8   r9   r:   r;   r>   r?   r÷   Úmainr   r   r   r   Ú<module>   st      b
