
\K]c           @` s  d  Z  d d l m Z m Z m Z d d l Z d d l m Z d d l	 m
 Z
 m Z m Z m Z m Z d d l	 m Z m Z m Z m Z d	 Z d
 Z d Z d d  Z e j 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   Z% d   Z& d   Z' d   Z( d   Z) d   Z* d   Z+ d   Z, d    Z- d!   Z. d"   Z/ d#   Z0 d$   Z1 d%   Z2 d&   Z3 d'   Z4 d(   Z5 d)   Z6 d*   Z7 d+   Z8 d,   Z9 d-   Z: d.   Z; d/   Z< d0   Z= d1   Z> d2   Z? d3   Z@ d4   ZA d5   ZB d6   ZC d7   ZD d8   ZE d9   ZF d:   ZG d;   ZH d<   ZI d=   ZJ d>   ZK d?   ZL d@   ZM dA   ZN dB   ZO dC   ZP dD   ZQ dE   ZR dF   ZS dG   ZT dH   ZU dI   ZV dJ   ZW dK   ZX dL   ZY dM   ZZ dN   Z[ dO   Z\ dP   Z] dQ   Z^ dR   Z_ dS   Z` dT   Za dU   Zb dV   Zc dW   Zd dX   Ze dY   Zf dZ   Zg d[   Zh d\   Zi d]   Zj d^   Zk d_   Zl d`   Zm da   Zn db   Zo dc   Zp dd   Zq de   Zr df   Zs dg   Zt dh   Zu di   Zv dj   Zw dk   Zx dl   Zy dm   Zz dn   Z{ do   Z| dp   Z} dq   Z~ dr   Z ds   Z dt   Z du   Z dv   Z dw   Z dx   Z dy   Z dz   Z d{   Z d|   Z d}   Z d~   Z d S(   s   Codegen for functions used as kernels in NumPy functions

Typically, the kernels of several ufuncs that can't map directly to
Python builtins
i    (   t   print_functiont   absolute_importt   divisionN(   t   corei   (   t   cgutilst   typingt   typest   loweringt   errorsi   (   t	   cmathimplt   mathimplt   numberst
   npdatetimeg+eG?g&{?g9B.?c         ` s   t  |  | k s t  t  |  j  | k s3 t  |  j d   | d k rU   } n  t   f d   |  j D  o |  j | k s d d l } | j   j j	 j
 } d j | |   } t s t |   n  d S(   s   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.
    i    c         3` s   |  ] } |   k Vq d  S(   N(    (   t   .0t   arg(   t   ty(    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pys	   <genexpr>%   s    Ns"   {0} called with invalid types: {1}(   t   lent   AssertionErrort   argst   Nonet   allt   return_typet   inspectt   currentframet   f_backt   f_codet   co_namet   formatt   False(   t   sigR   t   arityR   R   t   fnamet   msg(    (   R   s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   _check_arity_and_homogeneity   s    	.c         C` s   | j  } |  j |  } t j j | | g t | j   } t j | | d | }	 g  t	 | | j  D]$ \ }
 } |  j
 | |
 | |  ^ qh } | j |	 |  } |  j
 | | t j | j  S(   Nt   name(   t   modulet   get_argument_typet   lct   Typet   functionR   R   R   t   insert_pure_functiont   zipt   castt   callR   t   float64R   (   t   contextt   builderR   R   t	   func_nameR   t   modt   ltyt   fntyt   fnR   t   argtyt	   cast_argst   result(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   _call_func_by_name_with_cast,   s    	%:c         C` s  | j  d } y | | } Wn: t k
 rW } d j | t |   }	 t j |	   n X| j }
 | t j k rQ|  j	 | |  } g  | D] } t
 j | |  ^ q } | j   g | } | g t | j   } g  | D] } |  j |  j   ^ q } t j j t j j   |  } |
 j | d | } | j | |  | j | d  } n g  | j  D] } |  j |  ^ q[} |  j | j  } t j j | |  } t
 j |
 | d | } |  j | | | j  |  } | S(   Ni    s!   No {0} function for real type {1}R"   (   R   t   KeyErrorR   t   strR   t   LoweringErrorR#   R   t   complex_domaint   make_complexR   t   alloca_once_valuet   _getpointert   listt   get_value_typet
   as_pointerR%   R&   R'   t   voidt   get_or_insert_functionR+   t   loadR$   R   R(   t   call_external_function(   R-   R.   R   R   t   tablet	   user_nameR   R/   t   eR    R0   t   outR   t   ptrargst	   call_argst   call_argtyst   call_argltysR2   R3   t   retvalt   atyt   argtypest   restype(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   _dispatch_func_by_name_type<   s2    		"%%c         ` s0  | \ } } | j    t   f d   | D  s= t d   t j j   d  } t j j   d  } t j j   d | j  j d > } | j t j | |  }	 | j t j | |  }
 | j t j | |  } | j	 |
 |  } | j
 |	 |  } | j | d t  \ } } |  | j } Wd  QX|  | j } | j | |  } | j | |  } | j t j | |  } | j t j | |  } | j | |  } | j t j | |  } | j	 | |  } | j | | |  } | j | |  } Wd  QXWd  QX| j    } | j | |  | j | |  | S(   Nc         3` s   |  ] } | j    k Vq d  S(   N(   t   type(   R   t   i(   t   lltype(    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pys	   <genexpr>~   s    s   must have homogeneous typesi    ii   t   likely(   RS   R   R   R%   t   Constantt   intt   widtht   icmpt   ICMP_EQt   and_t   or_t   if_elseR   t   basic_blockt   sdivt   sremt   ICMP_SGTt   xort   ICMP_NEt   selectt   addt   phit   add_incoming(   R-   R.   R   R   t   numt   dent   ZEROt	   MINUS_ONEt   MIN_INTt   den_is_zerot   den_is_minus_onet   num_is_min_intt   could_cause_sigfpet
   force_zerot   thent	   otherwiset   bb_thent   bb_otherwiset   divR0   t   num_gt_zerot   den_gt_zerot   not_same_signt   mod_not_zerot   needs_fixingt	   fix_valuet   result_otherwiseR6   (    (   RU   s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_sdiv_implz   s:    	(#	c         C` s_  t  | | d  | \ } } | j d } | j } |  j | d  } | j t j | |  }	 | j }
 t j	 | |	   | j } | j
 | |  } | j t j | |  } | j t j | |  } | j | |  } | j t j | |  } | j | |  } | j | | |  } | j | |  } Wd  QX| j |  } | j | |
  | j | |  | S(   Ni   i    (   R!   R   RS   t   get_constantRZ   R%   Rd   R_   R   t   if_unlikelyRa   Rb   Rc   R\   Re   Rf   Rg   Rh   (   R-   R.   R   R   Ri   Rj   R   R1   Rk   t   den_not_zerot   bb_no_ift   bb_ifR0   Rx   Ry   Rz   R{   R|   R}   t	   final_modR6   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_srem_impl   s*    			c         ` s   | \ } } | j    t   f d   | D  s= t d   t j j   d  } | j t j | |  } | j | d t	 K \ } }	 |  | j
 }
 Wd  QX|	   | j | |  } | j
 } Wd  QXWd  QX| j    } | j | |
  | j | |  | S(   Nc         3` s   |  ] } | j    k Vq d  S(   N(   RS   (   R   RT   (   RU   (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pys	   <genexpr>   s    s   must have homogeneous typesi    RV   (   RS   R   R   R%   RW   RX   RZ   R[   R^   R   R_   t   udivRg   Rh   (   R-   R.   R   R   Ri   Rj   Rk   t   div_by_zeroRs   Rt   Ru   Rw   Rv   R6   (    (   RU   s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_udiv_impl   s    	(c         C` s   t  | | d  | \ } } | j d } | j } |  j | d  } | j t j | |  }	 | j }
 t j	 | |	    | j } | j
 | |  } Wd  QX| j |  } | j | |
  | j | |  | S(   Ni   i    (   R!   R   RS   R   RZ   R%   Rd   R_   R   R   Ra   Rg   Rh   (   R-   R.   R   R   Ri   Rj   R   R1   Rk   R   R   R   R0   R6   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_urem_impl   s    			c         C` s   t  | | d  | j |   S(   Ni   (   R!   t   fdiv(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_div_impl   s    c         C` s   t  | | d  | \ } } | j d } |  j | d  } | j | |  } | j t j | |  }	 | j t j | |  }
 | j t j | |  } | j |	 | j	 |
 |   } | j
 | | |  } | j | |  S(   Ni   i    g        (   R!   R   R   t   fremt   fcmpR%   t   FCMP_ONEt   FCMP_OLTR\   Rc   Re   t   fadd(   R-   R.   R   R   t   in1t   in2R   Rk   t   rest   res_ne_zerot   den_lt_zerot   res_lt_zeroR|   R}   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_mod_impl   s    	c         C` s   t  | | d  | j |   S(   Ni   (   R!   R   (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_fmod_impl  s    c         C` sU   t  j j | j d  } | j | |  } | j t  j | |  } | j | | |  S(   Ng        (   R%   RW   t   realRS   t   fsubR   R   Re   (   R-   R.   R   Rk   t   arg_negatedt   arg_is_negative(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   _fabs  s    c   "      C` sz  g  | D]% } |  j  | | j d d | ^ q \ } } | j } | j } | j }	 | j }
 | j } t g  | | |	 |
 g D] } | j | k ^ q{  s t d   |  j | | j  } t	 j
 j | d  } t	 j
 j | d  } t |  | |	  } t |  | |
  } | j t	 j | |  } | j |  ?\ } } | c| j t	 j | |  } | j t	 j | |  } | j | |  } | j |  \ } } | / | j | |  | _ | j | |  | _ Wd  QX|  | j |
 |	  } | j |
 |  } | j |	 |  } | j | |  } | j | |  } | j | |  } | j | |  }  | j | |  }! | j |  |  | _ | j |! |  | _ Wd  QXWd  QXWd  QX|  | j |	 |
  } | j |	 |  } | j |
 |  } | j | |  } | j | |  } | j | |  } | j | |  }  | j | |  }! | j |  |  | _ | j |! |  | _ Wd  QXWd  QX| j   S(   Ni    t   values   mismatched typesg        g      ?(   R<   R   R   t   imagRS   R   R   t   make_helperR   R%   RW   R   R   t   FCMP_OGER^   t   FCMP_OEQR\   R   t   fmulR   R   t	   _getvalue("   R-   R.   R   R   R   R   R   t   in1rt   in1it   in2rt   in2it   ftypeRT   RI   Rk   t   ONEt   in2r_abst   in2i_abst   in2r_abs_ge_in2i_absRs   Rt   t   in2r_is_zerot   in2i_is_zerot   in2_is_zerot   inn_thent   inn_otherwiset   ratt   tmp1t   tmp2t   sclt   tmp3t   tmp4t   tmp5t   tmp6(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_div_impl  s\    5					@'!c         C` sC   t  | | d  i d t j 6d t j 6} t |  | | | | d  S(   Ni   t   npy_logaddexpft   npy_logaddexpt	   logaddexp(   R!   R   t   float32R,   RR   (   R-   R.   R   R   t   dispatch_table(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_logaddexp_impl_  s    
c         C` sC   t  | | d  i d t j 6d t j 6} t |  | | | | d  S(   Ni   t   npy_logaddexp2ft   npy_logaddexp2t
   logaddexp2(   R!   R   R   R,   RR   (   R-   R.   R   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_logaddexp2_implm  s    
c         ` s   | \ } } | j    t   f d   | D  s= t d   | j \ } } |  j | | | t j  } |  j | | | t j  } | j | |  S(   Nc         3` s   |  ] } | j    k Vq d  S(   N(   RS   (   R   RT   (   RU   (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pys	   <genexpr>  s    s   must have homogeneous types(   RS   R   R   R   R*   R   R,   R   (   R-   R.   R   R   Ri   Rj   t   numtyt   denty(    (   RU   s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_truediv_impl|  s    	(c         C` sC   t  |  | | |  } t j | j | j  } t |  | | | f  S(   N(   R   R   t	   signatureR   t   np_real_floor_impl(   R-   R.   R   R   R   t   s(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_floor_div_impl  s    c         C` s  | j  d j } t j | |  } g  | D]% } |  j | | j  d d | ^ q) \ } } | j }	 | j }
 | j } | j } |	 j } t g  |	 |
 | | g D] } | j | k ^ q  s t	 d   t
 j j | d  } |  j | | j  } | | _ t |  | |  } t |  | |  } | j t
 j | |  } | j |  5\ } } |  | j | |  } | j |
 |  } | j | |  } | j |	 |  } | j | |  } | j | |  } t |  | | | f  | _ Wd  QX|  | j | |  } | j |	 |  } | j | |  } | j |
 |  } | j | |  } | j | |  } t |  | | | f  | _ Wd  QXWd  QX| j   S(   Ni    R   s   mismatched typesg        (   R   t   underlying_floatR   R   R<   R   R   RS   R   R   R%   RW   R   R   R   R   R   R^   R   R   R   R   R   (   R-   R.   R   R   t
   float_kindt	   floor_sigR   R   R   R   R   R   R   R   RT   Rk   RI   R   R   R   Rs   Rt   R   R   R   R   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_floor_div_impl  sD    5					@	!'c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R   t   complex_power_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_power_impl  s    c         C` s[  t  | | d  | d } | j d } | j } |  j | d  } |  j | d  } |  j | d  }	 |  j | t d   }
 |  j | |  } | | _ | | _ t j	 t
 j | g d  } | | j   g } t |  | | |  } t |  | | |  } t |  | | |  } | j | | |  } | j | |	 |
  } | j | | |  | _ | j   S(   Ni   i    g        g      ?g      t   nani   (   R!   R   R   R   t   floatR<   R   R   R   R   R   t   booleanR   t   np_complex_ge_implt   np_complex_eq_implt   np_complex_lt_implRe   (   R-   R.   R   R   t   opR   t   float_tyRk   R   Rl   t   NANR6   t   cmp_sigt   cmp_argst   arg1_ge_arg2t   arg1_eq_arg2t   arg1_lt_arg2t   real_when_get   real_when_nge(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_sign_impl  s(    
			c         C` s#   t  | | d  t j | d |  S(   Ni   s	   llvm.rint(   R!   R
   t   call_fp_intrinsic(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_rint_impl  s    c   	      C` s   t  | | d  | j d } | j } |  j | | d | d } |  j | |  } t j | g d   } t |  | | | j g  | _ t |  | | | j g  | _ | j	   S(   Ni   i    R   i   (
   R!   R   R   R<   R   R   R   R   R   R   (	   R-   R.   R   R   R   R   R   RI   t	   inner_sig(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_rint_impl  s    	c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t   exp_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_exp_impl  s    c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R	   R   (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_exp_impl  s    c         C` sC   t  | | d  i d t j 6d t j 6} t |  | | | | d  S(   Ni   t	   npy_exp2ft   npy_exp2t   exp2(   R!   R   R   R,   RR   (   R-   R.   R   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_exp2_impl  s    
c   	      C` s   t  | | d  | j d } | j } |  j | | d | d } |  j | |  } |  j | t  } | j | | j  | _ | j | | j  | _ t	 |  | | | j
   g  S(   Ni   i    R   (   R!   R   R   R<   R   t
   _NPY_LOGE2R   R   R   R   R   (	   R-   R.   R   R   R   R   R   t   tmpt   loge2(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_exp2_impl$  s    	c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t   log_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_log_impl3  s    c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R	   R   (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_log_impl8  s    c         C` sC   t  | | d  i d t j 6d t j 6} t |  | | | | d  S(   Ni   t	   npy_log2ft   npy_log2t   log2(   R!   R   R   R,   RR   (   R-   R.   R   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_log2_impl?  s    
c         C` s   t  | | d  | j d } | j } t |  | | |  } |  j | | d | } |  j | t  } | j | | j  | _ | j | | j	  | _	 | j
   S(   Ni   i    R   (   R!   R   R   R   R<   R   t
   _NPY_LOG2ER   R   R   R   (   R-   R.   R   R   R   R   R   t   log2e(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_log2_implJ  s    	c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t
   log10_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_log10_implZ  s    c         C` s   t  | | d  | j d } | j } t |  | | |  } |  j | | d | } |  j | t  } | j | | j  | _ | j | | j	  | _	 | j
   S(   Ni   i    R   (   R!   R   R   R   R<   R   t   _NPY_LOG10ER   R   R   R   (   R-   R.   R   R   R   R   R   t   log10e(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_log10_impl_  s    	c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t
   expm1_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_expm1_implo  s    c         C` s  t  | | d  | j d } | j } t j | g d   } |  j | d  } |  j | | d | d } t |  | | | j g  }	 |  j | |  }
 t	 |  | | | j
 g  } t |  | | | j
 g  } | j |	 |  } | j |	 |  |
 _
 | j | |  |
 _ |
 j   S(   Ni   i    i   g      R   (   R!   R   R   R   R   R   R<   R   R   t   np_real_cos_implR   t   np_real_sin_implR   R   R   (   R-   R.   R   R   R   R   t   float_unary_sigRl   R   t   aRI   t   cos_imagt   sin_imagR   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_expm1_impls  s    	c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t
   log1p_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_log1p_impl  s    c         C` s  t  | | d  | j d } | j } t j | g d   } t j | g d   } |  j | d  } |  j | | d | d }	 |  j | |  }
 | j |	 j |  } t	 |  | | | |	 j
 g  } t |  | | |	 j
 | g  |
 _
 t |  | | | g  |
 _ |
 j   S(   Ni   i    i   i   g      ?R   (   R!   R   R   R   R   R   R<   R   R   t   np_real_hypot_implR   t   np_real_atan2_implR   R   (   R-   R.   R   R   R   R   R  t   float_binary_sigR   R   RI   t   real_plus_onet   l(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_log1p_impl  s    	c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t	   sqrt_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_sqrt_impl  s    c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R	   R  (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_sqrt_impl  s    c         C` s(   t  | | d  | j | d | d  S(   Ni   i    (   R!   t   mul(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_square_impl  s    c         C` s(   t  | | d  | j | d | d  S(   Ni   i    (   R!   R   (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_square_impl  s    c         C` sM   t  | | d  t j | j g d   } t j |  | | | d | d g  S(   Ni   i   i    (   R!   R   R   R   R   t   complex_mul_impl(   R-   R.   R   R   t
   binary_sig(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_square_impl  s    c   	      C` s   t  | | d  | j } t j | g d   } |  j | | d | t j  } |  j t j d  } | j | |  } |  j | | t j |  S(   Ni   i   i    (	   R!   R   R   R   R*   R   R,   R   R   (	   R-   R.   R   R   R   R  t   in_as_floatR   t   result_as_float(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_reciprocal_impl  s    	c         C` s9   t  | | d  |  j | j d  } | j | | d  S(   Ni   g      ?i    (   R!   R   R   R   (   R-   R.   R   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_reciprocal_impl  s    c         C` s  t  | | d  | j d } | j } |  j | d  } |  j | d  } |  j | | d | d } |  j | |  }	 | j }
 | j } t |  | |
  } t |  | |  } | j t	 j
 | |  } | j |  \ } } | } | j | |
  } | j | |  } | j |
 |  } | j | |  } | j | |  } | |	 _ | j | |  |	 _ Wd  QX| w | j |
 |  } | j |
 |  } | j | |  } | j | |  } | j | |  |	 _ | j | |  |	 _ Wd  QXWd  QX|	 j   S(   Ni   i    g        g      ?R   (   R!   R   R   R   R<   R   R   R   R   R%   t   FCMP_OLER^   R   R   R   R   R   (   R-   R.   R   R   R   R   Rk   R   R   RI   R   R   t   in1r_abst   in1i_abst   in1i_abs_le_in1r_absRs   Rt   t   rt   tmp0t   dt   inv_dt   minus_r(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_reciprocal_impl  s:    				!c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t   sin_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyR    s    c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R	   R+  (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_sin_impl  s    c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t   cos_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyR    s    c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R	   R-  (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_cos_impl  s    c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t   tan_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_tan_impl   s    c         C` s  t  | | d  | j d } | j } t j | g d   } |  j | d  } |  j | | | d  } |  j | |  }	 | j }
 | j } t	 |  | | |
 g  } t
 |  | | |
 g  } t |  | | | g  } t |  | | | g  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  |	 _ | j | |  |	 _ |	 j   S(   Ni   i    i   g      ?(   R!   R   R   R   R   R   R<   R   R   R  R  t   np_real_sinh_implt   np_real_cosh_implR   R   R   R   R   (   R-   R.   R   R   R   R   R  R   t   xRI   t   xrt   xit   srt   crt   shit   chit   rst   is_t   rct   ict   sqr_rct   sqr_icR'  R(  t   rs_rct   is_ict   is_rct   rs_ict   numrt   numi(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_tan_impl%  s<    			c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t	   asin_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_asin_implN  s    c         C` s   | t  j k s t  t j | g d   } |  j | | d | } |  j | j d  } x t |  D] }	 |  j | j |	  }
 t	 j
 |  | | | | j   g  } | j |  | j | | j | j |
   | _ | j | j |
  | _ qe W| j   S(   s  this is used to implement approximations using series that are
    quite common in NumPy's source code to improve precision when the
    magnitude of the arguments is small. In funcs.inc.src this is
    implemented by repeated use of the macro "SERIES_HORNER_TERM
    i   R   g      ?(   R   R;   R   R   R   R<   R   R   t   reversedR   R  R   t	   _setvalueR   R   R   R   (   R-   R.   R   t   initialR3  t   coefsR  t   accumR   t   coeft   constantR   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   _complex_expand_seriesS  s    $c         C` s  t  | | d  | j d } | j } |  j | d  } |  j | | d | d } |  j | |  } t |  | | j  }	 t |  | | j  }
 | j t	 j
 |	 |  } | j t	 j
 |
 |  } | j | |  } t j | g d   } | j |  \ } } | *|  j | | d  } |  j | | d  } |  j | | d  } t |  | | |  } t j |  | | | | g  } t |  | | | g  } t j |  | | | | d g  } t j |  | | | | g  } t |  | | | g  } t j |  | | | | g  } | j t j |  | | | | g   Wd  QX|  i d d g t j 6d d d g t j 6} t |  | | |  } |  j | | d  } t |  | | | | | |  } | j t j |  | | | d | g   Wd  QXWd  QX| j   S(   Ni   i    gMbP?R   i   y              ?g      ?y                g        g      @g      "@g      4@g      9@g      E@y      ?        y                gUUUUUU?g?gUUUUUU?g?g00?y      ?        (   R!   R   R   R   R<   R   R   R   R   R%   t   FCMP_OGTR]   R   R   R^   t   get_constant_genericR  R   t   complex_sub_implR  R  t   complex_add_implR   RJ  R   t	   complex64t
   complex128RP  R   (   R-   R.   R   R   R   R   t   epsilonR3  RI   t   abs_rt   abs_it   abs_r_gt_epsilont   abs_i_gt_epsilont   any_gt_epsilont   complex_binary_sigRs   Rt   t   IR   Rk   t   xxt   one_minus_xxt   sqrt_one_minus_xxt   ixt   log_argt   logt   ilogt	   coef_dictR   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_asin_implh  s^    	 c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t	   acos_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_acos_impl  s    c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t	   atan_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_atan_impl  s    c         C` s  t  | | d  | j d } | j } |  j | d  } |  j | | d | d } |  j | |  } t |  | | j  }	 t |  | | j  }
 | j t	 j
 |	 |  } | j t	 j
 |
 |  } | j | |  } t j | g d   } | j |  \ } } |  |  j | | d  } |  j | | d  } t j |  | | | | d g  } t j |  | | | | d g  } t |  | | | | g  } t |  | | | g  } t j |  | | | | g  } | j |  Wd  QX|  i d d g t j 6d d d g t j 6} t |  | | |  } |  j | | d  } t |  | | | | | |  } | j t j |  | | | d | g   Wd  QXWd  QX| j   S(   Ni   i    gMbP?R   i   g        y              ?y              ?g      g      @g      g      @g      g      @g      ?y                y              ?y              ?gUUUUUUտg333333gUUUUUUտg333333gm۶my      ?        (   R!   R   R   R   R<   R   R   R   R   R%   RQ  R]   R   R   R^   RR  R   RS  RT  R   R   R  RJ  R   RU  RV  R  RP  R   (   R-   R.   R   R   R   R   RW  R3  RI   RX  RY  RZ  R[  R\  R  Rs   Rt   R^  t   I2Rj   Ri   Rw   Rd  R   Rf  R_  R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_atan_impl  sL    	 c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t   atan2_float_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyR    s    c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t   hypot_float_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyR    s    c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t	   sinh_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyR1    s    c         C` s  t  | | d  | j d } | j } t j | g d   } |  j | | | d  } |  j | |  } | j }	 | j }
 t |  | | |
 g  } t	 |  | | |	 g  } t
 |  | | |
 g  } t |  | | |	 g  } | j | |  | _ | j | |  | _ | j   S(   Ni   i    i   (   R!   R   R   R   R   R<   R   R   R  R1  R  R2  R   R   (   R-   R.   R   R   R   t   ftyt   fsig1R3  RI   R4  R5  t   sxit   shxrt   cxit   chxr(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_sinh_impl  s    			c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t	   cosh_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyR2     s    c         C` s  t  | | d  | j d } | j } t j | g d   } |  j | | | d  } |  j | |  } | j }	 | j }
 t |  | | |
 g  } t	 |  | | |	 g  } t
 |  | | |
 g  } t |  | | |	 g  } | j | |  | _ | j | |  | _ | j   S(   Ni   i    i   (   R!   R   R   R   R   R<   R   R   R  R2  R  R1  R   R   (   R-   R.   R   R   R   Rq  Rr  R3  RI   R4  R5  Ru  Rv  Rs  Rt  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_cosh_impl%  s    			c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t	   tanh_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_tanh_impl@  s    c         C` s  t  | | d  | j d } | j } t j | g d   } |  j | d  } |  j | | | d  } |  j | |  }	 | j }
 | j } t	 |  | | | g  } t
 |  | | | g  } t |  | | |
 g  } t |  | | |
 g  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  } | j | |  |	 _ | j | |  |	 _ |	 j   S(   Ni   i    i   g      ?(   R!   R   R   R   R   R   R<   R   R   R  R  R1  R2  R   R   R   R   R   (   R-   R.   R   R   R   Rq  Rr  R   R3  RI   R4  R5  t   sit   cit   shrt   chr_R:  R;  R<  R=  R>  R?  R'  R(  R@  RA  RB  RC  RD  RE  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_tanh_implE  s<    			c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t
   asinh_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_asinh_impln  s    c         C` sl  t  | | d  | j d } | j } |  j | d  } |  j | | d | d } |  j | |  } t |  | | j  }	 t |  | | j  }
 | j t	 j
 |	 |  } | j t	 j
 |
 |  } | j | |  } t j | g d   } | j |  i\ } } |  |  j | | d  } t |  | | |  } t j |  | | | | g  } t |  | | | g  } t j |  | | | | d g  } t |  | | | g  } | j |  Wd  QX|  i d d g t j 6d d d g t j 6} t |  | | |  } |  j | | d  } t |  | | | | | |  } | j t j |  | | | d | g   Wd  QXWd  QX| j   S(   Ni   i    gMbP?R   i   g      ?y                g      g      @g      "g      4@g      9g      E@y      ?        gUUUUUUſgܿgUUUUUUſgܿg00y      ?        (   R!   R   R   R   R<   R   R   R   R   R%   RQ  R]   R   R   R^   RR  R  R   RT  R  R   RJ  R   RU  RV  RP  R  R   (   R-   R.   R   R   R   R   RW  R3  RI   RX  RY  RZ  R[  R\  R  Rs   Rt   R   R_  t   one_plus_xxt   sqrt_resRc  R   Rf  R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_asinh_impls  sH    	 c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t
   acosh_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_acosh_impl  s    c         C` s  t  | | d  | j d } t j | g d   } |  j | | d  } | d } t j |  | | | | g  } t j |  | | | | g  }	 t |  | | | g  }
 t |  | | |	 g  } t j	 |  | | |
 | g  } t j |  | | | | g  } t
 |  | | | g  S(   Ni   i    i   g      ?y                y      ?        (   R!   R   R   R   RR  R   RT  RS  R  R  R   (   R-   R.   R   R   R   t   csig2R   R3  t
   x_plus_onet   x_minus_onet   sqrt_x_plus_onet   sqrt_x_minus_onet	   prod_sqrtRc  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_acosh_impl  s"    
c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t
   atanh_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_atanh_impl  s    c         C` s  t  | | d  | j d } | j } |  j | d  } |  j | | d | d } |  j | |  } t |  | | j  }	 t |  | | j  }
 | j t	 j
 |	 |  } | j t	 j
 |
 |  } | j | |  } t j | g d   } | j |  \ } } |  |  j | | d  } |  j | | d  } t j |  | | | | d g  } t j |  | | | | d g  } t |  | | | | g  } t |  | | | g  } t j |  | | | | g  } | j |  Wd  QX|  i d d g t j 6d d d g t j 6} t |  | | |  } |  j | | d  } t |  | | | | | |  } | j t j |  | | | d | g   Wd  QXWd  QX| j   S(   Ni   i    gMbP?R   i   g      ?y                g      ?g      @g      @g      @y      ?        y      ?        gUUUUUU?g333333?gUUUUUU?g333333?gm۶m?y      ?        (   R!   R   R   R   R<   R   R   R   R   R%   RQ  R]   R   R   R^   RR  R   RS  RT  R   R   R  RJ  R   RU  RV  R  RP  R   (   R-   R.   R   R   R   R   RW  R3  RI   RX  RY  RZ  R[  R\  R  Rs   Rt   R   t   HALFRj   Ri   Rw   Rd  R   Rf  R_  R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_atanh_impl  sL    	 c         C` s#   t  | | d  t j | d |  S(   Ni   s
   llvm.floor(   R!   R
   R   (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyR     s    c         C` s#   t  | | d  t j | d |  S(   Ni   s	   llvm.ceil(   R!   R
   R   (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_ceil_impl  s    c         C` s#   t  | | d  t j | d |  S(   Ni   s
   llvm.trunc(   R!   R
   R   (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_trunc_impl  s    c         C` s#   t  | | d  t j | d |  S(   Ni   s	   llvm.fabs(   R!   R
   R   (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_fabs_impl&  s    c         C` s  t  | | d d t j | j d } g  | D] } |  j | | d | ^ q- \ } } | j } | j }	 | j }
 | j } | j t j	 | |
  } | j t j
 |	 |  } | j t j | |
  } | j t j |	 |  } | j | |  } | j | |  } | j | |  S(   Ni   R   i    R   (   R!   R   R   R   R<   R   R   R   R%   RQ  t   FCMP_ORDR   R   R\   R]   (   R-   R.   R   R   R   R   R   R   R4  R5  t   yrt   yit   xr_gt_yrt   no_nan_xi_yit   xr_eq_yrt   xi_ge_yit
   first_termt   second_term(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyR   1  s    1				c         C` s  t  | | d d t j | j d } g  | D] } |  j | | d | ^ q- \ } } | j } | j }	 | j }
 | j } | j t j	 | |
  } | j t j
 |	 |  } | j t j | |
  } | j t j |	 |  } | j | |  } | j | |  } | j | |  S(   Ni   R   i    R   (   R!   R   R   R   R<   R   R   R   R%   R   R  R   R!  R\   R]   (   R-   R.   R   R   R   R   R   R   R4  R5  R  R  t   xr_lt_yrR  R  t   xi_le_yiR  R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_le_implF  s    1				c         C` s  t  | | d d t j | j d } g  | D] } |  j | | d | ^ q- \ } } | j } | j }	 | j }
 | j } | j t j	 | |
  } | j t j
 |	 |  } | j t j | |
  } | j t j	 |	 |  } | j | |  } | j | |  } | j | |  S(   Ni   R   i    R   (   R!   R   R   R   R<   R   R   R   R%   RQ  R  R   R\   R]   (   R-   R.   R   R   R   R   R   R   R4  R5  R  R  R  R  R  t   xi_gt_yiR  R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_gt_impl[  s    1				c         C` s  t  | | d d t j | j d } g  | D] } |  j | | d | ^ q- \ } } | j } | j }	 | j }
 | j } | j t j	 | |
  } | j t j
 |	 |  } | j t j | |
  } | j t j	 |	 |  } | j | |  } | j | |  } | j | |  S(   Ni   R   i    R   (   R!   R   R   R   R<   R   R   R   R%   R   R  R   R\   R]   (   R-   R.   R   R   R   R   R   R   R4  R5  R  R  R  R  R  t   xi_lt_yiR  R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyR   p  s    1				c         C` s   t  | | d d t j | j d } g  | D] } |  j | | d | ^ q- \ } } | j } | j }	 | j }
 | j } | j t j	 | |
  } | j t j	 |	 |  } | j
 | |  S(   Ni   R   i    R   (   R!   R   R   R   R<   R   R   R   R%   R   R\   (   R-   R.   R   R   R   R   R   R   R4  R5  R  R  R  t   xi_eq_yi(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyR     s    1				c         C` s   t  | | d d t j | j d } g  | D] } |  j | | d | ^ q- \ } } | j } | j }	 | j }
 | j } | j t j	 | |
  } | j t j	 |	 |  } | j
 | |  S(   Ni   R   i    R   (   R!   R   R   R   R<   R   R   R   R%   t   FCMP_UNER]   (   R-   R.   R   R   R   R   R   R   R4  R5  R  R  t   xr_ne_yrt   xi_ne_yi(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_ne_impl  s    1				c         C` sR   |  j  | | d | } t j | | j  } t j | | j  } | j | |  S(   NR   (   R<   R   t   is_trueR   R   R]   (   R-   R.   R   t   valt   complex_valt   re_truet   im_true(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   _complex_is_true  s    c         C` sU   t  | | d d t j t j | | d  } t j | | d  } | j | |  S(   Ni   R   i    i   (   R!   R   R   R   R  R\   (   R-   R.   R   R   R  t   b(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_logical_and_impl  s    c         C` si   t  | | d d t j t |  | | j d | d  } t |  | | j d | d  } | j | |  S(   Ni   R   i    i   (   R!   R   R   R  R   R\   (   R-   R.   R   R   R  R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_logical_and_impl  s      c         C` sU   t  | | d d t j t j | | d  } t j | | d  } | j | |  S(   Ni   R   i    i   (   R!   R   R   R   R  R]   (   R-   R.   R   R   R  R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_logical_or_impl  s    c         C` si   t  | | d d t j t |  | | j d | d  } t |  | | j d | d  } | j | |  S(   Ni   R   i    i   (   R!   R   R   R  R   R]   (   R-   R.   R   R   R  R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_logical_or_impl  s      c         C` sU   t  | | d d t j t j | | d  } t j | | d  } | j | |  S(   Ni   R   i    i   (   R!   R   R   R   R  Rc   (   R-   R.   R   R   R  R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_logical_xor_impl  s    c         C` si   t  | | d d t j t |  | | j d | d  } t |  | | j d | d  } | j | |  S(   Ni   R   i    i   (   R!   R   R   R  R   Rc   (   R-   R.   R   R   R  R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_logical_xor_impl  s      c         C` s-   t  | | d d t j t j | | d  S(   Ni   R   i    (   R!   R   R   R   t   is_false(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_logical_not_impl  s    c         C` sF   t  | | d d t j t |  | | j d | d  } | j |  S(   Ni   R   i    (   R!   R   R   R  R   t   not_(   R-   R.   R   R   R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_logical_not_impl  s     c         C` sG   t  | | d  | \ } } | j t j | |  } | j | | |  S(   Ni   (   R!   RZ   R%   t   ICMP_SGERe   (   R-   R.   R   R   t   arg1t   arg2t   arg1_sge_arg2(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_smax_impl  s    c         C` sG   t  | | d  | \ } } | j t j | |  } | j | | |  S(   Ni   (   R!   RZ   R%   t   ICMP_UGERe   (   R-   R.   R   R   R  R  t   arg1_uge_arg2(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_umax_impl  s    c         C` s   t  | | d  | \ } } | j t j | |  } | j t j | |  } | j | | |  } | j t j | |  }	 | j |	 | |  }
 | j | | |
  S(   Ni   (   R!   R   R%   t   FCMP_UNORe   R   (   R-   R.   R   R   R  R  t   arg1_nant   any_nant
   nan_resultR   t   non_nan_result(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_maximum_impl   s    c         C` s   t  | | d  | \ } } | j t j | |  } | j t j | |  } | j | | |  } | j t j | |  }	 | j |	 | |  }
 | j | | |
  S(   Ni   (   R!   R   R%   R  Re   R   (   R-   R.   R   R   R  R  t   arg2_nanR  R  R   R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_fmax_impl  s    c         C` s   t  | | d  | j d } t j t j |  } t j t j | g d  } | \ } } t |  | | | g  }	 t |  | | | g  }
 | j |	 |
  } | j |	 | |  } t	 |  | | |  } | j | | |  } | j | | |  S(   Ni   i    (
   R!   R   R   R   R   R   t   np_complex_isnan_implR]   Re   R   (   R-   R.   R   R   R   t   bc_sigt   bcc_sigR  R  R  R  R  R  R   R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_maximum_impl  s    c         C` s   t  | | d  | j d } t j t j |  } t j t j | g d  } | \ } } t |  | | | g  }	 t |  | | | g  }
 | j |	 |
  } | j |
 | |  } t	 |  | | |  } | j | | |  } | j | | |  S(   Ni   i    (
   R!   R   R   R   R   R   R  R]   Re   R   (   R-   R.   R   R   R   R  R  R  R  R  R  R  R  R   R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_fmax_impl4  s    c         C` sG   t  | | d  | \ } } | j t j | |  } | j | | |  S(   Ni   (   R!   RZ   R%   t   ICMP_SLERe   (   R-   R.   R   R   R  R  t   arg1_sle_arg2(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_smin_implI  s    c         C` sG   t  | | d  | \ } } | j t j | |  } | j | | |  S(   Ni   (   R!   RZ   R%   t   ICMP_ULERe   (   R-   R.   R   R   R  R  t   arg1_ule_arg2(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_umin_implP  s    c         C` s   t  | | d  | \ } } | j t j | |  } | j t j | |  } | j | | |  } | j t j | |  }	 | j |	 | |  }
 | j | | |
  S(   Ni   (   R!   R   R%   R  Re   R!  (   R-   R.   R   R   R  R  R  R  R  t   arg1_le_arg2R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_minimum_implW  s    c         C` s   t  | | d  | \ } } | j t j | |  } | j t j | |  } | j | | |  } | j t j | |  }	 | j |	 | |  }
 | j | | |
  S(   Ni   (   R!   R   R%   R  Re   R!  (   R-   R.   R   R   R  R  R  R  R  R  R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_fmin_implf  s    c         C` s   t  | | d  | j d } t j t j |  } t j t j | g d  } | \ } } t |  | | | g  }	 t |  | | | g  }
 | j |	 |
  } | j |	 | |  } t	 |  | | |  } | j | | |  } | j | | |  S(   Ni   i    (
   R!   R   R   R   R   R   R  R]   Re   R  (   R-   R.   R   R   R   R  R  R  R  R  R  R  R  R  R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_minimum_implu  s    c         C` s   t  | | d  | j d } t j t j |  } t j t j | g d  } | \ } } t |  | | | g  }	 t |  | | | g  }
 | j |	 |
  } | j |
 | |  } t	 |  | | |  } | j | | |  } | j | | |  S(   Ni   i    (
   R!   R   R   R   R   R   R  R]   Re   R  (   R-   R.   R   R   R   R  R  R  R  R  R  R  R  R  R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_fmin_impl  s    c         C` s    t  | | d d t j t j S(   Ni   R   (   R!   R   R   R   t	   false_bit(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_isnan_impl  s    c         C` s-   t  | | d d t j t j | | d  S(   Ni   R   i    (   R!   R   R   R
   t   is_nan(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_isnan_impl  s    c         C` sV   t  | | d d t j | \ } | j \ } |  j | | d | } t j | |  S(   Ni   R   R   (   R!   R   R   R   R<   R	   R  (   R-   R.   R   R   R3  R   R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyR    s
    	c         C` s    t  | | d d t j t j S(   Ni   R   (   R!   R   R   R   t   true_bit(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_isfinite_impl  s    c         C` s3   t  | | d d t j | j d | d t j  S(   Ni   R   s   !=i    (   R!   R   R   t   icmp_unsignedR   t   NAT(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_datetime_isfinite_impl  s    c         C` s-   t  | | d d t j t j | | d  S(   Ni   R   i    (   R!   R   R   R
   t	   is_finite(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_isfinite_impl  s    c         C` sV   t  | | d d t j | \ } | j \ } |  j | | d | } t j | |  S(   Ni   R   R   (   R!   R   R   R   R<   R	   R  (   R-   R.   R   R   R3  R   R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_isfinite_impl  s
    	c         C` s    t  | | d d t j t j S(   Ni   R   (   R!   R   R   R   R  (   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_int_isinf_impl  s    c         C` s-   t  | | d d t j t j | | d  S(   Ni   R   i    (   R!   R   R   R
   t   is_inf(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_isinf_impl  s    c         C` sV   t  | | d d t j | \ } | j \ } |  j | | d | } t j | |  S(   Ni   R   R   (   R!   R   R   R   R<   R	   R  (   R-   R.   R   R   R3  R   R  (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_complex_isinf_impl  s
    	c         C` s   t  | | d d t j i d t j 6d t j 6} t j t j | j  } t	 |  | | | | d  } | j
 d | | j d   } | S(   Ni   R   t   numba_signbitft   numba_signbitt   signbits   !=i    (   R!   R   R   R   R,   R   R   t   intcR   RR   R  RS   (   R-   R.   R   R   R   R   t   int_rest   bool_res(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_signbit_impl  s    
c         C` s&   t  | | d  t j |  | | |  S(   Ni   (   R!   R
   t   copysign_float_impl(   R-   R.   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_copysign_impl  s    c         C` sC   t  | | d  i d t j 6d t j 6} t |  | | | | d  S(   Ni   t   npy_nextafterft   npy_nextaftert	   nextafter(   R!   R   R   R,   RR   (   R-   R.   R   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_nextafter_impl  s    
c         C` sC   t  | | d  i d t j 6d t j 6} t |  | | | | d  S(   Ni   t   npy_spacingft   npy_spacingt   spacing(   R!   R   R   R,   RR   (   R-   R.   R   R   R   (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_spacing_impl  s    
c   	      C` sj   | \ } } | j  \ } } |  j | | | t j  } t j | | t j  } t j |  | | | | f  S(   N(   R   R*   R   R  R   R   R
   t
   ldexp_impl(	   R-   R.   R   R   t   x1t   x2t   ty1t   ty2t   f_fi_sig(    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   np_real_ldexp_impl
  s
    (   t   __doc__t
   __future__R    R   R   t   matht   llvmlite.llvmpyR   R%   t    R   R   R   R   R   R	   R
   R   R   R   R   R   R   R!   R,   R7   RR   R   R   R   R   t   np_int_fmod_implR   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.  R0  RF  RH  RP  Rg  Ri  Rk  Rm  R  R  R1  Rw  R2  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  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  (    (    (    s5   lib/python2.7/site-packages/numba/targets/npyfuncs.pyt   <module>   s   ("	>	$								M					6			 																					
			*						)			A			9								)		6				:																																																	