U
    ¿|e	ô  ã                   @   s´  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 ddlmZ ddlmZ ddlmZmZmZ d	Zd
ZdZ�ddd„Zejfdd„Zdd„ Zdd„ Zdd„ Zdd„ Z dd„ Z!dd„ Z"dd„ Z#e"Z$dd„ Z%d d!„ Z&d"d#„ Z'd$d%„ Z(d&d'„ Z)d(d)„ Z*d*d+„ Z+d,d)„ Z*e+e*eej,ej-ƒ d-d.„ Z.d/d0„ Z/d1d2„ Z0ee0d3d4�d5d6„ ƒZ1e+e/d7e0ej2ƒ d8d9„ Z3d:d;„ Z4d<d=„ Z5d>d?„ Z6d@dA„ Z7dBdC„ Z8dDdE„ Z9dFdG„ Z:dHdI„ Z;dJdK„ Z<dLdM„ Z=dNdO„ Z>dPdQ„ Z?dRdS„ Z@dTdU„ ZAdVdW„ ZBdXdY„ ZCdZd[„ ZDd\d]„ ZEd^d_„ ZFd`da„ ZGdbdc„ ZHddde„ ZIdfdg„ ZJdhdi„ ZKdjdk„ ZLdldm„ ZMdndo„ ZNdpdq„ ZOdrds„ ZPdtdu„ ZQdvdw„ ZRdxdy„ ZSdzd{„ ZTd|d}„ ZUd~d„ ZVd€d�„ ZWd‚dƒ„ ZXd„d…„ ZYd†d‡„ ZZdˆd‰„ Z[dŠd‹„ Z\dŒd�„ Z]dŽd�„ Z^d�d‘„ Z_d’d“„ Z`d”d•„ Zad–d—„ Zbd˜d™„ Zcdšd›„ Zddœd�„ ZedždŸ„ Zfd d¡„ Zgd¢d£„ Zhd¤d¥„ Zid¦d§„ Zjd¨d©„ Zkdªd«„ Zld¬d­„ Zmd®d¯„ Znd°d±„ Zod²d³„ Zpd´dµ„ Zqd¶d·„ Zrd¸d¹„ Zsdºd»„ Ztd¼d½„ Zud¾d¿„ ZvdÀdÁ„ ZwdÂdÃ„ ZxdÄdÅ„ ZydÆdÇ„ ZzdÈdÉ„ Z{dÊdË„ Z|dÌdÍ„ Z}dÎdÏ„ Z~dÐdÑ„ ZdÒdÓ„ Z€dÔdÕ„ Z�dÖd×„ Z‚dØdÙ„ ZƒdÚdÛ„ Z„dÜdÝ„ Z…dÞdß„ Z†dàdá„ Z‡dâdã„ Zˆdädå„ Z‰dædç„ ZŠdèdé„ Z‹dêdë„ ZŒdìdí„ Z�dîdï„ ZŽdðdñ„ Z�dòdó„ Z�dôdõ„ Z‘död÷„ Z’dødù„ Z“dúdû„ Z”düdý„ Z•dþdÿ„ Z–�d �d„ Z—�d�d„ Z˜�d�d„ Z™dS (  zŽCodegen 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)Úregister_jitable)Ú
npdatetime)Ú	cmathimplÚmathimplÚnumbersgþ‚+eG÷?gå&{ËÛ?gï9úþB.æ?c                    sŒ   t |ƒ|kst‚t | jƒ|ks"t‚| jd ‰ |dkr8ˆ }t‡ fdd„| jD ƒƒrZ| j|ksˆddl}| ¡ jjj	}d 
|| ¡}dsˆt|ƒ‚dS )zëchecks 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   s   | ]}|ˆ kV  qd S ©N© ©Ú.0Úarg©Útyr   úN/var/www/website-v5/atlas_env/lib/python3.8/site-packages/numba/np/npyfuncs.pyÚ	<genexpr>)   s     z/_check_arity_and_homogeneity.<locals>.<genexpr>z"{0} called with invalid types: {1}F)ÚlenÚAssertionErrorÚargsÚallÚreturn_typeÚinspectÚcurrentframeÚf_backÚf_codeÚco_nameÚformat)Úsigr   Úarityr   r   ÚfnameÚmsgr   r   r   Ú_check_arity_and_homogeneity   s    
"r'   c                    sx   ˆ j }ˆ ˆ¡}tj ||gt|jƒ ¡}tj|||d�}	‡ ‡‡fdd„t	||jƒD ƒ}
ˆ  
|	|
¡}ˆ ˆ |tj|j¡S )N©Únamec                    s    g | ]\}}ˆ  ˆ ||ˆ¡‘qS r   )Úcast)r   r   Úargty©ÚbuilderÚcontextr   r   r   Ú
<listcomp>9   s   ÿz0_call_func_by_name_with_cast.<locals>.<listcomp>)ÚmoduleÚget_argument_typeÚllvmliteÚirÚFunctionTyper   r   r	   Úinsert_pure_functionÚzipÚcallr*   r   Úfloat64r   )r.   r-   r#   r   Ú	func_namer   ÚmodÚltyÚfntyÚfnÚ	cast_argsÚresultr   r,   r   Ú_call_func_by_name_with_cast0   s    

ÿr@   c              
      sD  |j d }z|| }W n< tk
rR } zd |t|ƒ¡}	t |	¡‚W 5 d }~X Y nX ˆ j}
|tjkrðˆ 	ˆ |¡}‡ fdd„|D ƒ}| 
¡ g| }|gt|j ƒ }‡fdd„|D ƒ}tj tj ¡ |¡}t |
||¡}ˆ  ||¡ ˆ  |d ¡}nP‡fdd„|j D ƒ}ˆ |j¡}tj ||¡}tj|
||d�}ˆ ˆ ||j |¡}|S )Nr   z!No {0} function for real type {1}c                    s   g | ]}t  ˆ |¡‘qS r   )r	   Úalloca_once_valuer   )r-   r   r   r/   Y   s   ÿz/_dispatch_func_by_name_type.<locals>.<listcomp>c                    s   g | ]}ˆ   |¡ ¡ ‘qS r   )Úget_value_typeÚ
as_pointer)r   r   ©r.   r   r   r/   a   s   ÿc                    s   g | ]}ˆ   |¡‘qS r   )r1   )r   ÚatyrD   r   r   r/   i   s     r(   )r   ÚKeyErrorr"   Ústrr   ÚLoweringErrorr0   r   Úcomplex_domainÚmake_complexÚ_getpointerÚlistr2   r3   r4   ÚVoidTyper	   Úget_or_insert_functionr7   Úloadr1   r   r5   Úcall_external_function)r.   r-   r#   r   ÚtableZ	user_namer   r9   Úer&   r:   ÚoutZptrargsÚ	call_argsZcall_argtysZcall_argltysr<   r=   ÚretvalÚargtypesÚrestyper   )r-   r.   r   Ú_dispatch_func_by_name_type@   s6    	


ÿ
ÿrX   c              
   C   sv  t ||dƒ |\}}|jd }|  |d¡}|  |d¡}|  |d|jjd > ¡}	| d||¡}
| d||¡}| d|	|¡}| ||¡}| |
|¡}|j|dd��ª\}}|� |j	}W 5 Q R X |�€ |j	}| 
||¡}| ||¡}| d||¡}| d||¡}| ||¡}| d	||¡}| ||¡}| |||¡}| ||¡}W 5 Q R X W 5 Q R X | |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)r.   r-   r#   r   ÚnumÚdenr   ÚZEROÚ	MINUS_ONEZMIN_INTZden_is_zeroZden_is_minus_oneZnum_is_min_intZcould_cause_sigfpeZ
force_zeroÚthenÚ	otherwiseÚbb_thenÚbb_otherwiseÚdivr:   Únum_gt_zeroÚden_gt_zeroÚnot_same_signÚmod_not_zeroÚneeds_fixingÚ	fix_valueZresult_otherwiser?   r   r   r   Únp_int_sdiv_impl~   s:    
 r€   c              	   C   sì   t ||dƒ |\}}|jd }|  |d¡}| d||¡}|j}	t ||¡�t |j}
| ||¡}| d||¡}| d||¡}| 	||¡}| d||¡}| 
||¡}| |||¡}| ||¡}W 5 Q R X | |j¡}| ||	¡ | ||
¡ |S )NrY   r   r`   r_   )r'   r   ra   rd   rh   r	   Úif_unlikelyrj   rk   rl   re   rm   rn   ro   rb   rp   )r.   r-   r#   r   rq   rr   r   rs   Úden_not_zeroÚbb_no_ifÚbb_ifr:   rz   r{   r|   r}   r~   r   Z	final_modr?   r   r   r   Únp_int_srem_impl£   s(    
r…   c                 C   sH   t | ||jd |jŽ |ƒ}t| ||jd |jŽ |ƒ}|  ||j||g¡S ©Nr   r[   )r€   r   r   r…   Ú
make_tuple©r.   r-   r#   r   ry   Úremr   r   r   Únp_int_sdivrem_impl¿   s    rŠ   c              
   C   s¶   t ||dƒ |\}}|jd }|  |d¡}| d||¡}|j|dd��B\}	}
|	� |j}W 5 Q R X |
� | ||¡}|j}W 5 Q R X W 5 Q R X | |j¡}| 	||¡ | 	||¡ |S )NrY   r   r\   Fr]   )
r'   r   ra   rd   rg   rh   Úudivro   rb   rp   )r.   r-   r#   r   rq   rr   r   rs   Zdiv_by_zeroru   rv   rw   ry   rx   r?   r   r   r   Únp_int_udiv_implÅ   s    
rŒ   c              	   C   s�   t ||dƒ |\}}|jd }|  |d¡}| d||¡}|j}	t ||¡� |j}
| ||¡}W 5 Q R X | |j	¡}| 
||	¡ | 
||
¡ |S )NrY   r   r`   )r'   r   ra   rd   rh   r	   r�   Úuremro   rb   rp   )r.   r-   r#   r   rq   rr   r   rs   r‚   rƒ   r„   r:   r?   r   r   r   Únp_int_urem_implÜ   s    
rŽ   c                 C   sH   t | ||jd |jŽ |ƒ}t| ||jd |jŽ |ƒ}|  ||j||g¡S r†   )rŒ   r   r   rŽ   r‡   rˆ   r   r   r   Únp_int_udivrem_implñ   s    r�   c                 C   s   t ||dƒ |j|Ž S ©NrY   )r'   Úfdiv©r.   r-   r#   r   r   r   r   Únp_real_div_implü   s    r“   c                 C   sŽ   t ||dƒ |\}}|jd }|  |d¡}| ||¡}| d||¡}	| d||¡}
| d||¡}| |	| |
|¡¡}| |||¡}| ||¡S )NrY   r   ç        r`   ú<)	r'   r   ra   ÚfremÚfcmp_orderedre   rl   rm   Úfadd)r.   r-   r#   r   Úin1Úin2r   rs   ÚresZres_ne_zeroZden_lt_zeroZres_lt_zeror~   r   r   r   r   Únp_real_mod_impl  s    

ÿrœ   c                 C   s   t ||dƒ |j|Ž S r�   )r'   r–   r’   r   r   r   Únp_real_fmod_impl  s    r�   c                 C   s8   t j |jd¡}| ||¡}| d||¡}| |||¡S )Nr”   r•   )r2   r3   ÚConstantrb   Úfsubr—   rm   )r.   r-   r   rs   Zarg_negatedZarg_is_negativer   r   r   Ú_fabs  s    r    c                    sj  ‡ ‡‡fdd„|D ƒ\}}|j }|j}|j }|j}	|j‰t‡fdd„||||	fD ƒƒs^tdƒ‚ˆ ˆ ˆj¡}
tj 	ˆd¡}tj 	ˆd¡}t
ˆˆ |ƒ}t
ˆˆ |	ƒ}ˆ  d||¡}ˆ  |¡��¢\}}|��  ˆ  d||¡}ˆ  d||¡}ˆ  ||¡}ˆ  |¡�Â\}}|�" ˆ  ||¡|
_ ˆ  ||¡|
_W 5 Q R X |�‚ ˆ  |	|¡}ˆ  |	|¡}ˆ  ||¡}ˆ  ||¡}ˆ  ||¡}ˆ  ||¡}ˆ  ||¡}ˆ  ||¡}ˆ  ||¡|
_ ˆ  ||¡|
_W 5 Q R X W 5 Q R X W 5 Q R X |�‚ ˆ  ||	¡}ˆ  ||¡}ˆ  |	|¡}ˆ  ||¡}ˆ  ||¡}ˆ  ||¡}ˆ  ||¡}ˆ  ||¡}ˆ  ||¡|
_ ˆ  ||¡|
_W 5 Q R X W 5 Q R X |
 ¡ S )	Nc                    s"   g | ]}ˆj ˆ ˆjd  |d�‘qS ©r   ©Úvalue©rJ   r   r   ©r-   r.   r#   r   r   r/   *  s   ÿz'np_complex_div_impl.<locals>.<listcomp>c                    s   g | ]}|j ˆ k‘qS r   ©rb   ©r   Úi©Úftyper   r   r/   2  s     úmismatched typesr”   ç      ð?ú>=r\   )ÚrealÚimagrb   r   r   Úmake_helperr   r2   r3   rž   r    r—   rg   re   r‘   Úfmulr˜   rŸ   Ú	_getvalue)r.   r-   r#   r   r™   rš   Úin1rÚin1iÚin2rÚin2irS   rs   ÚONEÚin2r_absÚin2i_absÚin2r_abs_ge_in2i_absru   rv   Zin2r_is_zeroZin2i_is_zeroZin2_is_zeroZinn_thenZinn_otherwiseÚratÚtmp1Útmp2ÚsclÚtmp3Útmp4Útmp5Ztmp6r   ©r-   r.   rª   r#   r   Únp_complex_div_impl"  s^    ÿ
&,"rÃ   c                 C   s   d S r   r   ©Úx1Úx2r   r   r   Ú_npy_logaddexpo  s    rÇ   c                    s    t | dd�‡ ‡‡fdd„ƒ}d S )NÚgeneric©Útargetc                    s(   | |krd S | ˆƒ‰ ‡‡‡ fdd„}|S )Nc                    s\   | | }}||kr|ˆ S || }|dkr<|ˆˆ | ƒƒ S |dkrT|ˆˆ |ƒƒ S |S d S )Nr   r   )rÅ   rÆ   ÚxÚyÚtmp)ÚexpfnÚlog1pfnÚshiftr   r   Úimpl{  s    
z;_generate_logaddexp.<locals>.ol_npy_logaddexp.<locals>.implr   )rÅ   rÆ   rÑ   ©ÚconstrÎ   rÏ   )rÐ   r   Úol_npy_logaddexpv  s
    z-_generate_logaddexp.<locals>.ol_npy_logaddexpr   )Z
fnoverloadrÓ   rÏ   rÎ   rÔ   r   rÒ   r   Ú_generate_logaddexpr  s    
rÕ   c                 C   s   d S r   r   rÄ   r   r   r   rÇ   ‹  s    c                 C   sB   t ||dƒ | j t¡}| | j|j˜i ¡}|  ||¡}|||ƒS r�   )r'   Útyping_contextÚresolve_value_typerÇ   Úget_call_typer   Úget_function©r.   r-   r#   r   r<   rÑ   r   r   r   Únp_real_logaddexp_impl’  s
    rÛ   c                 C   s   d S r   r   rÄ   r   r   r   Ú_npy_logaddexp2œ  s    rÜ   c                 C   s   d S r   r   ©rË   r   r   r   Únpy_log2_1pŸ  s    rÞ   rÈ   rÉ   c                    s   | t ƒ‰ ‡ fdd„}|S )Nc                    s   ˆ t  | ¡ S r   )ÚnpÚlog1prÝ   ©ZLOG2Er   r   rÑ   ¨  s    zol_npy_log2_1p.<locals>.impl)Ú
_NPY_LOG2E)rË   rÑ   r   rá   r   Úol_npy_log2_1p¥  s    rã   r¬   c                 C   sB   t ||dƒ | j t¡}| | j|j˜i ¡}|  ||¡}|||ƒS r�   )r'   rÖ   r×   rÜ   rØ   r   rÙ   rÚ   r   r   r   Únp_real_logaddexp2_impl°  s
    rä   c                    sf   |\}}|j ‰ t‡ fdd„|D ƒƒs,tdƒ‚|j\}}|  |||tj¡}|  |||tj¡}| ||¡S )Nc                 3   s   | ]}|j ˆ kV  qd S r   r¦   r§   ©Úlltyper   r   r   Â  s     z&np_int_truediv_impl.<locals>.<genexpr>zmust have homogeneous types)rb   r   r   r   r*   r   r8   r‘   )r.   r-   r#   r   rq   rr   ZnumtyZdentyr   rå   r   Únp_int_truediv_impl¼  s    
rç   c                 C   s.   t | |||ƒ}t |j|j¡}t| |||fƒS r   )r“   r   Ú	signaturer   Únp_real_floor_impl)r.   r-   r#   r   r›   Úsr   r   r   Únp_real_floor_div_implÎ  s    rë   c                 C   sH   t | ||jd |jŽ |ƒ}t| ||jd |jŽ |ƒ}|  ||j||g¡S r†   )rë   r   r   rœ   r‡   rˆ   r   r   r   Únp_real_divmod_implÔ  s    rì   c              
      s´  ˆj d j}t ||¡}‡ ‡‡fdd„|D ƒ\}}|j}|j}	|j}
|j}|j‰t‡fdd„||	|
|fD ƒƒsvtdƒ‚t	j
 ˆd¡}ˆ ˆ ˆj¡}||_tˆˆ |
ƒ}tˆˆ |ƒ}ˆ  d||¡}ˆ  |¡�Þ\}}|�` ˆ  ||
¡}ˆ  |	|¡}ˆ  ||¡}ˆ  ||¡}ˆ  |
|¡}ˆ  ||¡}tˆˆ ||fƒ|_W 5 Q R X |�` ˆ  |
|¡}ˆ  ||¡}ˆ  |
|¡}ˆ  |	|¡}ˆ  ||¡}ˆ  ||¡}tˆˆ ||fƒ|_W 5 Q R X W 5 Q R X | ¡ S )Nr   c                    s"   g | ]}ˆj ˆ ˆjd  |d�‘qS r¡   r¤   r   r¥   r   r   r/   ä  s   ÿz-np_complex_floor_div_impl.<locals>.<listcomp>c                    s   g | ]}|j ˆ k‘qS r   r¦   r§   r©   r   r   r/   ì  s     r«   r”   r­   )r   Úunderlying_floatr   rè   r®   r¯   rb   r   r   r2   r3   rž   r°   r   r    r—   rg   r‘   r±   r˜   ré   r²   )r.   r-   r#   r   Ú
float_kindZ	floor_sigr™   rš   r³   r´   rµ   r¶   rs   rS   r¸   r¹   rº   ru   rv   r»   r¼   r½   r¿   rÀ   rÁ   r   rÂ   r   Únp_complex_floor_div_implÚ  sF    ÿ
&&rï   c                 C   s   t ||dƒ t | |||¡S r�   ©r'   r   Úcomplex_power_implr’   r   r   r   Únp_complex_power_impl  s    rò   c                 C   s   t ||dƒ t | |||¡S r�   )r'   r   Úreal_power_implr’   r   r   r   Úreal_float_power_impl  s    rô   c                 C   s   t ||dƒ t | |||¡S r�   rð   r’   r   r   r   Únp_complex_float_power_impl  s    rõ   c                 C   s   t ||dƒ t | |||¡S r�   )r'   r   Zgcd_implr’   r   r   r   Únp_gcd_impl(  s    rö   c           
      C   sV   |j \}}||  kr |jks&n t‚|\}}dd„ }|  ||||¡}	t| ||j|	ƒS )Nc                 S   s$   | dkrdS t | |t || ¡  ƒS )z7
        Like gcd, heavily cribbed from Julia.
        r   )Úabsrß   Úgcd)ÚaÚbr   r   r   Úlcm6  s    znp_lcm_impl.<locals>.lcm)r   r   r   Úcompile_internalr   )
r.   r-   r#   r   ÚxtyÚytyrË   rÌ   rû   r›   r   r   r   Únp_lcm_impl0  s    
rÿ   c                 C   sò   t ||dƒ |d }|jd }|j}|  |d¡}|  |d¡}|  |d¡}	|  |tdƒ¡}
|  ||¡}||_||_tj	t
jf|gd žŽ }|| ¡ g}t| |||ƒ}t| |||ƒ}t| |||ƒ}| |||¡}| ||	|
¡}| |||¡|_| ¡ S )Nr[   r   r”   r¬   ç      ð¿ÚnanrY   )r'   r   rí   ra   ÚfloatrJ   r®   r¯   r   rè   r   Úbooleanr²   Únp_complex_ge_implÚnp_complex_eq_implÚnp_complex_lt_implrm   )r.   r-   r#   r   Úopr   Úfloat_tyrs   r·   rt   ÚNANr?   Zcmp_sigZcmp_argsÚarg1_ge_arg2Zarg1_eq_arg2Zarg1_lt_arg2Zreal_when_geZreal_when_nger   r   r   Únp_complex_sign_implC  s(    
r  c                 C   s   t ||dƒ t |d|¡S )Nr[   z	llvm.rint©r'   r   Zcall_fp_intrinsicr’   r   r   r   Únp_real_rint_implc  s    r  c           	      C   s|   t ||dƒ |jd }|j}| j|||d d�}|  ||¡}tj|gd Ž }t| |||jgƒ|_t| |||jgƒ|_| 	¡ S )Nr[   r   r¢   rY   )
r'   r   rí   rJ   r   rè   r  r®   r¯   r²   )	r.   r-   r#   r   r   r  r™   rS   Ú	inner_sigr   r   r   Únp_complex_rint_impli  s    
r  c                 C   s   t ||dƒ t | |||¡S ©Nr[   )r'   r   Úexp_implr’   r   r   r   Únp_real_exp_impl|  s    r  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   r  r’   r   r   r   Únp_complex_exp_impl�  s    r  c                 C   s.   t ||dƒ tjdtjdi}t| ||||dƒS )Nr[   Znumba_exp2fZ
numba_exp2Úexp2©r'   r   Úfloat32r8   rX   ©r.   r-   r#   r   Údispatch_tabler   r   r   Únp_real_exp2_implˆ  s      þ
 ÿr  c           	      C   s|   t ||dƒ |jd }|j}| j|||d d�}|  ||¡}|  |t¡}| ||j¡|_| ||j¡|_t	| ||| 
¡ gƒS ©Nr[   r   r¢   )r'   r   rí   rJ   ra   Ú
_NPY_LOGE2r±   r®   r¯   r  r²   )	r.   r-   r#   r   r   r  r™   rÍ   Zloge2r   r   r   Únp_complex_exp2_impl”  s    
r  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Úlog_implr’   r   r   r   Únp_real_log_impl£  s    r  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   r  r’   r   r   r   Únp_complex_log_impl¨  s    r  c                 C   s.   t ||dƒ tjdtjdi}t| ||||dƒS )Nr[   Znumba_log2fZ
numba_log2Úlog2r  r  r   r   r   Únp_real_log2_impl¯  s      þ
 ÿr!  c                 C   sn   t ||dƒ |jd }|j}t| |||ƒ}| j|||d�}|  |t¡}| ||j¡|_| ||j	¡|_	| 
¡ S r  )r'   r   rí   r  rJ   ra   râ   r±   r®   r¯   r²   )r.   r-   r#   r   r   r  rÍ   Zlog2er   r   r   Únp_complex_log2_implº  s    
r"  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Z
log10_implr’   r   r   r   Únp_real_log10_implÊ  s    r#  c                 C   sn   t ||dƒ |jd }|j}t| |||ƒ}| j|||d�}|  |t¡}| ||j¡|_| ||j	¡|_	| 
¡ S r  )r'   r   rí   r  rJ   ra   Ú_NPY_LOG10Er±   r®   r¯   r²   )r.   r-   r#   r   r   r  rÍ   Zlog10er   r   r   Únp_complex_log10_implÏ  s    
r%  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Z
expm1_implr’   r   r   r   Únp_real_expm1_implß  s    r&  c                 C   s¾   t ||dƒ |jd }|j}tj|gd Ž }|  |d¡}| j|||d d�}t| |||jgƒ}	|  ||¡}
t	| |||j
gƒ}t| |||j
gƒ}| |	|¡}| |	|¡|
_
| ||¡|
_|
 ¡ S )Nr[   r   rY   r   r¢   )r'   r   rí   r   rè   ra   rJ   r  r®   Únp_real_cos_implr¯   Únp_real_sin_implr±   r˜   r²   )r.   r-   r#   r   r   r  Úfloat_unary_sigrt   r™   rù   rS   Zcos_imagZsin_imagrÍ   r   r   r   Únp_complex_expm1_implã  s    
r*  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Z
log1p_implr’   r   r   r   Únp_real_log1p_implû  s    r+  c                 C   sº   t ||dƒ |jd }|j}tj|gd Ž }tj|gd Ž }|  |d¡}| j|||d d�}	|  ||¡}
| |	j|¡}t	| ||||	j
gƒ}t| |||	j
|gƒ|
_
t| |||gƒ|
_|
 ¡ S )Nr[   r   rY   é   r¬   r¢   )r'   r   rí   r   rè   ra   rJ   r˜   r®   Únp_real_hypot_implr¯   Únp_real_atan2_implr  r²   )r.   r-   r#   r   r   r  r)  Zfloat_binary_sigr·   r™   rS   Zreal_plus_oneÚlr   r   r   Únp_complex_log1p_implÿ  s"    
ÿÿr0  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Ú	sqrt_implr’   r   r   r   Únp_real_sqrt_impl  s    r2  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   r1  r’   r   r   r   Únp_complex_sqrt_impl  s    r3  c                 C   s    t ||dƒ | |d |d ¡S ©Nr[   r   )r'   Úmulr’   r   r   r   Únp_int_square_impl%  s    r6  c                 C   s    t ||dƒ | |d |d ¡S r4  )r'   r±   r’   r   r   r   Únp_real_square_impl*  s    r7  c                 C   s:   t ||dƒ tj|jgd Ž }t | |||d |d g¡S ©Nr[   r,  r   )r'   r   rè   r   r   Úcomplex_mul_impl)r.   r-   r#   r   Ú
binary_sigr   r   r   Únp_complex_square_impl.  s
    
ÿr;  c                    s:   t ||dƒ tdd�dd„ ƒ‰ ‡ fdd„}|  ||||¡S )Nr[   T)Úfastmathc                 S   s(   | dk rt  |  d¡ S t  | d¡S d S )Nr   gUUUUUUÕ?)rß   ÚpowerrÝ   r   r   r   Úcbrt=  s    znp_real_cbrt_impl.<locals>.cbrtc                    s   t  | ¡rt jS ˆ | ƒS r   )rß   Úisnanr  rÝ   ©r>  r   r   Ú_cbrtD  s    
z np_real_cbrt_impl.<locals>._cbrt)r'   r
   rü   )r.   r-   r#   r   rA  r   r@  r   Únp_real_cbrt_impl8  s
    
rB  c           	      C   sd   t ||dƒ |j}tj|gd Ž }|  ||d |tj¡}|  tjd¡}| ||¡}|  ||tj|¡S r8  )	r'   r   r   rè   r*   r   r8   ra   r‘   )	r.   r-   r#   r   r   r:  Zin_as_floatr·   Zresult_as_floatr   r   r   Únp_int_reciprocal_implO  s    rC  c                 C   s*   t ||dƒ |  |jd¡}| ||d ¡S )Nr[   r¬   r   )r'   ra   r   r‘   )r.   r-   r#   r   r·   r   r   r   Únp_real_reciprocal_impl]  s    rD  c              
   C   sd  t ||dƒ |jd }|j}|  |d¡}|  |d¡}| j|||d d�}|  ||¡}	|j}
|j}t| ||
ƒ}t| ||ƒ}| d||¡}| 	|¡�Æ\}}|�V | 
||
¡}| ||¡}| |
|¡}| 
||¡}| ||¡}||	_| ||¡|	_W 5 Q R X |�R | 
|
|¡}| |
|¡}| ||¡}| 
||¡}| ||¡|	_| ||¡|	_W 5 Q R X W 5 Q R X |	 ¡ S )Nr[   r   r”   r¬   r¢   ú<=)r'   r   rí   ra   rJ   r®   r¯   r    r—   rg   r‘   r±   r˜   rŸ   r²   )r.   r-   r#   r   r   r  rs   r·   r™   rS   r³   r´   Zin1r_absZin1i_absZin1i_abs_le_in1r_absru   rv   ÚrÚtmp0ÚdÚinv_dZminus_rr   r   r   Únp_complex_reciprocal_implc  s:    
"rJ  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Úsin_implr’   r   r   r   r(  �  s    r(  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   rK  r’   r   r   r   Únp_complex_sin_impl’  s    rL  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Úcos_implr’   r   r   r   r'  š  s    r'  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   rM  r’   r   r   r   Únp_complex_cos_implŸ  s    rN  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Útan_implr’   r   r   r   Únp_real_tan_impl§  s    rP  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Ú	asin_implr’   r   r   r   Únp_real_asin_impl¯  s    rR  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Ú	acos_implr’   r   r   r   Únp_real_acos_impl·  s    rT  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Ú	atan_implr’   r   r   r   Únp_real_atan_impl¿  s    rV  c                 C   s   t ||dƒ t | |||¡S r�   )r'   r   Zatan2_float_implr’   r   r   r   r.  Ç  s    r.  c                 C   s   t ||dƒ t | |||¡S r�   )r'   r   Zhypot_float_implr’   r   r   r   r-  Ï  s    r-  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Z	sinh_implr’   r   r   r   Únp_real_sinh_impl×  s    rW  c                 C   sº   t ||dƒ |jd }|j}tj|gd Ž }|  |||d ¡}|  ||¡}|j}	|j}
t| |||
gƒ}t	| |||	gƒ}t
| |||
gƒ}t| |||	gƒ}| ||¡|_| ||¡|_| ¡ S ©Nr[   r   rY   )r'   r   rí   r   rè   rJ   r®   r¯   r(  rW  r'  Únp_real_cosh_implr±   r²   )r.   r-   r#   r   r   ÚftyÚfsig1rË   rS   ÚxrÚxiÚsxiÚshxrÚcxiÚchxrr   r   r   Únp_complex_sinh_implÜ  s    
rb  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Z	cosh_implr’   r   r   r   rY  ø  s    rY  c                 C   sº   t ||dƒ |jd }|j}tj|gd Ž }|  |||d ¡}|  ||¡}|j}	|j}
t| |||
gƒ}t	| |||	gƒ}t
| |||
gƒ}t| |||	gƒ}| ||¡|_| ||¡|_| ¡ S rX  )r'   r   rí   r   rè   rJ   r®   r¯   r'  rY  r(  rW  r±   r²   )r.   r-   r#   r   r   rZ  r[  rË   rS   r\  r]  r`  ra  r^  r_  r   r   r   Únp_complex_cosh_implý  s    
rc  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Z	tanh_implr’   r   r   r   Únp_real_tanh_impl  s    rd  c                 C   sn  t ||dƒ |jd }|j}tj|gd Ž }|  |d¡}|  |||d ¡}|  ||¡}	|j}
|j}t	| |||gƒ}t
| |||gƒ}t| |||
gƒ}t| |||
gƒ}| ||¡}| ||¡}| ||¡}| ||¡}| ||¡}| ||¡}| ||¡}| ||¡}| ||¡}| ||¡}| ||¡}| ||¡}| ||¡}| ||¡}| ||¡|	_| ||¡|	_|	 ¡ S )Nr[   r   rY   r¬   )r'   r   rí   r   rè   ra   rJ   r®   r¯   r(  r'  rW  rY  r±   r˜   r‘   rŸ   r²   )r.   r-   r#   r   r   rZ  r[  r·   rË   rS   r\  r]  ÚsiÚciZshrZchr_ÚrsÚis_ÚrcÚicZsqr_rcZsqr_icrH  rI  Zrs_rcZis_icZis_rcZrs_icZnumrZnumir   r   r   Únp_complex_tanh_impl  s<    
rk  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Ú
asinh_implr’   r   r   r   Únp_real_asinh_implF  s    rm  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Z
acosh_implr’   r   r   r   Únp_real_acosh_implN  s    rn  c                 C   s¼   t ||dƒ |jd }tj|gd Ž }|  ||d¡}|d }t | ||||g¡}t | ||||g¡}	t| |||gƒ}
t| |||	gƒ}t 	| |||
|g¡}t | ||||g¡}t
| |||gƒS )Nr[   r   r,  y      ð?        )r'   r   r   rè   Úget_constant_genericr   Úcomplex_add_implÚcomplex_sub_implr3  r9  r  )r.   r-   r#   r   r   Zcsig2r·   rË   Z
x_plus_oneZx_minus_oneZsqrt_x_plus_oneZsqrt_x_minus_oneZ	prod_sqrtZlog_argr   r   r   Únp_complex_acosh_implS  s,    
ÿÿ
ÿÿÿrr  c                 C   s   t ||dƒ t | |||¡S r  )r'   r   Ú
atanh_implr’   r   r   r   Únp_real_atanh_implq  s    rt  c                 C   s   t ||dƒ t |d|¡S )Nr[   z
llvm.floorr  r’   r   r   r   ré   y  s    ré   c                 C   s   t ||dƒ t |d|¡S )Nr[   z	llvm.ceilr  r’   r   r   r   Únp_real_ceil_impl‚  s    ru  c                 C   s   t ||dƒ t |d|¡S )Nr[   z
llvm.truncr  r’   r   r   r   Únp_real_trunc_impl‹  s    rv  c                 C   s   t ||dƒ t |d|¡S )Nr[   z	llvm.fabsr  r’   r   r   r   Únp_real_fabs_impl”  s    rw  c                    sª   t ||dtjd� |jd ‰‡ ‡‡fdd„|D ƒ\}}|j}|j}|j}|j}	ˆ  d||¡}
ˆ  d||	¡}ˆ  d||¡}ˆ  d	||	¡}ˆ  |
|¡}ˆ  ||¡}ˆ  ||¡S )
NrY   ©r   r   c                    s   g | ]}ˆj ˆ ˆ|d �‘qS ©r¢   ©rJ   r   r,   r   r   r/   ¥  s     z&np_complex_ge_impl.<locals>.<listcomp>r_   Úordr\   r­   ©	r'   r   r  r   r®   r¯   r—   re   rf   )r.   r-   r#   r   r™   rš   r\  r]  ÚyrÚyiÚxr_gt_yrÚno_nan_xi_yiÚxr_eq_yrZxi_ge_yiÚ
first_termÚsecond_termr   r,   r   r  Ÿ  s    
r  c                    sª   t ||dtjd� |jd ‰‡ ‡‡fdd„|D ƒ\}}|j}|j}|j}|j}	ˆ  d||¡}
ˆ  d||	¡}ˆ  d||¡}ˆ  d	||	¡}ˆ  |
|¡}ˆ  ||¡}ˆ  ||¡S )
NrY   rx  r   c                    s   g | ]}ˆj ˆ ˆ|d �‘qS ry  rz  r   r,   r   r   r/   º  s     z&np_complex_le_impl.<locals>.<listcomp>r•   r{  r\   rE  r|  )r.   r-   r#   r   r™   rš   r\  r]  r}  r~  Úxr_lt_yrr€  r�  Zxi_le_yir‚  rƒ  r   r,   r   Únp_complex_le_impl´  s    
r…  c                    sª   t ||dtjd� |jd ‰‡ ‡‡fdd„|D ƒ\}}|j}|j}|j}|j}	ˆ  d||¡}
ˆ  d||	¡}ˆ  d||¡}ˆ  d||	¡}ˆ  |
|¡}ˆ  ||¡}ˆ  ||¡S )	NrY   rx  r   c                    s   g | ]}ˆj ˆ ˆ|d �‘qS ry  rz  r   r,   r   r   r/   Ï  s     z&np_complex_gt_impl.<locals>.<listcomp>r_   r{  r\   r|  )r.   r-   r#   r   r™   rš   r\  r]  r}  r~  r  r€  r�  Zxi_gt_yir‚  rƒ  r   r,   r   Únp_complex_gt_implÉ  s    
r†  c                    sª   t ||dtjd� |jd ‰‡ ‡‡fdd„|D ƒ\}}|j}|j}|j}|j}	ˆ  d||¡}
ˆ  d||	¡}ˆ  d||¡}ˆ  d||	¡}ˆ  |
|¡}ˆ  ||¡}ˆ  ||¡S )	NrY   rx  r   c                    s   g | ]}ˆj ˆ ˆ|d �‘qS ry  rz  r   r,   r   r   r/   ä  s     z&np_complex_lt_impl.<locals>.<listcomp>r•   r{  r\   r|  )r.   r-   r#   r   r™   rš   r\  r]  r}  r~  r„  r€  r�  Zxi_lt_yir‚  rƒ  r   r,   r   r  Þ  s    
r  c                    sv   t ||dtjd� |jd ‰‡ ‡‡fdd„|D ƒ\}}|j}|j}|j}|j}	ˆ  d||¡}
ˆ  d||	¡}ˆ  |
|¡S )NrY   rx  r   c                    s   g | ]}ˆj ˆ ˆ|d �‘qS ry  rz  r   r,   r   r   r/   ù  s     z&np_complex_eq_impl.<locals>.<listcomp>r\   )r'   r   r  r   r®   r¯   r—   re   )r.   r-   r#   r   r™   rš   r\  r]  r}  r~  r�  Zxi_eq_yir   r,   r   r  ó  s    
r  c                    sv   t ||dtjd� |jd ‰‡ ‡‡fdd„|D ƒ\}}|j}|j}|j}|j}	ˆ  d||¡}
ˆ  d||	¡}ˆ  |
|¡S )NrY   rx  r   c                    s   g | ]}ˆj ˆ ˆ|d �‘qS ry  rz  r   r,   r   r   r/   
  s     z&np_complex_ne_impl.<locals>.<listcomp>r`   )r'   r   r  r   r®   r¯   Úfcmp_unorderedrf   )r.   r-   r#   r   r™   rš   r\  r]  r}  r~  Zxr_ne_yrZxi_ne_yir   r,   r   Únp_complex_ne_impl  s    
rˆ  c                 C   s8   | j |||d�}t ||j¡}t ||j¡}| ||¡S )Nr¢   )rJ   r	   Úis_truer®   r¯   rf   )r.   r-   r   ÚvalÚcomplex_valZre_trueZim_truer   r   r   Ú_complex_is_true  s    rŒ  c                 C   s>   t ||dtjd� t ||d ¡}t ||d ¡}| ||¡S ©NrY   rx  r   r[   )r'   r   r  r	   r‰  re   ©r.   r-   r#   r   rù   rú   r   r   r   Únp_logical_and_impl"  s    r�  c                 C   sN   t ||dtjd� t| ||jd |d ƒ}t| ||jd |d ƒ}| ||¡S r�  )r'   r   r  rŒ  r   re   rŽ  r   r   r   Únp_complex_logical_and_impl)  s    r�  c                 C   s>   t ||dtjd� t ||d ¡}t ||d ¡}| ||¡S r�  )r'   r   r  r	   r‰  rf   rŽ  r   r   r   Únp_logical_or_impl0  s    r‘  c                 C   sN   t ||dtjd� t| ||jd |d ƒ}t| ||jd |d ƒ}| ||¡S r�  )r'   r   r  rŒ  r   rf   rŽ  r   r   r   Únp_complex_logical_or_impl7  s    r’  c                 C   s>   t ||dtjd� t ||d ¡}t ||d ¡}| ||¡S r�  )r'   r   r  r	   r‰  rl   rŽ  r   r   r   Únp_logical_xor_impl>  s    r“  c                 C   sN   t ||dtjd� t| ||jd |d ƒ}t| ||jd |d ƒ}| ||¡S r�  )r'   r   r  rŒ  r   rl   rŽ  r   r   r   Únp_complex_logical_xor_implE  s    r”  c                 C   s"   t ||dtjd� t ||d ¡S ©Nr[   rx  r   )r'   r   r  r	   Úis_falser’   r   r   r   Únp_logical_not_implL  s    r—  c                 C   s4   t ||dtjd� t| ||jd |d ƒ}| |¡S r•  )r'   r   r  rŒ  r   Únot_)r.   r-   r#   r   rù   r   r   r   Únp_complex_logical_not_implQ  s    r™  c                 C   s0   t ||dƒ |\}}| d||¡}| |||¡S ©NrY   r­   ©r'   rk   rm   )r.   r-   r#   r   Úarg1Úarg2Zarg1_sge_arg2r   r   r   Únp_int_smax_impl`  s    rž  c                 C   s0   t ||dƒ |\}}| d||¡}| |||¡S rš  ©r'   rd   rm   )r.   r-   r#   r   rœ  r�  Zarg1_uge_arg2r   r   r   Únp_int_umax_implg  s    r   c                 C   sh   t ||dƒ |\}}| d||¡}| d||¡}| |||¡}| d||¡}	| |	||¡}
| |||
¡S ©NrY   Úunor­   ©r'   r‡  rm   r—   )r.   r-   r#   r   rœ  r�  Úarg1_nanÚany_nanÚ
nan_resultr
  Únon_nan_resultr   r   r   Únp_real_maximum_impln  s    r¨  c                 C   sh   t ||dƒ |\}}| d||¡}| d||¡}| |||¡}| d||¡}	| |	||¡}
| |||
¡S r¡  r£  )r.   r-   r#   r   rœ  r�  Úarg2_nanr¥  r¦  r
  r§  r   r   r   Únp_real_fmax_impl}  s    rª  c                 C   s¨   t ||dƒ |jd }t tj|¡}tjtjf|gd žŽ }|\}}t| |||gƒ}	t| |||gƒ}
| |	|
¡}| |	||¡}t	| |||ƒ}| |||¡}| |||¡S ©NrY   r   ©
r'   r   r   rè   r   r  Únp_complex_isnan_implrf   rm   r  ©r.   r-   r#   r   r   Úbc_sigÚbcc_sigrœ  r�  r¤  r©  r¥  r¦  r
  r§  r   r   r   Únp_complex_maximum_implŒ  s    
r±  c                 C   s¨   t ||dƒ |jd }t tj|¡}tjtjf|gd žŽ }|\}}t| |||gƒ}	t| |||gƒ}
| |	|
¡}| |
||¡}t	| |||ƒ}| |||¡}| |||¡S r«  r¬  r®  r   r   r   Únp_complex_fmax_impl¢  s    
r²  c                 C   s0   t ||dƒ |\}}| d||¡}| |||¡S ©NrY   rE  r›  )r.   r-   r#   r   rœ  r�  Zarg1_sle_arg2r   r   r   Únp_int_smin_impl·  s    r´  c                 C   s0   t ||dƒ |\}}| d||¡}| |||¡S r³  rŸ  )r.   r-   r#   r   rœ  r�  Zarg1_ule_arg2r   r   r   Únp_int_umin_impl¾  s    rµ  c                 C   sh   t ||dƒ |\}}| d||¡}| d||¡}| |||¡}| d||¡}	| |	||¡}
| |||
¡S ©NrY   r¢  rE  r£  ©r.   r-   r#   r   rœ  r�  r¤  r¥  r¦  Úarg1_le_arg2r§  r   r   r   Únp_real_minimum_implÅ  s    r¹  c                 C   sh   t ||dƒ |\}}| d||¡}| d||¡}| |||¡}| d||¡}	| |	||¡}
| |||
¡S r¶  r£  r·  r   r   r   Únp_real_fmin_implÔ  s    rº  c                 C   s¨   t ||dƒ |jd }t tj|¡}tjtjf|gd žŽ }|\}}t| |||gƒ}	t| |||gƒ}
| |	|
¡}| |	||¡}t	| |||ƒ}| |||¡}| |||¡S r«  ©
r'   r   r   rè   r   r  r­  rf   rm   r…  ©r.   r-   r#   r   r   r¯  r°  rœ  r�  r¤  r©  r¥  r¦  r¸  r§  r   r   r   Únp_complex_minimum_implã  s    
r½  c                 C   s¨   t ||dƒ |jd }t tj|¡}tjtjf|gd žŽ }|\}}t| |||gƒ}	t| |||gƒ}
| |	|
¡}| |
||¡}t	| |||ƒ}| |||¡}| |||¡S r«  r»  r¼  r   r   r   Únp_complex_fmin_implù  s    
r¾  c                 C   s   t ||dtjd� tjS ©Nr[   rx  ©r'   r   r  r	   Ú	false_bitr’   r   r   r   Únp_int_isnan_impl  s    rÂ  c                 C   s"   t ||dtjd� t ||d ¡S r•  )r'   r   r  r   Úis_nanr’   r   r   r   Únp_real_isnan_impl  s    rÄ  c                 C   s<   t ||dtjd� |\}|j\}| j|||d�}t ||¡S ©Nr[   rx  r¢   )r'   r   r  r   rJ   r   rÃ  ©r.   r-   r#   r   rË   r   r‹  r   r   r   r­    s
    r­  c                 C   s   t ||dtjd� tjS r¿  )r'   r   r  r	   Útrue_bitr’   r   r   r   Únp_int_isfinite_impl$  s    rÈ  c                 C   s&   t ||dtjd� | d|d tj¡S )Nr[   rx  r`   r   )r'   r   r  rd   r   ÚNATr’   r   r   r   Únp_datetime_isfinite_impl)  s    rÊ  c                 C   s&   t ||dtjd� | d|d tj¡S )Nr[   rx  r\   r   )r'   r   r  rk   r   rÉ  r’   r   r   r   Únp_datetime_isnat_impl.  s    rË  c                 C   s"   t ||dtjd� t ||d ¡S r•  )r'   r   r  r   Ú	is_finiter’   r   r   r   Únp_real_isfinite_impl3  s    rÍ  c                 C   s<   t ||dtjd� |\}|j\}| j|||d�}t ||¡S rÅ  )r'   r   r  r   rJ   r   rÌ  rÆ  r   r   r   Únp_complex_isfinite_impl8  s
    rÎ  c                 C   s   t ||dtjd� tjS r¿  rÀ  r’   r   r   r   Únp_int_isinf_impl@  s    rÏ  c                 C   s"   t ||dtjd� t ||d ¡S r•  )r'   r   r  r   Úis_infr’   r   r   r   Únp_real_isinf_implE  s    rÑ  c                 C   s<   t ||dtjd� |\}|j\}| j|||d�}t ||¡S rÅ  )r'   r   r  r   rJ   r   rÐ  rÆ  r   r   r   Únp_complex_isinf_implJ  s
    rÒ  c           
   	   C   s    t ||dtjd� 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 )	Nr[   rx  i €  l        l            r   Úuintr`   )r'   r   r  Úfloat16ra   Úuint16r  Úuint32r8   Úuint64r   ÚgetattrÚbitwidthrB   re   Úbitcastrd   rb   )
r.   r-   r#   r   ÚmasksZarg_tyZ
arg_int_tyZarg_ll_int_tyZint_resZbool_resr   r   r   Únp_real_signbit_implR  s        ý

ÿrÜ  c                 C   s   t ||dƒ t | |||¡S r�   )r'   r   Zcopysign_float_implr’   r   r   r   Únp_real_copysign_impld  s    rÝ  c                 C   s.   t ||dƒ tjdtjdi}t| ||||dƒS )NrY   Únumba_nextafterfÚnumba_nextafterÚ	nextafterr  r  r   r   r   Únp_real_nextafter_impli  s      þ
 ÿrá  c                 C   s¬   t ||dƒ tjdtjdi}|j\}t |j||¡}|d j}|t	j
ƒ}tj |||g¡}	tj|j|	dd�}
| |
||d g¡}||g }t| ||||dƒ}| ||d ¡S )Nr[   rÞ  rß  r   zllvm.copysignr(   rà  )r'   r   r  r8   r   r   rè   r   rb   rß   Úinfr2   r3   r4   r	   r5   r0   r7   rX   rŸ   )r.   r-   r#   r   r  r   r  Zll_tyZll_infr<   r=   Zll_sinfÚ
inner_argsrà  r   r   r   Únp_real_spacing_implt  s,      þ


ÿ
 þrä  c           	      C   sH   |\}}|j \}}|  |||tj¡}t ||tj¡}t | ||||f¡S r   )r   r*   r   Úintcr   rè   r   Z
ldexp_impl)	r.   r-   r#   r   rÅ   rÆ   Úty1Zty2Zf_fi_sigr   r   r   Únp_real_ldexp_impl‘  s
    
rç  )N)šÚ__doc__ÚmathÚllvmlite.irr2   Únumpyrß   Únumba.core.extendingr   Únumba.core.imputilsr   Ú
numba.corer   r   r   r   r	   r
   Únumba.npr   Únumba.cpythonr   r   r   râ   r$  r  r'   r8   r@   rX   r€   r…   rŠ   rŒ   rŽ   r�   Únp_int_fmod_implr“   rœ   r�   r    rÃ   rÇ   rÕ   rà   ÚexprÛ   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+  r0  r2  r3  r6  r7  r;  rB  rC  rD  rJ  r(  rL  r'  rN  rP  rR  rT  rV  r.  r-  rW  rb  rY  rc  rd  rk  rm  rn  rr  rt  ré   ru  rv  rw  r  r…  r†  r  r  rˆ  rŒ  r�  r�  r‘  r’  r“  r”  r—  r™  rž  r   r¨  rª  r±  r²  r´  rµ  r¹  rº  r½  r¾  rÂ  rÄ  r­  rÈ  rÊ  rË  rÍ  rÎ  rÏ  rÑ  rÒ  rÜ  rÝ  rá  rä  rç  r   r   r   r   Ú<module>   s  ÿ
>%M


6		 
*)				