U
    L?hz                     @   sr   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
 d dlmZmZ ed\ZZZdd	 Zd
d ZdS )    )product)S)symbols)explog)srepr)	logaddexp
logaddexp2zx y zc            
      C   s   t tt} ttttt }ttttgtdD ]2\}}| ||||| 	t
 dks2tq2dtd d }dtd d }t|}t|}t ||}|	tdkst|
 dkstt dd}	t|	t|	
 kstd S )N   r         )r   xyr   r   r   zrangediffrewritesimplifyAssertionErrorr   )
Zlae_xyZref_xywrtderiv_orderZone_third_eZtwo_thirds_eZ	logThirdEZlogTwoThirdsEZlae_sum_to_ewas r   V/var/www/html/venv/lib/python3.8/site-packages/sympy/codegen/tests/test_numpy_nodes.pytest_logaddexp
   s(    





r   c                  C   s   t tt} tdt dt  td }ttttgtdD ]2\}}| ||||| t	 dks:t
q:dd }tjd d }d| }||}||}t ||}	|	tdkst
|	 dkst
t tt}
t|
t|
 kst
d S )Nr   r
   r   c                 S   s   t | t d S )Nr   )r   )r   r   r   r   lb'   s    ztest_logaddexp2.<locals>.lbr   )r	   r   r   r   r   r   r   r   r   cancelr   r   ZOner   r   )Zlae2_xyZref2_xyr   r   r   Z
two_thirdsZfour_thirdsZlbTwoThirdsZlbFourThirdsZlae2_sum_to_2r   r   r   r   test_logaddexp2   s*    





r   N)	itertoolsr   Zsympy.core.singletonr   Zsympy.core.symbolr   Z&sympy.functions.elementary.exponentialr   r   Zsympy.printing.reprr   Zsympy.codegen.numpy_nodesr   r	   r   r   r   r   r   r   r   r   r   <module>   s   