
    \h	                     f    S SK JrJr  S SKJr  S SKJr  S SKJrJ	r	  S SK
Jr  S SKJr  S rS rS	 rg
)    )FunctionDefinedFunctionsympify)tanh)cossin)limit)xc                  "   [         [        4 H  n  " S SU 5      nU" [        5      R                  [        SS5      [	        [        5      R                  [        SS5      :X  d   e[        U" [        5      [        -  [        S5      S:X  a  M   e   g)zCreate our new "sin" function.c                   .    \ rS rSrSS jr\S 5       rSrg)*test_function_series1.<locals>.my_function   c                 2    [        U R                  S   5      $ Nr   )r   argsselfargindexs     g/var/www/auris/envauris/lib/python3.13/site-packages/sympy/functions/elementary/tests/test_interface.pyfdiff0test_function_series1.<locals>.my_function.fdiff   s    499Q<((    c                 <    [        U5      nUS:X  a  [        S5      $ g r   r   clsargs     r   eval/test_function_series1.<locals>.my_function.eval   !    cl!8"1:% r    N   __name__
__module____qualname____firstlineno__r   classmethodr   __static_attributes__r!   r   r   my_functionr      s    ) & &r   r+   r   
   r#   N)r   r   r   seriesr	   r
   )Fr+   s     r   test_function_series1r/      ss     (		&! 		& 1~$$Q2.#a&--1b2IIII[^A%q!,111 )r   c                      [         [        4 HW  n  " S SU 5      nU" [        5      R                  [        SS5      [	        [        5      R                  [        SS5      :X  a  MW   e   g)zCreate our new "cos" function.c                   .    \ rS rSrSS jr\S 5       rSrg)+test_function_series2.<locals>.my_function2)   c                 4    [        U R                  S   5      * $ r   )r	   r   r   s     r   r   1test_function_series2.<locals>.my_function2.fdiff+   s    DIIaL)))r   c                 <    [        U5      nUS:X  a  [        S5      $ g )Nr   r#   r   r   s     r   r   0test_function_series2.<locals>.my_function2.eval.   r    r   r!   Nr"   r$   r!   r   r   my_function2r2   )   s    * & &r   r8   r   r,   N)r   r   r   r-   r   )r.   r8   s     r   test_function_series2r9   $   sS     (		&1 		& A%%aB/3q6==Ar3JJJJ )r   c                     ^ [         [        4 H^  n  " U4S jSU 5      m[        [        5      nT" [        5      nUR	                  [        SS5      UR	                  [        SS5      :X  a  M^   e   g)aC  
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                   6   > \ rS rSrSU 4S jjr\S 5       rSrg)%test_function_series3.<locals>.mytanhE   c                 :   > ST" U R                   S   5      S-  -
  $ )Nr#   r      )r   )r   r   mytanhs     r   r   +test_function_series3.<locals>.mytanh.fdiffG   s     6$))A,/222r   c                 <    [        U5      nUS:X  a  [        S5      $ g r   r   r   s     r   r   *test_function_series3.<locals>.mytanh.evalJ   r    r   r!   Nr"   r$   )r@   s   r   r@   r<   E   s    3 & &r   r@   r      N)r   r   r   r   r-   )r.   efr@   s      @r   test_function_series3rG   8   s\     (		&Q 		& G1Ixx1a AHHQ1$5555 )r   N)sympy.core.functionr   r   sympy.core.sympifyr   %sympy.functions.elementary.hyperbolicr   (sympy.functions.elementary.trigonometricr   r	   sympy.series.limitsr
   	sympy.abcr   r/   r9   rG   r!   r   r   <module>rN      s)    : & 6 ? % 2*K(6r   