U
    Ç-e  ã                   @   sh   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 dd„ Zd	d
„ Zdd„ ZdS )é    )ÚFunction©Úsympify)Útanh)ÚcosÚsin)Úlimit)Úxc                  C   sX   G dd„ dt ƒ} | tƒ tdd¡ttƒ tdd¡ks8t‚t| tƒt tdƒdksTt‚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   úp/var/www/html/Darija-Ai-Train/env/lib/python3.8/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	   Úseriesr   ÚAssertionErrorr   )r   r   r   r   Útest_function_series1   s    (r   c                  C   s<   G dd„ dt ƒ} | tƒ tdd¡ttƒ tdd¡ks8t‚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   Útest_function_series2   s    r!   c                     sH   G ‡ fdd„dt ƒ‰ ttƒ} ˆ tƒ}|  tdd¡| tdd¡ksDt‚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   =   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   @   s    z*test_function_series3.<locals>.mytanh.evalN)r
   r   r   r#   r   r   r$   ;   s   r$   r   é   N)r   r   r	   r   r   )ÚeÚfr   r#   r   Útest_function_series30   s    r(   N)Zsympy.core.functionr   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   