
ʽXc           @` s  d  Z  d d l m Z m Z m Z d d l Z d d l m Z m	 Z	 m
 Z
 m Z d d l m Z d d l j Z d d l m Z d d l m Z d d l m Z m Z m Z m Z m Z d d	 l m Z m Z m Z m Z m Z m  Z  m! Z! m" Z" m# Z# m$ Z$ d d
 l% m& Z& m' Z' m( Z( m) Z) m* Z* m+ Z+ y d d l, Z, Wn e- k
 rZe d  Z, n Xe j. d  j/ d k  Z0 e e, d  d    Z1 e e, d  d    Z2 e e, d  d    Z3 e e, d  d    Z4 e e, d  d    Z5 e e, d  d    Z6 e e, d  d    Z7 e e, d  d    Z8 e e, d  e j9 d     Z: e e, d  d    Z; e e, d  d    Z< e e, d  d    Z= d Z> e e, d  d     Z? e e, d  d!    Z@ e e, d  e j9 d"     ZA e e, d  e j9 d#     ZB e e, d  d$    ZC e e, d  d%    ZD e e, d  e j9 d&     ZE e e, d  e j9 d'     ZF e e, d  d(    ZG e e, d  d)    ZH e e, d  d*    ZI d+   ZJ e j9 e e, d  d,     ZK e j9 e e, d  d-     ZL e j9 e e, d  d.     ZM eN d/ d0 d1 d0  ZO d2 e e eP  f d3     YZQ eR d4 k re	   n  d S(5   s4   
Test Scipy functions versus mpmath, if available.

i    (   t   divisiont   print_functiont   absolute_importN(   t   dect   run_module_suitet   assert_t   assert_allclose(   t   pi(   t   with_metaclass(   t   knownfailure_overridable(   t   MissingModulet   check_versiont   FuncDatat   DecoratorMetat   assert_func_equal(
   t   Argt   FixedArgt
   ComplexArgt   IntArgt   assert_mpmath_equalt   nonfunctional_tooslowt
   trace_argst   time_limitedt   exception_to_nant
   inf_to_nan(   t   _sinpit   _cospit   _lgam1pt   _lanczos_sum_expg_scaledt   _log1pmxt	   _igam_fact   mpmathi   s   0.10c          C` s   g  }  x} t  j d d d  D]f } x] t  j d d t  j d  D]? } | t  j d |  } |  j | t t j |   f  q? Wq Wt  j	 |  d t  j
 }  t t j |  d d  j   d  S(	   Nii   i
   i    i   y              ?t   dtypei   (   t   npt   logspacet   linspaceR   t   expt   appendt   complexR   t   eit   arrayt   complex_R   t   sct   expit   check(   t   datasett   rt   pt   z(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_expi_complex&   s    #*s   0.19c          C` s   g  }  xr d d g D]d } x[ t  j d d d  D]D } t j d  - |  j | | t t j | |   f  Wd  QXq/ Wq Wt  j |   }  t t	 j
 |  d d d	 d
 j   d  S(   Ni2   i3   i    i   i   id   i   i   t   rtolgvIh%<=(   i    i   (   R!   R"   R   t   workdpsR%   t   floatt   expintt   asarrayR   R*   t   expnR,   (   R-   t   nt   x(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_expn_large_n6   s    6c          C` s   g  }  d d d d d d g } x | D]z } xq | D]i } x` | D]X } | d | } t  j d   t t  j | |   } Wd  QX|  j | | | f  q? Wq2 Wq% Wt j |   }  t d	   |  d d d d j   d  S(   Ng     Xg      #g      g      ?g      #@g     X@y              ?ix   c         S` s   t  j |  j |  S(   N(   R*   t   hyp0f1t   real(   t   vR0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   <lambda>X   s    i    i   i   R2   gvIh%<=(   i    i   (	   R   R3   R&   R;   R%   R!   R(   R   R,   (   R-   t   axisR=   R9   t   yR0   t   res(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp0f1_gh5764G   s    "c          C` su   t  j d d d  }  t j |  d  } t  j g  |  D] } t j | d  ^ q4  } t | | j t  d d d  S(   Ni   i   i   g      ?R2   g-q=(	   R!   R#   R*   R;   R(   R   R   t   astypeR4   (   t   vvt   afR=   t   mf(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp0f1_gh_1609\   s    .s   0.14c          C` s   d d g }  t  d t  } g  |  D]% } | t t j | |    f ^ q" } t j | d t j } t t	 j | d d
 d d j
   d  S(   Ni   igffffff?it	   eliminateR    i    i   i   i   R2   g|=(   i   iigffffff?(   i   iigffffff?(   i    i   i   i   (   t   dictt   TrueR4   R   t   hyp2f1R!   R(   t   float_R   R*   R,   (   t   ptst   kwR/   R-   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp2f1_strange_pointsi   s    	2s   0.13c          C` s  d/ d0 d1 d2 d3 f d4 d5 d6 d7 f d8 d9 d: d; d< d d= d d f d d> d d f d? dA dB dC dD dE dF dG dH dI d' dJ d) dK f g }  g  |  D]" } | t  t j |    f ^ q } t j | d* t j } t j d+ d,  } z& t t j | dL d d- d. j	   Wd  t j |   Xd  S(M   Ni   i   i   i    g      ?g       @g      @i   g      ;@i    i   g      @g      T@iQ   iig      gx&?iig333333?g      ?g+?i   gGz?g      g      @g      
ig*4]92@g|O%@gCu?ii  g      %g      %@g      i   g      ?g     p@g      ?R    t   invalidt   ignoreR2   g|=(   i   i   i   i    gUUUUUU?gUUUUUU?g?g      ?g      ?g      ?g      ?gX<ݚ?(   i   iii   (   i   iii   (   i   g      g      i   (   i   i   i   i    (   gx&?iig333333?gUUUUUU?gUUUUUU?(   i   i   i   gGz?g      ?(   g      ?g      i   gGz?(   i   g      @g      
g+?(   ig*4]92@g|O%@gCu?(   ii  g      %gGz?(   ii  g      %@gGz?(   ii   i   g      ?(   ii   i   g      (   ii   i   g      ?(   ii   i   g      g     pgm˟?(   i    i   i   i   (
   R4   R   RK   R!   R(   RL   t   seterrR   R*   R,   (   RM   R/   R-   t   olderr(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp2f1_real_some_pointsv   s6    /&c          C` s   d d d d f d d g }  d
   } g  |  D]1 } t  t | |   t t j |    f ^ q+ } t j | d t j } t t	 j | d d d d j
   d  S(   Nip   i3   i
   igwJi|g      %@gGz?g      %c         S` s-   t  |  t  r% t |  d  |  d S|  Sd  S(   Ni    i   (   t
   isinstancet   tupleR4   (   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   fev   s    R    i    i   i   i   i   R2   g|=(   i3   i
   (   ii
   (   i
   i|g      %@gGz?(   i
   i|g      %gGz?(   i    i   i   i   (   RV   t   mapR4   R   RK   R!   R(   RL   R   R*   R,   (   RM   RW   R/   R-   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp2f1_some_points_2   s    		>c          C` sB  g  }  x d d d d d d g D] } x d d d	 d
 g D] } x d d d d g D]z } xq d d d d d d d d g D]Q } y" t  t j | | | |   } Wn
 qv n X|  j | | | | | f  qv WqQ Wq8 Wq Wt j |  d t j }  t j d d  } z, t t	 j |  d d d d d t
 j   Wd  t j |   Xd  S(   Niigg?i   i
   g      ii   g@igffffff4@g)\(gGzi    g333333?gffffff?g      ?R    RP   RQ   i   i   i   R2   g&.>t   ignore_inf_sign(   i    i   i   i   (   R4   R   RK   R%   R!   R(   RL   RR   R   R*   RJ   R,   (   R-   t   at   bt   cR0   R=   RS   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp2f1_real_some   s     %",s   0.12c          C` s  d }  t  j |  d f t  j  } t  j j d  t  j j d |   | d  d   d f <t  j j d |   | d  d   d f <t  j j d |   | d  d   d f <d t  j j |   d | d  d   d f <| d  d   d f c d	 t  j j d |   9<| d  d   d f c d	 t  j j d |   9<| d  d   d f c d	 t  j j d |   9<x | D]~ } t j	 d
 k  rt
 | d   j   t
 | d  k rt
 | d   j   | d <qn  t t j t | d      | d <q^Wt t j | d d d d j   d  S(   Ni  i   i  g      ?i    i   i   i   is   0.14i   R2   g&.>(   i    i   i   i   (   R!   t   zerosRL   t   randomt   seedt   paretot   randt   randintR   t   __version__t   abst   maxR4   RK   RV   R   R*   R,   (   t   npointsR-   t   ds(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp2f1_real_random   s     %%%*///& 'c          C` s:  t  j j t  j j }  } z d t  j _ t j t j d d d  t j d d d   \ } } t j t j d d d  t j d d d   \ } } t j | j	   | j	   f d t j | j	   | j	   f } t
 t j d	   | d
 t d d t
 t j d   | d
 t d d Wd  |  | t  j _ t  j _ Xd  S(   NiF   ii   i   i   ig?y              ?c         S` s   t  t j |    S(   N(   R&   R   t   erf(   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>      s    t
   vectorizedR2   gvIh%<=c         S` s   t  t j |    S(   N(   R&   R   t   erfc(   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>      s    (   R   t   mpt   dpst   precR!   t   meshgridR#   R"   t   r_t   ravelR   R*   Rk   t   FalseRm   (   t   old_dpst   old_prect   x1t   y1t   x2t   y2t   points(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_erf_complex   s    66@s   0.15c          C` s  g  }  xbd d d d d g D]K} |  j  d d | f d d | f d d | f d d | f d d | f d d	 | f d d | f d d
 | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f d d | f g  q Wd   } g  |  D]+ } | | | d | d | d  f ^ q{} t j | d t j } d   } t j d d  } z) t | | d# d d d  d! d" j   Wd  t j |   Xd  S($   NgGzgmgư>gL7A`?i   iig333333?g333333gi
   i   i   i   i   iiiig @g&@g g&c         S` sH   | t  |  k r5 | d k r5 | d k r. d Sd Sn  t j |  | |  S(   Ni   i    (   t   intR   t   legenp(   t   nut   muR9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   mplegenp  s
    i    i   R    c         S` s   t  j |  j t  | |  S(   N(   R*   t   lpmvRC   R}   (   R   R   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   evf%  s    RP   RQ   R2   g|=t   atolg+=(   i    i   i   (   t   extendR!   R(   RL   RR   R   R,   (   RM   R9   R   R/   R-   R   RS   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   test_lpmv   sJ    		8	)c          C` sn  t  j j d  t  j t  j d d d  t  j d d d  t  j d d d  t  j d d	 d  t  j d d	 d  d
 d d d d d f
 }  |  } t  j t  j | d  d   d  f |  d  d  d   f   j	 d d  j
 } t j j t j j } } zZ d t j _ t t j d   | d t d d d t t t j d   | d t d d Wd  | | t j _ t j _ Xd  S(   Ni  i8i   i   ii
   ii   i   g      ?gffffffig33333Yg3333i   i  c         S` s   t  t j |  |   S(   N(   R4   R   t   beta(   R[   R\   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   F  s    Rl   R2   g|=RZ   c         S` s%   t  t j t t j |  |     S(   N(   R4   R   t   logRf   R   (   R[   R\   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   N  s    (   R!   R`   Ra   Rr   R"   t   arangeR(   t   broadcast_arrayst   Nonet   reshapet   TR   Rn   Ro   Rp   R   R*   R   Rt   RJ   t   betaln(   R\   R[   t   abRu   Rv   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   test_beta3  s2    J	g?c          C` s   t  t j d d d d d g  }  t j d d t j d  } t j |  |  \ }  } |  t j d |  } t j d	 | d | f j   } g  } x0 | D]( } | j	 | t
 t j |   f  q Wt j |  } t t j | d d	 d
 d j   d  S(   Ngg{Gzi    g{Gz?g?i   i   y              ?i   R2   gvIh%,=(   t   LOGGAMMA_TAYLOR_RADIUSR!   R(   R#   R   Rq   R$   Rr   t   flattenR%   R&   R   t   loggammaR   R*   R,   (   R.   t   thetat   dzR0   R-   t   z0(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_loggamma_taylor_transition]  s    "!&c          C` s   t  j d t  j t  d  }  t  j d d t  j d  } t  j |  |  \ }  } |  t  j d |  } t  j d | d | f j	   } g  } x0 | D]( } | j
 | t t j |   f  q Wt  j |  } t t j | d d d d	 j   d  S(
   Nii
   i    i   i   y              ?i   R2   gvIh%,=(   R!   R"   t   log10R   R#   R   Rq   R$   Rr   R   R%   R&   R   R   R(   R   R*   R,   (   R.   R   R   R0   R-   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_loggamma_taylorp  s    !&c       
   C` s2  t  j t  j d d d  d t  j d d d  f }  |  j   } t  j |  |  \ }  } |  d | } t  j d d d  j d d d  } | t  j | f | j  j	   } g  } t
 j d  8 x0 | D]( } | j | t t
 j |   f  q WWd  QXt  j |  } t t j | d d d	 d
 j   d  S(   Niii   i    y              ?iVi   id   R2   g-q=(   R!   Rr   R"   t   copyRq   R   R   t   dstackt   sizeR   R   R3   R%   R&   t   rgammaR(   R   R*   R,   (   t   dxt   dyR   R_   R0   R-   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_rgamma_zeros  s    5$#,c       
   C` so  t  j t  j d  }  t |   g } t  j t  j d  }  | j t |    t j |  } t j d t j d d d  d t j d d d  d f } | j	   } t j
 | |  \ } } | d	 | } | t j | f | j  j   } g  } t  j d
  8 x0 | D]( } | j | t t  j |   f  qWWd  QXt j |  } t t j | d d d d j   d  S(   Ng      ?g      gQοiii
   i    gQ?y              ?i   i   R2   g+=(   R   t   findroott   digammaR4   R%   R!   R(   Rr   R"   R   Rq   R   R   R   R3   R&   R   R*   R,   (   t   roott   rootsR   R   R   R0   R-   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_digamma_roots  s     ;#,c       	   C` s  t  t j  }  t j d d d  } t j t j d d d  d t j d d d  f } t j | |  \ } } | d | j   } g  } t j d  ; x3 | D]+ } |  |  } | j	 | t
 |  f  q WWd  QXt j |  } t t j | d d	 d
 d j   d  S(   Ni,  iid   i    ii   y              ?i(   i   R2   gvIh%<=(   R   R   R   R!   R"   Rr   Rq   R   R3   R%   R&   R6   R   R*   R,   (   R   R9   R@   R0   R-   R   RA   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_digamma_negreal  s    5#c       	   C` s   t  j d d d  }  t  j d d d d g  } t  j |  |  \ }  } |  d | j   } g  } t j d	  > x6 | D]. } t j |  } | j | t	 |  f  qz WWd  QXt  j
 |  } t t j | d
 d d d j   d  S(   Ni,  iid   gffffffgg@gffffff@y              ?i   i    i   R2   gvIh%<=(   R!   R"   R(   Rq   R   R   R3   R   R%   R&   R6   R   R*   R,   (   R9   R@   R0   R-   R   RA   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_digamma_boundary  s    #c          C` s  d }  t  j d |  d |  d  } | j   } t  j | |  \ } } | j   | j   } } g  } t j d  V xN t | |  D]= \ } } | j | | t	 t j
 | d | d t  f  q WWd  QXt  j |  } t t j
 | d d d
 d j   d  S(   Ni   g      ?i   i2   id   R\   t   regularizedi    i   R2   g-q=(   i    i   (   R!   R#   R   Rq   R   R   R3   t   zipR%   R4   t   gammaincRJ   R(   R   R*   R,   (   t   smallR[   R9   R-   t   a0t   x0(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_gammainc_boundary  s    ;c          C` s   d   }  t  j d d  } t  j d d t  } d t  j | t  j d |   j   } g  } x' | D] } | j | |  |  f  qg Wt  j |  } t t	 j
 | d d d d	 j   d  S(
   Nc         S` s   t  t j d d |    S(   Ni   i   (   R&   R   t   polylog(   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   spence  s    g      ?g      ?i    i   i   y              ?R2   g+=(   R!   R#   R   t   outerR$   R   R%   R(   R   R*   R   R,   (   R   R.   R   R0   R-   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spence_circle  s    	)c          C` s/  t  j t  j }  t  j t  j d d d  d t  j d d d  f } | j   } t  j | |  \ } } | d | } t  j d d d  j	 d d d  } | t  j
 | f | j  j   } g  } x0 | D]( } | j | t t j |   f  q Wt  j |  } t t | d d d	 d
 |  j   d  S(   Ni    ii   y              ?iid   i   iR2   i   (   R!   t   finfoR4   t   epsRr   R"   R   Rq   R   R   R   R   R   R%   R&   R   t   sinpiR(   R   R   R,   (   R   R   R   R   R_   R0   R-   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_sinpi_zeros  s    5$#&c          C` s3  t  j t  j }  t  j t  j d d d  d t  j d d d  f } | j   } t  j | |  \ } } | d | } t  j d d d  d j	 d d d	  } | t  j
 | f | j  j   } g  } x0 | D]( } | j | t t j |   f  q Wt  j |  } t t | d d d
 d |  j   d  S(   Ni    ii   y              ?iid   i   g      ?iR2   i   (   R!   R   R4   R   Rr   R"   R   Rq   R   R   R   R   R   R%   R&   R   t   cospiR(   R   R   R,   (   R   R   R   R   R_   R0   R-   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_cospi_zeros(  s    5(#&c    	      C` s   d   }  d   } t  j d d d  } t  j t  j d d d  d t  j d d d  f } g  } x] | D]U } t t j |   } x7 | D]/ } | | } | j | | | | |  f  q Wqi Wt  j |  } t	 |  | d d	 d
 d j
   d  S(   Nc         S` s   t  j |  |  d S(   Ni   (   R*   t   ellipj(   t   ut   m(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   dn?  s    c         S` s   t  t j d d |  d |  S(   NR   R   R   (   R4   R   t   ellipfun(   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   mpmath_dnB  s    i    i   i   iii
   i   R2   g|=(   i    i   (   R!   R#   Rr   R"   R4   R   t   ellipkR%   R6   R   R,   (	   R   R   R   t   duR-   t   m0t   u0t   du0R/   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_dn_quarter_period=  s    		5
'c         C` sh   t  j |  S t  j |   }  t  j |  j t  j d t  j  } t  j t  j |   |  } Wd  QX| S(   Ni   (   R   R3   t   mpct   ceilt   imagR   t   lambertwR$   (   R0   Ro   t   unwindRA   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   _mpmath_wrightomegaV  s
    $!c    
      C` s  t  j d d d  }  t  j t  j t  j  g } t  j t  j t  j  g } t  j t  j t  j  g } t  j t  j t  j  g } x t d  D] } | j t  j | d t  j   | j t  j | d t  j   | j t  j | d t  j   | j t  j | d t  j   q Wt  j | | | | f  } t  j |  |  \ }  } |  d | j	   } g  } x0 | D]( }	 | j |	 t
 t |	 d   f  qsWt  j |  } t t j | d d d d	 j   d  S(
   Ni
   i    i   i2   iy              ?i   R2   g:0yE>(   R!   R"   t	   nextafterR   t   inft   rangeR%   t   hstackRq   R   R&   R   R6   R   R*   t   wrightomegaR,   (
   R9   t   picut_abovet   picut_belowt   npicut_abovet   npicut_belowt   iR@   R0   R-   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_wrightomega_branch^  s$     ! %&c          C` s   t  j d d  }  t  j d d t  j  } t  j |  |  \ }  } |  d | j   } g  } x0 | D]( } | j | t t | d   f  qd Wt  j |  } t	 t
 j | d d d d j   d  S(	   Nii   i   y              ?i   i    R2   gV瞯<(   R!   R#   R   Rq   R   R%   R&   R   R6   R   R*   R   R,   (   R9   R@   R0   R-   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_wrightomega_region1w  s    &c          C` s   t  j d d  }  t  j d t  j d  } t  j |  |  \ }  } |  d | j   } g  } x0 | D]( } | j | t t | d   f  qd Wt  j |  } t	 t
 j | d d d d j   d  S(	   Nii   iy              ?i   i    R2   gV瞯<(   R!   R#   R   Rq   R   R%   R&   R   R6   R   R*   R   R,   (   R9   R@   R0   R-   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_wrightomega_region2  s    &t   maxpreci   t   maxtermst   TestSystematicc           B` s#  e  Z e j d f e e d  f f g Z d   Z d   Z	 d   Z
 d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z  e! d  d    Z" d   Z# e! d  d    Z$ d   Z% d   Z& d    Z' d!   Z( d"   Z) d#   Z* d$   Z+ d%   Z, d&   Z- d'   Z. d(   Z/ d)   Z0 d*   Z1 d+   Z2 d,   Z3 d-   Z4 d.   Z5 d/   Z6 d0   Z7 d1   Z8 d2   Z9 d3   Z: d4   Z; d5   Z< d6   Z= d7   Z> d8   Z? d9   Z@ d:   ZA d;   ZB d<   ZC d=   ZD d>   ZE d?   ZF d@   ZG dA   ZH dB   ZI dC   ZJ dD   ZK dE   ZL dF   ZM dG   ZN dH   ZO dI   ZP dJ   ZQ dK   ZR e!   dL    ZS dM   ZT e!   dN    ZU eV dO    ZW dP   ZX dQ   ZY e! dR  dS    ZZ dT   Z[ dU   Z\ e!   dV    Z] e!   dW    Z^ e!   dX    Z_ e!   dY    Z` e! dZ  d[    Za eV d\    Zb e!   d]    Zc e jd ee d^  d_    Zf d`   Zg da   Zh e!   db    Zi dc   Zj dd   Zk de   Zl eV df    Zm dg   Zn e jd ee dh  di    Zo dj   Zp eV dk    Zq dl   Zr dm   Zs dn   Zt do   Zu e! dp  dq    Zv eV dr    Zw ds   Zx dt   Zy e!   du    Zz e! dv  dw    Z{ e!   dx    Z| e! dy  dz    Z} d{   Z~ d|   Z e jd ee dh  d}    Z d~   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z d   Z e! d  d    Z RS(   s   0.17c         C` sN   t  d   t j t d d  g d d t  d   t j t d d  g  d  S(	   Nc         S` s   t  j |   d S(   Ni    (   R*   t   airy(   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g    חg    חAR2   gh㈵>c         S` s   t  j |   d S(   Ni    (   R*   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g     @g     @@(   R   R   t   airyaiR   (   t   self(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_airyai  s    		c         C` s    t  d   t j t   g  d  S(   Nc         S` s   t  j |   d S(   Ni    (   R*   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    (   R   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_airyai_complex  s    	c         C` sN   t  d   d   t d d  g d d t  d   d   t d	 d
  g  d  S(   Nc         S` s   t  j |   d S(   Ni   (   R*   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |  d d S(   Nt
   derivativei   (   R   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g    חg    חAR2   gh㈵>c         S` s   t  j |   d S(   Ni   (   R*   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |  d d S(   NR   i   (   R   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g     @g     @@(   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_airyai_prime  s
    c         C` s    t  d   d   t   g  d  S(   Nc         S` s   t  j |   d S(   Ni   (   R*   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |  d d S(   NR   i   (   R   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    (   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_airyai_prime_complex  s    c         C` sN   t  d   d   t d d  g d d t  d   d   t d	 d
  g  d  S(   Nc         S` s   t  j |   d S(   Ni   (   R*   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |   S(   N(   R   t   airybi(   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g    חg    חAR2   gh㈵>c         S` s   t  j |   d S(   Ni   (   R*   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |   S(   N(   R   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g     @g     @@(   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_airybi  s
    c         C` s    t  d   d   t   g  d  S(   Nc         S` s   t  j |   d S(   Ni   (   R*   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |   S(   N(   R   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    (   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_airybi_complex  s    c         C` sN   t  d   d   t d d  g d d t  d   d   t d	 d
  g  d  S(   Nc         S` s   t  j |   d S(   Ni   (   R*   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |  d d S(   NR   i   (   R   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g    חg    חAR2   gh㈵>c         S` s   t  j |   d S(   Ni   (   R*   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |  d d S(   NR   i   (   R   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g     @g     @@(   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_airybi_prime  s
    c         C` s    t  d   d   t   g  d  S(   Nc         S` s   t  j |   d S(   Ni   (   R*   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |  d d S(   NR   i   (   R   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    (   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_airybi_prime_complex  s    c         C` s,   t  t j t d    t d d  g  d  S(   Nc         S` s   t  j d |  t  S(   Ni    (   R   t   beit   HYPERKW(   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g     @g     @@(   R   R*   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_bei  s    	c         C` s,   t  t j t d    t d d  g  d  S(   Nc         S` s   t  j d |  t  S(   Ni    (   R   t   berR   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g     @g     @@(   R   R*   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ber  s    	c         C` s2   t  d   d   t d d  g d d d d d  S(   Nc         S` s   t  j t |    t |   S(   N(   R*   t	   bernoulliR}   (   R8   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  t j t |     S(   N(   R4   R   R   R}   (   R8   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i    i2  R2   g&.>R8   (   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_bernoulli  s    	c         C` s8   t  t j t d    t d d  t   g d d d  S(   Nc         S` s   t  j |  | t  S(   N(   R   t   besseliR   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g}Ô%Ig}Ô%ITR   gJD(   R   R*   t   ivR   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_besseli  s    	c         C` s2   t  d   t d    t d d  t   g  d  S(   Nc         S` s   t  j |  j |  S(   N(   R*   R   R<   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |  | t  S(   N(   R   R   R   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g}Ô%Ig}Ô%IT(   R   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_besseli_complex  s    	c         C` s~   t  t j t d    t d d  t d d  g d t t  t j t d    t d d  t d d	  g d t d
 d d  S(   Nc         S` s   t  j |  | t  S(   N(   R   t   besseljR   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g}Ô%Ig}Ô%ITg     @g     @@RZ   c         S` s   t  j |  | t  S(   N(   R   R   R   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    g    חg    חAR2   gh㈵>(   R   R*   t   jvR   R   RJ   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_besselj  s    		c         C` s,   t  d   t d    t   t   g  d  S(   Nc         S` s   t  j |  j |  S(   N(   R*   R   R<   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   	  s    c         S` s   t  j |  | t  S(   N(   R   R   R   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   
  s    (   R   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_besselj_complex  s    	c         C` s8   d   } t  t j t |  t d d  t   g  d  S(   Nc         S` s   t  t j |  | t   } t |  d k rF t j t j |  } n  t |   t |  k r t |  t j k r t |  d k r t j j	 } d t j _	 z t  t j |  | t   } Wd  | t j _	 Xn  | S(   NgقnQ:Bi   i   (
   R4   R   t   besselkR   Rf   R!   R   t   signRn   Ro   (   R=   R9   R.   Ru   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   mpbesselk  s    ?g}Ô%Ig}Ô%IT(   R   R*   t   kvR   R   (   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_besselk  s    			c         C` s2   t  t j t d    t d d  t   g  d  S(   Nc         S` s   t  j |  | t  S(   N(   R   R   R   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   #  s    ii  (   R   R*   t   knR   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_besselk_int!  s    	c         C` s2   t  d   t d    t d d  t   g  d  S(   Nc         S` s   t  j |  j |  S(   N(   R*   R   R<   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   '  s    c         S` s   t  j |  | t  S(   N(   R   R   R   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   (  s    g}Ô%Ig}Ô%IT(   R   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_besselk_complex&  s    	c         C` sD   d   } t  t j t |  t d d  t d d  g d d d  S(   Nc         S` so   t  t j |  | t   } t |  d k rF t j t j |  } n  t |  d k rk | d k rk t j S| S(   NgقnQ:Bi    (	   R4   R   t   besselyR   Rf   R!   R   R   t   nan(   R=   R9   R.   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   mpbessely,  s    g}Ô%Ig}Ô%ITg    חg    חAR8   i  (   R   R*   t   yvR   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_bessely+  s
    				c         C` s8   d   } t  d   t |  t   t   g d d d  S(   Nc         S` sq   t  t j |  | t   } t |  d k rm t j d d  } z t j t j |  } Wd  t j |   Xn  | S(   NgقnQ:BRP   RQ   (	   R&   R   R   R   Rf   R!   RR   R   R   (   R=   R9   R.   RS   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR  ;  s    c         S` s   t  j |  j |  S(   N(   R*   R  R<   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   E  s    R8   i:  (   R   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_bessely_complex:  s
    	
		c         C` s>   d   } t  d   t |  t d d  t d d  g  d  S(   Nc         S` sA   t  t j |  |   } t |  d k r= | d k r= t j S| S(   Ni    (   R4   R   R   Rf   R!   R   (   R=   R9   R.   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR  K  s    c         S` s   t  j t |   |  S(   N(   R*   t   ynR}   (   R=   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   Q  s    ii  g    חg    חA(   R   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_bessely_intJ  s    			c      
   ` s~   g    t    f d   t t j  f d   t   t   g d d d t t t j  t j    d d d t d d d  S(   Nc         ` s   |  d k  s | d k  r t  j S|  d k  s7 | d k  r t t |  |   d d k r | r   j t |   t |  f  t  j Sn  t j |  |  S(   Ng   mi    i   (   R!   R   Rf   R4   R%   R   R   (   R[   R\   t   nonzero(   t
   bad_points(    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR   X  s    8
c         ` s     |  | d t  S(   NR  (   RJ   (   R[   R\   (   R   (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   h  s    Ro   i  RZ   R   g+=(   Rt   R   R*   R   R   RJ   R!   R(   (   R   (    (   R  R   s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR   U  s    		c         C` s;   t  t j t   t d     t   t   t   g  d  S(   Nc         S` s   t  j |  | d | d t S(   Ni    R   (   R   t   betaincRJ   (   R[   R\   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   v  s    (   R   R*   R	  R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_betainct  s    	c         ` sr   g    t    f d   t t j  f d   t   t   g d d t t j  t j    d d d d d  S(   Nc         ` s   t  |  d t  |   d k r' t j S|  | k  r t  t |  |  t j t |  |    d k  r | r   j t |   t |  f  t j Sn  t j |  |  S(   Ng    חAi   gV瞯<(   Rf   R!   R   R4   t   roundR%   R   t   binomial(   R8   t   kR  (   R  (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR  |  s     ?
c         ` s     |  | d t  S(   NR  (   RJ   (   R8   R  (   R  (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    Ro   i  R   g+=(   Rt   R   R*   t   binomR   R!   R(   (   R   (    (   R  R  s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt
   test_binomy  s    		c         C` s2   t  d   t d    t   t   g d d d  S(   Nc         S` s   t  j t |   |  S(   N(   R*   t   eval_chebytR}   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |  | t  S(   N(   R   t   chebytR   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    Ro   i2   (   R   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_chebyt_int  s    	s'   some cases in hyp2f1 not fully accuratec         C` s2   t  t j d   t d d  t   g d d d  S(   Nc         S` s"   t    t t j   |  | t  S(   N(   R   R   R   R  R   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    iie   R8   i'  (   R   R*   R  R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_chebyt  s    	c         C` s2   t  d   t d    t   t   g d d d  S(   Nc         S` s   t  j t |   |  S(   N(   R*   t   eval_chebyuR}   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |  | t  S(   N(   R   t   chebyuR   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    Ro   i2   (   R   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_chebyu_int  s    	c         C` s,   t  t j d   t d d  t   g  d  S(   Nc         S` s"   t    t t j   |  | t  S(   N(   R   R   R   R  R   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    iie   (   R   R*   R  R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_chebyu  s    	c         C` sK   d   } t  | t j t   g  t  | t j t d d d g  g  d  S(   Nc         S` s   t  j |   d S(   Ni   (   R*   t   shichi(   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   chi  s    iX   g&.>gU@g   V@(   R   R   R  R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_chi  s    	c         C` sK   d   } t  | t j t t t j d  t t j d   g d d d  S(   Nc         S` s   t  j |   d S(   Ni   (   R*   R  (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR    s    g    חg    חAR2   g-q=(   R   R   R  R   R&   R!   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_chi_complex  s
    	+c         C` s,   d   } t  | t j t d d  g  d  S(   Nc         S` s   t  j |   d S(   Ni   (   R*   t   sici(   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   ci  s    g    חg    חA(   R   R   R  R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ci  s    	c         C` sK   d   } t  | t j t t d t j  t d t j   g d d d  S(   Nc         S` s   t  j |   d S(   Ni   (   R*   R  (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR    s    g    חg    חAR2   g:0yE>(   R   R   R  R   R&   R!   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ci_complex  s
    	+c      	   C` s?   t  j t  j } t t t j t   g d t	 d d | d  S(   Nt   nan_okR2   i   (
   R!   R   R4   R   R   R   R   R   R   Rt   (   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt
   test_cospi  s    c         C` s)   t  t t j t   g d t d d d  S(   NR   R2   gvIh%<=(   R   R   R   R   R   Rt   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_cospi_complex  s    c         C` s2   t  t j t t j  t   g d d d d d  S(   NR2   g-q=Ro   i2   (   R   R*   R   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_digamma  s    	c      
   C` sA   d   } t  t j t t j  t   g d d d d d | d  S(   Nc         S` s2   t  j |  j d k  t  j |  j  d k  @t t  S(   Ni    gQ?(   R!   t   whereR<   Rf   R   Rt   RJ   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   param_filter  s    R2   gvIh%<=Ro   i(   R%  (   R   R*   R   R   R   R   (   R   R%  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_digamma_complex  s
    		c         C` s&   t  t j t j t   g d d d  S(   NR2   g+=(   R   R*   t   exp1R   t   e1R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_e1  s    	c         C` s   t  t j t j t t t j d  t t j d   g d d t  t j t j t j	 d d d  d  d   d  f t j d t j d	 d
 d  t j d	 d
 d  f d j   d d t  t j t j t j	 d d d  d d d d  S(   Ng    חg    חAR2   gdy=ii2   i   i    ii   i=   i   y              ?ii'  y                (   R   R*   R'  R   R(  R   R&   R!   R   R#   R   Rr   R"   Rs   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_e1_complex  s    	+	"%	c      
   C` s   t  t j d   t d t j t j t j  j  d t j t j t j  j   g  t  t j d   t j	 d d d d d	 t j
 g  d
 d t t j t j t j
    t t j t j
  d k  d  S(   Nc         S` s*   |  d k r t  j |   |  St  j d  S(   Ni    s   1.0(   R   t   expm1t   mpf(   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R[   R\   c         S` s*   |  d k r t  j |   |  St  j d  S(   Ni    s   1.0(   R   R+  R,  (   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   	  s    g-q=gW:i    g   mBgyCxDR2   gdy=(   R   R*   t   exprelR   R!   R   R   t   doubleRg   R(   R   R   t   isinf(   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_exprel  s    	J	+c         C` s    t  t j t j t   g  d  S(   N(   R   R*   R+  R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_expm1_complex  s    	c         C` s&   t  t j d   t   g d d d  S(   Nc         S` s   t  j |  d  S(   Ni   (   R   R   (   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    Ro   i<   (   R   R*   t   log1pR   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_log1p_complex  s    	c         C` s)   t  t d   t   g d d d d d  S(   Nc         S` s   t  j |  d  |  S(   Ni   (   R   R   (   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    Ro   i<   R2   g+=(   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_log1pmx  s    c         C` s&   t  t j t j t   g d d d  S(   NR2   gdy=(   R   R*   R+   R   R'   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ei  s    	c         C` sE   t  t j t j t t t j d  t t j d   g d d d  S(   Ng    חg    חAR2   g&.>(	   R   R*   R+   R   R'   R   R&   R!   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ei_complex#  s    	+c         C` s&   t  t j t j t d d  g  d  S(   NR\   g      ?(   R   R*   t   ellipeR   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ellipe*  s    	c         C` s2   t  t j t j t d d  t d d  g  d  S(   Ng     @g     @@R\   g      ?(   R   R*   t	   ellipeincR   R7  R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ellipeinc/  s    	c         C` s&   t  t j t j t   t   g  d  S(   N(   R   R*   R9  R   R7  R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ellipeinc_largephi4  s    	c         C` s,   t  t j t j t d d  t   g  d  S(   Ng     @g     @@(   R   R*   t	   ellipkincR   t   ellipfR   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ellipf9  s    	c         C` s&   t  t j t j t   t   g  d  S(   N(   R   R*   R<  R   R=  R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ellipf_largephi>  s    	c         C` sN   t  t j t j t d d  g  t  t j d   t d d  g d d d  S(   NR\   g      ?c         S` s   t  j d |   S(   Ni   (   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   H  s    R[   g        Ro   i  (   R   R*   R   R   R   t   ellipkm1(   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ellipkC  s    		c         C` s>   d   } t  t j | t d d  t d d  g d t d  S(   Nc         S` s   t  j d |  |  S(   Ni    (   R   t   ellippi(   t   phiR   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR<  M  s    g     @g     @@R\   g      ?RZ   (   R   R*   R<  R   RJ   (   R   R<  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ellipkincL  s
    		c         C` s8   d   } t  t j | t   t d d  g d t d  S(   Nc         S` s   t  j d |  |  S(   Ni    (   R   RB  (   RC  R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR<  U  s    R\   g      ?RZ   (   R   R*   R<  R   RJ   (   R   R<  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ellipkinc_largephiT  s
    		c      	   C` sD   d   } t  d   | t d d  t d d d d  g d	 d
 d  S(   Nc         S` s-   |  d k r d St  j d d |  d | Sd  S(   Ni    t   snR   R   (   R   R   (   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyRF  ]  s    c         S` s   t  j |  |  d S(   Ni    (   R*   R   (   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   g  s    g    .g    .AR[   i    R\   i   R2   g:0yE>(   R   R   (   R   RF  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ellipfun_sn\  s
    	
	$c      	   C` s>   t  d   d   t d d  t d d d d  g d	 d
 d  S(   Nc         S` s   t  j |  |  d S(   Ni   (   R*   R   (   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   n  s    c         S` s   t  j d d |  d | S(   Nt   cnR   R   (   R   R   (   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   o  s    g    .g    .AR[   i    R\   i   R2   g:0yE>(   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ellipfun_cnl  s    	$c      	   C` s>   t  d   d   t d d  t d d d d  g d	 d
 d  S(   Nc         S` s   t  j |  |  d S(   Ni   (   R*   R   (   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   u  s    c         S` s   t  j d d |  d | S(   NR   R   R   (   R   R   (   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   v  s    g    .g    .AR[   i    R\   i   R2   g:0yE>(   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ellipfun_dns  s    	$c         C` s    t  t j d   t   g  d  S(   Nc         S` s   t  j |   S(   N(   R   Rk   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   |  s    (   R   R*   Rk   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_erfz  s    	c         C` s&   t  t j d   t   g d d d  S(   Nc         S` s   t  j |   S(   N(   R   Rk   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R8   i   (   R   R*   Rk   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR|     s    	c         C` s,   t  t j t d    t   g d d d  S(   Nc         S` s   t  j |   S(   N(   R   Rm   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R2   gvIh%<=(   R   R*   Rm   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   test_erfc  s    	c         C` s,   t  t j t d    t   g d d d  S(   Nc         S` s   t  j |   S(   N(   R   Rm   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R8   i   (   R   R*   Rm   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_erfc_complex  s    	c         C` s&   t  t j t j t   g d d d  S(   NR8   i   (   R   R*   t   erfiR   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   test_erfi  s    	c         C` s&   t  t j t j t   g d d d  S(   NR8   i   (   R   R*   RN  R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_erfi_complex  s    	c         C` s,   t  t j t d    t   g d d d  S(   Nc         S` s   t  j |   S(   N(   R   t   ncdf(   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R8   i   (   R   R*   t   ndtrR   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   test_ndtr  s    	c      
   C` sD   t  t j d   t d t d d  d t d d   g d d d  S(   Nc         S` s   t  j |  t j d   d S(   Ng       @(   R   Rm   R!   t   sqrt(   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R[   iR\   i'  R8   i  (   R   R*   RR  R   R&   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ndtr_complex  s    	c         C` s2   t  t j t d    t   g d d d d d  S(   Nc         S` s   t  j t  j |    S(   N(   R   R   RQ  (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R8   iX  Ro   i,  (   R   R*   t   log_ndtrR   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_log_ndtr  s    	c      
   C` sP   t  t j t d    t d t d d  d t d d   g d d	 d
 d d  S(   Nc         S` s(   t  j t  j |  t j d   d  S(   Ng       @(   R   R   Rm   R!   RT  (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R[   iiR\   i'  id   R8   i   Ro   i,  (   R   R*   RV  R   R   R&   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_log_ndtr_complex  s    	c         C` s,   t  d   t j t d d  g d d d  S(   Nc         S` s   t  j |   d S(   Ni(   R*   t   euler(   R8   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i   i'  R8   (   R   R   t   eulernumR   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_eulernum  s    	c         C` sA   t  t j t j t d d  t d t j  g d d d d d  S(   Ni    i   R2   gvIh%<=Ro   i   (	   R   R*   R7   R   R5   R   R   R!   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_expint  s    	!c         C` s&   d   } t  | t j t   g  d  S(   Nc         S` s   t  j |   d S(   Ni    (   R*   t   fresnel(   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   fresnels  s    (   R   R   R^  R   (   R   R^  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_fresnels  s    	c         C` s&   d   } t  | t j t   g  d  S(   Nc         S` s   t  j |   d S(   Ni   (   R*   R]  (   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   fresnelc  s    (   R   R   R`  R   (   R   R`  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_fresnelc  s    	c         C` s&   t  t j t t j  t   g  d  S(   N(   R   R*   t   gammaR   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt
   test_gamma  s    	c         C` s,   t  t j t t j  t   g d d d  S(   NR2   g-a=(   R   R*   Rb  R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_gamma_complex  s    	c         C` sD   t  t j d   t d d d t t d d  g d t d d d  S(   Nc         S` s   t  j |  d | d t S(   NR\   R   (   R   R   RJ   (   R0   R\   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i    g     @t   inclusive_aR   R2   gdy=(   R   R*   R   R   Rt   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_gammainc  s    	$c         C` sD   t  t j d   t d d d t t d d  g d t d d d  S(   Nc         S` s   t  j |  d | d t S(   NR[   R   (   R   R   RJ   (   R0   R[   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i    g     @Re  R   R2   gdy=(   R   R*   t	   gammainccR   Rt   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_gammaincc  s    	$c         C` s,   d   } t  t j t |  t   g  d  S(   Nc         S` s   t  j |   j S(   N(   R   R   R<   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   f  s    (   R   R*   t   gammalnR   R   (   R   Ri  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_gammaln  s    	c         C` s8   t  t j t t j  t d d  t   t   g  d  S(   Ng     @g     @@(   R   R*   t   eval_gegenbauerR   R   t
   gegenbauerR   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_gegenbauer  s    	c      
   C` s   d   } d   } t  | t |  t d d  t   t   g d d d d d t t  | t |  t d d  t   t t j d	 d
 d   g d d d t d  S(   Nc         S` s   t  |  d k r t j S|  d k r. d } n2 |  d k rK d | | } n t j |  | |  } t |  d k r |  d | k r | d k  r t |  t t |   k r t j |  | t j d  |  } n  t  |  d k r t j S| S(	   Ng}Ô%ITi    g      ?i   i   is   1e-50g\4@Iw(	   Rf   R!   R   R   Rm  R4   R}   R,  R   (   R8   R[   R9   R.   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyRm    s    	L%c         S` s8   t  j t |   | |  } t |  d k r4 t j S| S(   Ng\4@Iw(   R*   Rl  R}   Rf   R!   R   (   R8   R[   R9   R.   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   sc_gegenbauer  s    i    id   R8   i@  Ro   RZ   iii   (   R   R   R   R   RJ   R   R!   R"   (   R   Rm  Ro  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_gegenbauer_int  s    				0c         C` s8   t  d   t t j  t d d  t   t   g  d  S(   Nc         S` s   t  j t |   | j |  S(   N(   R*   Rl  R}   R<   (   R8   R[   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i    id   (   R   R   R   Rm  R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_gegenbauer_complex  s    	c         C` s8   t  d   t t j  t d d  t   t   g  d  S(   Nc         S` s   t  j |  j | j |  S(   N(   R*   Rl  R<   (   R8   R[   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   !  s    g     @g     @@(   R   R   R   Rm  R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_gegenbauer_complex_general  s    	c         C` s2   t  t j t d    t d d  t   g  d  S(   Nc         S` s   t  j |  | t  S(   N(   R   t   hankel1R   (   R=   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   '  s   g@xg@xD(   R   R*   Rs  R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hankel1%  s    	c         C` s2   t  t j t d    t d d  t   g  d  S(   Nc         S` s   t  j |  | t  S(   N(   R   t   hankel2R   (   R=   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   -  s    g@xg@xD(   R   R*   Ru  R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hankel2+  s    	s%   issues at intermediately large ordersc         C` s2   t  d   t t j  t d d  t   g  d  S(   Nc         S` s   t  j t |   |  S(   N(   R*   t   eval_hermiteR}   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   2  s    i    i'  (   R   R   R   t   hermiteR   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hermite0  s    	c         ` sM   t  d d d d    t t j   f d   t d d  t d d	  g  d  S(
   NR   i  R   i  c         ` s   t  j |  |    S(   N(   R   R;   (   R[   R9   (   t   KW(    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   <  s    g    cg    cAi    g     j@(   RI   R   R*   R;   R   (   R   (    (   Rz  s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp0f18  s    	c      	   C` sJ   t  d   t d    t d d  t t d d  t d d   g  d  S(   Nc         S` s   t  j |  j |  S(   N(   R*   R;   R<   (   R[   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   D  s    c         S` s   t  j |  | t  S(   N(   R   R;   R   (   R[   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   E  s    ii   iix   (   R   R   R   R   R&   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp0f1_complexC  s    	c         C` sJ   t  t t j  t d    t d d  t d d  t   g d d d  S(   Nc         S` s   t  j |  | | t  S(   N(   R   t   hyp1f1R   (   R[   R\   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   N  s    g     jg     j@R8   i  (   R   R   R*   R}  R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp1f1K  s    $c         C` sJ   t  t d    t d    t d d  t d d  t   g d d d  S(   Nc         S` s   t  j |  j | j |  S(   N(   R*   R}  R<   (   R[   R\   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   T  s    c         S` s   t  j |  | | t  S(   N(   R   R}  R   (   R[   R\   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   U  s    g     @g     @@R8   i  (   R   R   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp1f1_complexR  s    $c         C` sD   d   } t  | t d    t   t   t   t   g d d d  S(   Nc         S` sN   t  j |  | | |  \ } } t |  t d t |   d k rJ t j S| S(   Ni   gHz>(   R*   t   hyp1f2Rf   Rg   R!   R   (   R[   R\   R]   R9   R=   t   err(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR  [  s    %c         S` s   t  j |  | | | t  S(   N(   R   R  R   (   R[   R\   R]   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   a  s    R8   i N  (   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp1f2Y  s
    	c         C` s2   d   } t  | d   t   t   t   g  d  S(   Nc         S` sN   t  j |  | | d  \ } } t |  t d t |   d k rJ t j S| S(   Ni   gHz>(   R*   t   hyp2f0Rf   Rg   R!   R   (   R[   R\   R9   R=   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR  g  s    %c         S` s.   t  d  t t t j    |  | | t  S(   Ng?(   R   R   R   R   R  R   (   R[   R\   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   m  s   (   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp2f0e  s    	s>   spurious inf (or inf with wrong sign) for some argument valuesc         C` s8   t  t j t d    t   t   t   t   g  d  S(   Nc         S` s   t  j |  | | | t  S(   N(   R   RK   R   (   R[   R\   R]   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   t  s    (   R   R*   RK   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp2f1q  s    	c         C` sP   t  d   t d    t d d  t d d  t d d  t   g d d d  S(   Nc         S` s   t  j |  j | j | j |  S(   N(   R*   RK   R<   (   R[   R\   R]   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   z  s    c         S` s   t  j |  | | | t  S(   N(   R   RK   R   (   R[   R\   R]   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   {  s    g      Yg      Y@R8   i
   (   R   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyp2f1_complexw  s    	0c         C` s2   t  t j t d    t   t   t   g  d  S(   Nc         S` s   t  j |  | | t  S(   N(   R   t   hyperuR   (   R[   R\   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    (   R   R*   R  R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_hyperu  s    	s:   mpmath issue gh-342: unsupported operand mpz, long for powc         C` sA   d   } t  t | t d d d t t d d  g d d d  S(   Nc         S` s+   t  j | |   t  j |  t  j |   S(   N(   R   t   powerR$   Rb  (   R[   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   mp_igam_fac  s    i    g  ļBRe  R2   g|=(   R   R   R   Rt   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_igam_fac  s
    	$c         C` sN   t  t j t j t d d  g  t  t j t j t d d  g d d d  S(   Ng     @g     @@g    חg    חAR2   gh㈵>(   R   R*   t   j0R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_j0  s    		c         C` sN   t  t j t j t d d  g  t  t j t j t d d  g d d d  S(   Ng     @g     @@g    חg    חAR2   gh㈵>(   R   R*   t   j1R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_j1  s    		c         C` sl   t  t j t d    t   t   t   t   g  t  d   t d    t   t   t   t   g  d  S(   Nc         S` s   t  j |  | | | t  S(   N(   R   t   jacobiR   (   R[   R\   R]   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j t |   | | |  S(   N(   R*   t   eval_jacobiR}   (   R8   R\   R]   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |  | | | t  S(   N(   R   R  R   (   R[   R\   R]   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    (   R   R*   R  R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_jacobi  s    		c         ` sM   d     t  d     f d   t   t   t   t   g d d d d d  S(   Nc         S` s&   |  d k r d St  j |  | | |  S(   Ni    g      ?(   R   R  (   R8   R[   R\   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR    s    c         S` s   t  j t |   | | |  S(   N(   R*   R  R}   (   R8   R[   R\   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         ` s   t     |  | | | t  S(   N(   R   R   (   R8   R[   R\   R9   (   R  (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R8   i N  Ro   i2   (   R   R   R   (   R   (    (   R  s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_jacobi_int  s
    		c         C` s2   d   } t  t j | t d d  g d d d  S(   Nc         S` s.   |  d k r t  d St t j  d |  t  S(   Ni    i   (   R   R   R   t   keiR   (   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR    s    	gꌠ9Y>)gꌠ9Y>)FR8   i  (   R   R*   R  R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_kei  s    		c         C` s2   t  t j t d    t d d  g d d d  S(   Nc         S` s   t  j d |  t  S(   Ni    (   R   t   kerR   (   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    gꌠ9Y>)gꌠ9Y>)FR8   i  (   R   R*   R  R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_ker  s    	c         C` s,   t  t t j  d   t   t   g  d  S(   Nc         S` s   t  t j  |  | t  S(   N(   R   R   t   laguerreR   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    (   R   R   R*   t   eval_laguerreR   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_laguerre  s    c         C` s,   t  d   d   t   t   g d d d  S(   Nc         S` s   t  j t |   |  S(   N(   R*   R  R}   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  t j  |  | t  S(   N(   R   R   R  R   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R8   i N  (   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_laguerre_int  s    	s   see gh-3551 for bad pointsc         C` s,   t  d   d   t   t d d  g  d  S(   Nc         S` s   t  j |  t |   S(   N(   R*   R   R}   (   R9   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  j |  t |   S(   N(   R   R   R}   (   R9   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i    i
   (   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_lambertw  s    	c         ` s\   d } t  j d    d     f d   } t | t j t d | d t g d d d  S(	   NgGase@i   g  E@c         ` s"   |   d   |  d t  |   S(   Ng      ?(   R   (   R9   (   t   et   g(    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyRb    s    i    Re  R2   gvIh%<=(   R!   R$   R   R   Rb  R   Rt   (   R   t   maxgammaRb  (    (   R  R  s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_lanczos_sum_expg_scaled  s    c         C` s&   t  t j t j t   t   g  d  S(   N(   R   R*   t   eval_legendreR   t   legendreR   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_legendre  s    	c      	   C` s`   t  d   d   t   t   g d d t  d   d   t   t t j d d d	   g  d  S(
   Nc         S` s   t  j t |   |  S(   N(   R*   R  R}   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  t j  |  | t  S(   N(   R   R   R  R   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R8   i N  c         S` s   t  j t |   |  S(   N(   R*   R  R}   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    c         S` s   t  t j  |  | t  S(   N(   R   R   R  R   (   R8   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    iii   (   R   R   R   R   R!   R"   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_legendre_int  s    		c         C` s   d   } d   } d   } t  | | t d d  t d d  t   g  t  | | t d d  t d d  t d d  g  d  S(   Nc         S` sk   y! t  j | |  |  d d } Wn t k
 r8 t j SXt |  d k rg t j t j | j  } n  | S(   Ni    ig)#v(   ii(	   R*   t   lpmnt
   ValueErrorR!   R   Rf   R   R   R<   (   R8   R   R0   R=   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   lpnm  s    !c         S` sG   t  j | |  |  } t |  d k rC t j t j | j  } n  | S(   Ng)#v(   R*   R   Rf   R!   R   R   R<   (   R8   R   R0   R=   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   lpnm_2  s    c         S` s   | d k s | d k rp t  |   |  k rp | d k ri |  d k  rP |  d }  n  t j t j |  |   Sd Sn  t |  d k  r t j St |  d k  r d n d } t t j  |  | | d | } t |  d k r t j	 t j | j
  } n  | S(	   Ni   ii    gV瞯<i   i   t   typeg)#v(   R}   R   R  R   Rf   R!   R   R   R~   R   R<   (   R8   R   R0   t   typR=   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR~     s    *!iid   ii   (   R   R   R   (   R   R  R  R~   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_legenp  s    	
		%c         C` s   d   } d   } t  j d d d d d d d	 d
 d g	  } t  j d d d d g  } | d  d   d  f d | d  d  d   f j   } t | | t d d d d d d g  t d d d d d d g  t |  g d d d d d  S(   Nc         S` sG   y+ t  j | j |  j | d d d d SWn t k
 rB t j SXd  S(   NR  i   i    i(   ii(   R*   t   clpmnR<   R  R!   R   (   R8   R   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   clpnm.  s    +c         S` sJ   t  |  d k  r t j St t j  t |  j  t | j  | d d S(   NgV瞯<R  i   (   Rf   R!   R   R   R   R~   R}   R<   (   R8   R   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR~   4  s    igGzg      i    gh㈵>g      ?gGz?i   g     @@g     @g?y              ?ii   i   i
   R2   gư>R8   i  (   R!   R(   R   Rs   R   R   (   R   R  R~   R9   R@   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_legenp_complex_2-  s    		*4Ec         C` s   d   } d   } t  j d d d d d d d	 d
 d g	  } t  j d d d d g  } | d  d   d  f d | d  d  d   f j   } t | | t d d d d d d g  t d d d d d d g  t |  g d d d d d  S(   Nc         S` sG   y+ t  j | j |  j | d d d d SWn t k
 rB t j SXd  S(   NR  i   i    i(   ii(   R*   R  R<   R  R!   R   (   R8   R   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR  F  s    +c         S` sJ   t  |  d k  r t j St t j  t |  j  t | j  | d d S(   NgV瞯<R  i   (   Rf   R!   R   R   R   R~   R}   R<   (   R8   R   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR~   L  s    igGzg      i    gh㈵>g      ?gGz?i   g     @@g     @g?y              ?ii   i   i
   R2   gư>R8   i  (   R!   R(   R   Rs   R   R   (   R   R  R~   R9   R@   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_legenp_complex_3E  s    		*4Es*   apparently picks wrong function at |z| > 1c         C` sD   d   } d   } t  | | t d d  t d d  t   g  d  S(   Nc         S` s   t  j | |  |  d d S(   Ni    i(   ii(   R*   t   lqmn(   R8   R   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   lqnm_  s    c         S` s8   t  |  d k  r t j St t j  |  | | d d S(   NgV瞯<R  i   (   Rf   R!   R   R   R   t   legenq(   R8   R   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR  b  s    i    id   (   R   R   R   (   R   R  R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_legenq]  s
    		c         C` sJ   d   } d   } t  | | t d d  t d d  t   g d d d  S(   Nc         S` s-   t  j t | j  t |  j  |  d d S(   Ni    i(   ii(   R*   R  R}   R<   (   R8   R   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR  n  s    c         S` sJ   t  |  d k  r t j St t j  t |  j  t | j  | d d S(   NgV瞯<R  i   (   Rf   R!   R   R   R   R  R}   R<   (   R8   R   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR  q  s    i    id   R8   (   R   R   R   (   R   R  R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_legenq_complexl  s    		$c      
   C` s>   d   } d   } t  t | t   g d d d d d | d  S(   Nc         S` s,   t  j t  j |   |  k |  d k @t t  S(   Ni    (   R!   R$  t   floorRt   RJ   (   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR%  }  s    c         S` s   t  j d |   j S(   Ni   (   R   R   R<   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   mp_lgam1p  s    R2   gvIh%<=Ro   id   R%  (   R   R   R   (   R   R%  R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_lgam1p|  s    		c      
   C` s8   d   } t  t j | t   g d t d t d d d  S(   Nc         S` s@   y t  j |   } Wn& t k
 r; t t j t j  } n X| S(   N(   R   R   R  R&   R!   R   (   R0   RA   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   mpmath_loggamma  s
    R   t   distinguish_nan_and_infR2   gvIh%,=(   R   R*   R   R   Rt   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_loggamma  s
    		c         C` s2   d   } t  | t d    t   t   g  d  S(   Nc         S` s   t  j |  |  d S(   Ni    (   R*   t   pbdv(   R=   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   pcfd  s    c         S` s   t  j |  | t  S(   N(   R   R  R   (   R=   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    (   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   test_pcfd  s    	sH   it's not the same as the mpmath function --- maybe different definition?c         C` s2   d   } t  | d   t   t   g d d d  S(   Nc         S` s   t  j |  |  d S(   Ni    (   R*   t   pbvv(   R=   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   pcfv  s    c         S` s"   t    t t j   |  | t  S(   N(   R   R   R   R  R   (   R=   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    R8   i  (   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   test_pcfv  s    	c         C` s8   d   } t  | d   t   t   g d d d d d  S(   Nc         S` s   t  j |  |  d S(   Ni    (   R*   t   pbwa(   R[   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   pcfw  s    c         S` s"   t    t t j   |  | t  S(   N(   R   R   R   R  R   (   R=   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    Ro   i2   R8   i  (   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   test_pcfw  s    	sC   issues at large arguments (atol OK, rtol not) and <eps-close to z=0c         C` s;   t  t j t   t t j   t d d  t   g  d  S(   Ni    i  (   R   R*   t	   polygammaR   R   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_polygamma  s    	c         C` s,   d   } t  t j | t   g d t d  S(   Nc         S` s&   |  d k  r t  j St j |   } | S(   Ni(   R!   R   R   R   (   R9   R=   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR     s    RZ   (   R   R*   R   R   RJ   (   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_rgamma  s
    		c         C` s,   t  t j t t j  t   g d d d  S(   NR2   g-a=(   R   R*   R   R   R   R   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_rgamma_complex  s    	c         C` s2   d   } t  t j | t   t   g d d d  S(   Nc         S` sl   t  |  |  t |  |  k r\ t  |  |  d k r\ t j |   }  t |  |  |  } n  t j |  |  S(   Ni    (   R4   R}   R   R,  t   rf(   R[   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   mppoch  s    6Ro   i  (   R   R*   t   pochR   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_rf  s
    			c      	   C` s?   t  j t  j } t t t j t   g d t	 d d | d  S(   NR   R2   i   (
   R!   R   R4   R   R   R   R   R   R   Rt   (   R   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt
   test_sinpi  s    c         C` s)   t  t t j t   g d t d d d  S(   NR   R2   g+=(   R   R   R   R   R   Rt   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_sinpi_complex  s    c         C` sK   d   } t  | t j t   g  t  | t j t d d d g  g  d  S(   Nc         S` s   t  j |   d S(   Ni    (   R*   R  (   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   shi  s    iX   g&.>gU@g   V@(   R   R   R  R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_shi  s    	c         C` sK   d   } t  | t j t t t j d  t t j d   g d d d  S(   Nc         S` s   t  j |   d S(   Ni    (   R*   R  (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR    s    g    חg    חAR2   g-q=(   R   R   R  R   R&   R!   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_shi_complex  s
    	+c         C` s&   d   } t  | t j t   g  d  S(   Nc         S` s   t  j |   d S(   Ni    (   R*   R  (   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   si  s    (   R   R   R  R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_si  s    	c         C` sK   d   } t  | t j t t d t j  t d t j   g d d d  S(   Nc         S` s   t  j |   d S(   Ni    (   R*   R  (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR    s    g    חg    חAR2   g-q=(   R   R   R  R   R&   R!   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_si_complex  s
    	+c         C` s;   d   } t  t j t |  t d t j  g d d d  S(   Nc         S` s   t  j d d |   S(   Ni   i   (   R   R   (   R9   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   dilog  s    i    R2   g+=(   R   R*   R   R   R   R!   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spence  s    			c         C` s2   d   } t  t j t |  t   g d d d  S(   Nc         S` s   t  j d d |   S(   Ni   i   (   R   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR    s    R2   g+=(   R   R*   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spence_complex  s    			c         C` sr   d   } t  | t j t d d  t d d  t d d d t  t d d d d t  g d d d	 d
 d d d  S(   Nc         S` s)   | |  k r t  j St j | |  | |  S(   N(   R!   R   R*   t   sph_harm(   t   lR   R   RC  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   spherharm  s    i    id   R[   R\   i   R   g:0yE>R8   ip  Ro   i   (   R   R   R  R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spherharm  s    	.c         C` s>   t  t j t t j  t d d  t d d  g d d d  S(   Ng     g     @i    R2   g&.>(   R   R*   t   struveR   R   t   struvehR   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_struveh  s    	c         C` sJ   d   } t  t j t |  t d d  t d d  g d d d t d  S(   Nc         S` sz   |  d k  rj | |  k  rj t  |   d k rj t j j } z  d t j _ t j |  |  SWd  | t j _ Xn  t j |  |  S(   Ni    i  i,  (   Rf   R   Rn   Ro   t   struvel(   R=   R0   Ru   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt
   mp_struvel   s    +g     g     @i    R2   g&.>RZ   (   R   R*   t	   modstruveR   R   RJ   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_struvel  s    			c         C` s,   t  t j d   t   g d d d t d  S(   Nc         S` s   t  |  d  S(   Ni   (   R   (   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   3  s    R2   g+=R   (   R   R*   R   R   Rt   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_wrightomega1  s    	c      
   C` sJ   t  t j t t j  t d d d d d t  t d d d t  g  d  S(   NR[   i   R\   g    _BRe  i    (   R   R*   t   zetaR   R   R   Rt   (   R   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   test_zeta6  s    	c      
   C` sP   d   } t  t j t |  t d d d t  t   g d d d d d	 d
 d  S(   Nc         S` s[   t  j j |   }  t  j j |  } | d k r@ t  j j |   St  j j |  |  | Sd  S(   Ni    (   R   Rn   R,  R   t   powm1(   R9   t   lmbda(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt	   mp_boxcox>  s
    R[   i    Re  R8   i   Ro   i<   R2   gvIh%<=(   R   R*   t   boxcoxR   R   Rt   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_boxcox<  s    			c      
   C` sP   d   } t  t j t |  t d d d t  t   g d d d d d	 d
 d  S(   Nc         S` su   t  j j |   }  t  j j |  } t  j j d  } | d k rV t  j j | |   St  j j | |  |  | Sd  S(   Ni   i    (   R   Rn   R,  R   R  (   R9   R  t   one(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   mp_boxcox1pO  s    R[   iRe  R8   i   Ro   i<   R2   gvIh%<=(   R   R*   t   boxcox1pR   R   Rt   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_boxcox1pM  s    				c         C` sD   d   } t  d   t |  t d d  t d d  g d d d  S(	   Nc         S` sh   t  j |  } t  j |  t  j d  d |  t  j d | t  j  } | j d k r` | j S| Sd  S(   Ni   i   i    (   R   t	   mpmathifyR   R,  RT  R   R   R<   (   R8   R0   t   argt   out(    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   mp_spherical_jn`  s     c         S` s   t  j t |   |  S(   N(   R*   t   spherical_jnR}   (   R8   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   i  s    i    i   g    חg    חARo   i,  (   R   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spherical_jn_  s
    				c         C` s8   d   } t  d   t |  t d d  t   g  d  S(   Nc         S` sh   t  j |  } t  j |  t  j d  d |  t  j d | t  j  } | j d k r` | j S| Sd  S(   Ni   i   i    (   R   R  R   R,  RT  R   R   R<   (   R8   R0   R  R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR  o  s     c         S` s   t  j t |  j  |  S(   N(   R*   R  R}   R<   (   R8   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>   x  s    i    i   (   R   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spherical_jn_complexn  s    				c         C` sD   d   } t  d   t |  t d d  t d d  g d d d  S(	   Nc         S` sh   t  j |  } t  j |  t  j d  d |  t  j d | t  j  } | j d k r` | j S| Sd  S(   Ni   i   i    (   R   R  R   R,  RT  R   R   R<   (   R8   R0   R  R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   mp_spherical_yn}  s     c         S` s   t  j t |   |  S(   N(   R*   t   spherical_ynR}   (   R8   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i    i   g    _g    _BRo   id   (   R   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spherical_yn|  s
    				c         C` s8   d   } t  d   t |  t d d  t   g  d  S(   Nc         S` sh   t  j |  } t  j |  t  j d  d |  t  j d | t  j  } | j d k r` | j S| Sd  S(   Ni   i   i    (   R   R  R   R,  RT  R   R   R<   (   R8   R0   R  R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR    s     c         S` s   t  j t |  j  |  S(   N(   R*   R  R}   R<   (   R8   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i    i   (   R   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spherical_yn_complex  s    				c      	   C` sD   d   } t  d   t |  t d d  t   g d d d d	 d  S(
   Nc         S` sh   t  j |  } t  j |  t  j d  d |  t  j d | t  j  } | j d k r` | j S| Sd  S(   Ni   i   i    (   R   R  R   R,  RT  R   R   R<   (   R8   R0   R  R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   mp_spherical_in  s     c         S` s   t  j t |   |  S(   N(   R*   t   spherical_inR}   (   R8   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i    i   Ro   R   i
   ig訰6(   R   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spherical_in  s
    				c         C` s8   d   } t  d   t |  t d d  t   g  d  S(   Nc         S` sh   t  j |  } t  j |  t  j d  d |  t  j d | t  j  } | j d k r` | j S| Sd  S(   Ni   i   i    (   R   R  R   R,  RT  R   R   R<   (   R8   R0   R  R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR    s     c         S` s   t  j t |  j  |  S(   N(   R*   R  R}   R<   (   R8   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i    i   (   R   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spherical_in_complex  s    				c         C` s>   d   } t  d   t |  t d d  t   g d d d  S(   Nc         S` sk   t  j |  t  j d  d |  t  j t  j d t  j |   } t  j |  j d k rc | j S| Sd  S(   Ni   i   i    (   R   R   R,  RT  R   R  R   R<   (   R8   R0   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   mp_spherical_kn  s
     $c         S` s   t  j t |   |  S(   N(   R*   t   spherical_knR}   (   R8   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i    i   Ro   id   (   R   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spherical_kn  s
    			s.   Accuracy issues near z = -1 inherited from kv.c         C` s>   d   } t  d   t |  t d d  t   g d d d  S(   Nc         S` sh   t  j |  } t  j |  t  j d  d |  t  j d | t  j  } | j d k r` | j S| Sd  S(   Ni   i   i    (   R   R  R   R,  RT  R   R   R<   (   R8   R0   R  R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR    s     c         S` s   t  j t |  j  |  S(   N(   R*   R  R}   R<   (   R8   R0   (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR>     s    i    i   Ro   (   R   R   R   R   (   R   R  (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   test_spherical_kn_complex  s
    				N(   t   __name__t
   __module__R   t   slowR   R   R   t
   decoratorsR   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R  R  R  R   R
  R  R  R	   R  R  R  R  R  R  R  R!  R"  R#  R&  R)  R*  R0  R1  R3  R4  R5  R6  R8  R:  R;  R>  R?  RA  RD  RE  RG  RI  RJ  RK  R|   RL  RM  RO  RP  RS  RU  RW  RX  R[  R\  R_  Ra  Rc  Rd  Rf  Rh  Rk  Rn  Rp  Rq  R   Rr  Rt  Rv  Ry  R{  R|  R~  R  R  R  R  R  R  t   knownfailureift   _is_32bit_platformR  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R  R   (    (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyR     s  	
		
		
		
																										
						
																																					.					
		
			
					2																															t   __main__(S   t   __doc__t
   __future__R    R   R   t   numpyR!   t   numpy.testingR   R   R   R   R   t   scipy.specialt   specialR*   t   scipy._lib.sixR   t   scipy._lib._testutilsR	   t   scipy.special._testutilsR
   R   R   R   R   t   scipy.special._mptestutilsR   R   R   R   R   R   R   R   R   R   t   scipy.special._ufuncsR   R   R   R   R   R   R   t   ImportErrort   intpt   itemsizeR  R1   R:   RB   RG   RO   RT   RY   R^   R  Rj   R|   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   R   RI   R   t   objectR   R  (    (    (    s>   /tmp/pip-build-7oUkmx/scipy/scipy/special/tests/test_mpmath.pyt   <module>   sx   "(F.#;'	     9