o
    h	                     @   sl   d dl mZ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 dd Zd	d
 Zdd ZdS )    )FunctionDefinedFunctionsympify)tanh)cossin)limit)xc                  C   sf   t tfD ],} G dd d| }|ttddtttddks"J t|tt tddks0J qdS )zCreate our new "sin" function.c                   @   "   e Zd ZdddZedd ZdS )z*test_function_series1.<locals>.my_function   c                 S   s   t | jd S Nr   )r   argsselfargindex r   e/var/www/html/ai/venv/lib/python3.10/site-packages/sympy/functions/elementary/tests/test_interface.pyfdiff   s   z0test_function_series1.<locals>.my_function.fdiffc                 S      t |}|dkrt dS d S r   r   clsargr   r   r   eval      z/test_function_series1.<locals>.my_function.evalNr   __name__
__module____qualname__r   classmethodr   r   r   r   r   my_function       
r!   r   
   r   N)r   r   r
   seriesr   r	   )Fr!   r   r   r   test_function_series1   s
   (r&   c                  C   sJ   t tfD ]} G dd d| }|ttddtttddks"J qdS )zCreate our new "cos" function.c                   @   r   )z+test_function_series2.<locals>.my_function2r   c                 S   s   t | jd  S r   )r   r   r   r   r   r   r   +   s   z1test_function_series2.<locals>.my_function2.fdiffc                 S   s   t |}|dkrt dS d S )Nr   r   r   r   r   r   r   r   .   r   z0test_function_series2.<locals>.my_function2.evalNr   r   r   r   r   r   my_function2)   r"   r'   r   r#   N)r   r   r
   r$   r   )r%   r'   r   r   r   test_function_series2$   s   *r(   c                     sV   t tfD ]$} G  fddd|  tt} t}|tdd|tddks(J qdS )a_  
    Test our easy "tanh" function.

    This test tests two things:
      * that the Function interface works as expected and it's easy to use
      * that the general algorithm for the series expansion works even when the
        derivative is defined recursively in terms of the original function,
        since tanh(x).diff(x) == 1-tanh(x)**2
    c                       s&   e Zd Zd fdd	Zedd ZdS )z%test_function_series3.<locals>.mytanhr   c                    s   d | j d d  S )Nr   r      )r   r   mytanhr   r   r   G   s   z+test_function_series3.<locals>.mytanh.fdiffc                 S   r   r   r   r   r   r   r   r   J   r   z*test_function_series3.<locals>.mytanh.evalNr   r   r   r*   r   r   r+   E   s    r+   r      N)r   r   r   r
   r$   )r%   efr   r*   r   test_function_series38   s   "r/   N)sympy.core.functionr   r   sympy.core.sympifyr   %sympy.functions.elementary.hyperbolicr   (sympy.functions.elementary.trigonometricr   r   sympy.series.limitsr	   	sympy.abcr
   r&   r(   r/   r   r   r   r   <module>   s   