
    Xh                     |   d dl mZmZmZ d dlmZ d dlmZ d dlm	Z	 d dl
mZ d dlmZmZ d dlmZmZ dd	lmZmZ d
ddZej        dz  Z ee          Zd
ddZd
ddZd
ddZ G d de          Z G d de          Z G d de          Z G d de          Z G d de          Z  G d de          Z!dS )    )AddArgumentIndexErrorFunction)Pow)S)default_sort_key)sympify)explog)MaxMin   )TokennoneTevaluatec          	      |    t          t          t          | |          t          ||          |                    S Nr   )r   r   r
   x1x2r   s      k/var/www/tools.fuzzalab.pt/emblema-extractor/venv/lib/python3.11/site-packages/sympy/codegen/numpy_nodes.py
_logaddexpr      s:    s3rH---s2/I/I/IT\]]]^^^       c                4    t          | |          t          z  S r   )r   _ln2xr   s     r   _lbr       s    q8$$$T))r   c                0    t          t          | |          S r   )r   _twor   s     r   _exp2r#      s    tQ****r   c          	      |    t          t          t          | |          t          ||          |                    S r   )r    r   r#   r   s      r   _logaddexp2r%      sL    s5h///h///(D D D E E Er   c                   6    e Zd ZdZdZd Zd
dZd Zd Zd Z	d	S )	logaddexpz Logarithm of the sum of exponentiations of the inputs.

    Helper class for use with e.g. numpy.logaddexp

    See Also
    ========

    https://numpy.org/doc/stable/reference/generated/numpy.logaddexp.html
    r   c                 N    t          j        | gt          |t                    R  S N)keyr   __new__sortedr   clsargss     r   r,   zlogaddexp.__new__,   )    IfT7G&H&H&HIIIIr   r   c                     |dk    r| j         \  }}n!|dk    r| j         \  }}nt          | |          t          j        t          j        t	          ||z
            z   z  S z@
        Returns the first derivative of this function.
        r   r   )r0   r   r   Oner
   selfargindexwrtothers       r   fdiffzlogaddexp.fdiff/   s^     q==JC]]JE33$T8444uaec%)nn,--r   c                 "    t          ||          S N)r   r6   r   r   kwargss       r   _eval_rewrite_as_logzlogaddexp._eval_rewrite_as_log;   s    "b!!!r   c                 L     |                      t                    j        |i |S r<   rewriter   evalfr6   r0   r>   s      r   _eval_evalfzlogaddexp._eval_evalf>   &    &t||C  &7777r   c                     fd| j         D             \  }}t          ||          }|t          ||d          k    r|S t          ||          S )Nc              3   2   K   | ]} |j         di V  d S N )simplify.0r   r>   s     r   	<genexpr>z+logaddexp._eval_simplify.<locals>.<genexpr>B   s5      88

$$V$$888888r   Fr   )r0   r   r'   r6   r0   r>   ab	candidates     `   r   _eval_simplifyzlogaddexp._eval_simplifyA   s_    8888di8881q!$$	
1a%88888Q??"r   Nr   
__name__
__module____qualname____doc__nargsr,   r:   r?   rE   rS   rJ   r   r   r'   r'       sx          EJ J J
. 
. 
. 
." " "8 8 8# # # # #r   r'   c                   6    e Zd ZdZdZd Zd
dZd Zd Zd Z	d	S )
logaddexp2z Logarithm of the sum of exponentiations of the inputs in base-2.

    Helper class for use with e.g. numpy.logaddexp2

    See Also
    ========

    https://numpy.org/doc/stable/reference/generated/numpy.logaddexp2.html
    r   c                 N    t          j        | gt          |t                    R  S r)   r+   r.   s     r   r,   zlogaddexp2.__new__V   r1   r   r   c                     |dk    r| j         \  }}n!|dk    r| j         \  }}nt          | |          t          j        t          j        t	          ||z
            z   z  S r3   )r0   r   r   r4   r#   r5   s       r   r:   zlogaddexp2.fdiffY   s`     q==JC]]JE33$T8444uaeeE#I...//r   c                 "    t          ||          S r<   )r%   r=   s       r   r?   zlogaddexp2._eval_rewrite_as_loge   s    2r"""r   c                 L     |                      t                    j        |i |S r<   rA   rD   s      r   rE   zlogaddexp2._eval_evalfh   rF   r   c                     fd| j         D             \  }}t          ||          }|t          ||d          k    r|S t          ||          S )Nc              3   V   K   | ]#} |j         di                                 V  $d S rI   )rK   factorrL   s     r   rN   z,logaddexp2._eval_simplify.<locals>.<genexpr>l   sA      AA!

$$V$$++--AAAAAAr   Fr   )r0   r%   r\   rO   s     `   r   rS   zlogaddexp2._eval_simplifyk   sa    AAAAtyAAA11%%	Aq599999a###r   NrT   rU   rJ   r   r   r\   r\   J   sx          EJ J J
0 
0 
0 
0# # #8 8 8$ $ $ $ $r   r\   c                   8    e Zd ZdZdxZZdeiZ ee	          Z
dS )aminz Minimum value along an axis.

    Helper class for use with e.g. numpy.amin


    See Also
    ========

    https://numpy.org/doc/stable/reference/generated/numpy.amin.html
    arrayaxisrh   NrV   rW   rX   rY   	__slots___fieldsr   defaultsstaticmethodr	   _construct_axisrJ   r   r   re   re   t   <        	 	 ,+I~H"l7++OOOr   re   c                   8    e Zd ZdZdxZZdeiZ ee	          Z
dS )amaxz Maximum value along an axis.

    Helper class for use with e.g. numpy.amax


    See Also
    ========

    https://numpy.org/doc/stable/reference/generated/numpy.amax.html
    rf   rh   Nri   rJ   r   r   rq   rq      ro   r   rq   c                       e Zd ZdZd ZdS )maximumz Element-wise maximum of array elements.

    Helper class for use with e.g. numpy.maximum


    See Also
    ========

    https://numpy.org/doc/stable/reference/generated/numpy.maximum.html
    c                     t          | j         S r<   )r   r0   r6   r0   s     r   _eval_rewrite_as_Maxzmaximum._eval_rewrite_as_Max       DIr   N)rV   rW   rX   rY   rv   rJ   r   r   rs   rs      -        	 	    r   rs   c                       e Zd ZdZd ZdS )minimumz Element-wise minimum of array elements.

    Helper class for use with e.g. numpy.minimum


    See Also
    ========

    https://numpy.org/doc/stable/reference/generated/numpy.minimum.html
    c                     t          | j         S r<   )r   r0   ru   s     r   _eval_rewrite_as_Minzminimum._eval_rewrite_as_Min   rw   r   N)rV   rW   rX   rY   r|   rJ   r   r   rz   rz      rx   r   rz   N)"sympy.core.functionr   r   r   sympy.core.powerr   sympy.core.singletonr   sympy.core.sortingr   sympy.core.sympifyr	   &sympy.functions.elementary.exponentialr
   r   (sympy.functions.elementary.miscellaneousr   r   astr   r   r   r4   r"   r   r    r#   r%   r'   r\   re   rq   rs   rz   rJ   r   r   <module>r      sW   A A A A A A A A A A             " " " " " " / / / / / / & & & & & & ; ; ; ; ; ; ; ; = = = = = = = =         $( _ _ _ _ _ 	uQw
s4yy  * * * * *  + + + + + %) E E E E E
'# '# '# '# '# '# '# '#T'$ '$ '$ '$ '$ '$ '$ '$T, , , , ,5 , , , , , , , ,5 , , ,     h        h     r   