ó
¡¼™\c           @   s]   d  d l  m Z m Z m Z m Z m Z m Z d  d l m Z d „  Z	 d „  Z
 d „  Z d S(   iÿÿÿÿ(   t   Functiont   sympifyt   sint   cost   limitt   tanh(   t   xc          C   s~   d t  f d „  ƒ  Y}  |  t ƒ j t d d ƒ t t ƒ j t d d ƒ k sR t ‚ t |  t ƒ t t d ƒ d k sz t ‚ d S(   s   Create our new "sin" function.t   my_functionc           B   s#   e  Z d  d „ Z e d „  ƒ Z RS(   i   c         S   s   t  |  j d ƒ S(   Ni    (   R   t   args(   t   selft   argindex(    (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyt   fdiff   s    c         S   s&   t  | ƒ } | d k r" t  d ƒ Sd  S(   Ni    (   R   (   t   clst   arg(    (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyt   eval   s    (   t   __name__t
   __module__R   t   classmethodR   (    (    (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyR   
   s   i    i
   i   N(   R    R   t   seriesR   t   AssertionErrorR   (   R   (    (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyt   test_function_series1   s    <c          C   sV   d t  f d „  ƒ  Y}  |  t ƒ j t d d ƒ t t ƒ j t d d ƒ k sR t ‚ d S(   s   Create our new "cos" function.t   my_function2c           B   s#   e  Z d  d „ Z e d „  ƒ Z RS(   i   c         S   s   t  |  j d ƒ S(   Ni    (   R   R   (   R	   R
   (    (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyR      s    c         S   s&   t  | ƒ } | d k r" t  d ƒ Sd  S(   Ni    i   (   R   (   R   R   (    (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyR   "   s    (   R   R   R   R   R   (    (    (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyR      s   i    i
   N(   R    R   R   R   R   (   R   (    (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyt   test_function_series2   s    c             st   d t  f ‡  f d †  ƒ  Y‰  t t ƒ }  ˆ  t ƒ } t t ƒ j t d d ƒ ˆ  t ƒ j t d d ƒ k sp t ‚ d S(   s_  
    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
    t   mytanhc              s)   e  Z d  ‡  f d † Z e d „  ƒ Z RS(   i   c            s   d ˆ  |  j  d ƒ d S(   Ni   i    i   (   R   (   R	   R
   (   R   (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyR   9   s    c         S   s&   t  | ƒ } | d k r" t  d ƒ Sd  S(   Ni    (   R   (   R   R   (    (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyR   <   s    (   R   R   R   R   R   (    (   R   (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyR   7   s   i    i   N(   R    R   R   R   R   (   t   et   f(    (   R   sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyt   test_function_series3,   s    N(   t   sympyR    R   R   R   R   R   t	   sympy.abcR   R   R   R   (    (    (    sN   lib/python2.7/site-packages/sympy/functions/elementary/tests/test_interface.pyt   <module>   s   .		