a
    kº”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 ]X} G dd„ d| ƒ}|tƒ tdd¡ttƒ tdd¡ksDJ ‚t|tƒt tdƒdksJ ‚qdS )zCreate our new "sin" function.c                   @   s"   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©ÚselfZargindex© r   ú]/var/www/auris/lib/python3.9/site-packages/sympy/functions/elementary/tests/test_interface.pyÚfdiff   s    z0test_function_series1.<locals>.my_function.fdiffc                 S   s   t |ƒ}|dkrt dƒS d S r   r   ©ÚclsÚargr   r   r   Úeval   s    z/test_function_series1.<locals>.my_function.evalN)r   ©Ú__name__Ú
__module__Ú__qualname__r   Úclassmethodr   r   r   r   r   Úmy_function   s   
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                   @   s"   e Zd Zddd„Zedd„ ƒZdS )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   .   s    z0test_function_series2.<locals>.my_function2.evalN)r   r   r   r   r   r   Úmy_function2)   s   
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 ]H} 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   s   t |ƒ}|dkrt dƒS d S r   r   r   r   r   r   r   J   s    z*test_function_series3.<locals>.mytanh.evalN)r   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)Zsympy.core.functionr   r   Zsympy.core.sympifyr   Z%sympy.functions.elementary.hyperbolicr   Z(sympy.functions.elementary.trigonometricr   r   Zsympy.series.limitsr	   Z	sympy.abcr
   r    r"   r)   r   r   r   r   Ú<module>   s   