
    sg                     b    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 Zd Zd	 Zy
)    )Functionsympify)tanh)cossin)limit)xc                       G d dt               }  | t              j                  t        dd      t        t              j                  t        dd      k(  sJ t	         | t              t        z  t        d      dk(  sJ y)zCreate our new "sin" function.c                   $    e Zd ZddZed        Zy)*test_function_series1.<locals>.my_functionc                 2    t        | j                  d         S Nr   )r   argsselfargindexs     b/var/www/html/venv/lib/python3.12/site-packages/sympy/functions/elementary/tests/test_interface.pyfdiffz0test_function_series1.<locals>.my_function.fdiff   s    tyy|$$    c                 :    t        |      }|dk(  rt        d      S y r   r   clsargs     r   evalz/test_function_series1.<locals>.my_function.eval   !    #,Caxqz! r   N   __name__
__module____qualname__r   classmethodr    r   r   my_functionr      s    	% 
	" 
	"r   r%   r   
   r   N)r   r
   seriesr   r	   )r%   s    r   test_function_series1r(      sb    	"h 	" q>  Ar*c!fmmAq".EEEEQ!1a(A---r   c                       G d dt               }  | t              j                  t        dd      t        t              j                  t        dd      k(  sJ y)zCreate our new "cos" function.c                   $    e Zd ZddZed        Zy)+test_function_series2.<locals>.my_function2c                 4    t        | j                  d          S r   )r   r   r   s     r   r   z1test_function_series2.<locals>.my_function2.fdiff#   s    		!%%%r   c                 :    t        |      }|dk(  rt        d      S y )Nr   r   r   r   s     r   r   z0test_function_series2.<locals>.my_function2.eval&   r   r   Nr   r   r$   r   r   my_function2r+   !   s    	& 
	" 
	"r   r.   r   r&   N)r   r
   r'   r   )r.   s    r   test_function_series2r/      sB    	"x 	" ?!!!Q+s1v}}Q2/FFFFr   c                       G fddt               t        t              }  t              }| j                  t        dd      |j                  t        dd      k(  sJ y)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                   *    e Zd Zd fd	Zed        Zy)%test_function_series3.<locals>.mytanhc                 :    d | j                   d         dz  z
  S )Nr   r      )r   )r   r   mytanhs     r   r   z+test_function_series3.<locals>.mytanh.fdiff=   s     vdiil+Q...r   c                 :    t        |      }|dk(  rt        d      S y r   r   r   s     r   r   z*test_function_series3.<locals>.mytanh.eval@   r   r   Nr   r   )r5   s   r   r5   r2   ;   s    	/ 
	" 
	"r   r5   r      N)r   r   r
   r'   )efr5   s     @r   test_function_series3r:   0   sK    	" 	" 	QAq	A88Aq!Aq 1111r   N)sympy.core.functionr   sympy.core.sympifyr   %sympy.functions.elementary.hyperbolicr   (sympy.functions.elementary.trigonometricr   r   sympy.series.limitsr	   	sympy.abcr
   r(   r/   r:   r$   r   r   <module>rA      s)    ) & 6 ? % .&G$2r   