§
    OŠtjÑ	  ã                   óh   — 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„ Zd„ Zd	„ Zd
S )é    )ÚFunctionÚDefinedFunction©Úsympify)Útanh)ÚcosÚsin)Úlimit)Úxc                  ó`  — t           t          fD ]ž}  G d„ d| ¦  «        } |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     úm/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/functions/elementary/tests/test_interface.pyÚfdiffz0test_function_series1.<locals>.my_function.fdiff   s   € Ý˜4œ9 Qœ<Ñ(Ô(Ð(ó    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‘l”l�Ø˜!’8�8Ý" 1™:œ:Ð%ð �8r   N©r   ©Ú__name__Ú
__module__Ú__qualname__r   Úclassmethodr   © r   r   Úmy_functionr      sC   € € € € € ð)ð )ð )ð )ð ð&ð &ñ Œ[ð&ð &ð &r   r&   r   é
   r   N)r   r   r   Úseriesr	   r
   )ÚFr&   s     r   Útest_function_series1r*      s¼   € õ �Ð(ð 2ð 2ˆð		&ð 		&ð 		&ð 		&ð 		&˜!ñ 		&ô 		&ð 		&ð ˆ{�1‰~Œ~×$Ò$¥Q¨¨2Ñ.Ô.µ#µa±&´&·-²-ÅÀ1ÀbÑ2IÔ2IÒIÐIÐIÐIÝ�[�[¥‘^”^¥AÑ%¥q¨!Ñ,Ô,°Ò1Ð1Ð1Ð1Ð1ð2ð 2r   c                  óü   — t           t          fD ]l}  G d„ d| ¦  «        } |t          ¦  «                             t          dd¦  «        t	          t          ¦  «                             t          dd¦  «        k    sJ ‚Œmd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   € Ý˜DœI aœLÑ)Ô)Ð)Ð)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   r0   r   r'   N)r   r   r   r(   r   )r)   r0   s     r   Útest_function_series2r1   $   s–   € õ �Ð(ð Kð Kˆð		&ð 		&ð 		&ð 		&ð 		&˜1ñ 		&ô 		&ð 		&ð ˆ|�A‰Œ×%Ò%¥a¨¨BÑ/Ô/µ3µq±6´6·=²=ÅÀAÀrÑ3JÔ3JÒJÐJÐJÐJÐJðKð Kr   c                  ó
  ‡— t           t          fD ]r}  G ˆfd„d| ¦  «        Št          t          ¦  «        } ‰t          ¦  «        }|                     t          dd¦  «        |                     t          dd¦  «        k    sJ ‚Œsd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.fdiffG   s#   ø€ Ø˜6˜6 $¤)¨A¤,Ñ/Ô/°Ñ2Ñ2Ð2r   c                 óN   — t          |¦  «        }|dk    rt          d¦  «        S d S r   r   r   s     r   r   z*test_function_series3.<locals>.mytanh.evalJ   r   r   Nr   r    )r7   s   €r   r7   r4   E   sN   ø€ € € € € ð3ð 3ð 3ð 3ð 3ð 3ð ð&ð &ñ Œ[ð&ð &ð &r   r7   r   é   N)r   r   r   r   r(   )r)   ÚeÚfr7   s      @r   Útest_function_series3r<   8   s¥   ø€ õ �Ð(ð 6ð 6ˆð		&ð 		&ð 		&ð 		&ð 		&ð 		&ð 		&�Qñ 		&ô 		&ð 		&õ •‰GŒGˆØˆF•1‰IŒIˆØ�xŠx�˜1˜aÑ Ô  A§H¢H­Q°°1Ñ$5Ô$5Ò5Ð5Ð5Ð5Ð5ð6ð 6r   N)Úsympy.core.functionr   r   Úsympy.core.sympifyr   Ú%sympy.functions.elementary.hyperbolicr   Ú(sympy.functions.elementary.trigonometricr   r	   Úsympy.series.limitsr
   Ú	sympy.abcr   r*   r1   r<   r%   r   r   ú<module>rC      s¹   ðð :Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø &Ð &Ð &Ð &Ð &Ð &Ø 6Ð 6Ð 6Ð 6Ð 6Ð 6Ø ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ð ?Ø %Ð %Ð %Ð %Ð %Ð %Ø Ð Ð Ð Ð Ð ð2ð 2ð 2ð*Kð Kð Kð(6ð 6ð 6ð 6ð 6r   