
    bi                       d Z ddlZddlmZmZ ddlmZ ddlZddlZddl	m
Z
 ddlmZ ddl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$ 	 ddl%Z%ejN                  jQ                  d
      Z) ee%d      d        Z* ee%d      d        Z+ ee%d      d        Z, ee%d      d        Z- ee%d      d        Z. ee%d      d        Z/ ee%d      d        Z0 ee%d      d        Z1 ee%d      d        Z2 ee%d      ejN                  jf                  d               Z4 ee%d      d        Z5 ee%d      d        Z6ejN                  jf                   ee%d      d                Z7d!Z8 ee%d      d"        Z9 ee%d      d#        Z: ee%d      ejN                  jf                  d$               Z; ee%d      ejN                  jf                  d%               Z< ee%d      d&        Z= ee%d      d'        Z> ee%d      ejN                  jf                  d(               Z? ee%d      ejN                  jf                  d)               Z@ ee%d      d*        ZA ee%d      d+        ZB ee%d      d,        ZCd- ZDejN                  jf                   ee%d      d.               ZEejN                  jf                   ee%d      d/               ZFejN                  jf                   ee%d      d0               ZGejN                  jf                   ee%d      d1               ZH eId2d23      ZJejN                  jf                   ee%d4       G d5 d6                    ZKy# e&$ r  ed	      Z%Y 	w xY w)7z4
Test SciPy functions versus mpmath, if available.

    N)assert_assert_allclose)pi)_pep440)MissingModulecheck_versionFuncDataassert_func_equal)
ArgFixedArg
ComplexArgIntArgassert_mpmath_equalnonfunctional_tooslow
trace_argstime_limitedexception_to_nan
inf_to_nan)_sinpi_cospi_lgam1p_lanczos_sum_expg_scaled_log1pmx	_igam_facmpmathzXmpmath gmpy2 backend is not thread-safe, see https://github.com/mpmath/mpmath/issues/974reasonz0.10c            
         g } t        j                  ddd      D ]y  }t        j                  ddt         j                  z  d      D ]L  }|t        j                  d|z        z  }| j                  |t        t        j                  |            f       N { t        j                  | t         j                        } t        t        j                  | dd      j                          y )	Ni   
   r                    ?dtype   )nplogspacelinspacer   expappendcomplexr   eiarraycdoubler	   scexpicheck)datasetrpzs       Z/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/scipy/special/tests/test_mpmath.pytest_expi_complexr7   &   s    G[[a$ 7Q"%%, 	7A"&&A,ANNAwvyy|456	77 hhwbjj1GRWWgq!$**,    z0.19c                     g } dD ]m  }t        j                  ddd      D ]Q  }t        j                  d      5  | j	                  ||t        t        j                  ||            f       d d d        S o t        j                  |       } t        t        j                  | ddd	      j                          y # 1 sw Y   xY w)
N)2   3   r         d   r   r%   r   vIh%<=rtol)r&   r'   r   workdpsr*   floatexpintasarrayr	   r/   expnr1   )r2   nxs      r6   test_expn_large_nrJ   6   s     G CQ3' 	CA$ C1eFMM!Q,?&@ABC C	CC jj!GRWWgvqu5;;=	C Cs   2B77C c            
      l   g } g d}|D ]i  }|D ]b  }|D ][  }|d|z  z   }t        j                  d      5  t        t        j                  ||            }d d d        | j	                  ||f       ] d k t        j                  |       } t        d | ddd      j                          y # 1 sw Y   XxY w)	N)g     Xg      #            ?g      #@g     X@r"   x   c                 B    t        j                  | j                  |      S Nr/   hyp0f1realvr5   s     r6   <lambda>z$test_hyp0f1_gh5764.<locals>.<lambda>X   s    "))AFFA. r8   r?   r   r@   rA   )	r   rC   r+   rR   r*   r&   r-   r	   r1   )r2   axisrU   rI   yr5   ress          r6   test_hyp0f1_gh5764rZ   G   s     G.D 	, 	,A ,1H ^^C( 7!&--1"56C71c{+,	,	, hhwG.7 7s    B*	*B3c            	         t        j                  ddd      } t        j                  | d      }t        j                  | D cg c]  }t        j                  |d       c}      }t        ||j                  t              d       y c c}w )N         rM   -q=rA   )	r&   r(   r/   rR   r-   r   r   astyperD   )vvafrU   mfs       r6   test_hyp0f1_gh_1609rd   \   sd     
S#r	"B	2s	B	"5Q6==C(5	6BB		%(u5 6s   Bz1.1.0c                  `   g } t        j                  dd      D ]  }t        j                  ddd      D ]t  }| }| j                  ||dt	        t        j                  ||d            f       | |z   dz
  }| j                  ||dt	        t        j                  ||d            f       v  dD ]<  }dD ]5  }| j                  ||dt	        t        j                  ||d            f       7 > t        j                  |       } t        t        j                  | dd	d
d      j                          y )N      r   r%   )      %      rL   r   rM   r%   r    )      rL   r   rM   r%         ?r         @r   r%   r      V瞯<-a=rB   atol)r&   aranger(   r*   rD   r   hyperur-   r	   r/   r1   )r2   rH   bas       r6   test_hyperu_around_0rx   i   s   GYYr1 ERB' 	EAANNAq!U6==Aq+A%BCDQ
ANNAq!U6==Aq+A%BCD		EE 0 E5 	EANNAq!U6==Aq+A%BCD	EE hhwGRYYAEFLLNr8   1.0.0c                     ddg} | t        t        j                  g dd            z  } | D cg c]*  \  }}}}||k(  rt        |      |k(  r|dk  r|dk7  r||||f, } }}}}t	        d	      }| D cg c]$  }|t        t        j                  |i |      fz   & }}t        j                  |t        j                  
      }t        t        j                  |ddd      j                          y c c}}}}w c c}w )N)r   r{   ffffff?)r   r}   r|   )r   r%   gffffffr<   )repeatr   r~   T)	eliminater#   r   r%   r   ro   绽|=rA   )list	itertoolsproductrounddictrD   r   hyp2f1r&   r-   float64r	   r/   r1   )ptsrw   rv   crI   kwr4   r2   s           r6   test_hyp2f1_strange_pointsr      s     	C 4	!!"5a@AAC'* #Aq!6eAh!mA!u* 
Aq!C  
	B>ABqE&--1b1244BGBhhwbjj1GRYYAE:@@B
 Cs   /C2
5)C:z0.13c            	      f   g d} | D cg c]!  }|t        t        j                  |       fz   # }}t        j                  |t        j
                        }t        j                  d      5  t        t        j                  |ddd      j                          d d d        y c c}w # 1 sw Y   y xY w)	N)r%   r   ro   r   )UUUUUU?gUUUUUU?g?g      ?)      ?rM   g      ?gX<ݚ?)r   r}   ro   )r   r   r}   ro   )r   rj   rj   ro   r   )gx&?r{   rf   g333333?)r   r   r   +?)r   r   r   r{   )r   ro   rg   Gz?)rl   rL   ro   r   )r   rm   g      
r   )g*4]92@g|O%@gCu?)  ri   r   )r   r         %@r   )r{   r   r%         ?)r{   r   r%   rk   )r      rg   r   )r   r   rg   rk   )rM   g     prl   gm˟?r#   ignoreinvalidr   r<   r   rA   )
rD   r   r   r&   r-   r   errstater	   r/   r1   )r   r4   r2   s      r6   test_hyp2f1_real_some_pointsr      s    C. 9<<1qE&--+,..<G<hhwbjj1G	X	& GGY>DDFG G =G Gs   &B",-B''B00.14c            	      <   g d} d }| D cg c]4  }t        t        ||            t        t        j                  |       fz   6 }}t        j                  |t
        j                        }t        t        j                  |ddd      j                          y c c}w )N))p   )r;   r    )r    gwJ)r    |r   r   )r    r   ri   r   c                 N    t        | t              rt        | d         | d   z  S | S )Nr   r%   )
isinstancetuplerD   rI   s    r6   fevz&test_hyp2f1_some_points_2.<locals>.fev   s(    a1;1%%Hr8   r#   r   r<   r   rA   )r   maprD   r   r   r&   r-   r   r	   r/   r1   )r   r   r4   r2   s       r6   test_hyp2f1_some_points_2r      s}    C JMMAuSa[!U6==!+<%=$??MGMhhwbjj1GRYYAE:@@B Ns   9Bc                     g } dD ]O  }dD ]H  }dD ]A  }dD ]:  }	 t        t        j                  ||||            }| j	                  |||||f       < C J Q t        j                  | t
        j                        } t        j                  d      5  t        t        j                  | dd	d
d      j                          d d d        y # t        $ r Y w xY w# 1 sw Y   y xY w)N)r   rf   g?rg   r    )g      r{   r%   g@)r   r   rg   gffffff4@)r   g)\(Gzr   g333333?gffffff?rl   r    r#   r   r   r   r<   &.>TrB   ignore_inf_sign)rD   r   r   	Exceptionr*   r&   r-   r   r   r	   r/   r1   )r2   rw   rv   r   r5   rU   s         r6   test_hyp2f1_real_somer      s    G( 4# 	4A( 4C 4A!!&--1a";< NNAq!Q?344	44 hhwbjj1G	X	& /GY!%	'',uw/ / % ! !
/ /s   !C	.C		CCC!z0.12c            
      t   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                  |       z  dz
  |d d df<   |d d dfxx   d	t         j                  j                  d|       z  z  cc<   |d d dfxx   d	t         j                  j                  d|       z  z  cc<   |d d dfxx   d	t         j                  j                  d|       z  z  cc<   |D ]  }t        j                  d
k  rJt        |d d       j                         t        |d         kD  rt        |d d       j                         |d<   t        t        j                  t        |d d              |d<    t        t         j                  |ddd      j#                          y )N  rg     rl   r   r%   r   ro   r{   r   r<   r   r   rA   )r&   zerosr   randomseedparetorandrandintr   __version__absmaxrD   r   r   r	   r/   r1   )npointsr2   dss      r6   test_hyp2f1_real_randomr      s    Ghh|RZZ0GIINN4II$$S'2GAqDMII$$S'2GAqDMII$$S'2GAqDMbiinnW--1GAqDMAqDMb299,,Q888MAqDMb299,,Q888MAqDMb299,,Q888M 5&2bq6{ 3r!u:-BrF)1fmmU2bq6]3415 RYYqt<BBDr8   c                     t         j                  j                  t         j                  j                  }} 	 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   z  z   }t        t        j                  d	 |d
d       t        t        j                  d |d
d       | |ct         j                  _        t         j                  _        y # | |ct         j                  _        t         j                  _        w xY w)NF   r   r%         ig?r"   c                 >    t        t        j                  |             S rP   )r+   r   erfr   s    r6   rV   z"test_erf_complex.<locals>.<lambda>  s    GFJJqM,B r8   Fr@   
vectorizedrB   c                 >    t        t        j                  |             S rP   )r+   r   erfcr   s    r6   rV   z"test_erf_complex.<locals>.<lambda>  s    WV[[^-D r8   )r   mpdpsprecr&   meshgridr(   r'   r_ravelr
   r/   r   r   )old_dpsold_precx1y1x2y2pointss          r6   test_erf_complexr      s/    		vyy~~XG:		R[[a4bkk#q"6MNBR[[b"5r{{3B7OPBrxxz"((*,-255RXXZ9O3P0PP"&&"BF%*	8"''#Df%*	8 )0%		vyy~%		vyy~s   D?F! !-Gz0.15c                  D   g } dD ]{  }| 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       } d }| D cg c]  }| ||d   |d   |d         fz    }}t        j                  |t        j                        }d }t        j                  d      5  t        ||dd
dd      j                          d d d        y c c}w # 1 sw Y   y xY w) N)r   gmư>gL7A`?r%   r%   r{   r}   g333333?g333333gr    r   ro      rg   r   rf   r   ig @g&@g g&c                 d    |t        |      k(  r|dk(  r|dk(  ryyt        j                  | ||      S Nr%   r   )intr   legenp)numurI   s      r6   mplegenpztest_lpmv.<locals>.mplegenp0  s3    R=Q!VQw}}RQ''r8   r   r   r#   c                 V    t        j                  | j                  t              ||      S rP   )r/   lpmvr`   r   )r   r   rI   s      r6   evfztest_lpmv.<locals>.evf<  s    wwryy~r1--r8   r   r   rn   r   +=rr   )extendr&   r-   r   r   r	   r1   )r   rI   r   r4   r2   r   s         r6   	test_lpmvr     s   
C, 

1IAJAJQKQKaLaLqMAJAJ1IAJAJQKAJQKQKaLQKaLaLqMaLqMqMN5
 	<( ;>>QqHQqT1Q41.00>G>hhwbjj1G. 
X	& KgwEBHHJK K ?K Ks   
D( DDc                     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
z   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                  }}	 dt        j                  _        t        t        j                   d |ddd       t        t        j"                  d |dd       ||ct        j                  _        t        j                  _        y # ||ct        j                  _        t        j                  _        w xY w)Nr   8r=   r<   r   r    r{   r%   r   rM   gffffffr   g33333Yg3333r     c                 @    t        t        j                  | |            S rP   )rD   r   betarw   rv   s     r6   rV   ztest_beta.<locals>.<lambda>[  s    uV[[A->'? r8   Fr   T)r   rB   r   c           
      x    t        t        j                  t        t        j                  | |                        S rP   )rD   r   logr   r   r   s     r6   rV   ztest_beta.<locals>.<lambda>c  s$    vzz#fkk!Q.?*@AB r8   r   )r&   r   r   r   r'   rt   r-   broadcast_arraysreshapeTr   r   r   r   r
   r/   r   betaln)rv   rw   abr   r   s        r6   	test_betar   G  sa    IINN4
bkk$Q'kk#r1%kk"a#iiR#iiR#c)$FH- 	.A 	
A	"%%a$i46;	<	D	DQ	K	M	MB		vyy~~XG:		"''?%*$*.	0 	IIB	 )0%		vyy~%		vyy~s   1AF1 1-Gg?c            	      0   t         t        j                  g d      z   } t        j                  ddt        j                  z  d      }t        j
                  | |      \  } }| t        j                  d|z        z  }t        j                  d|z   d|z   f   j                         }|D cg c]"  }|t        t        j                  |            f$ }}t        j                  |      }t        t        j                  |ddd      j                          y c c}w )	N)gg{Gzr   g{Gz?g?r   r   rh   r"   r%   vIh%,=rA   )LOGGAMMA_TAYLOR_RADIUSr&   r-   r(   r   r   r)   r   flattenr+   r   loggammar	   r/   r1   r3   thetadzr5   z0r2   s         r6   test_loggamma_taylor_transitionr  r  s    
 	*E!FFAKK1RUU7B'E{{1e$HAu	
266"U(	B
a"fa"fn%%'A<=>bGFOOB/01>G>hhwGR[['1ae4::< ?s   ('Dc            	      P   t        j                  dt        j                  t              d      } t        j                  ddt         j
                  z  d      }t        j                  | |      \  } }| t        j                  d|z        z  }t         j                  d|z   d|z   f   j                         }|D cg c]"  }|t        t        j                  |            f$ }}t        j                  |      }t        t        j                  |ddd	      j!                          y c c}w )
Nir    r   r   rh   r"   r%   r   rA   )r&   r'   log10r   r(   r   r   r)   r   r   r+   r   r   r-   r	   r/   r1   r   s         r6   test_loggamma_taylorr    s     	C"892>AKK1RUU7B'E{{1e$HAu	
266"U(	B
a"fa"fn%%'A<=>bGFOOB/01>G>hhwGR[['1ae4::< ?s   8'D#c            
         t         j                  t        j                  ddd       dt        j                  ddd      f   } | j                         }t        j                  | |      \  } }| d|z  z   }t        j
                  ddd      j                  ddd      }|t        j                  |f|j                  z        z   j                         }t        j                  d      5  |D cg c]"  }|t        t        j                  |            f$ }}d d d        t        j                        }t        t         j                  |ddd	
      j#                          y c c}w # 1 sw Y   PxY w)Nr{   ro   r   r"   iVr%   r>   r_   rA   )r&   r   r'   copyr   rt   r   dstacksizer   r   rC   r+   rgammar-   r	   r/   r1   )dxdyr   r   r5   r  r2   s          r6   test_rgamma_zerosr    s(    
BQ''BKKR,CC	DB	B[[R FB	beBIIar"**1a4E	B5+,	,557A		 A>?@Bb 123@@A hhwGRYYAE288: AA As   $E!)'EE!E!!E*c            
         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	|z  z   }|t        j                  |f|j                  z        z   j                         }t        j                  d
      5  |D cg c]"  }|t        t        j                  |            f$ }}d d d        t        j                        }t!        t"        j                  |ddd      j%                          y c c}w # 1 sw Y   PxY w)Nrl   rL   gQοr{   r    r   gQ?r"   r!   r%   r   rA   )r   findrootdigammarD   r*   r&   r-   r   r'   r  r   r	  r
  r   rC   r+   r	   r/   r1   )rootrootsr  r  r   r5   r  r2   s           r6   test_digamma_rootsr    s]    ??6>>3/D4[ME??6>>40D	LLtHHUOE 
ur{{2sB//BKKR4LdR	SB	B[[R FB	beB	B5+,	,557A		 B?@ABr 234AAB hhwGRZZ!QU399; BB Bs   F>'F9-F>9F>>Gc            
      f   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|z  z   j                         }t        j                  d      5  |D cg c]  }|t         | |            f }}d d d        t        j                        }t        t        j                  |dd	d
      j                          y c c}w # 1 sw Y   PxY w)N,  r>   r   r   rg   r"   (   r%   r@   rA   )r   r   r  r&   r'   r   r   r   rC   r+   rF   r	   r/   r1   )r  rI   rX   r5   r  r2   s         r6   test_digamma_negrealr    s     v~~.G	S#s	##A
r{{1b!$$aRA)>>?A;;q!DAq	
RTA		 ;89:"B,-::;jj!GRZZ!QU399; ;; ;s   7D'<D"D'"D''D0c            
         t        j                  ddd       } t        j                  g d      }t        j                  | |      \  } }| d|z  z   j	                         }t        j                  d      5  |D cg c]"  }|t        t        j                  |            f$ }}d d d        t        j                        }t        t        j                  |ddd	
      j                          y c c}w # 1 sw Y   PxY w)Nr  r  r>   )gffffffgg@gffffff@r"   r!   r   r%   r@   rA   )r&   r'   r-   r   r   r   rC   r+   r  rF   r	   r/   r1   rI   rX   r5   r  r2   s        r6   test_digamma_boundaryr    s    
 
S#s	##A
'(A;;q!DAq	
RTA		 B?@ABr 234AABjj!GRZZ!QU399; BB Bs   4C19'C, C1,C11C:c                  6   d} t        j                  d| z  d| z  d      }|j                         }t        j                  ||      \  }}|j	                         |j	                         }}t        j                  d      5  t        ||      D cg c])  \  }}||t        t        j                  ||d            f+ }}}d d d        t        j                        }t        t        j                  |ddd	
      j                          y c c}}w # 1 sw Y   QxY w)Nrh   rM   r   r:   r>   Trv   regularizedr?   r_   rA   )r&   r(   r  r   r   r   rC   ziprD   gammaincr-   r	   r/   r1   )smallrw   rI   a0x0r2   s         r6   test_gammainc_boundaryr&    s     E
CIqw+A	A;;q!DAq99;		qA		 ,!$Q,r2 E&//""MNO , ,, hhwGR[['6159??A	,, ,s   >D.D	<D	DDc            	         d } t        j                  dd      }t        j                  ddt        z        }dt        j                  |t        j                  d|z              z   j                         }t        j                  |D cg c]  }| | |      f c}      }t        t        j                  |ddd	      j                          y c c}w )
Nc                 F    t        t        j                  dd| z
              S Nr   r%   )r+   r   polylogr5   s    r6   spencez"test_spence_circle.<locals>.spence  s    v~~aQ/00r8   rM   rl   r   r   r%   r"   r   rA   )r&   r(   r   outerr)   r   rF   r	   r/   r,  r1   )r,  r3   r   r5   r  r2   s         r6   test_spence_circler.    s    1 	CAKK1R4 E	
RXXa5)*	*335AjjQ7r2vbz*78GRYYAE288: 8s   Cc                     t        j                  t              j                  } t         j                  t        j
                  ddd       dt        j
                  ddd      f   }|j                         }t        j                  ||      \  }}|d|z  z   }t        j                  ddd      j                  ddd      }|t        j                  |f|j                  z        z   j                         }t        j                  |D cg c]"  }|t        t        j                   |            f$ c}      }t#        t$        |ddd	| z  
      j'                          y c c}w )Nr   r  ro   r"   r>   r%   r{   r   rA   )r&   finforD   epsr   r'   r  r   rt   r   r	  r
  r   rF   r+   r   sinpir	   r   r1   r2  r  r  r   r   r5   r  r2   s           r6   test_sinpi_zerosr5    s   
((5/

C	AsA&&2;;sAq+AA	BB	B[[R FB	beBIIdC#++Aq"5E	B5+,	,557Ajj$%'  wv||B'789 ' (GVWa3/557's   'Ec                     t        j                  t              j                  } t         j                  t        j
                  ddd       dt        j
                  ddd      f   }|j                         }t        j                  ||      \  }}|d|z  z   }t        j                  ddd      dz   j                  ddd	      }|t        j                  |f|j                  z        z   j                         }t        j                  |D cg c]"  }|t        t        j                   |            f$ c}      }t#        t$        |ddd
| z        j'                          y c c}w )Nr   r  ro   r"   r0  r>   r%   rM   r{   r   rA   )r&   r1  rD   r2  r   r'   r  r   rt   r   r	  r
  r   rF   r+   r   cospir	   r   r1   r4  s           r6   test_cospi_zerosr8  (  s   
((5/

C	AsA&&2;;sAq+AA	BB	B[[R FB	beBYYtS!$s*33Aq"=E	B5+,	,557Ajj$%'  wv||B'789 ' (G VWa3/557's   'Ec            
         d } d }t        j                  ddd      }t         j                  t        j                  ddd       dt        j                  ddd      f   }g }|D ]G  }t	        t        j                  |            }|D ]"  }||z   }|j                  || |||      f       $ I t        j                  |      }t        | |d	d
d      j                          y )Nc                 4    t        j                  | |      d   S Nr   r/   ellipjums     r6   dnz"test_dn_quarter_period.<locals>.dn=  s    yyAq!!r8   c                 D    t        t        j                  d| |            S NrA  r>  )rD   r   ellipfunr>  s     r6   	mpmath_dnz)test_dn_quarter_period.<locals>.mpmath_dn@  s    V__TQ!455r8   r   r%   rh   r{   r  r    r?   r   r   rA   )r&   r(   r   r'   rD   r   ellipkr*   rF   r	   r1   )	rA  rE  r@  dur2   m0u0du0r4   s	            r6   test_dn_quarter_periodrK  ;  s    "6 	Aq"A	BR((!R[[b"-EE	FBG 66==$% 	6CSANNAr9Q#345	66
 jj!GR&!%0668r8   c                 `   t        j                  |      5  t        j                  |       } t        j                  | j                  t         j
                  z
  dt         j
                  z  z        }t        j                  t        j                  |       |      }d d d        |S # 1 sw Y   S xY wr;  )r   rC   mpcceilimagr   lambertwr)   )r5   r   unwindrY   s       r6   _mpmath_wrightomegarR  T  sy    		 5JJqMaffvyy01VYY;?@oofjjmV45 J	5 Js   BB##B-c                  
   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}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                                 t        j                  ||||f      }t        j                  | |      \  } }| d|z  z   j                         }t        j                  |D cg c]  }|t        t        |d            f c}      }	t        t        j                  |	ddd	      j!                          y c c}w )
Nr    r      r:   r{   r"   r%   :0yE>rA   )r&   r'   	nextafterr   infranger*   hstackr   r   rF   r+   rR  r	   r/   wrightomegar1   )
rI   picut_abovepicut_belownpicut_abovenpicut_belowirX   r5   r  r2   s
             r6   test_wrightomega_branchr`  \  s    
RB	A<<rvv./K<<w/0KLL"%%01LLL"%%"&&12L2Y E2<<B@A2<<B"&&ABBLLb)9266BCBLLb)9BFF7CD	E
 			;\<HIA;;q!DAq	
RTAjj$%'  w':2r'BCD ' (G R^^Wa6<<>'s   .J c                     t        j                  dd      } t        j                  ddt         j                  z        }t        j                  | |      \  } }| d|z  z   j	                         }t        j
                  |D cg c]  }|t        t        |d            f c}      }t        t        j                  |ddd      j                          y c c}w )	Nr}   r%   r   r"   rT  r   rp   rA   r&   r(   r   r   r   rF   r+   rR  r	   r/   rZ  r1   r  s        r6   test_wrightomega_region1rc  s  s     	BA
AqwA;;q!DAq	
RTAjj$%'  w':2r'BCD ' (G R^^Wa7==?'    Cc                     t        j                  dd      } t        j                  dt         j                  z  d      }t        j                  | |      \  } }| d|z  z   j	                         }t        j
                  |D cg c]  }|t        t        |d            f c}      }t        t        j                  |ddd      j                          y c c}w )	Nr}   r%   r{   r"   rT  r   rp   rA   rb  r  s        r6   test_wrightomega_region2rf    s     	BA
BruuHb!A;;q!DAq	
RTAjj$%'  w':2r'BCD ' (G R^^Wa7==?'rd  c                     t        j                  ddd      t        j                  ddd      }} t        j                  | |      \  } }| d|z  z   j                         }t        j                  |D cg c]"  }|t        t        j                  |            f$ c}      }t        t        j                  |ddd      j                          y c c}w )Nr{   r%   rT  r"   r   r@   rA   )r&   r(   r   r   rF   r+   r   rP  r	   r/   r1   r  s        r6   test_lambertw_smallzrh    s     ;;r1b!2;;r1b#9qA;;q!DAq	
RTAjj$%'  wvr':;< ' (G R[['1ae4::<'s   1'Cr=   maxprecmaxtermsz0.17c                   ^   e 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d Zd Zej<                  j?                  dd      d        Z d Z!ej<                  j?                  d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, Z.d- Z/d. Z0d/ Z1d0 Z2d1 Z3d2 Z4d3 Z5d4 Z6d5 Z7d6 Z8d7 Z9d8 Z:d9 Z;d: Z<d; Z=d< Z>d= Z?d> Z@d? ZAd@ ZBdA ZCdB ZDdC ZEdD ZFdE ZGdF ZHdG ZIdH ZJdI ZKdJ ZLdK ZMdL ZNdM ZOdN ZPej<                  j?                  dO      dP        ZQdQ ZRej<                  j?                  dO      dR        ZSeTdS        ZUdT ZVdU ZWej<                  j?                  ddV      dW        ZXdX ZYdY ZZdZ Z[ej<                  j?                  dO      d[        Z\eTd\        Z]ej<                  j?                  dO      d]        Z^ej<                  j                  d^      d_        Z`d` Zada Zbej<                  j?                  dO      db        Zcdc Zddd Zede ZfeTdf        Zgdg Zhej<                  j                  dh      di        Zidj ZjeTdk        Zkdl Zlej<                  j?                  ddm      dn        ZmeTdo        Zndp Zodq Zpej<                  j?                  dO      dr        Zqej<                  j?                  dds      dt        Zrdu Zsej<                  j?                  ddv      dw        Ztdx Zudy Zvej<                  j?                  dz{      d|        Zwd} Zxd~ Zyd Zzd Z{d Z|d Z}d Z~d Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zej<                  j?                  dd      d        Zy)TestSystematicc                     t        d t        j                  t        dd      gd       t        d t        j                  t        dd      g       y )	Nc                 2    t        j                  |       d   S Nr   r/   airyr+  s    r6   rV   z,TestSystematic.test_airyai.<locals>.<lambda>      bggajm r8       ח    חAh㈵>rA   c                 2    t        j                  |       d   S rp  rq  r+  s    r6   rV   z,TestSystematic.test_airyai.<locals>.<lambda>  rs  r8        @     @@)r   r   airyair   selfs    r6   test_airyaizTestSystematic.test_airyai  sC    3"MM s^,!%	' 	3"MM s^,	.r8   c                 N    t        d t        j                  t               g       y )Nc                 2    t        j                  |       d   S rp  rq  r+  s    r6   rV   z4TestSystematic.test_airyai_complex.<locals>.<lambda>  rs  r8   )r   r   rz  r   r{  s    r6   test_airyai_complexz"TestSystematic.test_airyai_complex  s    3"MM'\N	,r8   c                 p    t        d d t        dd      gd       t        d d t        d	d
      g       y )Nc                 2    t        j                  |       d   S Nr%   rq  r+  s    r6   rV   z2TestSystematic.test_airyai_prime.<locals>.<lambda>  rs  r8   c                 0    t        j                  | d      S Nr%   )
derivativer   rz  r+  s    r6   rV   z2TestSystematic.test_airyai_prime.<locals>.<lambda>      "MM!: r8   rt  ru  rv  rA   c                 2    t        j                  |       d   S r  rq  r+  s    r6   rV   z2TestSystematic.test_airyai_prime.<locals>.<lambda>  rs  r8   c                 0    t        j                  | d      S r  r  r+  s    r6   rV   z2TestSystematic.test_airyai_prime.<locals>.<lambda>  r  r8   rx  ry  r   r   r{  s    r6   test_airyai_primez TestSystematic.test_airyai_prime  ?    3 6; s^,!%	' 	3 6; s^,	.r8   c                 4    t        d d t               g       y )Nc                 2    t        j                  |       d   S r  rq  r+  s    r6   rV   z:TestSystematic.test_airyai_prime_complex.<locals>.<lambda>  rs  r8   c                 0    t        j                  | d      S r  r  r+  s    r6   rV   z:TestSystematic.test_airyai_prime_complex.<locals>.<lambda>  r  r8   r   r   r{  s    r6   test_airyai_prime_complexz(TestSystematic.test_airyai_prime_complex      3 6;'\N	,r8   c                 p    t        d d t        dd      gd       t        d d t        d	d
      g       y )Nc                 2    t        j                  |       d   S r;  rq  r+  s    r6   rV   z,TestSystematic.test_airybi.<locals>.<lambda>  rs  r8   c                 ,    t        j                  |       S rP   r   airybir+  s    r6   rV   z,TestSystematic.test_airybi.<locals>.<lambda>      "MM!, r8   rt  ru  rv  rA   c                 2    t        j                  |       d   S r;  rq  r+  s    r6   rV   z,TestSystematic.test_airybi.<locals>.<lambda>  rs  r8   c                 ,    t        j                  |       S rP   r  r+  s    r6   rV   z,TestSystematic.test_airybi.<locals>.<lambda>  r  r8   rx  ry  r  r{  s    r6   test_airybizTestSystematic.test_airybi  s?    3 6- s^,!%	' 	3 6- s^,	.r8   c                 4    t        d d t               g       y )Nc                 2    t        j                  |       d   S r;  rq  r+  s    r6   rV   z4TestSystematic.test_airybi_complex.<locals>.<lambda>  rs  r8   c                 ,    t        j                  |       S rP   r  r+  s    r6   rV   z4TestSystematic.test_airybi_complex.<locals>.<lambda>  r  r8   r  r{  s    r6   test_airybi_complexz"TestSystematic.test_airybi_complex  s    3 6-'\N	,r8   c                 p    t        d d t        dd      gd       t        d d t        d	d
      g       y )Nc                 2    t        j                  |       d   S Nro   rq  r+  s    r6   rV   z2TestSystematic.test_airybi_prime.<locals>.<lambda>  rs  r8   c                 0    t        j                  | d      S r  r  r+  s    r6   rV   z2TestSystematic.test_airybi_prime.<locals>.<lambda>  r  r8   rt  ru  rv  rA   c                 2    t        j                  |       d   S r  rq  r+  s    r6   rV   z2TestSystematic.test_airybi_prime.<locals>.<lambda>  rs  r8   c                 0    t        j                  | d      S r  r  r+  s    r6   rV   z2TestSystematic.test_airybi_prime.<locals>.<lambda>  r  r8   rx  ry  r  r{  s    r6   test_airybi_primez TestSystematic.test_airybi_prime  r  r8   c                 4    t        d d t               g       y )Nc                 2    t        j                  |       d   S r  rq  r+  s    r6   rV   z:TestSystematic.test_airybi_prime_complex.<locals>.<lambda>  rs  r8   c                 0    t        j                  | d      S r  r  r+  s    r6   rV   z:TestSystematic.test_airybi_prime_complex.<locals>.<lambda>  r  r8   r  r{  s    r6   test_airybi_prime_complexz(TestSystematic.test_airybi_prime_complex  r  r8   c                 d    t        t        j                  t        d       t	        dd      g       y )Nc                 8    t        j                  d| fi t        S rp  )r   beiHYPERKWr+  s    r6   rV   z)TestSystematic.test_bei.<locals>.<lambda>      vzz!Q7R'7R r8   rx  ry  )r   r/   r  r   r   r{  s    r6   test_beizTestSystematic.test_bei  %    BFF,-RS s^,	.r8   c                 d    t        t        j                  t        d       t	        dd      g       y )Nc                 8    t        j                  d| fi t        S rp  )r   berr  r+  s    r6   rV   z)TestSystematic.test_ber.<locals>.<lambda>  r  r8   rx  ry  )r   r/   r  r   r   r{  s    r6   test_berzTestSystematic.test_ber  r  r8   c                 >    t        d d t        dd      gdd       y )Nc                 V    t        j                  t        |             t        |          S rP   )r/   	bernoullir   rH   s    r6   rV   z/TestSystematic.test_bernoulli.<locals>.<lambda>  s    bll3q6&:3q6&B r8   c                 P    t        t        j                  t        |                   S rP   )rD   r   r  r   r  s    r6   rV   z/TestSystematic.test_bernoulli.<locals>.<lambda>  s    eF,<,<SV,D&E r8   r   i2  r   rB   rH   )r   r   r{  s    r6   test_bernoullizTestSystematic.test_bernoulli  s"    BE#Au-.!%	0r8   c                 z    t        t        j                  t        d       t	        dd      t	               gd       y )Nc                 8    t        j                  | |fi t        S rP   r   besselir  rT   s     r6   rV   z-TestSystematic.test_besseli.<locals>.<lambda>      &..A*I*I r8   }Ô%I}Ô%ITgJD)rs   )r   r/   ivr   r   r{  s    r6   test_besselizTestSystematic.test_besseli  s.    EEIJ'		
r8   c                 \    t        d t        d       t        dd      t               g       y )Nc                 B    t        j                  | j                  |      S rP   )r/   r  rS   rT   s     r6   rV   z5TestSystematic.test_besseli_complex.<locals>.<lambda>      qvvq) r8   c                 8    t        j                  | |fi t        S rP   r  rT   s     r6   rV   z5TestSystematic.test_besseli_complex.<locals>.<lambda>  r  r8   r  r  r   r   r   r   r{  s    r6   test_besseli_complexz#TestSystematic.test_besseli_complex  '    )IJ.	
r8   c           	          t        t        j                  t        d       t	        dd      t	        dd      gd       t        t        j                  t        d       t	        dd      t	        d	d
      gdd       y )Nc                 8    t        j                  | |fi t        S rP   r   besseljr  rT   s     r6   rV   z-TestSystematic.test_besselj.<locals>.<lambda>  r  r8   r  r  rx  ry  Tr   c                 8    t        j                  | |fi t        S rP   r  rT   s     r6   rV   z-TestSystematic.test_besselj.<locals>.<lambda>  r  r8   rt  ru  rv  )r   rB   )r   r/   jvr   r   r{  s    r6   test_besseljzTestSystematic.test_besselj  sg    EEIJT30 		
 	EEIJT30 	
r8   c                 X    t        d t        d       t               t               g       y )Nc                 B    t        j                  | j                  |      S rP   )r/   r  rS   rT   s     r6   rV   z5TestSystematic.test_besselj_complex.<locals>.<lambda>  r  r8   c                 8    t        j                  | |fi t        S rP   r  rT   s     r6   rV   z5TestSystematic.test_besselj_complex.<locals>.<lambda>  r  r8   r  r{  s    r6   test_besselj_complexz#TestSystematic.test_besselj_complex  s"    )IJUJL!	
r8   c           	          t        t        j                  t        j                  t        dd      t        dt        j                        gdd       y Nr   r=   r   Fr_   nan_okrB   )r   r/   kvr   besselkr   r&   rW  r{  s    r6   test_besselkzTestSystematic.test_besselk   s6    EENNs^SBFF^,	
r8   c           	          t        t        j                  t        j                  t        dd      t        dt        j                        gdd       y r  )	r   r/   knr   r  r   r   r&   rW  r{  s    r6   test_besselk_intzTestSystematic.test_besselk_int)  s7    EENND#Arvv/	
r8   c                 \    t        d t        d       t        dd      t               g       y )Nc                 B    t        j                  | j                  |      S rP   )r/   r  rS   rT   s     r6   rV   z5TestSystematic.test_besselk_complex.<locals>.<lambda>4  r  r8   c                 8    t        j                  | |fi t        S rP   )r   r  r  rT   s     r6   rV   z5TestSystematic.test_besselk_complex.<locals>.<lambda>5  r  r8   r  r  r  r{  s    r6   test_besselk_complexz#TestSystematic.test_besselk_complex2  r  r8   c           	          d }t        t        j                  t        |      t	        dd      t	        dd      gd       y )Nc                     t        t        j                  | |fi t              }t	        |      dkD  r&t
        j                  t        j                  |      z  }t	        |      dk(  r|dk(  rt
        j                  S |S )NقnQ:Br   )	rD   r   besselyr  r   r&   rW  signnanrU   rI   r3   s      r6   	mpbesselyz.TestSystematic.test_bessely.<locals>.mpbessely:  s\    fnnQ5W56A1v~FFRWWQZ'1v{qAvvvHr8   r  r  rt  ru    r  )r   r/   yvr   r   r|  r  s     r6   test_besselyzTestSystematic.test_bessely9  s8    	 	EEY'T30		
r8   c                 `    d }t        d t        |      t               t               gd       y )Nc                    t        t        j                  | |fi t              }t	        |      dkD  rGt        j                  d      5  t
        j                  t        j                  |      z  }d d d        |S |S # 1 sw Y   |S xY w)Nr  r   r   )	r+   r   r  r  r   r&   r   rW  r  r  s      r6   r  z6TestSystematic.test_bessely_complex.<locals>.mpbesselyK  sg    q!7w78A1v~[[2 ,+A,H1H,Hs   	'A<<Bc                 B    t        j                  | j                  |      S rP   )r/   r  rS   rT   s     r6   rV   z5TestSystematic.test_bessely_complex.<locals>.<lambda>S  r  r8   i:  r  r  r  s     r6   test_bessely_complexz#TestSystematic.test_bessely_complexJ  s+    	 	)Y'UJL!		
r8   c           	      d    d }t        d t        |      t        dd      t        dd      g       y )Nc                     t        t        j                  | |            }t        |      dk(  r|dk(  rt        j
                  S |S rp  )rD   r   r  r   r&   r  r  s      r6   r  z2TestSystematic.test_bessely_int.<locals>.mpbesselyZ  s6    fnnQ*+A1v{qAvvvHr8   c                 @    t        j                  t        |       |      S rP   )r/   ynr   rT   s     r6   rV   z1TestSystematic.test_bessely_int.<locals>.<lambda>a  s    s1vq) r8   r~     rt  ru  r   r   r   r   r  s     r6   test_bessely_intzTestSystematic.test_bessely_intY  s1    	 	)Y'E4 #dC.1	
r8   c                     g dfd	t        t        j                  fdt               t               gdd       t        t        j                  t	        j
                        ddd       y )	Nc                     | dk  s|dk  rt         j                  S | dk  s|dk  rTt        t        | |z               dz  dk(  r7|r5j	                  t        |       t        |      f       t         j                  S t        j                  | |      S )Ng   mr   r%   )r&   r  r   rD   r*   r   r   )rw   rv   nonzero
bad_pointss      r6   r   z&TestSystematic.test_beta.<locals>.betai  s{    5yAI vvAQSq1u%6%:q$@ %%uQxq&:;66M;;q!$$r8   c                      | |d      S NT)r   )rw   rv   r   s     r6   rV   z*TestSystematic.test_beta.<locals>.<lambda>z  s    aD1 r8   r   Tr   r   dy=)r   r   rs   F)r   r/   r   r   r&   r-   )r|  r  r   s    @@r6   r   zTestSystematic.test_betaf  s[    
	% 	GG1UCEN 	
 	GGHHZ  	
r8   c                     t        t        j                   t               t	        d             t               t               t               g       y )Nc                 6    t        j                  | |d|d      S )Nr   Tr   r   betaincrw   rv   rI   s      r6   rV   z-TestSystematic.test_betainc.<locals>.<lambda>      FNN1aA4$P r8   )r   r/   r  r   r   r   r{  s    r6   test_betainczTestSystematic.test_betainc  s:    JJLN P
 UCE35!	
r8   c                     t        t        j                   t               t	        d             t               t               t               gd       y )Nc                 6    t        j                  | ||dd      S )Nr%   Tr  r  r  s      r6   rV   z.TestSystematic.test_betaincc.<locals>.<lambda>  r  r8   r   r   )r   r/   betainccr   r   r   r{  s    r6   test_betaincczTestSystematic.test_betaincc  s=    KKLN P
 UCE35!		
r8   c                     g dfd	t        t        j                  fdt               t               gd       t        t        j                  t	        j
                        dd       y )Nc           	      z   t        |      dt        |       dz   z  kD  rt        j                  S | |k  rst        t        | |z
        t        j                  t        | |z
              z
        dk  r7|r5j                  t        |       t        |      f       t        j                  S t        j                  | |      S )Nru  r%   rp   )r   r&   r  rD   r   r*   r   binomial)rH   kr  r  s      r6   r  z+TestSystematic.test_binom.<locals>.binomial  s    1vSVaZ(( vv1uU1Q3Z"((51:*>>?%G %%uQxq&:;66M??1a((r8   c                      | |d      S r  r  )rH   r  r  s     r6   rV   z+TestSystematic.test_binom.<locals>.<lambda>  s    !Q5 r8   r   r  r   r   rs   r  )r   r/   binomr   r&   r-   )r|  r  r  s    @@r6   
test_binomzTestSystematic.test_binom  sU    
	) 	HH5UCEN		
 	HHHHZ 	
r8   c                 \    t        d t        d       t               t               gd       y )Nc                 @    t        j                  t        |       |      S rP   )r/   eval_chebytr   rH   rI   s     r6   rV   z0TestSystematic.test_chebyt_int.<locals>.<lambda>      A2 r8   c                 8    t        j                  | |fi t        S rP   )r   chebytr  r!  s     r6   rV   z0TestSystematic.test_chebyt_int.<locals>.<lambda>      &--1*H*H r8   r:   r  r  r{  s    r6   test_chebyt_intzTestSystematic.test_chebyt_int  %    2HIXsu		
r8   Fz'some cases in hyp2f1 not fully accurate)runr   c                 h    t        t        j                  d t        dd      t               gd       y )Nc                 h      t               t        t        j                              | |fi t        S rP   )r   r   r   r$  r  r!  s     r6   rV   z,TestSystematic.test_chebyt.<locals>.<lambda>  2      / r8   e   '  r  )r   r/   r   r   r{  s    r6   test_chebytzTestSystematic.test_chebyt  s+    NN s^SU#	
r8   c                 \    t        d t        d       t               t               gd       y )Nc                 @    t        j                  t        |       |      S rP   )r/   eval_chebyur   r!  s     r6   rV   z0TestSystematic.test_chebyu_int.<locals>.<lambda>  r"  r8   c                 8    t        j                  | |fi t        S rP   )r   chebyur  r!  s     r6   rV   z0TestSystematic.test_chebyu_int.<locals>.<lambda>  r%  r8   r:   r  r  r{  s    r6   test_chebyu_intzTestSystematic.test_chebyu_int  r'  r8   c                 d    t        t        j                  d t        dd      t               g       y )Nc                 h      t               t        t        j                              | |fi t        S rP   )r   r   r   r4  r  r!  s     r6   rV   z,TestSystematic.test_chebyu.<locals>.<lambda>  r+  r8   r,  r-  )r   r/   r2  r   r{  s    r6   test_chebyuzTestSystematic.test_chebyu  s(    NN s^SU#	
r8   c                     d }t        |t        j                  t               g       t        |t        j                  t	        g d      g       y )Nc                 2    t        j                  |       d   S r  r/   shichir   s    r6   chiz$TestSystematic.test_chi.<locals>.chi      99Q<?"r8   gU@X   g   V@)r   r   r=  r   r   r|  r=  s     r6   test_chizTestSystematic.test_chi  4    	#CceW5Ch7Q.R-STr8   c                     d }t        |t        j                  t        t	        t
        j                   d      t	        t
        j                  d            gd       y )Nc                 2    t        j                  |       d   S r  r;  r+  s    r6   r=  z,TestSystematic.test_chi_complex.<locals>.chi  r>  r8   rt  ru  r_   rA   )r   r   r=  r   r+   r&   rW  rA  s     r6   test_chi_complexzTestSystematic.test_chi_complex  C    	# 	JJ.0DEF		
r8   c                 V    d }t        |t        j                  t        dd      g       y )Nc                 2    t        j                  |       d   S r  r/   sicir   s    r6   ciz"TestSystematic.test_ci.<locals>.ci      771:a= r8   rt  ru  )r   r   rL  r   r|  rL  s     r6   test_cizTestSystematic.test_ci  s"    	! 	B		CcN+;<r8   c                     d }t        |t        j                  t        t	        dt
        j                         t	        dt
        j                              gd       y )Nc                 2    t        j                  |       d   S r  rJ  r+  s    r6   rL  z*TestSystematic.test_ci_complex.<locals>.ci  rM  r8   rt  ru  rU  rA   )r   r   rL  r   r+   r&   rW  rN  s     r6   test_ci_complexzTestSystematic.test_ci_complex  sC    	! 	IIrvvg.RVV0DEF		
r8   c                     t        j                  t              j                  }t	        t
        t        j                  t               gdd|z         y NFr   r  )	r&   r1  rD   r2  r   r   r   r7  r   r|  r2  s     r6   
test_cospizTestSystematic.test_cospi	  s2    hhuo!!FFLL35'%aPSeTr8   c                 Z    t        t        t        j                  t	               gdd       y )NFr@   r  )r   r   r   r7  r   r{  s    r6   test_cospi_complexz!TestSystematic.test_cospi_complex  !    LL\N	
r8   c                     t        t        j                  t        t        j                        t               gdd       y )Nr_   r:   rB   r   )r   r/   r  r   r   r   r{  s    r6   test_digammazTestSystematic.test_digamma  s*    JJV^^,UG	
r8   c                     d }t        t        j                  t        t        j                        t               gdd|       y )Nc                     t        j                  | j                  dk  t        j                  | j                        dk  z  dd      S )Nr   gQ?FT)r&   whererS   r   rO  r+  s    r6   param_filterz9TestSystematic.test_digamma_complex.<locals>.param_filter"  s3    88QVVaZBFF166NT,ABE4PPr8   r@   r  rB   r   r`  )r   r/   r  r   r   r   )r|  r`  s     r6   test_digamma_complexz#TestSystematic.test_digamma_complex  s5    	Q 	JJV^^,\N%	
r8   c                 l    t        t        j                  t        j                  t               gd       y )Nr   rA   )r   r/   exp1r   e1r   r{  s    r6   test_e1zTestSystematic.test_e1.  s"    GGIIUG		
r8   c                    t        t        j                  t        j                  t        t        t        j                   d      t        t        j                  d            g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z  z   j                         d       t        t        j                  t        j                  t        j                  ddd      dz   d       y )Nrt  ru  r  rA   r:      r   r   r   =   r   r"   ir.  y                )r   r/   rd  r   re  r   r+   r&   rW  r(   r   r'   r   r{  s    r6   test_e1_complexzTestSystematic.test_e1_complex6  s    GGII.0DEF		
 	GGII[[b#&q$w/uuQB2.RB1G0GGHKLMRUW	
 	GGII[[c5)B.		
r8   c                    t        t        j                  d t        t	        j
                  t	        j                  t        j                        j                         t	        j
                  t	        j                  t        j                        j                              g       t        t        j                  d t	        j                  dddddt        j                  g      d	
       t        t	        j                  t        j                  t        j                                     t        t        j                  t        j                         dk(         y )Nc                 f    | dk7  rt        j                  |       | z  S t        j                  d      S Nr   z1.0r   expm1mpfr   s    r6   rV   z,TestSystematic.test_exprel.<locals>.<lambda>Q  &    16fll1oa' vzz%7H r8   r   c                 f    | dk7  rt        j                  |       | z  S t        j                  d      S rn  ro  r   s    r6   rV   z,TestSystematic.test_exprel.<locals>.<lambda>W  rr  r8   r_   gW:r   g   mBgyCxDr  rA   )r   r/   exprelr   r&   r   r1  r   r   r-   rW  r   isinfr{  s    r6   test_exprelzTestSystematic.test_exprelN  s    IIHBFF288BJJ/334466"((2::.2235 6	
 	IIHHHeUAtT266:;		
 	266*+,		266'"a'(r8   c                     t        t        j                  t        j                  t	        t        t        j                   d      t        t        j                  d            g       y )N    c    cA)r   r/   rp  r   r   r+   r&   rW  r{  s    r6   test_expm1_complexz!TestSystematic.test_expm1_complex^  s=    HHLL.0DEF	
r8   c                 R    t        t        j                  d t               gd       y )Nc                 2    t        j                  | dz         S r  r   r   r   s    r6   rV   z3TestSystematic.test_log1p_complex.<locals>.<lambda>i  s    fjj1o r8   <   r  )r   r/   log1pr   r{  s    r6   test_log1p_complexz!TestSystematic.test_log1p_complexf  s    HH%\N		
r8   c                 @    t        t        d t               gdd       y )Nc                 8    t        j                  | dz         | z
  S r  r}  r   s    r6   rV   z-TestSystematic.test_log1pmx.<locals>.<lambda>q  s    fjjQ'!+ r8   r~  r   )r   rB   )r   r   r   r{  s    r6   test_log1pmxzTestSystematic.test_log1pmxn  s    +UG	
r8   c                 l    t        t        j                  t        j                  t               gd       y )Nr  rA   )r   r/   r0   r   r,   r   r{  s    r6   test_eizTestSystematic.test_eiw  s    BGGVYYeDr8   c                     t        t        j                  t        j                  t        t        t        j                   d      t        t        j                  d            gd       y )Nrt  ru  r   rA   )	r   r/   r0   r   r,   r   r+   r&   rW  r{  s    r6   test_ei_complexzTestSystematic.test_ei_complexz  s@    GGII.0DEF		
r8   c                 l    t        t        j                  t        j                  t	        d      g       y )Nr   rv   )r   r/   elliper   r   r{  s    r6   test_ellipezTestSystematic.test_ellipe  s    BIIv}}sSzlCr8   c                     t        t        j                  t        j                  t        dd      t        d      g       y )Nrx  ry  r   r  r   r/   	ellipeincr   r  r   r{  s    r6   test_ellipeinczTestSystematic.test_ellipeinc  s&    BLL&--#dC.#PS*9UVr8   c                 z    t        t        j                  t        j                  t               t               g       y rP   r  r{  s    r6   test_ellipeinc_largephiz&TestSystematic.test_ellipeinc_largephi      BLL&--#%Hr8   c                 ~    t        t        j                  t        j                  t        dd      t               g       y Nrx  ry  r   r/   	ellipkincr   ellipfr   r{  s    r6   test_ellipfzTestSystematic.test_ellipf  s#    BLL&--#dC.#%9PQr8   c                 z    t        t        j                  t        j                  t               t               g       y rP   r  r{  s    r6   test_ellipf_largephiz#TestSystematic.test_ellipf_largephi  r  r8   c                     t        t        j                  t        j                  t	        d      g       t        t        j
                  d t	        d      gd       y )Nr   r  c                 2    t        j                  d| z
        S r  )r   rF  )r@  s    r6   rV   z,TestSystematic.test_ellipk.<locals>.<lambda>  s    fmmAE* r8   g        )rw   r   r  )r   r/   rF  r   r   ellipkm1r{  s    r6   test_ellipkzTestSystematic.test_ellipk  s:    BIIv}}sSzlCKK*3ZL		
r8   c                 p    d }t        t        j                  |t        dd      t        d      gd       y )Nc                 0    t        j                  d| |      S rp  r   ellippiphir@  s     r6   r  z0TestSystematic.test_ellipkinc.<locals>.ellipkinc      >>!S!,,r8   rx  ry  r   r  Tr  r   r/   r  r   r|  r  s     r6   test_ellipkinczTestSystematic.test_ellipkinc  s.    	-LLs^S3Z( 		
r8   c                 l    d }t        t        j                  |t               t        d      gd       y )Nc                 0    t        j                  d| |      S rp  r  r  s     r6   r  z9TestSystematic.test_ellipkinc_largephi.<locals>.ellipkinc  r  r8   r   r  Tr  r  r  s     r6   test_ellipkinc_largephiz&TestSystematic.test_ellipkinc_largephi  s*    	-LLUC#J 		
r8   c           	      X    d }t        d |t        dd      t        dd      gd	       y )
Nc                 >    | dk(  ryt        j                  d| |      S )Nr   snr>  r   rD  r>  s     r6   r  z+TestSystematic.test_ellipfun_sn.<locals>.sn  s    AvtqA66r8   c                 4    t        j                  | |      d   S rp  r<  r>  s     r6   rV   z1TestSystematic.test_ellipfun_sn.<locals>.<lambda>      1a+ r8       .    .Ar   r%   r   rU  rA   r  )r|  r  s     r6   test_ellipfun_snzTestSystematic.test_ellipfun_sn  s.    	7 	+s^S1]+		
r8   c           	      T    t        d d t        dd      t        dd      gd	       y )
Nc                 4    t        j                  | |      d   S r  r<  r>  s     r6   rV   z1TestSystematic.test_ellipfun_cn.<locals>.<lambda>  r  r8   c                 2    t        j                  d| |      S )Ncnr>  r  r>  s     r6   rV   z1TestSystematic.test_ellipfun_cn.<locals>.<lambda>      a8 r8   r  r  r   r%   r   rU  rA   r  r{  s    r6   test_ellipfun_cnzTestSystematic.test_ellipfun_cn  '    +8s^S1]+		
r8   c           	      T    t        d d t        dd      t        dd      gd	       y )
Nc                 4    t        j                  | |      d   S r;  r<  r>  s     r6   rV   z1TestSystematic.test_ellipfun_dn.<locals>.<lambda>  r  r8   c                 2    t        j                  d| |      S rC  r  r>  s     r6   rV   z1TestSystematic.test_ellipfun_dn.<locals>.<lambda>  r  r8   r  r  r   r%   r   rU  rA   r  r{  s    r6   test_ellipfun_dnzTestSystematic.test_ellipfun_dn  r  r8   c                 N    t        t        j                  d t               g       y )Nc                 ,    t        j                  |       S rP   r   r   r+  s    r6   rV   z)TestSystematic.test_erf.<locals>.<lambda>      fjjm r8   )r   r/   r   r   r{  s    r6   test_erfzTestSystematic.test_erf  s    BFF$;ceWEr8   c                 R    t        t        j                  d t               gd       y )Nc                 ,    t        j                  |       S rP   r  r+  s    r6   rV   z1TestSystematic.test_erf_complex.<locals>.<lambda>  r  r8   r=   r  )r   r/   r   r   r{  s    r6   r   zTestSystematic.test_erf_complex  s    BFF$;jl^sSr8   c                 d    t        t        j                  t        d       t	               gd       y )Nc                 ,    t        j                  |       S rP   r   r   r+  s    r6   rV   z*TestSystematic.test_erfc.<locals>.<lambda>      v{{1~ r8   r@   rA   )r   r/   r   r   r   r{  s    r6   	test_erfczTestSystematic.test_erfc  s$    GG56UG		
r8   c                 d    t        t        j                  t        d       t	               gd       y )Nc                 ,    t        j                  |       S rP   r  r+  s    r6   rV   z2TestSystematic.test_erfc_complex.<locals>.<lambda>  r  r8   r=   r  )r   r/   r   r   r   r{  s    r6   test_erfc_complexz TestSystematic.test_erfc_complex  s$    GG56\N		
r8   c                 l    t        t        j                  t        j                  t	               gd       y Nr=   r  )r   r/   erfir   r   r{  s    r6   	test_erfizTestSystematic.test_erfi  s    BGGV[[35'SAr8   c                 l    t        t        j                  t        j                  t	               gd       y r  )r   r/   r  r   r   r{  s    r6   test_erfi_complexz TestSystematic.test_erfi_complex  s    BGGV[[:<.CHr8   c                 d    t        t        j                  t        d       t	               gd       y )Nc                 ,    t        j                  |       S rP   )r   ncdfr+  s    r6   rV   z*TestSystematic.test_ndtr.<locals>.<lambda>  r  r8   r=   r  )r   r/   ndtrr   r   r{  s    r6   	test_ndtrzTestSystematic.test_ndtr  s$    GG56UG		
r8   c                     t        t        j                  d t        t	        dd      t	        dd            gd       y )Nc                 `    t        j                  |  t        j                  d      z        dz  S Ng       @)r   r   r&   sqrtr+  s    r6   rV   z2TestSystematic.test_ndtr_complex.<locals>.<lambda>  s"    fkk1"RWWR[.1"4 r8   r.  r   r   r  )r   r/   r  r   r+   r{  s    r6   test_ndtr_complexz TestSystematic.test_ndtr_complex  s2    GG4'&&1WUE5JKL		
r8   c                 h    t        t        j                  t        d       t	               gddd       y )Nc                 R    t        j                  t        j                  |             S rP   )r   r   r  r+  s    r6   rV   z.TestSystematic.test_log_ndtr.<locals>.<lambda>  s    vzz&++a.'A r8   iX  r  r@   rH   r   rB   )r   r/   log_ndtrr   r   r{  s    r6   test_log_ndtrzTestSystematic.test_log_ndtr  s'    KKABUGs%	
r8   c                     t        t        j                  t        d       t	        t        dd      t        dd            gdd	       y )
Nc                     t        j                  t        j                  |  t        j                  d      z        dz        S r  )r   r   r   r&   r  r+  s    r6   rV   z6TestSystematic.test_log_ndtr_complex.<locals>.<lambda>	  s+    vzz&++qbn2Mb2P'Q r8   r  r0  r.  r>   r   r=   r  rH   r   )r   r/   r  r   r   r+   r{  s    r6   test_log_ndtr_complexz$TestSystematic.test_log_ndtr_complex  s:    KKQR'&$/75#3FGHs		
r8   c                 V    t        d t        j                  t        dd      gd       y )Nc                 2    t        j                  |       d   S )Nr{   )r/   eulerr  s    r6   rV   z.TestSystematic.test_eulernum.<locals>.<lambda>  s    bhhqk"o r8   r%   r.  r  )r   r   eulernumr   r{  s    r6   test_eulernumzTestSystematic.test_eulernum  s$    %OOAu		
r8   c           	          t        t        j                  t        j                  t        dd      t        dt        j                        gdd       y )Nr   r=   r@      r[  )	r   r/   rG   r   rE   r   r   r&   rW  r{  s    r6   test_expintzTestSystematic.test_expint  s6    GGMMAs^SBFF^,	
r8   c                 R    d }t        |t        j                  t               g       y )Nc                 2    t        j                  |       d   S rp  r/   fresnelr   s    r6   fresnelsz.TestSystematic.test_fresnels.<locals>.fresnels       ::a=##r8   )r   r   r  r   )r|  r  s     r6   test_fresnelszTestSystematic.test_fresnels      	$Hfoow?r8   c                 R    d }t        |t        j                  t               g       y )Nc                 2    t        j                  |       d   S r  r  r   s    r6   fresnelcz.TestSystematic.test_fresnelc.<locals>.fresnelc%  r  r8   )r   r   r  r   )r|  r  s     r6   test_fresnelczTestSystematic.test_fresnelc$  r  r8   c                 z    t        t        j                  t        t        j                        t               g       y rP   )r   r/   gammar   r   r   r{  s    r6   
test_gammazTestSystematic.test_gamma)  s     BHH&6v||&DsugNr8   c                 ~    t        t        j                  t        t        j                        t               gd       y Nrq   rA   )r   r/   r  r   r   r   r{  s    r6   test_gamma_complexz!TestSystematic.test_gamma_complex,  s'    HHV\\*\N		
r8   c           	      r    t        t        j                  d t        ddd      t        dd      gdd       y )Nc                 2    t        j                  | |d      S )NTr  r   r"  )r5   rv   s     r6   rV   z.TestSystematic.test_gammainc.<locals>.<lambda>8      aTB r8   r        @Finclusive_ar  r  )r   r/   r"  r   r{  s    r6   test_gammainczTestSystematic.test_gammainc4  s1    KKBCU+SC[9	
r8   c           	      r    t        t        j                  d t        ddd      t        dd      gdd       y )Nc                 2    t        j                  | |d      S )NT)rw   r   r  )r5   rw   s     r6   rV   z/TestSystematic.test_gammaincc.<locals>.<lambda>B  r  r8   r   r  Fr  r  r  )r   r/   	gammainccr   r{  s    r6   test_gammaincczTestSystematic.test_gammaincc>  s1    LLBCU+SC[9	
r8   c                 d    d }t        t        j                  t        |      t	               g       y )Nc                 @    t        j                  |       j                  S rP   r   r   rS   r+  s    r6   fz&TestSystematic.test_gammaln.<locals>.fJ  s    ??1%***r8   )r   r/   gammalnr   r   )r|  r  s     r6   test_gammalnzTestSystematic.test_gammalnH  s#    	+ 	BJJ(8(;ceWEr8   )r(  c                     t        t        j                  t        t        j
                        t        dd      t               t               g       y r  )r   r/   eval_gegenbauerr   r   
gegenbauerr   r{  s    r6   test_gegenbauerzTestSystematic.test_gegenbauerO  s5    V../s^SUCE*	
r8   c                    d }d }t        |t        |      t        dd      t        dd      t               gdddd	
       t        |t        |      t        dd      t               t	        t        j                  ddd            gdd       y )Nc                    t        |      dkD  rt        j                  S | dk(  rd}n%| dk(  r	d|z  |z  }nt        j                  | ||      }t        |      dk(  r|dk  rt        |      t        t        |            k(  rct        j                  | |t        j                  d      z   |      }t        |      t        j                  d      k  rt        j                  d      }t        |      d	kD  rt        j                  S |S )
Nr  r   r   r%   r   r{   z1e-50z0.0\4@Iw)	r   r&   r  r   r  rD   r   rq  rW  rH   rw   rI   r3   s       r6   r  z6TestSystematic.test_gegenbauer_int.<locals>.gegenbauerY  s     1v~vv AvaaCE%%aA. Qx1}RE!HE!H,E%%aVZZ-@)@!Dq6FJJw//

5)A 1v~vvHr8   c                     t        j                  t        |       ||      }t        |      dkD  rt        j
                  S |S )Nr  )r/   r  r   r   r&   rW  r  s       r6   sc_gegenbauerz9TestSystematic.test_gegenbauer_int.<locals>.sc_gegenbauert  s3    ""3q61a0A1v~vvHr8   r   r>   g    eg    eAi@  Tr   )rH   r   r   rB   r  r!   r  )r   r   r   r   r   r&   r'   )r|  r  r  s      r6   test_gegenbauer_intz"TestSystematic.test_gegenbauer_intW  s    	6	 	Z(As^Ss^SU3d		
 	Z(As^SUHR[[b"-E$FGT		
r8   c                     t        d t        t        j                        t	        dd      t               t               g       y )Nc                 V    t        j                  t        |       |j                  |      S rP   )r/   r  r   rS   rH   rw   rI   s      r6   rV   z8TestSystematic.test_gegenbauer_complex.<locals>.<lambda>  s    B..s1vqvvqA r8   r   r>   )r   r   r   r  r   r   r   r{  s    r6   test_gegenbauer_complexz&TestSystematic.test_gegenbauer_complex  s/    AV../As^SUJL1	
r8   c                     t        d t        t        j                        t	        dd      t	               t               g       y )Nc                 X    t        j                  | j                  |j                  |      S rP   )r/   r  rS   r#  s      r6   rV   z@TestSystematic.test_gegenbauer_complex_general.<locals>.<lambda>  s    B..qvvqvvqA r8   rx  ry  )r   r   r   r  r   r   r{  s    r6   test_gegenbauer_complex_generalz.TestSystematic.test_gegenbauer_complex_general  s/    AV../s^SUJL1	
r8   c                 v    t        t        j                  t        d       t	        dd      t	               g       y )Nc                 8    t        j                  | |fi t        S rP   )r   hankel1r  rU   rI   s     r6   rV   z-TestSystematic.test_hankel1.<locals>.<lambda>  r  r8   @x@xD)r   r/   r*  r   r   r{  s    r6   test_hankel1zTestSystematic.test_hankel1  +    JJIJsu%	
r8   c                 v    t        t        j                  t        d       t	        dd      t	               g       y )Nc                 8    t        j                  | |fi t        S rP   )r   hankel2r  r+  s     r6   rV   z-TestSystematic.test_hankel2.<locals>.<lambda>  r  r8   r,  r-  )r   r/   r2  r   r   r{  s    r6   test_hankel2zTestSystematic.test_hankel2  r/  r8   z%issues at intermediately large ordersc                 v    t        d t        t        j                        t	        dd      t               g       y )Nc                 @    t        j                  t        |       |      S rP   )r/   eval_hermiter   r!  s     r6   rV   z-TestSystematic.test_hermite.<locals>.<lambda>      Q3 r8   r   r.  )r   r   r   hermiter   r   r{  s    r6   test_hermitezTestSystematic.test_hermite  s*    3V^^,Ausu%	
r8   c           	          t        dd      t        t        j                  fdt	        dd      t	        dd      gd	
       y )Nr   i  ri  c                 2    t        j                  | |fi S rP   )r   rR   )rw   rI   KWs     r6   rV   z,TestSystematic.test_hyp0f1.<locals>.<lambda>  s    q!2r2 r8   rx  ry  r   g     j@r  r  )r   r   r/   rR   r   )r|  r<  s    @r6   test_hyp0f1zTestSystematic.test_hyp0f1  s8    #-II2s^SC[)		
r8   c                     t        d t        d       t        dd      t        t	        dd      t	        dd            g       y )Nc                 B    t        j                  | j                  |      S rP   rQ   )rw   r5   s     r6   rV   z4TestSystematic.test_hyp0f1_complex.<locals>.<lambda>  s    1661- r8   c                 8    t        j                  | |fi t        S rP   )r   rR   r  rw   rI   s     r6   rV   z4TestSystematic.test_hyp0f1_complex.<locals>.<lambda>  r%  r8   r   r    irN   )r   r   r   r   r+   r{  s    r6   test_hyp0f1_complexz"TestSystematic.test_hyp0f1_complex  s9    -HIb\:gdD&973;LMN	
r8   c           
          d }t        t        j                  |t        dd      t        ddd      t        dd      gdd       y )	Nc                 p    	 t        j                  | ||      S # t        $ r t        j                  cY S w xY wrP   )r   hyp1f1ZeroDivisionErrorr&   rW  r  s      r6   mpmath_hyp1f1z1TestSystematic.test_hyp1f1.<locals>.mpmath_hyp1f1  s2    }}Q1--$ vvs    55rh  r:   r%   Fr  r   )rH   r  )r   r/   rE  r   )r|  rG  s     r6   test_hyp1f1zTestSystematic.test_hyp1f1  s@    	 	IIb\3q"%8#c2,G	
r8   c           	          t        t        d       t        d       t        dd      t        dd      t	               gd       y )Nc                 X    t        j                  | j                  |j                  |      S rP   )r/   rE  rS   r  s      r6   rV   z4TestSystematic.test_hyp1f1_complex.<locals>.<lambda>  s    ryy'C r8   c                 :    t        j                  | ||fi t        S rP   )r   rE  r  r  s      r6   rV   z4TestSystematic.test_hyp1f1_complex.<locals>.<lambda>      V]]1a-Ng-N r8   rx  ry  i  r  )r   r   r   r   r   r{  s    r6   test_hyp1f1_complexz"TestSystematic.test_hyp1f1_complex  s7    CDNOs^Ss^Z\:		
r8   c           
          t        d t        d       t        dd      t        dd      t        dd      t               gd       y )Nc                 n    t        j                  | j                  |j                  |j                  |      S rP   )r/   r   rS   rw   rv   r   rI   s       r6   rV   z4TestSystematic.test_hyp2f1_complex.<locals>.<lambda>  s!    ryyC r8   c                 <    t        j                  | |||fi t        S rP   )r   r   r  rP  s       r6   rV   z4TestSystematic.test_hyp2f1_complex.<locals>.<lambda>      aAq0TG0T r8   g      Yg      Y@r    r  r  r{  s    r6   test_hyp2f1_complexz"TestSystematic.test_hyp2f1_complex  s;     	CTUs^Ss^Ss^Z\J		
r8   c                     t        t        j                  t        d       t	               t	               t	               g       y )Nc                 :    t        j                  | ||fi t        S rP   )r   ru   r  r  s      r6   rV   z,TestSystematic.test_hyperu.<locals>.<lambda>  rL  r8   )r   r/   ru   r   r   r{  s    r6   test_hyperuzTestSystematic.test_hyperu  s*    IINOUCE35!	
r8   z:mpmath issue gh-342: unsupported operand mpz, long for powc           	      b    d }t        t        |t        ddd      t        dd      gdd       y )	Nc                     t        j                  ||       t        j                  |       z  t        j                  |       z  S rP   )r   powerr)   r  rA  s     r6   mp_igam_facz1TestSystematic.test_igam_fac.<locals>.mp_igam_fac  s/    <<1%fjj!n4V\\!_DDr8   r   g  ļBFr  r      r[  )r   r   r   )r|  rZ  s     r6   test_igam_faczTestSystematic.test_igam_fac  s5    	E 	De,c!Tl;	
r8   c                     t        t        j                  t        j                  t	        dd      g       t        t        j                  t        j                  t	        dd      gd       y Nrx  ry  rt  ru  rv  rA   )r   r/   j0r   r   r{  s    r6   test_j0zTestSystematic.test_j0  s@     	BEE699s4~.>?BEE699s4~.>TJr8   c                     t        t        j                  t        j                  t	        dd      g       t        t        j                  t        j                  t	        dd      gd       y r^  )r   r/   j1r   r   r{  s    r6   test_j1zTestSystematic.test_j1  s>    BEE699s4~.>?BEE699s4~.>TJr8   c           	         t        t        j                  t        d       t	               t	               t	               t	               g       t        d t        d       t               t	               t	               t	               g       y )Nc                 <    t        j                  | |||fi t        S rP   r   jacobir  rP  s       r6   rV   z,TestSystematic.test_jacobi.<locals>.<lambda>  rR  r8   c                 D    t        j                  t        |       |||      S rP   r/   eval_jacobir   )rH   rv   r   rI   s       r6   rV   z,TestSystematic.test_jacobi.<locals>.<lambda>      r~~c!faA> r8   c                 <    t        j                  | |||fi t        S rP   rf  rP  s       r6   rV   z,TestSystematic.test_jacobi.<locals>.<lambda>  rR  r8   )r   r/   rj  r   r   r   r{  s    r6   test_jacobizTestSystematic.test_jacobi  sX    NNTUUCE35#%(	

 	>TUXsuceSU+	
r8   c           	      |    d t        d fdt               t               t               t               gdd       y )Nc                 >    | dk(  ryt        j                  | |||      S )Nr   r   )r   rg  rH   rw   rv   rI   s       r6   rg  z.TestSystematic.test_jacobi_int.<locals>.jacobi  s!    Av==Aq!,,r8   c                 D    t        j                  t        |       |||      S rP   ri  rp  s       r6   rV   z0TestSystematic.test_jacobi_int.<locals>.<lambda>%  rk  r8   c                 6     t              | |||fi t        S rP   )r   r  )rH   rw   rv   rI   rg  s       r6   rV   z0TestSystematic.test_jacobi_int.<locals>.<lambda>&  s     7/71aNgN r8   i  r:   r  r   r   r   )r|  rg  s    @r6   test_jacobi_intzTestSystematic.test_jacobi_int  s2    	-
 	>NXsuceSU+	
r8   c                 Z    d }t        t        j                  |t        dd      gd       y )Nc                 j    | dk(  r
t          dz  S  t        t        j                        d| fi t        S )Nr   r<   )r   r   r   keir  r   s    r6   rw  z$TestSystematic.test_kei.<locals>.kei-  s2    Avs1u/#FJJ/1@@@r8   ꌠ9Y>)ꌠ9Y>)Fr  r  )r   r/   rw  r   )r|  rw  s     r6   test_keizTestSystematic.test_kei,  s&    	A
 	BFFC#eT*:);tDr8   c                 h    t        t        j                  t        d       t	        dd      gd       y )Nc                 8    t        j                  d| fi t        S rp  )r   kerr  r   s    r6   rV   z)TestSystematic.test_ker.<locals>.<lambda>7  s    vzz!Q'B''B r8   rx  ry  r  r  )r   r/   r}  r   r   r{  s    r6   test_kerzTestSystematic.test_ker4  s*    FFBC		
r8   c                 r    t        t        t        j                        d t	               t	               g       y )Nc                 L     t        t        j                        | |fi t        S rP   r   r   laguerrer  r!  s     r6   rV   z.TestSystematic.test_laguerre.<locals>.<lambda>@      :)&//:1aK7K r8   )r   r   r/   eval_laguerrer   r{  s    r6   test_laguerrezTestSystematic.test_laguerre<  s&    r''(KUCEN	
r8   c                 J    t        d d t               t               gd       y )Nc                 @    t        j                  t        |       |      S rP   )r/   r  r   r!  s     r6   rV   z2TestSystematic.test_laguerre_int.<locals>.<lambda>F      ))#a&!4 r8   c                 L     t        t        j                        | |fi t        S rP   r  r!  s     r6   rV   z2TestSystematic.test_laguerre_int.<locals>.<lambda>G  r  r8    N  r  rs  r{  s    r6   test_laguerre_intz TestSystematic.test_laguerre_intD  s    4KXsu		
r8   zsee gh-3551 for bad pointsc           	          t        d d t        t        j                   t        j                        t	        dd      gdd       y )Nc                 T    t        j                  | t        |j                              S rP   )r/   rP  r   rS   rI   r  s     r6   rV   z3TestSystematic.test_lambertw_real.<locals>.<lambda>O  s    QAFF4 r8   c                 T    t        j                  | t        |j                              S rP   )r   rP  r   rS   r  s     r6   rV   z3TestSystematic.test_lambertw_real.<locals>.<lambda>P  s    CK8 r8   r   r    r@   FrB   r  )r   r   r&   rW  r   r{  s    r6   test_lambertw_realz!TestSystematic.test_lambertw_realL  s4    48(&B-8u		
r8   c           	          d}t        j                  d      dfd}t        |t        j                  t        d|d      gd	       y )
NgGase@r%   g  E@c                    t        j                  d      5  | z   dz
  z  | dz
  z  }|t         j                  k7  r|t        |       z  }n'| z   dz
  z  d| dz
  z  z  }|t        |       z  }||z  }d d d        |S # 1 sw Y   S xY w)Nr   )overrM   )r&   r   rW  r   )rI   facrY   egs      r6   r  z:TestSystematic.test_lanczos_sum_expg_scaled.<locals>.gammaZ  s    (+ AQ!c'2"&&=6q99CECK?c1s7m<C6q99C3JC J Js   AA==Br   Fr  r@   rA   )r&   r)   r   r   r  r   )r|  maxgammar  r  r  s      @@r6   test_lanczos_sum_expg_scaledz+TestSystematic.test_lanczos_sum_expg_scaledU  sE    &FF1I)		 	LLH%01		
r8   c                 z    t        t        j                  t        j                  t               t               g       y rP   )r   r/   eval_legendrer   legendrer   r{  s    r6   test_legendrezTestSystematic.test_legendrel  s     B,,foosu~Nr8   c                     t        d d t               t               gd       t        d d t               t        t	        j
                  ddd	            g       y )
Nc                 @    t        j                  t        |       |      S rP   r/   r  r   r!  s     r6   rV   z2TestSystematic.test_legendre_int.<locals>.<lambda>r  r  r8   c                 L     t        t        j                        | |fi t        S rP   r   r   r  r  r!  s     r6   rV   z2TestSystematic.test_legendre_int.<locals>.<lambda>s  r  r8   r  r  c                 @    t        j                  t        |       |      S rP   r  r!  s     r6   rV   z2TestSystematic.test_legendre_int.<locals>.<lambda>z  r  r8   c                 L     t        t        j                        | |fi t        S rP   r  r!  s     r6   rV   z2TestSystematic.test_legendre_int.<locals>.<lambda>{  r  r8   r  r  rh   )r   r   r   r   r&   r'   r{  s    r6   test_legendre_intz TestSystematic.test_legendre_intp  sK    4KXsu		
 	4KXxCR 89:	
r8   z*apparently picks wrong function at |z| > 1c           	      h    d }d }t        ||t        dd      t        dd      t               g       y )Nc                 <    t        j                  || |      d   d   S Nr   )r{   r{   )r/   lqmnrH   r@  r5   s      r6   lqnmz(TestSystematic.test_legenq.<locals>.lqnm  s    771a#A&u--r8   c                     t        |      dk  rt        j                  S  t        t        j
                        | ||d      S Nrp   r   )type)r   r&   r  r   r   legenqr  s      r6   r  z*TestSystematic.test_legenq.<locals>.legenq  s3    1v~vv2#FMM21aCCr8   r   r>   rs  r|  r  r  s      r6   test_legenqzTestSystematic.test_legenq  s5    	.	D 	As^VAs^SU3	
r8   c           	      l    d }d }t        ||t        dd      t        dd      t               gd       y )Nc                     t        j                  t        |j                        t        | j                        |      d   d   S r  )r/   r  r   rS   r  s      r6   r  z0TestSystematic.test_legenq_complex.<locals>.lqnm  s/    773qvv;AFFQ7:5AAr8   c                     t        |      dk  rt        j                  S  t        t        j
                        t        | j                        t        |j                        |d      S r  )r   r&   r  r   r   r  r   rS   r  s      r6   r  z2TestSystematic.test_legenq_complex.<locals>.legenq  sD    1v~vv2#FMM23qvv;AFFQUVWWr8   r   r>   r  )r   r   r   r  s      r6   test_legenq_complexz"TestSystematic.test_legenq_complex  s9    	B	X 	As^VAs^Z\:		
r8   c                 L    d }d }t        t        |t               gdd|       y )Nc                 h    t        j                  t        j                  |       | k(  | dk  z  dd      S )Nr   FT)r&   r_  floorr   s    r6   r`  z0TestSystematic.test_lgam1p.<locals>.param_filter  s+    88RXXa[A-!q&95$GGr8   c                 F    t        j                  d| z         j                  S r  r  r+  s    r6   	mp_lgam1pz-TestSystematic.test_lgam1p.<locals>.mp_lgam1p  s    ??1q5)...r8   r@   r>   ra  )r   r   r   )r|  r`  r  s      r6   test_lgam1pzTestSystematic.test_lgam1p  s-    	H	/ 	UG%	
r8   c                 Z    d }t        t        j                  |t               gddd       y )Nc                     	 t        j                  |       }|S # t        $ r, t        t        j
                  t        j
                        }Y |S w xY wrP   )r   r   
ValueErrorr+   r&   r  )r5   rY   s     r6   mpmath_loggammaz5TestSystematic.test_loggamma.<locals>.mpmath_loggamma  sF    .ooa( J  .bffbff-J.s    1AAFr   )r  distinguish_nan_and_infrB   )r   r/   r   r   )r|  r  s     r6   test_loggammazTestSystematic.test_loggamma  s+    	 	KK\N$)	
r8   c                 \    d }t        |t        d       t               t               g       y )Nc                 4    t        j                  | |      d   S rp  )r/   pbdvr+  s     r6   pcfdz&TestSystematic.test_pcfd.<locals>.pcfd      771a=##r8   c                 8    t        j                  | |fi t        S rP   )r   r  r  r+  s     r6   rV   z*TestSystematic.test_pcfd.<locals>.<lambda>  s    &++a*Fg*F r8   )r   r   r   )r|  r  s     r6   	test_pcfdzTestSystematic.test_pcfd  s&    	$FGUCEN	
r8   zHit's not the same as the mpmath function --- maybe different definition?c                 N    d }t        |d t               t               gd       y )Nc                 4    t        j                  | |      d   S rp  )r/   pbvvr+  s     r6   pcfvz&TestSystematic.test_pcfv.<locals>.pcfv  r  r8   c                 h      t               t        t        j                              | |fi t        S rP   )r   r   r   r  r  r+  s     r6   rV   z*TestSystematic.test_pcfv.<locals>.<lambda>  s(    F(8(EFq!WwW r8   r  r  r  )r|  r  s     r6   	test_pcfvzTestSystematic.test_pcfv  s#    	$WUCEN		
r8   c           	          d }d }d }t        |t        j                  t        dd      t        dd      gdd       t        ||t        dd      t        dd      gd	d       y )
Nc                 4    t        j                  | |      d   S rp  r/   pbwarA  s     r6   pcfwz&TestSystematic.test_pcfw.<locals>.pcfw  r  r8   c                 4    t        j                  | |      d   S r  r  rA  s     r6   dpcfwz'TestSystematic.test_pcfw.<locals>.dpcfw  r  r8   c                 P    t        j                  t         j                  | |fd      S )Nr?   )r   diffr  rA  s     r6   mpmath_dpcfwz.TestSystematic.test_pcfw.<locals>.mpmath_dpcfw  s    ;;v{{QFF;;r8   rf   rg   g:0yU>r>   r  g&.!>)r   r   r  r   )r|  r  r  r  s       r6   	test_pcfwzTestSystematic.test_pcfw  si    	$	$	<
 	KKQZR$	
 	QZR$	
r8   zCissues at large arguments (atol OK, rtol not) and <eps-close to z=0c                     t        t        j                   t               t	        t
        j                              t        dd      t               g       y )Nr   r  )r   r/   	polygammar   r   r   r   r   r{  s    r6   test_polygammazTestSystematic.test_polygamma  s;     	LLLN+F,<,<=>At_ce$	
r8   c                     t        t        j                  t        j                  t	        dt
        j                        gddd       y )Nir  FT)rH   r  r   )r   r/   r  r   r   r&   rW  r{  s    r6   test_rgammazTestSystematic.test_rgamma  s2    IIMM  	
r8   c                 ~    t        t        j                  t        t        j                        t               gd       y r  )r   r/   r  r   r   r   r{  s    r6   test_rgamma_complexz"TestSystematic.test_rgamma_complex  s'    IIV]]+\N		
r8   zNsee gh-3551 for bad points on 32 bit systems and gh-8095 for another bad pointr   c                     t        j                  t        j                        t        j                  d      k\  rt        j
                  }nd }t        t        j                  |t               t               gd       y )Nry   c                     t        | |z         t        | |z         k(  r7t        | |z         dk  r&t        j                  |       } t        | |z         | z
  }t        j                  | |      S rp  )rD   r   r   rq  rf)rw   r@  s     r6   mppochz&TestSystematic.test_rf.<locals>.mppoch  sY     Q<3q1u:-%A,!2C

1AAE
QAyyA&r8   r   r  )
r   parser   r   Versionr  r   r/   pochr   )r|  r  s     r6   test_rfzTestSystematic.test_rf  sN     ==++,0HHYYF' 	BGGVceSU^Er8   c                     t        j                  t              j                  }t	        t
        t        j                  t               gdd|z         y rT  )	r&   r1  rD   r2  r   r   r   r3  r   rU  s     r6   
test_sinpizTestSystematic.test_sinpi&  s8    hhuo!!LLUG3	
r8   c                 Z    t        t        t        j                  t	               gdd       y )NFg+=r  )r   r   r   r3  r   r{  s    r6   test_sinpi_complexz!TestSystematic.test_sinpi_complex0  rY  r8   c                     d }t        |t        j                  t               g       t        |t        j                  t	        g d      g       y )Nc                 2    t        j                  |       d   S rp  r;  r   s    r6   shiz$TestSystematic.test_shi.<locals>.shi:  r>  r8   r?  )r   r   r  r   r   r|  r  s     r6   test_shizTestSystematic.test_shi9  rC  r8   c                     d }t        |t        j                  t        t	        t
        j                   d      t	        t
        j                  d            gd       y )Nc                 2    t        j                  |       d   S rp  r;  r+  s    r6   r  z,TestSystematic.test_shi_complex.<locals>.shiA  r>  r8   rt  ru  r_   rA   )r   r   r  r   r+   r&   rW  r  s     r6   test_shi_complexzTestSystematic.test_shi_complex@  rG  r8   c                 R    d }t        |t        j                  t               g       y )Nc                 2    t        j                  |       d   S rp  rJ  r   s    r6   siz"TestSystematic.test_si.<locals>.siL  rM  r8   )r   r   r  r   r|  r  s     r6   test_sizTestSystematic.test_siK  s    	!B		CE73r8   c                     d }t        |t        j                  t        t	        dt
        j                         t	        dt
        j                              gd       y )Nc                 2    t        j                  |       d   S rp  rJ  r+  s    r6   r  z*TestSystematic.test_si_complex.<locals>.siQ  rM  r8   rt  ru  r_   rA   )r   r   r  r   r+   r&   rW  r  s     r6   test_si_complexzTestSystematic.test_si_complexP  sC    	! 	IIrvvg.RVV0DEF		
r8   c                     d }t        t        j                  t        |      t	        dt
        j                        gd       y )Nc                 4    t        j                  dd| z
        S r)  r   r*  r   s    r6   dilogz)TestSystematic.test_spence.<locals>.dilog]      >>!QU++r8   r   r   rA   )r   r/   r,  r   r   r&   rW  r|  r   s     r6   test_spencezTestSystematic.test_spence[  s3    	, 	IIU#BFF^		
r8   c                 h    d }t        t        j                  t        |      t	               gd       y )Nc                 4    t        j                  dd| z
        S r)  r  r+  s    r6   r   z1TestSystematic.test_spence_complex.<locals>.dilogh  r  r8   r   rA   )r   r/   r,  r   r   r  s     r6   test_spence_complexz"TestSystematic.test_spence_complexg  s(    	,IIU#\N		
r8   c           	          t        t        j                  t        t        j
                        t        dd      t        dd      gd       y )N     r  r   &.>rA   )r   r/   struver   r   struvehr   r{  s    r6   test_struvehzTestSystematic.test_struvehq  s4    IIV^^,s^SC[)		
r8   c           	          d }t        t        j                  t        |      t	        dd      t	        dd      gdd       y )Nc                 J   | dk  ro||  k  rit        |       dkD  r[t        j                  j                  }	 dt        j                  _        t        j                  | |      |t        j                  _        S t        j                  | |      S # |t        j                  _        w xY w)Nr   r  r   )r   r   r   r   struvel)rU   r5   r   s      r6   
mp_struvelz/TestSystematic.test_struvel.<locals>.mp_struvelz  sq    1uaRCFTM ))--,$'FIIM!>>!Q/$+FIIM>>!Q'' %,FIIMs   *B B"r  r  r   r	  Tr   )r   r/   	modstruver   r   )r|  r  s     r6   test_struvelzTestSystematic.test_struvely  s:    		( 	LLZ(s^SC[) 	
r8   c                 ^    d }t        t        j                  |t        dd      gddd       y )Nc                 z    t        j                  t        j                  |       t        j                  d            S )Nz-0.5)r   rP  r)   rq  r   s    r6   mpmath_wrightomega_realzETestSystematic.test_wrightomega_real.<locals>.mpmath_wrightomega_real  s$    ??6::a=&**V2DEEr8   r~   gPKDg+<r   F)rB   rs   r  )r   r/   rZ  r   )r|  r  s     r6   test_wrightomega_realz$TestSystematic.test_wrightomega_real  s2    	F 	NN#	
r8   c                 T    t        t        j                  d t               gdd       y )Nc                     t        | d      S )NrT  )rR  r+  s    r6   rV   z1TestSystematic.test_wrightomega.<locals>.<lambda>  s    )!R0 r8   r   Fr  )r   r/   rZ  r   r{  s    r6   test_wrightomegazTestSystematic.test_wrightomega  s!    NN0\N	
r8   c           	          t        t        j                  t        t        j                        t        ddd      t        dd      g       y )Nr%       _BF)rw   rv   r	  r   rw   r	  )r   r/   zetar   r   r   r{  s    r6   test_hurwitz_zetaz TestSystematic.test_hurwitz_zeta  s5    GGV[[)1%0#u2MN	
r8   c                 X    t        t        j                  d t        dd      gdd       y )Nc                 V    | dk7  rt        j                  |       S t         j                  S r  r   r  rW  r   s    r6   rV   z2TestSystematic.test_riemann_zeta.<locals>.<lambda>  s    Qfkk!n FJJ r8   r0  r>   Frq   r  )r   r/   r  r   r{  s    r6   test_riemann_zetaz TestSystematic.test_riemann_zeta  s&    GG>s^	
r8   c                 Z    t        t        j                  d t        dd      gddd       y )Nc                 \    | dk7  rt        j                  |       dz
  S t         j                  S r  r!  r   s    r6   rV   z+TestSystematic.test_zetac.<locals>.<lambda>  s!    AFfkk!nq( 

 r8   r0  r>   F-   rq   )r  r   rB   )r   r/   zetacr   r{  s    r6   
test_zetaczTestSystematic.test_zetac  s)    HHBs^	
r8   c                     d }t        t        j                  t        |      t	        dd      t	               gddd       y )	Nc                    t         j                  j                  |       } t         j                  j                  |      }|dk(  rt         j                  j                  |       S t         j                  j	                  | |      |z  S rp  r   r   rq  r   powm1)rI   lmbdas     r6   	mp_boxcoxz-TestSystematic.test_boxcox.<locals>.mp_boxcox  sZ    		a AIIMM%(Ezyy}}Q''yyq%0588r8   r   Fr  r=   r~  r@   r  )r   r/   boxcoxr   r   )r|  r-  s     r6   test_boxcoxzTestSystematic.test_boxcox  s:    	9 	IIY'1%(#%0	
r8   c                     d }t        t        j                  t        |      t	        dd      t	               gddd       y )	Nc                 V   t         j                  j                  |       } t         j                  j                  |      }t         j                  j                  d      }|dk(  r"t         j                  j                  || z         S t         j                  j	                  || z   |      |z  S r   r*  )rI   r,  ones      r6   mp_boxcox1pz1TestSystematic.test_boxcox1p.<locals>.mp_boxcox1p  st    		a AIIMM%(E))--"Czyy}}S1W--yysQw6>>r8   r{   Fr  r=   r~  r@   r  )r   r/   boxcox1pr   r   )r|  r3  s     r6   test_boxcox1pzTestSystematic.test_boxcox1p  s:    	? 	KK[)25)351	
r8   c           	      p    d }t        d t        |      t        dd      t        dd      gdd d f	       y )
Nc                    t        j                  |      }t        j                  | t        j                  d      dz  z   |      t        j                  d|z  t         j
                  z        z  }|j                  dk(  r|j                  S |S Nr%   r   r   r   	mpmathifyr  rq  r  r   rO  rS   rH   r5   argouts       r6   mp_spherical_jnz9TestSystematic.test_spherical_jn.<locals>.mp_spherical_jn  i    ""1%C>>!fjjmAo"5s;;;quVYY/0Cxx1}xx
r8   c                 @    t        j                  t        |       |      S rP   )r/   spherical_jnr   rH   r5   s     r6   rV   z2TestSystematic.test_spherical_jn.<locals>.<lambda>  r7  r8   r   r=   rt  ru  r  c                 2    t        j                  |       dkD  S )Ng#B;)r&   r   r+  s    r6   rV   z2TestSystematic.test_spherical_jn.<locals>.<lambda>  s    "&&)e*; r8   )r   r`  r  r|  r>  s     r6   test_spherical_jnz TestSystematic.test_spherical_jn  s<    	 	3_-As^Ss^, ;<	
r8   c                 `    d }t        d t        |      t        dd      t               g       y )Nc                    t        j                  |      }t        j                  | t        j                  d      dz  z   |      t        j                  d|z  t         j
                  z        z  }|j                  dk(  r|j                  S |S r8  r9  r;  s       r6   r>  zATestSystematic.test_spherical_jn_complex.<locals>.mp_spherical_jn  r?  r8   c                 T    t        j                  t        | j                        |      S rP   )r/   rA  r   rS   rB  s     r6   rV   z:TestSystematic.test_spherical_jn_complex.<locals>.<lambda>      QVVa8 r8   r   r=   r   r   r   r   rD  s     r6   test_spherical_jn_complexz(TestSystematic.test_spherical_jn_complex  ,    	 	8_-As^Z\*	
r8   c           	      h    d }t        d t        |      t        dd      t        dd      gd       y )	Nc                    t        j                  |      }t        j                  | t        j                  d      dz  z   |      t        j                  d|z  t         j
                  z        z  }|j                  dk(  r|j                  S |S r8  r   r:  r  rq  r  r   rO  rS   r;  s       r6   mp_spherical_ynz9TestSystematic.test_spherical_yn.<locals>.mp_spherical_yn  r?  r8   c                 @    t        j                  t        |       |      S rP   )r/   spherical_ynr   rB  s     r6   rV   z2TestSystematic.test_spherical_yn.<locals>.<lambda>  r7  r8   r   r=   g    _r  r>   r  r  r|  rP  s     r6   test_spherical_ynz TestSystematic.test_spherical_yn
  s4    	 	3_-As^S-.		
r8   c                 `    d }t        d t        |      t        dd      t               g       y )Nc                    t        j                  |      }t        j                  | t        j                  d      dz  z   |      t        j                  d|z  t         j
                  z        z  }|j                  dk(  r|j                  S |S r8  rO  r;  s       r6   rP  zATestSystematic.test_spherical_yn_complex.<locals>.mp_spherical_yn  r?  r8   c                 T    t        j                  t        | j                        |      S rP   )r/   rR  r   rS   rB  s     r6   rV   z:TestSystematic.test_spherical_yn_complex.<locals>.<lambda>&  rI  r8   r   r=   rJ  rS  s     r6   test_spherical_yn_complexz(TestSystematic.test_spherical_yn_complex  rL  r8   c                 f    d }t        d t        |      t        dd      t               gdd       y )Nc                    t        j                  |      }t        j                  | t        j                  d      dz  z   |      t        j                  d|z  t         j
                  z        z  }|j                  dk(  r|j                  S |S r8  r   r:  r  rq  r  r   rO  rS   r;  s       r6   mp_spherical_inz9TestSystematic.test_spherical_in.<locals>.mp_spherical_in,  r?  r8   c                 @    t        j                  t        |       |      S rP   )r/   spherical_inr   rB  s     r6   rV   z2TestSystematic.test_spherical_in.<locals>.<lambda>6  r7  r8   r   r=   g訰6r  r  r|  r\  s     r6   test_spherical_inz TestSystematic.test_spherical_in+  s2    	 	3_-As^SU#	
r8   c                 `    d }t        d t        |      t        dd      t               g       y )Nc                    t        j                  |      }t        j                  | t        j                  d      dz  z   |      t        j                  d|z  t         j
                  z        z  }|j                  dk(  r|j                  S |S r8  r[  r;  s       r6   r\  zATestSystematic.test_spherical_in_complex.<locals>.mp_spherical_in>  r?  r8   c                 T    t        j                  t        | j                        |      S rP   )r/   r^  r   rS   rB  s     r6   rV   z:TestSystematic.test_spherical_in_complex.<locals>.<lambda>H  rI  r8   r   r=   rJ  r_  s     r6   test_spherical_in_complexz(TestSystematic.test_spherical_in_complex=  rL  r8   c                 d    d }t        d t        |      t        dd      t               gd       y )Nc                 >   t        j                  |      }t        j                  | t        j                  d      dz  z   |      t        j                  d|z  t         j
                  z        z  }t        j                  |      j                  dk(  r|j                  S |S r8  r   r:  r  rq  r  r   rO  rS   r;  s       r6   mp_spherical_knz9TestSystematic.test_spherical_kn.<locals>.mp_spherical_knN  sw    ""1%C>>!fjjmAo"5s;;;quVYY/0C"''1,xx
r8   c                 @    t        j                  t        |       |      S rP   )r/   spherical_knr   rB  s     r6   rV   z2TestSystematic.test_spherical_kn.<locals>.<lambda>X  r7  r8   r   r\   r>   r  r  r|  rh  s     r6   test_spherical_knz TestSystematic.test_spherical_knM  s/    	 	3_-As^SU#		
r8   z.Accuracy issues near z = -1 inherited from kv.c                 d    d }t        d t        |      t        dd      t               gd       y )Nc                    t        j                  |      }t        j                  | t        j                  d      dz  z   |      t        j                  d|z  t         j
                  z        z  }|j                  dk(  r|j                  S |S r8  rg  r;  s       r6   rh  zATestSystematic.test_spherical_kn_complex.<locals>.mp_spherical_kna  r?  r8   c                 T    t        j                  t        | j                        |      S rP   )r/   rj  r   rS   rB  s     r6   rV   z:TestSystematic.test_spherical_kn_complex.<locals>.<lambda>k  rI  r8   r   r=   r  rJ  rk  s     r6   test_spherical_kn_complexz(TestSystematic.test_spherical_kn_complex^  s/    	 	8_-As^Z\*		
r8   N)__name__
__module____qualname__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&  pytestmarkxfailr/  r5  r8  rB  rF  rO  rR  rV  rX  r\  rb  rf  rk  rv  rz  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.  r3  r9  r=  rB  rH  rM  rS  rV  xfail_on_32bitr\  r`  rc  rm  rt  rz  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/  r5  rE  rK  rT  rX  r`  rd  rl  rp  r  r8   r6   rm  rm    sY   .,
.,
.,
.,
.
.
0


"




"

!
F	



B
 [[5)RS
 T

 [[5)RS
 T
U	
=	
U




0) 


E
DWIRI



$

FT

BI





@
@
O


F [[5!
 "
0
d [[5!
 "
 
 


 [[5)PQ
 R
	


 [[5!
 "
 
 
 [[5!
 "
 [[ !H I

I

KK
 [[5!

 "


E
 
 

 [[ <=
 >

. O O
 [[5)UV
 W
  
 
"
$
" [[5!
 "
 [[5 *G H
H

8 [[56  7
7


 [[  ' )F)F 

U	
4
	





(
 




&
(
&
 
"
 
$
 
" [[5N  P
P
r8   rm  )L__doc__numpyr&   numpy.testingr   r   r   rt  r   
scipy._libr   scipy.specialspecialr/   scipy.special._testutilsr   r   r	   r
   scipy.special._mptestutilsr   r   r   r   r   r   r   r   r   r   scipy.special._ufuncsr   r   r   r   r   r   r   ImportErrorru  thread_unsafe
pytestmarkr7   rJ   rZ   rd   rx   r   r   r   r   slowr   r   r   r   r   r  r  r  r  r  r  r&  r.  r5  r8  rK  rR  r`  rc  rf  rh  r   r  rm  r  r8   r6   <module>r     s    2         % [[&&> ' @
 vv- - vv	> 	>  vv! !( vv6 6 vwO  O, vwC  C" vvG G> vvC C* vv/ /$ vvE  E8 vv: :* vv0K 0Kn vv:  :L   vv= =  vv= =& vv;  ;. vv<  <* vv< <& vv< <( vvB  B& vv;  ;& vv
8 
8 vv8 8$ vv9 90 vv?  ?* vv
@  
@ vv
@  
@" vv=  = sS
) vvD
 D
  D
a  %8$F%s   M M,+M,