
    ܙdR                        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 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! Z2d" Z3d# Z4d$ Z5d% Z6d& Z7d' Z8d( Z9d) Z:d* Z;d+ Z<d, Z=d- Z>d. Z? G d/ d0e          Z@eAd1k    r ejB                     dS dS )2    N)compile_isolatedFlags)utilstypes)IS_WIN32	IS_32BITS)TestCaseCompilationCachetag)numpy_supportTc                 *    t          j        |           S N)mathsinxs    8lib/python3.11/site-packages/numba/tests/test_mathlib.pyr   r          8A;;    c                 *    t          j        |           S r   )r   cosr   s    r   r   r      r   r   c                 *    t          j        |           S r   )r   tanr   s    r   r   r      r   r   c                 *    t          j        |           S r   )r   sinhr   s    r   r   r   !       9Q<<r   c                 *    t          j        |           S r   )r   coshr   s    r   r   r   %   r   r   c                 *    t          j        |           S r   )r   tanhr   s    r   r    r    )   r   r   c                 *    t          j        |           S r   )r   asinr   s    r   r"   r"   -   r   r   c                 *    t          j        |           S r   )r   acosr   s    r   r$   r$   1   r   r   c                 *    t          j        |           S r   )r   atanr   s    r   r&   r&   5   r   r   c                 ,    t          j        | |          S r   )r   atan2)yr   s     r   r(   r(   9       :ar   c                 *    t          j        |           S r   )r   asinhr   s    r   r,   r,   =       :a==r   c                 *    t          j        |           S r   )r   acoshr   s    r   r/   r/   A   r-   r   c                 *    t          j        |           S r   )r   atanhr   s    r   r1   r1   E   r-   r   c                 *    t          j        |           S r   r   sqrtr   s    r   r4   r4   I   r   r   c                 *    t          j        |           S r   )npr4   r   s    r   npy_sqrtr7   M   s    71::r   c                 *    t          j        |           S r   )r   expr   s    r   r9   r9   Q   r   r   c                 *    t          j        |           S r   )r   expm1r   s    r   r;   r;   U   r-   r   c                 *    t          j        |           S r   )r   logr   s    r   r=   r=   Y   r   r   c                 *    t          j        |           S r   )r   log1pr   s    r   r?   r?   ]   r-   r   c                 *    t          j        |           S r   )r   log10r   s    r   rA   rA   a   r-   r   c                 *    t          j        |           S r   )r   floorr   s    r   rC   rC   e   r-   r   c                 *    t          j        |           S r   )r   ceilr   s    r   rE   rE   i   r   r   c                 *    t          j        |           S r   )r   truncr   s    r   rG   rG   m   r-   r   c                 *    t          j        |           S r   )r   isnanr   s    r   rI   rI   q   r-   r   c                 *    t          j        |           S r   )r   isinfr   s    r   rK   rK   u   r-   r   c                 *    t          j        |           S r   )r   isfiniter   s    r   rM   rM   y   s    =r   c                 ,    t          j        | |          S r   )r   hypotr   r)   s     r   rO   rO   }   r*   r   c                 *    t          j        |           S r   )r   degreesr   s    r   rR   rR          <??r   c                 *    t          j        |           S r   )r   radiansr   s    r   rU   rU      rS   r   c                 *    t          j        |           S r   )r   erfr   s    r   rW   rW      r   r   c                 *    t          j        |           S r   )r   erfcr   s    r   rY   rY      r   r   c                 *    t          j        |           S r   )r   gammar   s    r   r[   r[      r-   r   c                 *    t          j        |           S r   )r   lgammar   s    r   r]   r]      s    ;q>>r   c                 ,    t          j        | |          S r   )r   powrP   s     r   r_   r_          8Aq>>r   c                 ,    t          j        | |          S r   )r   gcdrP   s     r   rb   rb      r`   r   c                 ,    t          j        | |          S r   )r   copysignrP   s     r   rd   rd      s    =Ar   c                 *    t          j        |           S r   )r   frexpr   s    r   rf   rf      r-   r   c                 ,    t          j        | |          S r   )r   ldexp)r   es     r   rh   rh      r*   r   c                  2    t           j        t           j        fS r   )r   piri    r   r   get_constantsrm      s    7DF?r   c                      e Zd Zd Zd ZedfdZedfdZefdZefdZ	d Z
 ej        ej        d	k    d
          ef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ef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"ef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,efd)Z-d* Z.efd+Z/d, Z0efd-Z1d. Z2efd/Z3d0 Z4efd1Z5d2 Z6efd3Z7d4 Z8efd5Z9d6 Z:d7 Z;d8 Z<d9 Z=d: Z>d; Z?d< Z@efd=ZAd> ZBefd?ZCd@ ZDefdAZEdB ZFefdCZGdD ZHefdEZIdF ZJefdGZKdH ZLefdIZMdJ ZNefdKZOefdLZPdM ZQdN ZRefdOZSdP ZTefdQZUdR ZVefdSZWdT ZXdUS )VTestMathLibc                 ,    t                      | _        d S r   )r
   ccacheselfs    r   setUpzTestMathLib.setUp   s    &((r   c                 F    |                      t          t                     d S r   )run_nullary_funcrm   no_pyobj_flagsrr   s    r   test_constantszTestMathLib.test_constants   s    m^<<<<<r   exactc                     t          ||          D ]i\  }}| j                            ||f|          }	|	j        }
 |
|          } ||          }|t          j        u rdn|}d|} | j        ||f||d| jd S )Nflagssingle
for input precmsgziprq   compileentry_pointr   float32assertPreciseEqual)rs   pyfuncx_typesx_valuesr|   r   kwargstxvxcrcfuncgotexpectedactual_precr   s                  r   	run_unaryzTestMathLib.run_unary   s    '8,, 	. 	.FB$$VbU%$@@BNE%))CvbzzH&(EM&9&9((tKK$&B(C#D#C . . .&,. . . .	. 	.r   c                    t          |||          D ]x\  }}}	| j                            |||f|          }
|
j        } |||	          } |||	          }|t          j        u rdn|}d|d|	d}|                     ||||           yd S )Nr{   r}   zfor inputs (z, )r   r   )rs   r   r   r   y_valuesr|   r   tyr   r)   r   r   r   r   r   r   s                   r   
run_binaryzTestMathLib.run_binary   s    GXx88 	N 	NHB1$$Vb"XU$CCBNE%1++Cva||H&(EM&9&9((tKK+,11aaa0C##C#MMMM	N 	Nr   c                    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uint64r   float64floatr   )rs   r   r|   r   r   s        r   check_predicate_funcz TestMathLib.check_predicate_func   s    ;U[<u|=%-=%-@ q!Q1%LL#uU||%LL#uU||5 	vw%88888r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S Nr         r   皙?皙?)r   r   r   r   r   r   r   r   r   r   r   rs   r|   r   r   r   s        r   test_sinzTestMathLib.test_sin   \    ;U[<u|=%-1 100vw%88888r   c                 <    |                      t                     d S Nr{   )r   rw   rr   s    r   test_sin_npmzTestMathLib.test_sin_npm       N+++++r   win32z'not exactly equal on win32 (issue #597)c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )r   r   r   r   r   r   r   r   r   r   r   r   s        r   test_coszTestMathLib.test_cos   s^     ;U[<u|=%-1 100vw%88888r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_cos_npmzTestMathLib.test_cos_npm   r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )r   r   r   r   r   r   r   r   r   r   r   r   s        r   test_tanzTestMathLib.test_tan   r   r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_tan_npmzTestMathLib.test_tan_npm   r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S )Nr   r   r   r   r   r   r   r   )r4   r   r   r   r   r   r   r   r   r   r   r   s        r   	test_sqrtzTestMathLib.test_sqrt   \    ;U[<u|=%-1 .--vw%88888r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_sqrt_npmzTestMathLib.test_sqrt_npm      ^,,,,,r   c                 8   t           }g d}t          j        t          j        g}|                     ||||d           t          j        t          j        t          j        t          j        t          j	        t          j
        g}|                     ||||           d S )Nr   r}   r   )r7   r   r   r   r   r   r   r   r   r   r   rs   r|   r   r   r   s        r   test_npy_sqrtzTestMathLib.test_npy_sqrt  s~    ---;-vw%hGGG;<=%-1 	vw%88888r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_npy_sqrt_npmzTestMathLib.test_npy_sqrt_npm      00000r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )r9   r   r   r   r   r   r   r   r   r   r   r   s        r   test_expzTestMathLib.test_exp  r   r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_exp_npmzTestMathLib.test_exp_npm  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )r;   r   r   r   r   r   r   r   r   r   r   r   s        r   
test_expm1zTestMathLib.test_expm1  s\    ;U[<u|=%-1 100vw%88888r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_expm1_npmzTestMathLib.test_expm1_npm'      n-----r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S N)r   
   d   i  i i@B r   g?)r=   r   r   r   r   r   r   r   r   r   r   r   s        r   test_logzTestMathLib.test_log*  s]    ;U[<u|=%-1 A@@vw%88888r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_log_npmzTestMathLib.test_log_npm2  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )r?   r   r   r   r   r   r   r   r   r   r   r   s        r   
test_log1pzTestMathLib.test_log1p5  ]    ;U[<u|=%-1 A@@vw%88888r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_log1p_npmzTestMathLib.test_log1p_npm=  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )rA   r   r   r   r   r   r   r   r   r   r   r   s        r   
test_log10zTestMathLib.test_log10@  r   r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_log10_npmzTestMathLib.test_log10_npmH  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S Nr   r   r   r   r   r         ?r   )r"   r   r   r   r   r   r   r   r   r   r   r   s        r   	test_asinzTestMathLib.test_asinK  r   r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_asin_npmzTestMathLib.test_asin_npmS  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )r$   r   r   r   r   r   r   r   r   r   r   r   s        r   	test_acoszTestMathLib.test_acosV  r   r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_acos_npmzTestMathLib.test_acos_npm^  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )r&   r   r   r   r   r   r   r   r   r   r   r   s        r   	test_atanzTestMathLib.test_atana  s\    ;U[<u|=%-1 100vw%88888r   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_atan_npmzTestMathLib.test_atan_npmi  r   r   c                    t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}d |D             }| 
                    |||||           d S )Nr   c                     g | ]}|d z  S r   rl   .0r   s     r   
<listcomp>z*TestMathLib.test_atan2.<locals>.<listcomp>r      ,,,aAE,,,r   )r(   r   r   r   r   r   r   r   r   r   r   rs   r|   r   r   r   r   s         r   
test_atan2zTestMathLib.test_atan2l  sq    ;U[<u|=%-1 100,,8,,,8UCCCCCr   c                 <    |                      t                     d S r   )r   rw   rr   s    r   test_atan2_npmzTestMathLib.test_atan2_npmu  r   r   c                    t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||d           d S )Nr   doubler   )r,   r   r   r   r   r   r   r   r   r   r   r   s        r   
test_asinhzTestMathLib.test_asinhx  s`    ;U[<u|=%-1 .--vw%hGGGGGr   c                 <    |                      t                     d S r   )r  rw   rr   s    r   test_asinh_npmzTestMathLib.test_asinh_npm  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )r/   r   r   r   r   r   r   r   r   r   r   r   s        r   
test_acoshzTestMathLib.test_acosh  s\    ;U[<u|=%-1 .--vw%88888r   c                 <    |                      t                     d S r   )r  rw   rr   s    r   test_acosh_npmzTestMathLib.test_acosh_npm  r   r   c                    t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||d           d S )Nr   r   r   r   r   r   r   r   r  r   )r1   r   r   r   r   r   r   r   r   r   r   r   s        r   
test_atanhzTestMathLib.test_atanh  s`    ;U[<u|=%-1 0//vw%hGGGGGr   c                 <    |                      t                     d S r   )r  rw   rr   s    r   test_atanh_npmzTestMathLib.test_atanh_npm  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )r   r   r   r   r   r   r   r   r   r   r   r   s        r   	test_sinhzTestMathLib.test_sinh  r   r   c                 <    |                      t                     d S r   )r  rw   rr   s    r   test_sinh_npmzTestMathLib.test_sinh_npm  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )r   r   r   r   r   r   r   r   r   r   r   r   s        r   	test_coshzTestMathLib.test_cosh  r   r   c                 <    |                      t                     d S r   )r  rw   rr   s    r   test_cosh_npmzTestMathLib.test_cosh_npm  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S )Nr
  )r    r   r   r   r   r   r   r   r   r   r   r   s        r   	test_tanhzTestMathLib.test_tanh  \    ;U[<u|=%-1 0//vw%88888r   c                 <    |                      t                     d S r   )r  rw   rr   s    r   test_tanh_npmzTestMathLib.test_tanh_npm  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S N)r   r   r   r   r   r   r   gffffff?)rC   r   r   r   r   r   r   r   r   r   r   r   s        r   
test_floorzTestMathLib.test_floor  \    ;U[<u|=%-1 0//vw%88888r   c                 <    |                      t                     d S r   )r  rw   rr   s    r   test_floor_npmzTestMathLib.test_floor_npm  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r  )rE   r   r   r   r   r   r   r   r   r   r   r   s        r   	test_ceilzTestMathLib.test_ceil  r  r   c                 <    |                      t                     d S r   )r"  rw   rr   s    r   test_ceil_npmzTestMathLib.test_ceil_npm  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r  )rG   r   r   r   r   r   r   r   r   r   r   r   s        r   
test_trunczTestMathLib.test_trunc  r  r   c                 <    |                      t                     d S r   )r&  rw   rr   s    r   test_trunc_npmzTestMathLib.test_trunc_npm  r   r   c                 H    |                      t          t                     d S r   )r   rI   enable_pyobj_flagsrr   s    r   
test_isnanzTestMathLib.test_isnan  "    !!%/A!BBBBBr   c                 H    |                      t          t                     d S r   )r   rI   rw   rr   s    r   test_isnan_npmzTestMathLib.test_isnan_npm  !    !!%~!>>>>>r   c                 H    |                      t          t                     d S r   )r   rK   r*  rr   s    r   
test_isinfzTestMathLib.test_isinf  r,  r   c                 H    |                      t          t                     d S r   )r   rK   rw   rr   s    r   test_isinf_npmzTestMathLib.test_isinf_npm  r/  r   c                 H    |                      t          t                     d S r   )r   rM   r*  rr   s    r   test_isfinitezTestMathLib.test_isfinite  s"    !!(2D!EEEEEr   c                 H    |                      t          t                     d S r   )r   rM   rw   rr   s    r   test_isfinite_npmzTestMathLib.test_isfinite_npm  s!    !!(.!AAAAAr   c           	      @   t           }t          j        t          j        t          j        t          j        g}g d}d |D             }d}|                     ||||||           d }t          j        t          j        fD ]}| j                            |||f|          }	|	j	        }
t          j        |          j        } |t          j        |          j        dz            } |
||          }|                     | |||          d           |                     t          j        |                     t'          j                    5  t'          j        dt,                     |                     t,          d	|||           d d d            n# 1 swxY w Y   !d S )
N)r   r               gzG?g(\?c                     g | ]}|d z   S r   rl   r   s     r   r   z*TestMathLib.test_hypot.<locals>.<listcomp>  r   r   r}   c                 <    t          j        | | z  ||z  z             S r   r3   rP   s     r   naive_hypotz+TestMathLib.test_hypot.<locals>.naive_hypot  s    9QUQU]+++r   r{   g      >@r   errorz overflow encountered in .*scalar)rO   r   r   r   r   r   r   rq   r   r   r   as_dtypetyper6   finfomaxr   
assertTruerM   warningscatch_warningssimplefilterRuntimeWarningassertRaisesRegexp)rs   r|   r   r   r   r   r   r?  flttyr   r   dtvalnb_anss                 r   
test_hypotzTestMathLib.test_hypot  s   ;=%-1///,,8,,,8UDIII	, 	, 	,mU]3 	? 	?E$$VeU^5$IIBNE'..3B"RXb\\%+,,CU3__F##FFF3,<,<8#LLLOOBK//000(** ? ?%g~>>>''(J(3S#? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ?	? 	?s   9FF	F	c                 <    |                      t                     d S r   )rO  rw   rr   s    r   test_hypot_npmzTestMathLib.test_hypot_npm
  r   r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )rR   r   r   r   r   r   r   r   r   r   r   r   s        r   test_degreeszTestMathLib.test_degrees  \    ;U[<u|=%-1 .--vw%88888r   c                 <    |                      t                     d S r   )rS  rw   rr   s    r   test_degrees_npmzTestMathLib.test_degrees_npm      /////r   c                     t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}| 
                    ||||           d S r   )rU   r   r   r   r   r   r   r   r   r   r   r   s        r   test_radianszTestMathLib.test_radians  rT  r   c                 <    |                      t                     d S r   )rY  rw   rr   s    r   test_radians_npmzTestMathLib.test_radians_npm   rW  r   c           
          t           }dddddddt          d          g}t          j        t          j        gt          |          dz  z  }|                     ||||d	d
           d S )Nr                r         ?r;  r   r   r  r   ulps)rW   r   r   r   r   lenr   r   s        r   test_erfzTestMathLib.test_erf#  ss    CsCE%LLA=%-0CMMQ4FGvw%$1 	 	. 	. 	. 	. 	.r   c                 <    |                      t                     d S r   )rc  rw   rr   s    r   test_erf_npmzTestMathLib.test_erf_npm*  r   r   c           
          t           }dddddddt          d          g}t          j        t          j        gt          |          dz  z  }|                     ||||d	d
           d S )Nr   r]  r^  r   r_  r;  r   r   r  r:  r`  )rY   r   r   r   r   rb  r   r   s        r   	test_erfczTestMathLib.test_erfc-  ss    CsCE%LLA=%-0CMMQ4FGvw%$1 	 	. 	. 	. 	. 	.r   c                 <    |                      t                     d S r   )rg  rw   rr   s    r   test_erfc_npmzTestMathLib.test_erfc_npm4  r   r   c                 B   t           }g d}t          j        t          j        gt	          |          dz  z  }|                     ||||dd           dddd	d
t          d          g}t          j        gt	          |          z  }|                     ||||dd           d S )N)r   g      r_  r   r  r9  r`  皙r         @g333333$@g      I@r      )r[   r   r   r   rb  r   r   r   s        r   
test_gammazTestMathLib.test_gamma7  s    (((=%-0CMMQ4FGvw%hQOOO#sD#uU||<=/CMM1vw%$1 	 	. 	. 	. 	. 	.r   c                 <    |                      t                     d S r   )ro  rw   rr   s    r   test_gamma_npmzTestMathLib.test_gamma_npmA  r   r   c           
          t           }dddddddt          d          g}t          j        t          j        gt          |          d	z  z  }|                     ||||d
           d S )Nr   rk  rl  r   g      i@g    _Bgꌠ9Y>)Fr   r   r  r   )r]   r   r   r   r   rb  r   r   s        r   test_lgammazTestMathLib.test_lgammaD  sc    dCtT5<<H=%-0CMMQ4FGvw%hGGGGGr   c                 <    |                      t                     d S r   )rs  rw   rr   s    r   test_lgamma_npmzTestMathLib.test_lgamma_npmJ  s    ~.....r   c                    t           }t          j        t          j        t          j        t          j        t          j        t          j        t          j        t          j	        g}g d}d |D             }| 
                    |||||           d S )Nr   c                     g | ]}|d z  S r   rl   r   s     r   r   z(TestMathLib.test_pow.<locals>.<listcomp>S  r   r   )r_   r   r   r   r   r   r   r   r   r   r   r   s         r   test_powzTestMathLib.test_powM  sq    ;U[<u|=%-1 100,,8,,,8UCCCCCr   c                 0   ddl m}m}m} t          } |t          t          j                  g |dd          R  } |t          t          j                  g |dd          R  }t           |||           \  }}	}
| 
                    |||	|
|           d S )Nr   )productrepeatchain)r   r   r   r   r      r   r   )r   r   r   r}  	      )	itertoolsrz  r{  r|  rb   sortedr   signed_domainunsigned_domainr   r   )rs   r|   rz  r{  r|  r   signed_argsunsigned_argsr   r   r   s              r   test_gcdzTestMathLib.test_gcdV  s    4444444444g5&''
*0&1I1*M*M
 
 
  5())
,2F3F,J,J
 
 
 '*55m+L+L&M#88UCCCCCr   c                 <    |                      t                     d S r   )r  rw   rr   s    r   test_gcd_npmzTestMathLib.test_gcd_npmb  r   r   c                 <    |                      t                     d S r   )rx  rw   rr   s    r   test_pow_npmzTestMathLib.test_pow_npme  r   r   c                 6   t           }t          j        t          j        g}ddddddt	          d          t	          d          t	          d	          g	}t          t          t          j        |||                     \  }}}| 	                    |||||           d S )
Nr   r   r^  r   r   r   -infr   r   )
rd   r   r   r   r   listr   r  rz  r   )rs   r|   r   value_typesvaluesr   r   r   s           r   test_copysignzTestMathLib.test_copysignh  s    }em4b$Q5==%,,,, &*3{FF;;,= '> '>#88UCCCCCr   c                 <    |                      t                     d S r   )r  rw   rr   s    r   test_copysign_npmzTestMathLib.test_copysign_npmq  r   r   c           	          t           }t          j        t          j        g}ddddt	          d          t	          d          t	          d          g}|                     ||||d	           d S )
Ng      r^  r   g      @r  r   r   ry   r   )rf   r   r   r   r   r   r   s        r   
test_frexpzTestMathLib.test_frexpt  s`    =%-0$S&MM5<<u?vw%gFFFFFr   c                 <    |                      t                     d S r   )r  rw   rr   s    r   test_frexp_npmzTestMathLib.test_frexp_npm{  r   r   c                 b   t           }t          j        t          j        fD ]}| j                            ||t          j        f|          }|j        }ddddddt          d          d	ft          d
          d	ft          d          d	ff	D ]#}d|}| 	                     ||  ||            $d S )Nr{   )rm  r   )rm  r   )r   r   )r   r   )r^  r   )r^  r   r   r   r  r   r~   )
rh   r   r   r   rq   r   r   r   r   r   )rs   r|   r   rK  r   r   argsr   s           r   
test_ldexpzTestMathLib.test_ldexp~  s    mU]3 	E 	EE$$VeU[-A$OOBNE"Hh"I,,*U6]]A,>,,*, E E )-.''tffdmDDDDE	E 	Er   c                 <    |                      t                     d S r   )r  rw   rr   s    r   test_ldexp_npmzTestMathLib.test_ldexp_npm  r   r   N)Y__name__
__module____qualname__rt   rx   r*  r   r   r   r   r   unittestskipIfsysplatformr   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.  r1  r3  r5  r7  rO  rQ  rS  rV  rY  r[  rc  re  rg  ri  ro  rq  rs  ru  rx  r  r  r  r  r  r  r  r  r  rl   r   r   ro   ro      s       ) ) )= = = :L
. 
. 
. 
. ,'	N 	N 	N 	N 2D 9 9 9 9 0 9 9 9 9, , , X_S\W,>@ @/ 9 9 9@ @9, , , 0 9 9 9 9, , , 1 9 9 9 9- - - #5 	9 	9 	9 	91 1 1 0 9 9 9 9, , ,  2 9 9 9 9. . . 0 9 9 9 9, , ,  2 9 9 9 9. . .  2 9 9 9 9. . . 1 9 9 9 9- - - 1 9 9 9 9- - - 1 9 9 9 9- - -  2 D D D D. . .  2 H H H H. . .  2 9 9 9 9. . .  2 H H H H. . . 1 9 9 9 9- - - 1 9 9 9 9- - - 1 9 9 9 9- - -  2 9 9 9 9. . . 1 9 9 9 9- - -  2 9 9 9 9. . .C C C? ? ?C C C? ? ?F F FB B B  2 ? ? ? ?:. . . "4 9 9 9 90 0 0 "4 9 9 9 90 0 0 0 . . . ., , , 1 . . . .- - -  2 . . . .. . . !3 H H H H/ / / 0 D D D D 0 
D 
D 
D 
D, , ,, , , #5 D D D D1 1 1  2 G G G G. . .  2 
E 
E 
E 
E. . . . .r   ro   __main__)Cr  r   r  rF  numpyr6   numba.core.compilerr   r   
numba.corer   r   numba.core.configr   r   numba.tests.supportr	   r
   r   r  numba.npr   r*  enable_pyobjectrw   r   r   r   r   r   r    r"   r$   r&   r(   r,   r/   r1   r4   r7   r9   r;   r=   r?   rA   rC   rE   rG   rI   rK   rM   rO   rR   rU   rW   rY   r[   r]   r_   rb   rd   rf   rh   rm   ro   r  mainrl   r   r   <module>r     s{        



      7 7 7 7 7 7 7 7 # # # # # # # # 1 1 1 1 1 1 1 1 ? ? ? ? ? ? ? ? ? ?  " " " " " "UWW %)  "                                                                              \. \. \. \. \.( \. \. \.~ zHMOOOOO r   