
    g                     d    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d
S )    )Functionsympify)tanh)cossin)limit)xc                  H    G d dt                     }  | t                                        t          dd          t          t                                        t          dd          k    sJ t	           | t                    t          z  t          d          dk    sJ dS )zCreate our new "sin" function.c                   ,    e Zd ZddZed             ZdS )*test_function_series1.<locals>.my_function   c                 6    t          | j        d                   S Nr   )r   argsselfargindexs     k/var/www/html/ai-engine/env/lib/python3.11/site-packages/sympy/functions/elementary/tests/test_interface.pyfdiffz0test_function_series1.<locals>.my_function.fdiff   s    ty|$$$    c                 N    t          |          }|dk    rt          d          S d S r   r   clsargs     r   evalz/test_function_series1.<locals>.my_function.eval   )    #,,Caxxqzz! xr   Nr   __name__
__module____qualname__r   classmethodr    r   r   my_functionr      sC        	% 	% 	% 	% 
	" 	" 
	" 	" 	"r   r%   r   
   r   N)r   r
   seriesr   r	   )r%   s    r   test_function_series1r(      s    	" 	" 	" 	" 	"h 	" 	" 	" ;q>>  Ar**c!ffmmAq".E.EEEEEQ!1a((A------r   c                       G d dt                     }  | t                                        t          dd          t          t                                        t          dd          k    sJ dS )zCreate our new "cos" function.c                   ,    e Zd ZddZed             ZdS )+test_function_series2.<locals>.my_function2r   c                 8    t          | j        d                    S r   )r   r   r   s     r   r   z1test_function_series2.<locals>.my_function2.fdiff#   s    	!%%%%r   c                 N    t          |          }|dk    rt          d          S d S )Nr   r   r   r   s     r   r   z0test_function_series2.<locals>.my_function2.eval&   r   r   Nr   r   r$   r   r   my_function2r+   !   sC        	& 	& 	& 	& 
	" 	" 
	" 	" 	"r   r.   r   r&   N)r   r
   r'   r   )r.   s    r   test_function_series2r/      su    	" 	" 	" 	" 	"x 	" 	" 	" <??!!!Q++s1vv}}Q2/F/FFFFFFFr   c                       G fddt                     t          t                    }  t                    }|                     t          dd          |                    t          dd          k    sJ 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                   2    e Zd Zd fd	Zed             ZdS )%test_function_series3.<locals>.mytanhr   c                 <    d | j         d                   dz  z
  S )Nr   r      )r   )r   r   mytanhs     r   r   z+test_function_series3.<locals>.mytanh.fdiff=   s#    vvdil++Q...r   c                 N    t          |          }|dk    rt          d          S d S r   r   r   s     r   r   z*test_function_series3.<locals>.mytanh.eval@   r   r   Nr   r   )r5   s   r   r5   r2   ;   sN        	/ 	/ 	/ 	/ 	/ 	/ 
	" 	" 
	" 	" 	"r   r5   r      N)r   r   r
   r'   )efr5   s     @r   test_function_series3r:   0   s    	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	QAq		A88Aq!Aq 1 111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 6 6 6 6 6 ? ? ? ? ? ? ? ? % % % % % %      . . .&G G G$2 2 2 2 2r   