
    J/Ph|                     8   d Z ddlZddlZddlZddlmZ ddlm	Z	 ddl
mZmZmZmZmZmZ ddlmZ ddlmZ ddlmZmZmZ dd	lmZ d
ZdZdZddZej        rej        Z nej!        Z e fdZ"d Z#d Z$d Z%d Z&d Z'd Z(d Z)e(Z*d Z+d Z,d Z-d Z.d Z/d Z0d Z1d Z0 e1e0eej2        ej3                   d Z4d Z5d  Z6 ee6d!"          d#             Z7 e1e5d$e6ej8                   d% Z9d& Z:d' Z;d( Z<d) Z=d* Z>d+ Z?d, Z@d- ZAd. ZBd/ ZCd0 ZDd1 ZEd2 ZFd3 ZGd4 ZHd5 ZId6 ZJd7 ZKd8 ZLd9 ZMd: ZNd; ZOd< ZPd= ZQd> ZRd? ZSd@ ZTdA ZUdB ZVdC ZWdD ZXdE ZYdF ZZdG Z[dH Z\dI Z]dJ Z^dK Z_dL Z`dM ZadN ZbdO ZcdP ZddQ ZedR ZfdS ZgdT ZhdU ZidV ZjdW ZkdX ZldY ZmdZ Znd[ Zod\ Zpd] Zqd^ Zrd_ Zsd` Ztda Zudb Zvdc Zwdd Zxde Zydf Zzdg Z{dh Z|di Z}dj Z~dk Zdl Zdm Zdn Zdo Zdp Zdq Zdr Zds Zdt Zdu Zdv Zdw Zdx Zdy Zdz Zd{ Zd| Zd} Zd~ Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZdS )zCodegen for functions used as kernels in NumPy functions

Typically, the kernels of several ufuncs that can't map directly to
Python builtins
    Noverload)impl_ret_untracked)typingtypeserrorsloweringcgutilsconfig)register_jitable)
npdatetime)	cmathimplmathimplnumbers)numpy_versiong+eG?g&{?g9B.?c                 l   t          |          |k    sJ t          | j                  |k    sJ | j        d         |}t          fd| j        D                       r| j        |k    sGddl}|                                j        j        j        }d	                    ||           }J |            dS )zchecks that the following are true:
    - args and sig.args have arg_count elements
    - all input types are homogeneous
    - return type is 'return_type' if provided, otherwise it must be
      homogeneous with the input types.
    r   Nc              3   $   K   | ]
}|k    V  d S N ).0argtys     Q/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numba/np/npyfuncs.py	<genexpr>z/_check_arity_and_homogeneity.<locals>.<genexpr>*   s'      ,,CR,,,,,,    z"{0} called with invalid types: {1})
lenargsallreturn_typeinspectcurrentframef_backf_codeco_nameformat)sigr   arityr   r    fnamemsgr   s          @r   _check_arity_and_homogeneityr*      s     t99sx==E!!!!	!B,,,,38,,,,, K1O1O$$&&-4<299%EEc	 2P1Or   c                     j         }                               }t          j                            ||gt          |j                  z            }t          j        |||          }	 fdt          ||j                  D             }

                    |	|
          }                     |t          j        |j                  S )Nnamec                 F    g | ]\  }}                     ||          S r   )cast)r   r   argtybuildercontextr   s      r   
<listcomp>z0_call_func_by_name_with_cast.<locals>.<listcomp>>   s?     9 9 9S% gsE266 9 9 9r   )moduleget_argument_typellvmliteirFunctionTyper   r   r
   insert_pure_functionzipcallr/   r   float64r   )r2   r1   r&   r   	func_namer   modltyfntyfn	cast_argsresults   ``   `      r   _call_func_by_name_with_castrD   5   s    
 .C

#
#B
'
'C;##C#s38}})<==D		%c4i	@	@	@B9 9 9 9 9 9#&tSX#6#69 9 9I \\"i((F<<HHHr   c                     |j         d         }	 ||         }nI# t          $ r<}d                    |t          |                    }	t	          j        |	          d }~ww xY wj        }
|t          j        v r 	                    |          }fd|D             }|
                                g|z   }|gt          |j                   z   } fd|D             }t          j                            t          j                                        |          }t!          j        |
||          }                    ||                               |d                   }n fd|j         D             }                     |j                  }t          j                            ||          }t!          j        |
||          }                     ||j         |          }|S )Nr   z!No {0} function for real type {1}c                 :    g | ]}t          j        |          S r   )r
   alloca_once_value)r   r   r1   s     r   r3   z/_dispatch_func_by_name_type.<locals>.<listcomp>^   s6     $ $ $ ,Wc:: $ $ $r   c                 ^    g | ])}                     |                                          *S r   )get_value_type
as_pointer)r   r   r2   s     r   r3   z/_dispatch_func_by_name_type.<locals>.<listcomp>f   sC     / / /  ..r22==?? / / /r   c                 :    g | ]}                     |          S r   )r5   )r   atyr2   s     r   r3   z/_dispatch_func_by_name_type.<locals>.<listcomp>n   s'    GGGsG--c22GGGr   r,   )r   KeyErrorr%   strr   LoweringErrorr4   r   complex_domainmake_complex_getpointerlistr6   r7   r8   VoidTyper
   get_or_insert_functionr;   loadr5   r   r9   call_external_function)r2   r1   r&   r   table	user_namer   r=   er)   r>   outptrargs	call_argscall_argtyscall_argltysr@   rA   retvalargtypesrestypes   ``                   r   _dispatch_func_by_name_typerc   E   s    
!B("I		 ( ( (188CFFKK"3'''( .C	U!!! ""7B//$ $ $ $"$ $ $__&&''1	
 dT#(^^+/ / / /"-/ / /{''(<(<(>(>MM+CyAAR###il++GGGGchGGG++CO<<{''::)#t)DDD//SXtLLMs    
A 7AA c                    t          ||d           |\  }}|j        d         }|                     |d          }|                     |d          }|                     |d|j        j        dz
  z            }	|                    d||          }
|                    d||          }|                    d|	|          }|                    ||          }|                    |
|          }|                    |d          5 \  }}|5  |j	        }d d d            n# 1 swxY w Y   |5  |j	        }|
                    ||          }|                    ||          }|                    d||          }|                    d||          }|                    ||          }|                    d	||          }|                    ||          }|                    |||          }|                    ||          }d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |                    |j                  }|                    ||           |                    ||           |S )
N   r      ==Flikely>!=)r*   r   get_constanttypewidthicmp_unsignedand_or_if_elsebasic_blocksdivsremicmp_signedxorselectaddphiadd_incoming)r2   r1   r&   r   numdenr   ZERO	MINUS_ONEMIN_INTden_is_zeroden_is_minus_onenum_is_min_intcould_cause_sigfpe
force_zerothen	otherwisebb_thenbb_otherwisedivr>   num_gt_zeroden_gt_zeronot_same_signmod_not_zeroneeds_fixing	fix_valueresult_otherwiserC   s                                r   np_int_sdiv_implr      s    dA...HC	!BA&&D$$R,,I""2qSX^A-='>??G''dC88K,,T9cBB**4#>>N &6GG[*<==J	E	2	2 ;6GtY 	* 	*)G	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 
	; 
	;".L,,sC((C,,sC((C!--c3==K!--c3==K#KK[AAM"00sDAAL"<<|DDL|YEEI&{{3	::
	; 
	; 
	; 
	; 
	; 
	; 
	; 
	; 
	; 
	; 
	; 
	; 
	; 
	; 
	;; ; ; ; ; ; ; ; ; ; ; ; ; ; ; [[##F
g&&&
(,777Ms[   >HDHD	HD	 H%CH7HH	H
H	HH!Hc                    t          ||d           |\  }}|j        d         }|                     |d          }|                    d||          }|j        }	t          j        ||          5  |j        }
|                    ||          }|                    d||          }|                    d||          }|	                    ||          }|                    d||          }|
                    ||          }|                    |||          }|                    ||          }d d d            n# 1 swxY w Y   |                    |j                  }|                    ||	           |                    ||
           |S )Nre   r   rl   rk   )r*   r   rm   rp   rt   r
   if_unlikelyrv   rw   rx   rq   ry   rz   r{   rn   r|   )r2   r1   r&   r   r}   r~   r   r   den_not_zerobb_no_ifbb_ifr>   r   r   r   r   r   r   	final_modrC   s                       r   np_int_srem_implr      s    dA...HC	!BA&&D((tS99L"H		Wl	3	3 	0 	0#ll3s##))#sD99))#sD99K==,,T3==||M<@@NN<d;;	KK	3//		0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 [[##F
h'''
	5)))Ms   -B<D55D9<D9c                     t          | | |j        d         |j         |          }t          | | |j        d         |j         |          }|                     ||j        ||g          S Nr   rg   )r   r   r   r   
make_tupler2   r1   r&   r   r   rems         r   np_int_sdivrem_implr      h    
7G-?S_Q-?-JD
Q
QC
7G-?S_Q-?-JD
Q
QCgsc
CCCr   c                 F   t          ||d           |\  }}|j        d         }|                     |d          }|                    d||          }|                    |d          5 \  }	}
|	5  |j        }d d d            n# 1 swxY w Y   |
5  |                    ||          }|j        }d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |                    |j                  }|	                    ||           |	                    ||           |S )Nre   r   rh   Fri   )
r*   r   rm   rp   rs   rt   udivr{   rn   r|   )r2   r1   r&   r   r}   r~   r   r   div_by_zeror   r   r   r   r   rC   s                  r   np_int_udiv_implr      s    dA...HC	!BA&&D''dC88K	U	3	3 /7Hi 	* 	*)G	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*  	/ 	/,,sC((C".L	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/	/ / / / / / / / / / / / / / / [[##F
g&&&
\***MsZ   (C.B6CB	C	B	
CB9-C9B=	=C B=	CCCc                    t          ||d           |\  }}|j        d         }|                     |d          }|                    d||          }|j        }	t          j        ||          5  |j        }
|                    ||          }d d d            n# 1 swxY w Y   |                    |j	                  }|
                    ||	           |
                    ||
           |S )Nre   r   rl   )r*   r   rm   rp   rt   r
   r   uremr{   rn   r|   )r2   r1   r&   r   r}   r~   r   r   r   r   r   r>   rC   s                r   np_int_urem_implr      s%    dA...HC	!BA&&D((tS99L"H		Wl	3	3 $ $#ll3s##$ $ $ $ $ $ $ $ $ $ $ $ $ $ $ [[##F
h'''
U###Ms   -BBBc                     t          | | |j        d         |j         |          }t          | | |j        d         |j         |          }|                     ||j        ||g          S r   )r   r   r   r   r   r   s         r   np_int_udivrem_implr      r   r   c                 8    t          ||d            |j        | S Nre   )r*   fdivr2   r1   r&   r   s       r   np_real_div_implr     s%     !dA...7<r   c                    t          ||d           |\  }}|j        d         }|                     |d          }|                    ||          }|                    d||          }	|                    d||          }
|                    d||          }|                    |	|                    |
|                    }|                    |||          }|                    ||          S )Nre   r           rl   <)	r*   r   rm   fremfcmp_orderedrq   rx   ry   fadd)r2   r1   r&   r   in1in2r   r   resres_ne_zeroden_lt_zerores_lt_zeror   r   s                 r   np_real_mod_implr     s     !dA...HC	!BC((D
,,sC
 
 C&&tS$77K&&sC66K&&sC66K<< 'K E EG GL|S$77I<<Y'''r   c                 8    t          ||d            |j        | S r   )r*   r   r   s       r   np_real_fmod_implr     s#     dA...7<r   c                     t           j                            |j        d          }|                    ||          }|                    d||          }|                    |||          S )Nr   r   )r6   r7   Constantrn   fsubr   ry   )r2   r1   r   r   arg_negatedarg_is_negatives         r   _fabsr      s[    ;#..D,,tS))K**3T::O>>/;<<<r   c           	      4     fd|D             \  }}|j         }|j        }|j         }|j        }	|j        t          fd||||	fD                       s
J d                                 j                  }
t          j                            d          }t          j                            d          }t           |          }t           |	          }
                    d||          }                    |          5 \  }}|5  
                    d||          }
                    d||          }                    ||          }                    |          5 \  }}|5                      ||          |
_                             ||          |
_        d d d            n# 1 swxY w Y   |5                      |	|          }                    |	|          }                    ||          }                    ||          }                    ||          }                    ||          }                    ||          }                    ||          }                    ||          |
_                             ||          |
_        d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |5                      ||	          }                    ||          }                    |	|          }                    ||          }                    ||          }                    ||          }                    ||          }                    ||          }                    ||          |
_                             ||          |
_        d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |
                                S )Nc                 V    g | ]%}                     j        d          |          &S r   valuerQ   r   r   r   r1   r2   r&   s     r   r3   z'np_complex_div_impl.<locals>.<listcomp>/  D     ! ! ! $$Wchqk$EE ! ! !r   c                 &    g | ]}|j         k    S r   rn   r   iftypes     r   r3   z'np_complex_div_impl.<locals>.<listcomp>7      @@@!@@@r   mismatched typesr         ?>=rh   )realimagrn   r   make_helperr   r6   r7   r   r   r   rs   rq   r   fmulr   r   	_getvalue) r2   r1   r&   r   r   r   in1rin1iin2rin2ir[   r   ONEin2r_absin2i_absin2r_abs_ge_in2i_absr   r   in2r_is_zeroin2i_is_zeroin2_is_zeroinn_theninn_otherwiserattmp1tmp2scltmp3tmp4tmp5tmp6r   s    ```                            @r   np_complex_div_implr   '  sj   ! ! ! ! ! !! ! !HC 8D8D8D8DIE@@@@dD$'?@@@AAUUCUUUU


gs
7
7C;s++D
+

uc
*
*C Wgt,,HWgt,,H"//hII	-	.	. +/2C4 	7 	7"//hEEL"//hEEL!,,|\BBK-- 71J(M < <  '||D(;;CH&||D(;;CH	< < < < < < < < < < < < < < <
 # 7 7 ",,tT22C"<<c22D"<<d33D!,,sD11C #<<c22D"<<c22D"<<d33D"<<d33D&||D#66CH&||D#66CH7 7 7 7 7 7 7 7 7 7 7 7 7 7 77 7 7 7 7 7 7 7 7 7 7 7 7 7 7	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	7 	76  	/ 	/ ,,tT**C<<c**D<<d++D,,sD))C <<c**D<<c**D<<d++D<<d++D||D#..CH||D#..CH	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/ 	/9+/ +/ +/ +/ +/ +/ +/ +/ +/ +/ +/ +/ +/ +/ +/Z ==??s   O;AK$-K37F6	*K6F::K=F:>KC'J6	*K6J::K=J:>KK$KK$KK$O;$K(	(O;+K(	,O;1C'O$O;$O(	(O;+O(	,O;;O?O?c                     d S r   r   x1x2s     r   _npy_logaddexpr   t      Dr   c                 H    t          | d          fd            }d S )Ngenerictargetc                 >    | |k    rd S  |           fd}|S )Nc                     | |}}||k    r|z   S ||z
  }|dk    r|  |                     z   S |dk    r|  |                    z   S |S )Nr   r   )r   r   xytmpexpfnlog1pfnshifts        r   implz;_generate_logaddexp.<locals>.ol_npy_logaddexp.<locals>.impl  s}    rqAQ5y !e!GGwwuucT{{3333QhhwwuuSzz2222 Jr   r   )r   r   r  r  constr   r  s      @r   ol_npy_logaddexpz-_generate_logaddexp.<locals>.ol_npy_logaddexp{  sI    88F5			 	 	 	 	 	 	 r   r   )
fnoverloadr  r  r   r  s    ``` r   _generate_logaddexpr  w  sL     j+++      ,+  r   c                     d S r   r   r   s     r   r   r     r   r   c                     t          ||d           | j                            t                    }|                    | j        g |j        R i           }|                     ||          } |||          S r   )r*   typing_contextresolve_value_typer   get_call_typer   get_functionr2   r1   r&   r   r@   r  s         r   np_real_logaddexp_implr    ss     dA...!44^DDD


W3\sx\\2
F
FCc**D4r   c                     d S r   r   r   s     r   _npy_logaddexp2r    r   r   c                     d S r   r   r   s    r   npy_log2_1pr    r   r   r   r   c                 2     | t                     fd}|S )Nc                 2    t          j        |           z  S r   )nplog1p)r   LOG2Es    r   r  zol_npy_log2_1p.<locals>.impl  s    rx{{""r   )
_NPY_LOG2E)r   r  r  s     @r   ol_npy_log2_1pr    s.    AjMME# # # # #Kr   r   c                     t          ||d           | j                            t                    }|                    | j        g |j        R i           }|                     ||          } |||          S r   )r*   r
  r  r  r  r   r  r  s         r   np_real_logaddexp2_implr    ss     dA...!44_EED


W3\sx\\2
F
FCc**D4r   c                 .   |\  }}|j         t          fd|D                       s
J d            |j        \  }}|                     |||t          j                  }|                     |||t          j                  }|                    ||          S )Nc              3   .   K   | ]}|j         k    V  d S r   r   )r   r   lltypes     r   r   z&np_int_truediv_impl.<locals>.<genexpr>  s)      ,,!qvv~,,,,,,r   zmust have homogeneous types)rn   r   r   r/   r   r<   r   )	r2   r1   r&   r   r}   r~   numtydentyr   s	           @r   np_int_truediv_implr#    s     HCXF,,,,t,,,,,KK.KKKK8LE5
,,wUEM
:
:C
,,wUEM
:
:C<<C   r   c                     t          | |||          }t          j        |j        |j                  }t	          | |||f          S r   )r   r   	signaturer   np_real_floor_impl)r2   r1   r&   r   r   ss         r   np_real_floor_div_implr(    sA    
7GS$
7
7C#/::AgwC6:::r   c                     t          | | |j        d         |j         |          }t          | | |j        d         |j         |          }|                     ||j        ||g          S r   )r(  r   r   r   r   r   s         r   np_real_divmod_implr*    si    
 '3E3?13Esx3PRV
W
WC
7G-?S_Q-?-JD
Q
QCgsc
CCCr   c                 l    j         d         j        }t          j        ||          } fd|D             \  }}|j        }|j        }	|j        }
|j        }|j        t          fd||	|
|fD                       s
J d            t          j	        
                    d          }                     j                  }||_        t           |
          }t           |          }                    d||          }                    |          5 \  }}|5                      ||
          }                    |	|          }                    ||          }                    ||          }                    |
|          }                    ||          }t'           ||f          |_        d d d            n# 1 swxY w Y   |5                      |
|          }                    ||          }                    |
|          }                    |	|          }                    ||          }                    ||          }t'           ||f          |_        d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |                                S )Nr   c                 V    g | ]%}                     j        d          |          &S r   r   r   s     r   r3   z-np_complex_floor_div_impl.<locals>.<listcomp>  r   r   c                 &    g | ]}|j         k    S r   r   r   s     r   r3   z-np_complex_floor_div_impl.<locals>.<listcomp>  r   r   r   r   r   )r   underlying_floatr   r%  r   r   rn   r   r6   r7   r   r   r   r   r   rs   r   r   r   r&  r   )r2   r1   r&   r   
float_kind	floor_sigr   r   r   r   r   r   r   r[   r   r   r   r   r   r   r   r   r   r   r   r   s   ```                      @r   np_complex_floor_div_implr1    s    !-J Z88I! ! ! ! ! !! ! !HC 8D8D8D8DIE@@@@dD$'?@@@AAUUCUUUU;s++D


gs
7
7CCHWgt,,HWgt,,H"//hII	-	.	. P2C4 	P 	P,,tT**C<<c**D<<c**D<<d++D<<d++D<<d++D)'7IwOOCH	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P  	P 	P,,tT**C<<c**D<<c**D<<d++D<<d++D<<d++D)'7IwOOCH	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	P 	PP P P P P P P P P P P P P P P& ==??s\   J!BG
>J
G	JG	JBJ 4J J	JJ	JJJc                 R    t          ||d           t          j        | |||          S r   r*   r   complex_power_implr   s       r   np_complex_power_implr5    +     dA...%gwTBBBr   c                 R    t          ||d           t          j        | |||          S r   )r*   r   real_power_implr   s       r   real_float_power_implr9    s+     dA..."7GS$???r   c                 R    t          ||d           t          j        | |||          S r   r3  r   s       r   np_complex_float_power_implr;  $  r6  r   c                 R    t          ||d           t          j        | |||          S r   )r*   r   gcd_implr   s       r   np_gcd_implr>  -  +     dA...WgsD999r   c                     |j         \  }}||cxk    r|j        k    sn J |\  }}d }|                     ||||          }	t          | ||j        |	          S )Nc                 b    | dk    rdn't          | |t          j        ||           z  z            S )z7
        Like gcd, heavily cribbed from Julia.
        r   )absr  gcd)abs     r   lcmznp_lcm_impl.<locals>.lcm;  s2     FFqqAbfQll):$; < <<r   )r   r   compile_internalr   )
r2   r1   r&   r   xtyytyr   r   rF  r   s
             r   np_lcm_implrJ  5  s}    xHC#((((((((((DAq= = = 
"
"7Cd
;
;CgwEEEr   c                 |   t          ||d           t          dk    r2d }|                     ||||          }t          | ||j        |          S |d         }|j        d         }|                     ||          }|j        }	|                     |	d          }
|                     |	d          }|                     |	d          }|                     |	t          d                    }|
|_
        |
|_        t          j        t          j        g|gd	z  R  }||                                g}t#          | |||          }t%          | |||          }t'          | |||          }|                    ||
|          }|                    |||          }|                    |||          |_
        |                                S )
Nrg   )re   r   c                 Z    t          j        | j        | j                  }|dk    rdS | |z  S )Nr   y                )mathhypotr   r   )zrB  s     r   complex_signz*np_complex_sign_impl.<locals>.complex_signO  s.    *QVQV,,Caxxv3wr   r   r   r         nanre   )r*   r   rG  r   r   r   rQ   r.  rm   floatr   r   r   r%  r   booleanr   np_complex_ge_implnp_complex_eq_implnp_complex_lt_implry   )r2   r1   r&   r   rP  r   opr   rC   float_tyr   r   r   NANcmp_sigcmp_argsarg1_ge_arg2arg1_eq_arg2arg1_lt_arg2real_when_gereal_when_nges                        r   np_complex_sign_implrb  H  s    !dA...	 	 	 &&wc4HH!'7COSIII!WXa[%%gr22&##Hc22##Hc22((488	""8U5\\::"5=<B4!8<<<((**+)'7GXNN)'7GXNN)'7GXNN~~lD#>>|YDDnn\<OO!!!r   c                 P    t          ||d           t          j        |d|          S )Nrg   z	llvm.rintr*   r   call_fp_intrinsicr   s       r   np_real_rint_implrf  u  )     dA...%g{DAAAr   c                 t   t          ||d           |j        d         }|j        }|                     |||d                   }|                     ||          }t	          j        |gdz   }t          | |||j        g          |_        t          | |||j        g          |_        |	                                S )Nrg   r   r   re   )
r*   r   r.  rQ   r   r%  rf  r   r   r   )	r2   r1   r&   r   r   rY  r   r[   	inner_sigs	            r   np_complex_rint_implrj  {  s     !dA...	!B"H


w$q'

:
:C


w
+
+C 8*Q,/I '9sxjIICH '9sxjIICH==??r   c                 R    t          ||d           t          j        | |||          S Nrg   )r*   r   exp_implr   s       r   np_real_exp_implrn    r?  r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   rm  r   s       r   np_complex_exp_implrp    +     dA...gwT:::r   c                     t          ||d           |d         j        }t          j                            ||g          }t          j        |j        |d          }|                    ||d         g          S )Nrg   r   z	llvm.exp2r,   	r*   rn   r6   r7   r8   r
   r9   r4   r;   r2   r1   r&   r   ll_tyr@   rA   s          r   np_real_exp2_implrv    r     dA...GLE;##EE844D		%gnd+6
8 
8 
8B<<T!WI&&&r   c                    t          ||d           |j        d         }|j        }|                     |||d                   }|                     ||          }|                     |t
                    }|                    ||j                  |_        |                    ||j                  |_        t          | |||
                                g          S Nrg   r   r   )r*   r   r.  rQ   rm   
_NPY_LOGE2r   r   r   rp  r   )	r2   r1   r&   r   r   rY  r   r   loge2s	            r   np_complex_exp2_implr|    s     dA...	!B"H


w$q'

:
:C


w
+
+C  :66E||E38,,CH||E38,,CHws}}6GHHHr   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   log_implr   s       r   np_real_log_implr    r?  r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   r~  r   s       r   np_complex_log_implr    rq  r   c                     t          ||d           |d         j        }t          j                            ||g          }t          j        |j        |d          }|                    ||d         g          S )Nrg   r   z	llvm.log2r,   rs  rt  s          r   np_real_log2_implr    rw  r   c                 ~   t          ||d           |j        d         }|j        }t          | |||          }|                     |||          }|                     |t                    }|                    ||j                  |_        |                    ||j	                  |_	        |
                                S ry  )r*   r   r.  r  rQ   rm   r  r   r   r   r   )r2   r1   r&   r   r   rY  r   log2es           r   np_complex_log2_implr    s     dA...	!B"H
gwT
:
:C


w#

6
6C  :66E||E38,,CH||E38,,CH==??r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   
log10_implr   s       r   np_real_log10_implr    +     dA...wd;;;r   c                 ~   t          ||d           |j        d         }|j        }t          | |||          }|                     |||          }|                     |t                    }|                    ||j                  |_        |                    ||j	                  |_	        |
                                S ry  )r*   r   r.  r  rQ   rm   _NPY_LOG10Er   r   r   r   )r2   r1   r&   r   r   rY  r   log10es           r   np_complex_log10_implr    s     dA...	!B"H
gwT
:
:C


w#

6
6C!!(K88F||FCH--CH||FCH--CH==??r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   
expm1_implr   s       r   np_real_expm1_implr    r  r   c                 T   t          ||d           |j        d         }|j        }t          j        |gdz   }|                     |d          }|                     |||d                   }t          | |||j        g          }	|                     ||          }
t          | |||j
        g          }t          | |||j
        g          }|                    |	|          }|                    |	|          |
_
        |                    ||          |
_        |
                                S )Nrg   r   re   rQ  r   )r*   r   r.  r   r%  rm   rQ   rn  r   np_real_cos_implr   np_real_sin_implr   r   r   )r2   r1   r&   r   r   rY  float_unary_sigr   r   rD  r[   cos_imagsin_imagr   s                 r   np_complex_expm1_implr    s    dA...	!B"H&
15O$$Xt44I


w$q'

:
:C'?SXJGGA


w
+
+C/CH:NNH/CH:NNH
,,q(
#
#C||Ax((CH||C++CH==??r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   
log1p_implr   s       r   np_real_log1p_implr  	  r  r   c                 $   t          ||d           |j        d         }|j        }t          j        |gdz   }t          j        |gdz   }|                     |d          }|                     |||d                   }	|                     ||          }
|                    |	j        |          }t          | ||||	j
        g          }t          | |||	j
        |g          |
_
        t          | |||g          |
_        |
                                S )Nrg   r   re      r   r   )r*   r   r.  r   r%  rm   rQ   r   r   np_real_hypot_implr   np_real_atan2_implr  r   )r2   r1   r&   r   r   rY  r  float_binary_sigr   r   r[   real_plus_onels                r   np_complex_log1p_implr    s    dA...	!B"H&
15O'(A6


x
-
-C


w$q'

:
:C


w
+
+CLL3//M7G-=)384	6 	6A!'74D#&8]";= =CH/A3GGCH==??r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   	sqrt_implr   s       r   np_real_sqrt_implr  &  +     dA...gwT:::r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   r  r   s       r   np_complex_sqrt_implr  +  s+     dA...wd;;;r   c                 h    t          ||d           |                    |d         |d                   S Nrg   r   )r*   mulr   s       r   np_int_square_implr  3  s0     dA...;;tAwQ(((r   c                 h    t          ||d           |                    |d         |d                   S r  )r*   r   r   s       r   np_real_square_implr  8  s0     dA...<<Qa)))r   c                     t          ||d           t          j        |j        gdz   }t	          j        | |||d         |d         g          S Nrg   r  r   )r*   r   r%  r   r   complex_mul_impl)r2   r1   r&   r   
binary_sigs        r   np_complex_square_implr  <  sV     dA...!CO#4Q#67J#GWj&*1gtAw%79 9 9r   c                     t          ||d           t          d          d             fd}|                     ||||          S )Nrg   T)fastmathc                 f    | dk     rt          j        |  d           S t          j        | d          S )Nr   gUUUUUU?)r  powerr  s    r   cbrtznp_real_cbrt_impl.<locals>.cbrtK  s4    q55HaR++++8Ay)))r   c                 Z    t          j        |           rt           j        S  |           S r   )r  isnanrR  )r   r  s    r   _cbrtz np_real_cbrt_impl.<locals>._cbrtR  s'    8A;; 	6MtAwwr   )r*   r   rG  )r2   r1   r&   r   r  r  s        @r   np_real_cbrt_implr  F  sq     dA... t$$$* * %$*    
 ##GUC>>>r   c                 V   t          ||d           |j        }t          j        |gdz   }|                     ||d         |t
          j                  }|                     t
          j        d          }|                    ||          }|                     ||t
          j        |          S r  )	r*   r   r   r%  r/   r   r<   rm   r   )	r2   r1   r&   r   r   r  in_as_floatr   result_as_floats	            r   np_int_reciprocal_implr  ]  s     !dA...	B!B46*J,,wQU]CCK


u}a
0
0Cll344O<<%-DDDr   c                     t          ||d           |                     |j        d          }|                    ||d                   S )Nrg   r   r   )r*   rm   r   r   )r2   r1   r&   r   r   s        r   np_real_reciprocal_implr  k  sC     dA...


s
4
4C<<T!W%%%r   c                    t          ||d           |j        d         }|j        }|                     |d          }|                     |d          }|                     |||d                   }|                     ||          }	|j        }
|j        }t          | ||
          }t          | ||          }|                    d||          }|	                    |          5 \  }}|5  |
                    ||
          }|                    ||          }|                    |
|          }|
                    ||          }|                    ||          }||	_        |                    ||          |	_        d d d            n# 1 swxY w Y   |5  |
                    |
|          }|                    |
|          }|                    ||          }|
                    ||          }|                    ||          |	_        |                    ||          |	_        d d d            n# 1 swxY w Y   d d d            n# 1 swxY w Y   |	                                S )Nrg   r   r   r   r   <=)r*   r   r.  rm   rQ   r   r   r   r   rs   r   r   r   r   r   )r2   r1   r&   r   r   rY  r   r   r   r[   r   r   in1r_absin1i_absin1i_abs_le_in1r_absr   r   rtmp0dinv_dminus_rs                         r   np_complex_reciprocal_implr  q  s    !dA...	!B"H#..D


x
-
-C


w$q'

:
:C


w
+
+C8D8DWgt,,HWgt,,H"//hII	-	.	. 12C4 	4 	4T4((A<<a((DT4((ALLa((Ell4++GCH||GU33CH	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4 	4  	1 	1T4((A<<a((DT4((ALLa((E||Au--CH||D%00CH	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	11 1 1 1 1 1 1 1 1 1 1 1 1 1 1" ==??s\   "I(BF9IF			IF		IBH-!I-H1	1I4H1	5IIIc                 R    t          ||d           t          j        | |||          S rl  )r*   r   sin_implr   s       r   r  r    r?  r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   r  r   s       r   np_complex_sin_implr    rq  r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   cos_implr   s       r   r  r    r?  r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   r  r   s       r   np_complex_cos_implr    rq  r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   tan_implr   s       r   np_real_tan_implr    r?  r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   	asin_implr   s       r   np_real_asin_implr    r  r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   	acos_implr   s       r   np_real_acos_implr    r  r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   	atan_implr   s       r   np_real_atan_implr    r  r   c                 R    t          ||d           t          j        | |||          S r   )r*   r   atan2_float_implr   s       r   r  r    +     dA...$WgsDAAAr   c                 R    t          ||d           t          j        | |||          S r   )r*   r   hypot_float_implr   s       r   r  r    r  r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   	sinh_implr   s       r   np_real_sinh_implr    r  r   c                    t          ||d           |j        d         }|j        }t          j        |gdz   }|                     |||d                   }|                     ||          }|j        }	|j        }
t          | |||
g          }t          | |||	g          }t          | |||
g          }t          | |||	g          }|                    ||          |_        |                    ||          |_        |                                S Nrg   r   re   )r*   r   r.  r   r%  rQ   r   r   r  r  r  np_real_cosh_implr   r   )r2   r1   r&   r   r   ftyfsig1r   r[   xrxisxishxrcxichxrs                  r   np_complex_sinh_implr    s    !dA... 
!B

CseAg&EWb$q'22A


w
+
+C	
B	
B
7GURD
9
9CWgurd;;D
7GURD
9
9CWgurd;;D||C&&CH||C&&CH==??r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   	cosh_implr   s       r   r  r    r  r   c                    t          ||d           |j        d         }|j        }t          j        |gdz   }|                     |||d                   }|                     ||          }|j        }	|j        }
t          | |||
g          }t          | |||	g          }t          | |||
g          }t          | |||	g          }|                    ||          |_        |                    ||          |_        |                                S r  )r*   r   r.  r   r%  rQ   r   r   r  r  r  r  r   r   )r2   r1   r&   r   r   r  r  r   r[   r  r  r  r  r  r  s                  r   np_complex_cosh_implr    s    !dA...	!B

CseAg&EWb$q'22A


w
+
+C	
B	
B
7GURD
9
9CWgurd;;D
7GURD
9
9CWgurd;;D||C&&CH||C&&CH==??r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   	tanh_implr   s       r   np_real_tanh_implr  &  r  r   c                    t          ||d           |j        d         }|j        }t          j        |gdz   }|                     |d          }|                     |||d                   }|                     ||          }	|j        }
|j        }t          | |||g          }t          | |||g          }t          | |||
g          }t          | |||
g          }|                    ||          }|                    ||          }|                    ||          }|                    ||          }|                    ||          }|                    ||          }|                    ||          }|                    ||          }|                    ||          }|                    ||          }|                    ||          }|                    ||          }|                    ||          }|                    ||          }|                    ||          |	_        |                    ||          |	_        |	                                S )Nrg   r   re   r   )r*   r   r.  r   r%  rm   rQ   r   r   r  r  r  r  r   r   r   r   r   )r2   r1   r&   r   r   r  r  r   r   r[   r  r  sicishrchr_rsis_rcicsqr_rcsqr_icr  r  rs_rcis_icis_rcrs_icnumrnumis                                 r   np_complex_tanh_implr  +  s%    !dA...	!B

CseAg&E


sC
(
(CWb$q'22A


w
+
+C	
B	
B	'7EB4	8	8B	'7EB4	8	8B
GWebT
:
:CWgurd;;D	b#		B
,,r4
 
 C	b$		B	b#		B\\"b!!F\\"b!!FVV$$ALLa  ELLR  ELLb!!ELLb!!ELLR  E<<u%%D<<u%%D||D%((CH||D%((CH==??r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   
asinh_implr   s       r   np_real_asinh_implr  T  r  r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   
acosh_implr   s       r   np_real_acosh_implr  \  r  r   c                    t          ||d           |j        d         }t          j        |gdz   }|                     ||d          }|d         }t          j        | ||||g          }t          j        | ||||g          }	t          | |||g          }
t          | |||	g          }t          j	        | |||
|g          }t          j        | ||||g          }t          | |||g          S )Nrg   r   r  y      ?        )r*   r   r   r%  get_constant_genericr   complex_add_implcomplex_sub_implr  r  r  )r2   r1   r&   r   r   csig2r   r   
x_plus_onex_minus_onesqrt_x_plus_onesqrt_x_minus_one	prod_sqrtlog_args                 r   np_complex_acosh_implr!  a  s.    !dA...	!Brd1f%E

&
&wJ
?
?CQA)'7EAEHDJ K KJ*7GUQFIEK L LK*7GS:,OOO+GWcK=QQ('5+:+;+=> >I &wBKAM N NG wwi@@@r   c                 R    t          ||d           t          j        | |||          S rl  )r*   r   
atanh_implr   s       r   np_real_atanh_implr$    r  r   c                 P    t          ||d           t          j        |d|          S )Nrg   z
llvm.floorrd  r   s       r   r&  r&    )     dA...%g|TBBBr   c                 P    t          ||d           t          j        |d|          S )Nrg   z	llvm.ceilrd  r   s       r   np_real_ceil_implr(    rg  r   c                 P    t          ||d           t          j        |d|          S )Nrg   z
llvm.truncrd  r   s       r   np_real_trunc_implr*    r&  r   c                 P    t          ||d           t          j        |d|          S )Nrg   z	llvm.fabsrd  r   s       r   np_real_fabs_implr,    rg  r   c                     t          ||dt          j                   |j        d          fd|D             \  }}|j        }|j        }|j        }|j        }	                    d||          }
                    d||	          }                    d||          }                    d||	          }                    |
|          }                    ||          }                    ||          S )	Nre   r   r   c                 @    g | ]}                     |           S r   rQ   r   r   r1   r2   r   s     r   r3   z&np_complex_ge_impl.<locals>.<listcomp>  .    MMM$$Wb$<<MMMr   rk   ordrh   r   	r*   r   rT  r   r   r   r   rq   rr   )r2   r1   r&   r   r   r   r  r  yryixr_gt_yrno_nan_xi_yixr_eq_yrxi_ge_yi
first_termsecond_termr   s   ``              @r   rU  rU         !dA5=IIII	!BMMMMMMMMMHC	B	B	B	B##CR00H''r266L##D"b11H##D"b11Hh55J,,x22K;;z;///r   c                     t          ||dt          j                   |j        d          fd|D             \  }}|j        }|j        }|j        }|j        }	                    d||          }
                    d||	          }                    d||          }                    d||	          }                    |
|          }                    ||          }                    ||          S )	Nre   r.  r   c                 @    g | ]}                     |           S r0  r1  r2  s     r   r3   z&np_complex_le_impl.<locals>.<listcomp>  r3  r   r   r4  rh   r  r5  )r2   r1   r&   r   r   r   r  r  r6  r7  xr_lt_yrr9  r:  xi_le_yir<  r=  r   s   ``              @r   np_complex_le_implrC    r>  r   c                     t          ||dt          j                   |j        d          fd|D             \  }}|j        }|j        }|j        }|j        }	                    d||          }
                    d||	          }                    d||          }                    d||	          }                    |
|          }                    ||          }                    ||          S )Nre   r.  r   c                 @    g | ]}                     |           S r0  r1  r2  s     r   r3   z&np_complex_gt_impl.<locals>.<listcomp>  r3  r   rk   r4  rh   r5  )r2   r1   r&   r   r   r   r  r  r6  r7  r8  r9  r:  xi_gt_yir<  r=  r   s   ``              @r   np_complex_gt_implrG         !dA5=IIII	!BMMMMMMMMMHC	B	B	B	B##CR00H''r266L##D"b11H##CR00Hh55J,,x22K;;z;///r   c                     t          ||dt          j                   |j        d          fd|D             \  }}|j        }|j        }|j        }|j        }	                    d||          }
                    d||	          }                    d||          }                    d||	          }                    |
|          }                    ||          }                    ||          S )Nre   r.  r   c                 @    g | ]}                     |           S r0  r1  r2  s     r   r3   z&np_complex_lt_impl.<locals>.<listcomp>  r3  r   r   r4  rh   r5  )r2   r1   r&   r   r   r   r  r  r6  r7  rA  r9  r:  xi_lt_yir<  r=  r   s   ``              @r   rW  rW    rH  r   c                 B    t          ||dt          j                   |j        d          fd|D             \  }}|j        }|j        }|j        }|j        }	                    d||          }
                    d||	          }                    |
|          S )Nre   r.  r   c                 @    g | ]}                     |           S r0  r1  r2  s     r   r3   z&np_complex_eq_impl.<locals>.<listcomp>  r3  r   rh   )r*   r   rT  r   r   r   r   rq   )r2   r1   r&   r   r   r   r  r  r6  r7  r:  xi_eq_yir   s   ``          @r   rV  rV    s     !dA5=IIII	!BMMMMMMMMMHC	B	B	B	B##D"b11H##D"b11H<<(+++r   c                 B    t          ||dt          j                   |j        d          fd|D             \  }}|j        }|j        }|j        }|j        }	                    d||          }
                    d||	          }                    |
|          S )Nre   r.  r   c                 @    g | ]}                     |           S r0  r1  r2  s     r   r3   z&np_complex_ne_impl.<locals>.<listcomp>  r3  r   rl   )r*   r   rT  r   r   r   fcmp_unorderedrr   )r2   r1   r&   r   r   r   r  r  r6  r7  xr_ne_yrxi_ne_yir   s   ``          @r   np_complex_ne_implrT    s     !dA5=IIII	!BMMMMMMMMMHC	B	B	B	B%%dB33H%%dB33H;;x***r   c                     |                      |||          }t          j        ||j                  }t          j        ||j                  }|                    ||          S )Nr   )rQ   r
   is_truer   r   rr   )r2   r1   r   valcomplex_valre_trueim_trues          r   _complex_is_truer[  )  sX    &&w#&>>Kog{'788Gog{'788G;;w(((r   c                     t          ||dt          j                   t          j        ||d                   }t          j        ||d                   }|                    ||          S Nre   r.  r   rg   )r*   r   rT  r
   rV  rq   r2   r1   r&   r   rD  rE  s         r   np_logical_and_implr_  0  sY     dA5=IIIIa))Aa))A<<1r   c                     t          ||dt          j                   t          | ||j        d         |d                   }t          | ||j        d         |d                   }|                    ||          S r]  )r*   r   rT  r[  r   rq   r^  s         r   np_complex_logical_and_implra  7  si     dA5=IIII'38A;Q@@A'38A;Q@@A<<1r   c                     t          ||dt          j                   t          j        ||d                   }t          j        ||d                   }|                    ||          S r]  )r*   r   rT  r
   rV  rr   r^  s         r   np_logical_or_implrc  >  Y     dA5=IIIIa))Aa))A;;q!r   c                     t          ||dt          j                   t          | ||j        d         |d                   }t          | ||j        d         |d                   }|                    ||          S r]  )r*   r   rT  r[  r   rr   r^  s         r   np_complex_logical_or_implrf  E  i     dA5=IIII'38A;Q@@A'38A;Q@@A;;q!r   c                     t          ||dt          j                   t          j        ||d                   }t          j        ||d                   }|                    ||          S r]  )r*   r   rT  r
   rV  rx   r^  s         r   np_logical_xor_implri  L  rd  r   c                     t          ||dt          j                   t          | ||j        d         |d                   }t          | ||j        d         |d                   }|                    ||          S r]  )r*   r   rT  r[  r   rx   r^  s         r   np_complex_logical_xor_implrk  S  rg  r   c                 r    t          ||dt          j                   t          j        ||d                   S Nrg   r.  r   )r*   r   rT  r
   is_falser   s       r   np_logical_not_implro  Z  s2     dA5=IIIIGT!W---r   c                     t          ||dt          j                   t          | ||j        d         |d                   }|                    |          S rm  )r*   r   rT  r[  r   not_)r2   r1   r&   r   rD  s        r   np_complex_logical_not_implrr  _  sH     dA5=IIII'38A;Q@@A<<??r   c                     t          ||d           |\  }}|                    d||          }|                    |||          S Nre   r   r*   rw   ry   )r2   r1   r&   r   arg1arg2arg1_sge_arg2s          r   np_int_smax_implry  n  J     dA...JD$''dD99M>>-t444r   c                     t          ||d           |\  }}|                    d||          }|                    |||          S rt  r*   rp   ry   )r2   r1   r&   r   rv  rw  arg1_uge_arg2s          r   np_int_umax_implr~  u  J     dA...JD$))$d;;M>>-t444r   c                 B   t          ||d           |\  }}|                    d||          }|                    d||          }|                    |||          }|                    d||          }	|                    |	||          }
|                    |||
          S Nre   unor   r*   rQ  ry   r   )r2   r1   r&   r   rv  rw  arg1_nanany_nan
nan_resultr]  non_nan_results              r   np_real_maximum_implr  |       dA...JD$%%eT488H$$UD$77G$55J''dD99L^^L$==N>>':~>>>r   c                 B   t          ||d           |\  }}|                    d||          }|                    d||          }|                    |||          }|                    d||          }	|                    |	||          }
|                    |||
          S r  r  )r2   r1   r&   r   rv  rw  arg2_nanr  r  r]  r  s              r   np_real_fmax_implr    r  r   c                    t          ||d           |j        d         }t          j        t          j        |          }t          j        t          j        g|gdz  R  }|\  }}t          | |||g          }	t          | |||g          }
|                    |	|
          }|                    |	||          }t          | |||          }|                    |||          }|                    |||          S Nre   r   
r*   r   r   r%  r   rT  np_complex_isnan_implrr   ry   rU  r2   r1   r&   r   r   bc_sigbcc_sigrv  rw  r  r  r  r  r]  r  s                  r   np_complex_maximum_implr         !dA...	!BemR00Fu}6tAv666GJD$$WgvvFFH$WgvvFFHkk(H--G$55J%gwFFL^^L$==N>>':~>>>r   c                    t          ||d           |j        d         }t          j        t          j        |          }t          j        t          j        g|gdz  R  }|\  }}t          | |||g          }	t          | |||g          }
|                    |	|
          }|                    |
||          }t          | |||          }|                    |||          }|                    |||          S r  r  r  s                  r   np_complex_fmax_implr        
 !dA...	!BemR00Fu}6tAv666GJD$$WgvvFFH$WgvvFFHkk(H--G$55J%gwFFL^^L$==N>>':~>>>r   c                     t          ||d           |\  }}|                    d||          }|                    |||          S Nre   r  ru  )r2   r1   r&   r   rv  rw  arg1_sle_arg2s          r   np_int_smin_implr    rz  r   c                     t          ||d           |\  }}|                    d||          }|                    |||          S r  r|  )r2   r1   r&   r   rv  rw  arg1_ule_arg2s          r   np_int_umin_implr    r  r   c                 B   t          ||d           |\  }}|                    d||          }|                    d||          }|                    |||          }|                    d||          }	|                    |	||          }
|                    |||
          S Nre   r  r  r  r2   r1   r&   r   rv  rw  r  r  r  arg1_le_arg2r  s              r   np_real_minimum_implr    r  r   c                 B   t          ||d           |\  }}|                    d||          }|                    d||          }|                    |||          }|                    d||          }	|                    |	||          }
|                    |||
          S r  r  r  s              r   np_real_fmin_implr    r  r   c                    t          ||d           |j        d         }t          j        t          j        |          }t          j        t          j        g|gdz  R  }|\  }}t          | |||g          }	t          | |||g          }
|                    |	|
          }|                    |	||          }t          | |||          }|                    |||          }|                    |||          S r  
r*   r   r   r%  r   rT  r  rr   ry   rC  r2   r1   r&   r   r   r  r  rv  rw  r  r  r  r  r  r  s                  r   np_complex_minimum_implr    r  r   c                    t          ||d           |j        d         }t          j        t          j        |          }t          j        t          j        g|gdz  R  }|\  }}t          | |||g          }	t          | |||g          }
|                    |	|
          }|                    |
||          }t          | |||          }|                    |||          }|                    |||          S r  r  r  s                  r   np_complex_fmin_implr    r  r   c                 T    t          ||dt          j                   t          j        S Nrg   r.  r*   r   rT  r
   	false_bitr   s       r   np_int_isnan_implr    $     dA5=IIIIr   c                 r    t          ||dt          j                   t          j        ||d                   S rm  )r*   r   rT  r   is_nanr   s       r   np_real_isnan_implr  $  1     dA5=IIII?7DG,,,r   c                     t          ||dt          j                   |\  }|j        \  }|                     |||          }t          j        ||          S Nrg   r.  r   )r*   r   rT  r   rQ   r   r  r2   r1   r&   r   r   r   rX  s          r   r  r  )  sX     dA5=IIII	BA
(CB&&w!&<<KG[111r   c                 T    t          ||dt          j                   t          j        S r  )r*   r   rT  r
   true_bitr   s       r   np_int_isfinite_implr  2  s$     dA5=IIIIr   c                     t          ||dt          j                   |                    d|d         t          j                  S )Nrg   r.  rl   r   )r*   r   rT  rp   r   NATr   s       r   np_datetime_isfinite_implr  7  s9     dA5=IIII  tAw
???r   c                     t          ||dt          j                   |                    d|d         t          j                  S )Nrg   r.  rh   r   )r*   r   rT  rw   r   r  r   s       r   np_datetime_isnat_implr  <  s9     dA5=IIIItT!Wjn===r   c                 r    t          ||dt          j                   t          j        ||d                   S rm  )r*   r   rT  r   	is_finiter   s       r   np_real_isfinite_implr  A  s2     dA5=IIIIgtAw///r   c                     t          ||dt          j                   |\  }|j        \  }|                     |||          }t          j        ||          S r  )r*   r   rT  r   rQ   r   r  r  s          r   np_complex_isfinite_implr  F  sX     dA5=IIII	BA
(CB&&w!&<<Kw444r   c                 T    t          ||dt          j                   t          j        S r  r  r   s       r   np_int_isinf_implr  N  r  r   c                 r    t          ||dt          j                   t          j        ||d                   S rm  )r*   r   rT  r   is_infr   s       r   np_real_isinf_implr  S  r  r   c                     t          ||dt          j                   |\  }|j        \  }|                     |||          }t          j        ||          S r  )r*   r   rT  r   rQ   r   r  r  s          r   np_complex_isinf_implr  X  sX     dA5=IIII	BA
(CB&&w!&<<KG[111r   c           	      ~   t          ||dt          j                   t          j        |                     t          j        d          t          j        |                     t          j        d          t          j        |                     t          j	        d          i}|j
        d         }t          t          d|j                   }|                     |          }|                    |                    |d         |          ||                   }|                    d||                    d                    }	|	S )	Nrg   r.  i   l        l            r   uintrl   )r*   r   rT  float16rm   uint16float32uint32r<   uint64r   getattrbitwidthrI   rq   bitcastrp   rn   )
r2   r1   r&   r   masksarg_ty
arg_int_tyarg_ll_int_tyint_resbool_ress
             r   np_real_signbit_implr  `  s     dA5=IIII 	w++EL&AAw++EL*EEw++EL:LMME
 Xa[F 8v 8 899J**:66Mll7??47MBB =* *G$$T7GLLOODDHOr   c                 R    t          ||d           t          j        | |||          S r   )r*   r   copysign_float_implr   s       r   np_real_copysign_implr  r  s+     dA...'#tDDDr   c                     t          ||d           t          j        dt          j        di}t	          | ||||d          S )Nre   numba_nextafterfnumba_nextafter	nextafter)r*   r   r  r<   rc   )r2   r1   r&   r   dispatch_tables        r   np_real_nextafter_implr  w  sQ     dA... 	)(N
 'wd'5{D D Dr   c                    t          ||d           t          j        dt          j        di}|j        \  }t          j        |j        ||          }|d         j        } |t          j
                  }t          j                            |||g          }	t          j        |j        |	d          }
|                    |
||d         g          }||gz   }t%          | ||||d          }|                    ||d                   S )Nrg   r  r  r   zllvm.copysignr,   r  )r*   r   r  r<   r   r   r%  r   rn   r  infr6   r7   r8   r
   r9   r4   r;   rc   r   )r2   r1   r&   r   r  r   ri  ru  ll_infr@   rA   ll_sinf
inner_argsr  s                 r   np_real_spacing_implr    s    !dA... 	)(N
 8DR "b99IGLEU26]]F;##EE5>::D		%gnd+:
< 
< 
<Bll2Q011G
"J+GWi,6,79 9I <<	47+++r   c                     |\  }}|j         \  }}|                     |||t          j                  }t	          j        ||t          j                  }t          j        | ||||f          S r   )r   r/   r   intcr   r%  r   
ldexp_impl)	r2   r1   r&   r   r   r   ty1ty2f_fi_sigs	            r   np_real_ldexp_implr    sd     FBxHC 
gr3
	3	3BS%*55HwB8DDDr   r   )__doc__rM  llvmlite.irr6   numpyr  numba.core.extendingr   numba.core.imputilsr   
numba.corer   r   r   r	   r
   r   r   numba.npr   numba.np.mathr   r   r   numba.np.numpy_supportr   r  r  rz  r*   USE_LEGACY_TYPE_SYSTEMr<   cast_arg_ty
np_float64rD   rc   r   r   r   r   r   r   np_int_fmod_implr   r   r   r   r   r   r  r  expr  r  r  r  exp2r  r#  r(  r*  r1  r5  r9  r;  r>  rJ  rb  rf  rj  rn  rp  rv  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,  rU  rC  rG  rW  rV  rT  r[  r_  ra  rc  rf  ri  rk  ro  rr  ry  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   <module>r     s	             ) ) ) ) ) ) 2 2 2 2 2 2 G G G G G G G G G G G G G G G G 1 1 1 1 1 1       6 6 6 6 6 6 6 6 6 6 0 0 0 0 0 0
 5
44
   & 
  #-KK"K 0;I I I I . . .|" " "J  8D D D  .  *D D D $   ( ( (&  
= = =G G GZ	 	 	  2	 	 	  NJ"& A A A  	 	 		 	 	 
+i(((  )(  OS+rw ? ? ?  ! ! !$; ; ;D D D0 0 0lC C C@ @ @C C C: : :F F F&'" '" '"ZB B B  &: : :
; ; ;' ' '	I 	I 	I: : :
; ; ;' ' '
 
 
 < < <

 
 
 < < <  0< < <  2; ; ;
< < <) ) )
* * *9 9 9? ? ?.E E E& & &$ $ $T: : :
; ; ;: : :
; ; ;: : :; ; ;; ; ;; ; ;B B BB B B; ; ;
  8; ; ;
  6; ; ;
# # #R< < << < <
A A A<< < <C C CB B BC C CB B B0 0 0*0 0 0*0 0 0*0 0 0*, , ,"+ + +.) ) )            . . .
  5 5 55 5 5? ? ?? ? ?? ? ?,? ? ?*5 5 55 5 5? ? ?? ? ?? ? ?,? ? ?0  
- - -
2 2 2  
@ @ @
> > >
0 0 0
5 5 5  
- - -
2 2 2  $E E E
	D 	D 	D, , ,:E E E E Er   