
    wg	                         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y)    )AddArgumentIndexErrorFunction)Pow)S)log)cossinTevaluatec                R    t        t        | |      t        j                   |      S Nr   )r   r	   r   One)xr   s     ^/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/sympy/codegen/scipy_nodes.py_cosm1r      s    s1x(155&8DD    c                   .    e Zd ZdZdZddZd Zd Zd Zy)	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                 J    |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4r   c                     t        |      S N)r   )r   r   kwargss      r   _eval_rewrite_as_coszcosm1._eval_rewrite_as_cos   s    ayr   c                 L     | j                  t              j                  |i |S r   )rewriter	   evalfr   r   r    s      r   _eval_evalfzcosm1._eval_evalf    #    &t||C &&777r   c                     | j                   \  }t         |j                  di |      }|t        |d      k7  r|S t        |      S NFr    )r   r   simplifyr   )r   r    r   	candidates       r   _eval_simplifyzcosm1._eval_simplify#   sC    YY:1:://0	q5118Or   Nr   )	__name__
__module____qualname____doc__nargsr   r!   r&   r-   r*   r   r   r   r      s"    
 E58r   r   c                T    t        t        | ||      t        j                   |      S r   )r   r   r   r   )r   yr   s      r   _powm1r6   ,   s     s1a(+aeeVhGGr   c                   .    e Zd ZdZdZddZd Zd Zd Zy)	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
       c                    |dk(  rFt        | 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   sv     q=tyy|TYYq\2499Q<?		!LL]tyy|$S$))_44$T8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     | j                  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      k7  r|S t        ||      S r)   )r   r6   r+   r8   )r   r    r   r5   r,   s        r   r-   zpowm1._eval_simplifyI   sZ    yy1:1:://1Ef1EF	q!e44A;r   Nr.   )	r/   r0   r1   r2   r3   r   r<   r&   r-   r*   r   r   r8   r8   0   s"    
 E	5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      sF    A A   " 6 =  EH @ " HH r   