
    g	                         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mZ dddZ G d	 d
e          ZdddZ G d de          ZdS )    )AddArgumentIndexErrorFunction)Pow)S)log)cossinTevaluatec                Z    t          t          | |          t          j         |          S Nr   )r   r	   r   One)xr   s     U/var/www/html/ai-engine/env/lib/python3.11/site-packages/sympy/codegen/scipy_nodes.py_cosm1r      s(    s1x(((15&8DDDD    c                   0    e Zd ZdZdZddZd Zd Zd ZdS )	cosm1z Minus one plus cosine of x, i.e. cos(x) - 1. For use when x is close to zero.

    Helper class for use with e.g. scipy.special.cosm1
    See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.cosm1.html
       c                 L    |dk    rt          | j          S t          | |          )@
        Returns the first derivative of this function.
        r   )r
   argsr   selfargindexs     r   fdiffzcosm1.fdiff   s,     q==O##$T8444r   c                      t          |          S N)r   )r   r   kwargss      r   _eval_rewrite_as_coszcosm1._eval_rewrite_as_cos   s    ayyr   c                 L     |                      t                    j        |i |S r   )rewriter	   evalfr   r   r    s      r   _eval_evalfzcosm1._eval_evalf    &    &t||C  &7777r   c                     | j         \  }t           |j        di |          }|t          |d          k    r|S t          |          S NFr    )r   r   simplifyr   )r   r    r   	candidates       r   _eval_simplifyzcosm1._eval_simplify#   sS    Y:1:////00	q51111188Or   Nr   )	__name__
__module____qualname____doc__nargsr   r!   r&   r-   r*   r   r   r   r      sf         
 E5 5 5 5  8 8 8    r   r   c                \    t          t          | ||          t          j         |          S r   )r   r   r   r   )r   yr   s      r   _powm1r6   ,   s*    s1a(+++aeVhGGGGr   c                   0    e Zd ZdZdZd	dZd Zd Zd ZdS )
powm1z Minus one plus x to the power of y, i.e. x**y - 1. For use when x is close to one or y is close to zero.

    Helper class for use with e.g. scipy.special.powm1
    See: https://docs.scipy.org/doc/scipy/reference/generated/scipy.special.powm1.html
       r   c                    |dk    rBt          | j        d         | j        d                   | j        d         z  | j        d         z  S |dk    r)t          | j        d                   t          | j         z  S t          | |          )r   r   r   r9   )r   r   r   r   r   s     r   r   zpowm1.fdiff8   sw     q==ty|TYq\2249Q<?	!LL]]ty|$$S$)_44$T8444r   c                 "    t          ||          S r   )r6   )r   r   r5   r    s       r   _eval_rewrite_as_Powzpowm1._eval_rewrite_as_PowC   s    a||r   c                 L     |                      t                    j        |i |S r   )r#   r   r$   r%   s      r   r&   zpowm1._eval_evalfF   r'   r   c                     | j         \  }}t           |j        di | |j        di |          }|t          ||d          k    r|S t          ||          S r)   )r   r6   r+   r8   )r   r    r   r5   r,   s        r   r-   zpowm1._eval_simplifyI   sn    y1:1:////1E1Ef1E1EFF	q!e44444A;;r   Nr.   )	r/   r0   r1   r2   r3   r   r<   r&   r-   r*   r   r   r8   r8   0   sf         
 E	5 	5 	5 	5  8 8 8    r   r8   N)sympy.core.functionr   r   r   sympy.core.powerr   sympy.core.singletonr   &sympy.functions.elementary.exponentialr   (sympy.functions.elementary.trigonometricr	   r
   r   r   r6   r8   r*   r   r   <module>rD      s   A A A A A A A A A A             " " " " " " 6 6 6 6 6 6 = = = = = = = =  E E E E E    H   @ " H H H H H    H     r   