+
    /is                        ^ RI t ^ RIt^ RIHtHtHt ^ RIHt ^ RI	H
t ^ RIHu Ht ^ RIHtHtHtHtHtHtHtHtHt ^ RIHt ^ RIHtHtHt ^ RIH t  ^ RI!H"t"H#t#H$t$ ^ R	I%H&t&H't' ] PP                  PR                  t)]"! ]4       ! R
 R4      4       t*]"! ]4       ! R R4      4       t+]"! ]4       ! R R4      4       t,]"! ]4       ! R R4      4       t-]"! ]4       ! R R4      4       t.]"! ]4       ! R R4      4       t/]"! ]4       ! R R4      4       t0RRRRRRRR!/R lt1]"! ]4       ! R R4      4       t2]"! ]Pf                  4       ! R R 4      4       t4R# )"    N)assert_equalassert_almost_equalassert_allclose)given)	rombnewton_cotescumulative_trapezoid	trapezoidquadsimpson
fixed_quadqmc_quadcumulative_simpson)%_cumulative_simpson_unequal_intervals)statsspecial	integrate)skip_xp_invalid_arg)make_xp_test_casexp_default_dtypeis_numpy)xp_assert_closexp_assert_equalc                   ,   a  ] tR t^t o R tR tRtV tR# )TestFixedQuadc                p   a ^o^^S,          ,          p\        V3R l^ ^SR7      w  r#\        W!RR7       R# )   c                 2   < V ^S,          ^,
          ,          #     )xns   &c/var/www/html/photoedit/myenv/lib/python3.14/site-packages/scipy/integrate/tests/test_quadrature.py<lambda>+TestFixedQuad.test_scalar.<locals>.<lambda>   s    a!A#'l    r#   -q=rtolN)r   r   )selfexpectedgot_r#   s   &   @r$   test_scalarTestFixedQuad.test_scalar   s2    ac72AqA>E2r'   c                   a ^p\         P                  ! ^^V,          4      o^S^,           ,          p\        V3R l^ ^VR7      w  r4\        W2RR7       R# )r   c                 $   < V SR,          ,          # )NNNr4   Nr!   )r"   ps   &r$   r%   +TestFixedQuad.test_vector.<locals>.<lambda>#   s    a7mr'   r(   r)   r*   N)nparanger   r   )r,   r#   r-   r.   r/   r6   s   &    @r$   test_vectorTestFixedQuad.test_vector   sF    IIa1a!e93QQ?E2r'   r!   N)__name__
__module____qualname____firstlineno__r0   r:   __static_attributes____classdictcell____classdict__s   @r$   r   r      s     33 3r'   r   c                   ,   a  ] tR t^'t o R tR tRtV tR# )TestRombc                    \        \        VP                  R 4      4      VP                  RVP                  R7      4       R# )g      1@g      `@dtypeN)r   r   r9   asarrayfloat64r,   xps   &&r$   	test_rombTestRomb.test_romb)   s*    RYYt_-rzz%rzzz/RSr'   c                `   \         P                  ! ^4      p\         P                  ! RV,          4      p\        VP	                  V4      4      p\        R \         P                  ! V4      \         P                  ! V4      4      w  rV\        WAP	                  WQP                  R7      R^ R7       R# )r    皙?c                 d    \         P                  ! \         P                  ! R V ,          4      4      # )rP   )r8   cosarrayr"   s   &r$   r%   ,TestRomb.test_romb_gh_3731.<locals>.<lambda>1   s    RVVBHHSUO%<r'   rG   g:0yE>r+   atolN)
r8   r9   rR   r   rI   r   minmaxr   rJ   )r,   rL   r"   yvalr-   r/   s   &&     r$   test_romb_gh_3731TestRomb.test_romb_gh_3731,   sq    IIfFF3q5M2::a=!<bffQiPQSZZ

ZC$UVWr'   r!   N)r<   r=   r>   r?   rM   r\   r@   rA   rB   s   @r$   rE   rE   '   s     TX Xr'   rE   c                   ,   a  ] tR t^5t o R tR tRtV tR# )TestNewtonCotesc                   ^p\        V^4      w  r#\        W!\        P                  ! RR.4      ,          4       \	        W1^,          ) R,          4       ^p\        V^4      w  r#\	        W!\        P                  ! . R
O4      ,          R,          4       \	        W1^,          ) R,          4       ^p\        V^4      w  r#\	        W!\        P                  ! . RO4      ,          R,          4       \	        W1^,          ) R,          4       ^p\        V^4      w  r#\	        W!\        P                  ! . RO4      ,          R,          4       \	        W1^,          ) R,          4       R	# )z5Test the first few degrees, for evenly spaced points.      ?      (@      @g     @       @g     P@g     V@g     =AN)      ?      @re   )re         @rg   re   )      @      @@rb   ri   rh   )r   r   r8   rS   r   )r,   r#   wtserrcoffs   &   r$   test_newton_cotes!TestNewtonCotes.test_newton_cotes7   s   #Aq)SBHHc3Z001GdU4Z0#Aq)C288O#<!<S!@AGdU6\2#Aq)C288,@#A!A#!EFGdU6\2#Aq)C288,H#I!I$!NOGdU9_5r'   c                J   \         P                  ! . RO4      pV^,          p\        V4      w  r4Rp\         P                  ! W24      p\	        We4       \         P                  ! . RO4      pV^,          p\        V4      w  r4Rp\         P                  ! W24      p\	        We4       R# )z9Test newton_cotes with points that are not evenly spaced.      "@N)        g      ?       @gUUUUUU@)rp   gffffff?g @rg   )r8   rS   r   dotr   )r,   r"   rZ   rj   rk   exact_integralnumeric_integrals   &      r$   test_newton_cotes2"TestNewtonCotes.test_newton_cotes2M   s     HH_%qD#A66#>,=HH)*qD#A66#>,=r'   r!   N)r<   r=   r>   r?   rl   ru   r@   rA   rB   s   @r$   r_   r_   5   s     6,> >r'   r_   c                   n   a  ] tR t^_t o R t]P                  P                  RRR.4      R 4       tRt	V t
R# )TestSimpsonc           
     
   \         P                  ! ^4      p\        \        V4      ^4       \        \        VRR7      ^@4       \        \        V\         P                  ! ^ ^^4      R7      ^ 4       \         P                  ! ^^^4      pR p\        \        V! V4      VR7      R4       \         P                  ! ^^^4      p\        \        V! V4      RR7      ^r4       \         P                  ! ^4      P                  ^^4      p\         P                  ! R4      P                  ^^^4      pV! V4      p\        ^4       F  p\        WVR7      p\         P                  ! VR	.R
7      pV F  p\        VP                  4      p	V	P                  V\        R4      4       V\        V	4      ,          R,          ^,          ^,          V\        V	4      ,          ^ ,          ^,          ^,          ,
          p
\        WgP                  ,          V
4       K  	  K  	  \         P                  ! ^4      P                  ^^4      pV! V4      p\        WRR7      pRVR,          VR,          ,           ,          VR,          VR,          ,
          ,          p
\        Wj4       \         P                  ! ^4      P                  ^^4      p\         P                  ! ^}4      P                  ^^^4      pV! V4      p\        ^4       F  p\        WVR7      p\         P                  ! VR	.R
7      pV F  p\        VP                  4      p	V	P                  V\        R4      4       V\        V	4      ,          R,          ^,          ^,          V\        V	4      ,          ^ ,          ^,          ^,          ,
          p
\        WgP                  ,          V
4       K  	  K  	  \         P                  ! ^.4      p\         P                  ! V^4      p\        \        W^ R7      R4       \        \        WRR7      R4       \         P                  ! . RO4      p\         P                  ! V^4      p\        \        W^ R7      R4       \        \        WRR7      R4       \         P                  ! . RO. RO. RO.4      p\         P                  ! V^4      p. ROpR.^,          p\        \        W^ R7      V4       \        \        WRR7      V4       \         P                  ! . RO. RO. RO.4      p\         P                  ! V^4      p. ROp. ROp\        \        W^ R7      V4       \        \        WRR7      V4       R# )   ra   dxrT   c                     V ^,          # r   r!   rT   s   &r$   f#TestSimpson.test_simpson.<locals>.fi   s    a4Kr'         5@rq         P@r"   axismulti_index)flagsNrp   )r4      )r4   r   )   r   r   r   )r   r    r      )rp   rp   rp   rp   竪Je@)r   r          )rp   g      a@g      @g      @)r   r   g*U@)r8   r9   r   r   linspacer   reshaperangenditerlistr   insertslicetuplerS   power)r,   rZ   r"   r~   airitr/   idxintegral	zero_axisdefault_axiss   &            r$   test_simpsonTestSimpson.test_simpsona   s   IIbMWQZ%WQ3',WQ"++aB"78"= KK1a 	 	!*D1 KK1a !-s3 IIbM!!!Q'IIcN""1a+aDqAQ'A1]O4B2>>*

1eDk*U3Z=,a/!3ac
mA6F6IA6MM.. 18<	   IIbM!!!Q'aDA$!D'AdG+,$!D'0AB$ IIbM!!!Q'IIcN""1a+aDqAQ'A1]O4B2>>*

1eDk*U3Z=,a/!3ac
mA6F6IA6MM.. 18<	   HHaSMHHQNQ/5R0#6HH\"HHQNQ/5R0#6HHlL,?@HHQN(	!{QQ/;R0,?HHlL.ABHHQN0	>Q/;R0,?r'   droplastFTc                    \         P                  ! . RO. RO.4      pV'       d   VRRR13,          p\        VRR7      p\        \         P                  ! V\         P                  R7      RR7      p\	        W44       R# )r    r4   Nr   rG   )r    r    r   r   r   r      )r   r   r    r   
      r   r   )r8   rS   r   rJ   r   )r,   r   rZ   resultr-   s   &&   r$   test_simpson_2d_integer_no_x(TestSimpson.test_simpson_2d_integer_no_x   s`     HH/35 6!SbS&	A$288ARZZ8rBV&r'   r!   N)r<   r=   r>   r?   r   pytestmarkparametrizer   r@   rA   rB   s   @r$   rx   rx   _   s6     K@\ [[Z%7	' 8	'r'   rx   c                      a  ] tR t^t o R tR tR tR t]P                  P                  R^R.4      R 4       tR tR	tV tR
# )TestCumulative_trapezoidc                    VP                  R^^R7      pTp\        W2^ R7      pVP                  . RO4      p\        WE4       \        W2RR7      p\        WER,          4       R# )r    numinitialNr   NNr   )rp                r   rp   r   r	   rI   r   )r,   rL   r"   rZ   y_int
y_expecteds   &&    r$   test_1d TestCumulative_trapezoid.test_1d   sV    KKA1K%$Q15ZZ 9:
*$Q48"~.r'   c                   VP                  VP                  ^\        V4      R7      R4      pTp\        W2^ R7      pVP	                  . RO. RO.. RO. R	O.. R
O. RO..4      p\        WE4       . ROp\        . ROV4       FG  w  rx\        W2^ VR7      pVP                  R8X  g   Q h\        W2RVR7      pVP                  V8X  d   KG  Q h	  R# )r   rG   r   )r   r   Nr   r    r   )rp   ra   rq         @)rp   r         $@     0@)rp         !@      2@g     <@)rp         )@g      :@     @D@)rp   r   g      A@g     @J@)rp        4@g      E@g      P@))r    r    r   )r   r   r   )r   r    r   r   r   r    )r   r9   r   r	   rI   r   zipshape)	r,   rL   r"   rZ   r   r   shapesr   r   s	   &&       r$   test_y_nd_x_nd'TestCumulative_trapezoid.test_y_nd_x_nd   s    JJryy2B22FyGS$Q15ZZ"4"6"8"6"7"9"7"7"9	!: ;
 	* 3y&1KD(qtDE;;)+++(t$GE;;%'''	 2r'   c           	        VP                  VP                  ^\        V4      R7      R4      pVP                  ^\        V4      R7      ^,          pVP                  . RO. RO.. RO. RO..4      VP                  . R	O.. R
O.. RO..4      VP                  . RO. RO.. RO. RO.. RO. RO..4      3p\	        . ROV4       F2  w  rV\        W#RVP                  V,           VRR7      p\        Wv4       K4  	  R# )r   rG   N)r"   r   r   r   )rf         @rc   rh   )rd   ro   r         &@)g      D@g      F@g      H@g      J@)g      L@g      N@r   g      Q@)rq   rg   rf   r   )r   r   rb         *@)r   g      3@      4@r   )ra   r   g     1@)r   r   g     J@)r   g     B@g     `V@)r   g     J@g     `_@)r   g     @Q@g     0d@)r   g     @U@g     h@r   )r   r9   r   rI   r   r	   r   r   )r,   rL   rZ   r"   ys_expectedr   r   r   s   &&      r$   test_y_nd_x_1d'TestCumulative_trapezoid.test_y_nd_x_1d   s   JJryy2B22FyGSIIa/3I4a7 JJ)+---/0 1 JJ)*-.-.0 1 JJ)+)+-++-	. /0 !$I{ ;D(.?d157EE. !<r'   c                   VP                  R^^R7      p\        V4      pVP                  . RO4      p\        W44       \        V^ R7      pVP                  . RO4      p\        W44       \        V^R7      pVP                  . R	O4      p\        W44       \        V^^ R7      pVP                  . R
O4      p\        W44       R# )r    r   r   r{   )r|   r   Nr   )r   r   r   rp   )r   r   r   r   rp   )            r   rp   )r   r   r   r   rp   r   )r,   rL   rZ   r   r   s   &&   r$   test_x_none$TestCumulative_trapezoid.test_x_none   s    KKA1K%$Q'ZZ 56
*$Q2ZZ 89
*$Q1-ZZ 56
*$Q1a8ZZ 89
*r'   r   ra   c                    VP                  ^ ^
^
R7      p\        P                  ! \        RR7      ;_uu_ 4        \	        W1R7       RRR4       R#   + '       g   i     R# ; i)z4If initial is not None or 0, a ValueError is raised.r   z	`initial`matchr   N)r   r   raises
ValueErrorr	   )r,   r   rL   rZ   s   &&& r$   test_initial_error+TestCumulative_trapezoid.test_initial_error  s@    
 KK22K&]]:[99 4 :999s   AA!	c                    \         P                  ! \        R R7      ;_uu_ 4        \        VP	                  . 4      R7       RRR4       R#   + '       g   i     R# ; i)At least one point is requiredr   rZ   N)r   r   r   r	   rI   rK   s   &&r$   test_zero_len_y(TestCumulative_trapezoid.test_zero_len_y  s4    ]]:-MNN 2::b>2 ONNNs   AA	r!   N)r<   r=   r>   r?   r   r   r   r   r   r   r   r   r   r@   rA   rB   s   @r$   r   r      sO     /(*/0+& [[As8553 3r'   r   c                   H   a  ] tR tRt o R tR tR t]R 4       tR t	Rt
V tR# )	TestTrapezoidi  c           	         VP                  R^
R4      p\        VP                  RV^,          ,          4      VP                  ^VP	                  VP
                  4      ,          4      ,          RR7      p\        W1P	                  R4      4       R# )r   g?r{   re   N      )r9   r
   expsqrtrI   pir   )r,   rL   r"   r   s   &&  r$   test_simpleTestTrapezoid.test_simple  sb    IIc2r"bffS16\*RWWQBEE9J5J-KKPST::c?+r'   c                   VP                  ^ ^^4      pVP                  ^ ^^4      pVP                  ^ ^^4      pVP                  V4      V^,          V^ ,          ,
          ,          pV^ ;;,          ^,          uu&   VR;;,          ^,          uu&   VP                  V4      V^,          V^ ,          ,
          ,          pV^ ;;,          ^,          uu&   VR;;,          ^,          uu&   VP                  V4      V^,          V^ ,          ,
          ,          pV^ ;;,          ^,          uu&   VR;;,          ^,          uu&   VR,          VR,          ,           VR,          ,           pVP                  WR,          ,          ^ R7      p	VP                  WR,          ,          ^R7      p
VP                  WR,          ,          ^R7      p\        WR,          ^ R7      p\	        W4       \        WR,          ^R7      p\	        W4       \        WR,          ^R7      p\	        W4       \        W^ R7      p\	        W4       \        W^R7      p\	        W4       \        W^R7      p\	        W4       R# )r   Nr   r   r   )r4   NN)Nr4   N)NNr4   )r   	ones_likesumr
   r   )r,   rL   r"   rZ   zwxwywzqqxqyqzr   s   &&           r$   	test_ndimTestTrapezoid.test_ndim  s   KK1a KK1a KK1b!\\!_!qt,
1

2!\\!_!qt,
1

2!\\!_!qt,
1

2!mq.<@VVA=))V2VVA=))V2VVA=))V2 a]+!4a\?3a\?3 a1%a1%a1%r'   c           
        VP                  VP                  ^ ^^4      R4      pVP                  VP                  ^ ^^4      R4      pVP                  ^R^
4      p\        \        W2^ R7      V4       \        \        W1P	                  . RO4      ^ R7      V4       \        \        W1P	                  . RO4      R,          ^ R7      V4       \
        P                  ! \        4      ;_uu_ 4        \        W1P	                  . RO4      R,          ^ R7       RRR4       VP	                  . RO4      p\        \        W2^R7      V4       \        \        W1P                  ^ ^	^
4      ^R7      V4       R#   + '       g   i     Ld; i)	r   i|  r   N)r   r   )r   r   r   r5   )Nr4   )r   g     P`@g     k@)r   r   r   r
   rI   r   r   	Exception)r,   rL   r"   rZ   out0out1s   &&    r$   test_gh21908TestTrapezoid.test_gh21908C  s   JJr{{1b"-w7JJr{{1b"-w7{{3R(	!q148	!zz-'@qI4Pa::m4W=AF	
 ]]9%%a::m4W=AF & zz/0	!q148a;;q!R0q9	
 &%s   *&E,,E<	c                   \         P                  ! ^4      pW",          pV^8H  p\         P                  P                  W4R7      pRp\	        \        WR4      V4       \         P                  P                  W$R7      p\	        \        WW4      V4       \         P                  P                  W$R7      p\	        \        W74      V4       R# )r   )maskr   N)r8   r9   marS   r   r
   )r,   rL   r"   rZ   r  ymr   xms   &&      r$   test_maskedTestTrapezoid.test_masked[  s     IIaLEAvUU[[[&	"(!,UU[[[&	")1-UU[[[&	!(!,r'   c                @   \        \        ^4      4      pV Uu. uF  q"V,          NK  	  pp\        P                  ! V\        P                  R7      p\        P                  ! V\        P                  R7      p\        W14      p\        WT4      p\        Wg4       R# u upi )r   rG   N)r   r   r8   rI   rJ   r
   r   )r,   r"   trZ   xarryarrresresarrs   &       r$   test_array_likeTestTrapezoid.test_array_likel  so    qNAqUUAzz!2::.zz!2::.o4&$ s   Br!   N)r<   r=   r>   r?   r   r   r  r   r  r  r@   rA   rB   s   @r$   r   r     s3     ,#J
0 - - % %r'   r   c                   d  a  ] tR tRt o R tRR lt]P                  P                  RRR.4      ]P                  P                  R^^.4      R 4       4       t	]P                  P                  RR	R	.RR.RR	.R	R..4      R
 4       t
]P                  P                  RRR.4      R 4       tR tRtV tR# )TestQMCQuadiv  c           
     f  a SP                  R R .4      pSP                  RR.4      pRp\        P                  ! \        VR7      ;_uu_ 4        \	        RW#4       RRR4       Rp\        P                  ! \
        VR7      ;_uu_ 4        \	        R W#4       RRR4       V3R lpR	p\        S4      '       d;   \        P                  ! \        VR7      ;_uu_ 4        \	        WRV4       RRR4       M9\        P                  ! \
        VR7      ;_uu_ 4        \	        WRV4       RRR4       R
p\        P                  ! \        VR7      ;_uu_ 4        \	        R W#RR7       RRR4       Rp\        P                  ! \        VR7      ;_uu_ 4        \	        R W#RR7       RRR4       Rp\        P                  ! \        VR7      ;_uu_ 4        \	        R W#RR7       RRR4       Rp\        P                  ! \
        VR7      ;_uu_ 4        \	        R W#\        P                  P                  ^4      R7       RRR4       Rp\        P                  ! \        VR7      ;_uu_ 4        \	        R W#^
R7       RRR4       R#   + '       g   i     EL.; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     EL; i  + '       g   i     ELx; i  + '       g   i     ELN; i  + '       g   i     EL$; i  + '       g   i     L; i  + '       g   i     R# ; i)rp   re   z`func` must be callable.r   za duckNz/`func` must evaluate the integrand at points...c                      ^# r   r!   r!   r'   r$   r%   3TestQMCQuad.test_input_validation.<locals>.<lambda>  s    Qr'   c                 L   < V P                   ^8X  g   Q hSP                  V 4      # r  )ndimr   r"   rL   s   &r$   func/TestQMCQuad.test_input_validation.<locals>.func  s!    66Q;;66!9r'   z8Exception encountered when attempting vectorized call...z`n_points` must be an integer.c                     ^# r  r!   rT   s   &r$   r%   r        qr'   g     @)n_pointsz!`n_estimates` must be an integer.c                     ^# r  r!   rT   s   &r$   r%   r    r  r'   r   )n_estimatesz8`qrng` must be an instance of scipy.stats.qmc.QMCEngine.c                     ^# r  r!   rT   s   &r$   r%   r    r  r'   )qrngz8`qrng` must be initialized with dimensionality equal to c                     ^# r  r!   rT   s   &r$   r%   r    r  r'   z,`log` must be boolean \(`True` or `False`\).c                     ^# r  r!   rT   s   &r$   r%   r    r  r'   log)rI   r   r   	TypeErrorr   r   r   warnsUserWarningr   qmcSobol)r,   rL   r   bmessager  s   &f    r$   test_input_validation!TestQMCQuad.test_input_validationx  s   JJBx JJBx ,]]9G44Xq$ 5 D]]:W55Y% 6	 MB<<k99!$ :9 z99!$ : 3]]9G44[!8 5 6]]9G44[!C8 5 M]]9G44[!X6 5 M]]:W55[!UYY__Q-?@ 6 B]]9G44[!B/ 54G 544 655 :99 :99 544 544 544 65 544sl   J 	JJ(J<KK$K8-L&L J	J%	(J9	<K	K!	$K5	8L		L	L0	Nc           
       aa \        S4      pVf   \        P                  ! ^4      p^p\        P                  ! V4      p\        P                  ! V4      pV3R lo\        P
                  P                  R4      p	\        P                  P                  WiR7      p
\        P                  ! V4      p\        P                  ! V4      V,          p\        SSP                  WR7      SP                  WR7      WV
R7      p\        P                  P                  WWR7      p\        P                  ! V^,
          R4      VP                   ,          p\#        VP$                  SP                  WR7      VR7       \        P&                  ! V4      VP$                  ,          ^ 8  g   Q h\        P
                  P                  R4      p	\        P                  P                  WiR7      p
\        VV3R	 lSP                  WR7      SP                  WR7      WR
V
R7      pVP$                  P(                  SP*                  8X  d   RMRp\#        SP-                  SP/                  VP$                  4      4      VP$                  VR7       SP1                  VP$                  R,           4      \        P&                  ! V4      ^ 8  d   SP2                  M^ 8X  g   Q h\#        SP/                  VP                   4      VP                   VV^d,          R7       R # )Nc                    < SP                  RSP                  W ,          ^ R7      ,          4      ^SP                  ,          ,          # )ra   r   r   )r   r   r   r  s   &r$   r  $TestQMCQuad.basic_test.<locals>.func  s3    66$!!445RUUCCr'   l   ^^@E9? )seedrG   )r  r!  r#  )lower_limitgףp=
?rW   c                  .   < SP                  S! V !  4      # )Nr&  )argsr  rL   s   *r$   r%   (TestQMCQuad.basic_test.<locals>.<lambda>  s    tT{(;r'   T)r  r!  r'  r#  +=g>r*   y                rV   )r   r8   oneszeroseyerandomdefault_rngr   r+  r,  r   rI   multivariate_normalcdfr   stdtritstandard_errorr   r   prodrH   rJ   realr   imagr   )r,   r  r!  signsrL   rH   r  meancovrngr#  r   r-  r  refrW   logresr+   r  s   &&&&f             @r$   
basic_testTestQMCQuad.basic_test  s,    $=GGAJExx~ffTl	D ii##$78yyt.HHTNGGDME!tRZZZ7A9S (N''++AS+H{1}e4s7I7IIbjjj&BNwwu~cll*Q...ii##$78yyt.;**Q*4bjjj6P#+"/ **bjj8udv 78#,,TRwwv+,"''%.1:LRSTTTv445**DH	Fr'   r  r!  c                ,    V P                  WVR 7       R# ))rL   NrM  )r,   r  r!  rL   s   &&&&r$   
test_basicTestQMCQuad.test_basic  s     	"5r'   rG  re   c                *    V P                  WR 7       R# ))rG  rL   NrP  )r,   rG  rL   s   &&&r$   	test_signTestQMCQuad.test_sign  s    e+r'   r'  FTc           
     d   R p\         P                  ! \        VR7      ;_uu_ 4        \        R VP	                  ^ ^ .4      VP	                  ^ ^.4      VR7      pRRR4       XP
                  V'       d   VP                  ) M^ 8X  g   Q hVP                  ^ 8X  g   Q hR#   + '       g   i     LM; i)z-A lower limit was equal to an upper limit, sor   c                     ^# r  r!   rT   s   &r$   r%   'TestQMCQuad.test_zero.<locals>.<lambda>  s    Qr'   r&  N)r   r)  r*  r   rI   r   infrC  )r,   r'  rL   r.  r  s   &&&  r$   	test_zeroTestQMCQuad.test_zero  s    A\\+W55;

Aq6(:BJJ1v<NTWXC 6||3A666!!Q&&& 65s   3BB/	c                    R  p\        V^ ^4      p\        P                  P                  ^^R7      \        P                  P                  ^ ^R7      ,
          p\	        VP
                  VR4       R# )c                 D    \         P                  P                  V ^R7      # )r    scale)r   normpdfrT   s   &r$   r  -TestQMCQuad.test_flexible_input.<locals>.func  s    ::>>!1>--r'   r^  g{Gz?N)r   r   r`  rA  r   r   )r,   r  r  rK  s   &   r$   test_flexible_inputTestQMCQuad.test_flexible_input  sS    	. tQ"jjnnQan(5::>>!1>+EEc40r'   r!      )re  r   NNi   g      )r<   r=   r>   r?   r/  rM  r   r   r   rQ  rT  rZ  rc  r@   rA   rB   s   @r$   r  r  v  s     )0V!FF [[Z$7[[]QG46 5 86 [[WBx#sc2YS	&RS, T, [[UUDM2' 3'1 1r'   r  r"   r|   r   r   c          	        a	 V P                   V,          ^8  d(   Vf   \        WW$RR7      # V\        WW$^ R7      ,           # \        P                  ! WR4      p \        P                  ! V4      ^8  d   \        P                  ! WR4      MTp\        P                  ! V4      ^8  d   \        P                  ! W$R4      MTp\        P                  ! V4      ^8  d   \        P                  ! W4R4      MTpV P                   R,          o	Ve   V\        P
                  ! S	4      ,          MTpVRJ pV'       d   ^ MTp\        P                  ! WP                   4      p\        P                  ! W0P                   RR R,           4      p\        P                  ! WV3RR7      pV	3R lp\        P                  ! VRV4      pV'       d
   VR,          MTp\        P                  ! VRV4      pV# )r   N)r"   r|   r   r   r   c                 N   < \        V R S V S^S,           V ^S,          R  R7      # )N)r"   r   )r   )r   r#   s   &r$   r~   *cumulative_simpson_nd_reference.<locals>.f  s,    !!BQ%1Qqs8QqstWEEr'   r   r  .r   )	r   r	   r8   moveaxisr  r9   broadcast_toconcatenateapply_along_axis)
rZ   r"   r|   r   r   initial_was_noner   r~   r  r#   s
   &$$$$    @r$   cumulative_simpson_nd_referencero    sp   wwt}q?'2$OO1!RTUVVV 	AR A$&GGAJNAR A&(ggbkAoRr	"2B020@10Dbkk','G 	
A^RYYq\A$#aG 	77#Aoogwws|d':;G
gR0AF


aQ
'C +#g,C
++c2t
$CJr'   c                   (  a  ] tR tRt o ]P
                  ! ^4      t]^,          t]P                  P                  RR'4      ]P                  P                  RR'4      R 4       4       t]! RR7      ]P                  P                  R]P
                  ! R(^4      4      ]P                  P                  R	R)4      ]P                  P                  R
R*4      ]P                  P                  RR+4      ]P                  P                  RR,4      R 4       4       4       4       4       4       t]P                  P                  R-R]! . R.OR7      3R]! ]. R/O.]].R7      3R]! ]]].]]].^ R7      3R]! . . R7      3R]! ^R7      3R]! ]P
                  ! ^4      R7      3R]! ]P
                  ! ^4      R7      3R]! R]P
                  ! ^4      R7      3.4      R 4       tR tR t]P                  P%                  ^
4      ]P                  P&                  ]! ]P,                  ! ]P.                  ]P0                  ! ^^^
R7      ]P4                  ! R0^
RR7      P7                  R  4      R!7      R"7      R# 4       4       4       t]P                  P%                  ^
4      ]P                  P&                  ]! ]P,                  ! ]P.                  ]P0                  ! ^^^
R7      ]P4                  ! R0^
RR7      P7                  R$ 4      R!7      R"7      R% 4       4       4       tR&tV tR# )1TestCumulativeSimpsoni  use_dxFTuse_initialc                ~   \         P                  P                  R 4      p^
pV'       d   ^M^pVP                  VP                  4       4      pV^8X  d6   VP                  \         P                  ! VP                  V4      4      4      pMGVP                  WSP                  R7      V,          VP                  VP                  4       4      ,           pVP                  V^,           VP                  R7      RVP                  3,          p	VP                  VP                  V^,           4      4      RVP                  3,          p
VP                  WV	,          ,          ^ R7      pVP                  WV	^,           ,          ,          V	^,           ,          ^ R7      pV'       d   TMW^ ,          ,
          R,          pV'       d
   V^ ,          MRpV'       d   RV/MRV/p\        V3/ VBRV/B pV'       g   \        VVR	R
7       R# V'       d   ^ M^p\        VVRR
7       \        VVR^1,          VVR^1,          R	R
7       R# )   F*BG rG   r4   r   r   Nr|   r"   r   gV瞯<r*   g{Gzd?)r8   r>  r?  rI   sortr9   rJ   newaxisr   r   r   )r,   rr  rs  rL   rJ  r#   orderr|   r"   r   crZ   YrK  r   kwargr  i0s   &&&&              r$   r   TestCumulativeSimpson.test_1d  s   
 ii##$89 ZZ

%A:

2773::a=12A		!::	.r1BJJszz|4LLAIIeairzzI21bjj=AJJszz%!),-am<FF1T6F"FF1QZ<Q'aF0aQtVRL &!A$4$r
3( =e=W= C51!qBC62CAJBEE
?r'   )cpu_onlyr   x_ndimx_leni_ndimNr|   c                   \         P                  P                  R 4      p^^V.pVR,          W,          uW&   VR&   VP                  4       p	^W&   V^8X  d   T	MRp
VP	                  VP                  VR7      4      pRRr\V'       d<   V^8  d   VP                  V	R7      MVP                  4       pVP	                  V4      pMlV^8  d)   \         P
                  ! VP                  VR7      VR7      M+\         P
                  ! VP                  W,          R7      4      pVP	                  V4      pVf   RM VP	                  VP                  V
R7      4      p\        WW]VR7      p\        \         P                  ! V4      \         P                  ! V4      Vf   RM\         P                  ! V4      Vf   RM\         P                  ! V4      VR7      p\        WP	                  V4      RR7       R# )	ru  sizeNr   )r"   r|   r   r   V瞯<r*   r   r!   )	r8   r>  r?  copyrI   rv  r   ro  r   )r,   r   r  r  r  r|   rL   rJ  r   shape_len_1i_shaperZ   r"   r   r  rK  s   &&&&&&&         r$   test_ndTestCumulativeSimpson.test_nd1  s    ii##$89 Au!&rEKU2Yjjl!'1+" JJszzuz-.d217!-BBB?Ez/d;ggcjjekj:; 

1A .$bjj9Q.R !BdK .JJqMRZZ]rztrzzRT~#ODG1D4
 	ZZ_59r'   zx must be strictly increasingrT   )r"   rZ   )r"   rZ   r   r   z-`axis=4` is not valid for `y` with `y.ndim=1`r   z+shape of `x` must be the same as `y` or 1-Dz'`initial` must either be a scalar or...r   z"`dx` must either be a scalar or...)r"   r|   c                    \        VP                  V P                  4      VP                  V P                  4      R R RR7      pVP	                  4        UUu/ uFC  w  rVT\        V\        4      '       d&   VP                  \        P                  ! V4      4      MTbKE  	  ppp\        P                  ! \        VR7      ;_uu_ 4        \        R/ \        V3/ VB B  R R R 4       R # u uppi   + '       g   i     R # ; i)N)rZ   r"   r|   r   r   r   r   r!   )dictrI   y0x0items
isinstancer   r8   r   r   r   r   )r,   r.  kwarg_updaterL   kwargs0kvs   &&&&   r$   test_simpson_exceptions-TestCumulativeSimpson.test_simpson_exceptionsX  s     DGG,

4770C#". %1$6$6$8:$8DA 
1d8K8K2::bjjm4QRR$8 	 :]]:W55?g!>!>? 65:555s   A	C&C,,C=	c                    \         P                  P                  R 4      pVP                  VP                  ^
R7      4      p\	        VRR7      p\        WAP                  ^	VP                  R7      4       R# )ru  r  rp   r{   rG   N)r8   r>  r?  rI   r   r   r<  rJ   )r,   rL   rJ  rZ   r  s   &&   r$   test_special_cases(TestCumulativeSimpson.test_special_casesj  sU    ii##$89JJszzrz*+ r*XXarzzX:;r'   c                   \         P                  ! VRR7      p\        W4      p\        VRRRR13,          VRRRR13,          4      RRRR13,          p. VP                  RR O^N5p\         P                  ! \         P
                  ! V4      VR,          VRRR13,          ,
          \         P
                  ! V4      .RR7      pRVR&   V# )aB  `cumulative_simpson` and `simpson` can be tested against other to verify
they give consistent results. `simpson` will iteratively be called with
successively higher upper limits of integration. This function calculates
the theoretical correction required to `simpson` at even intervals to match
with `cumulative_simpson`.
r   .Nrp   r   ri  ).:r   Nr    )r8   diffr   r   rl  r<  )r,   rZ   r"   dsub_integrals_h1sub_integrals_h2zeros_shapetheoretical_differences   &&&     r$   1_get_theoretical_diff_between_simps_and_cum_simpsGTestCumulativeSimpson._get_theoretical_diff_between_simps_and_cum_simpsu  s     GGAB@F@c4R4iL!C2I,

tt)
 )(a(!#%!'*-=c3B3h-GG%
 "
 -0y) &%r'   )max_dimsmin_sidemax_side)	allow_nanc                    \        V 4      R 8  # gHz>absrT   s   &r$   r%   TestCumulativeSimpson.<lambda>      #a&SW-r'   )elementsr   c                6   R p\        VP                  V4      RR7      pV! V4      pV P                  V\        P                  ! VP
                  R,          4      R7      p\        VR	,          VP                  VR	,          VR	,          ,           4      RR7       R# )
E  Theoretically, the output of `cumulative_simpson` will be identical
to `simpson` at all even indices and in the last index. The first index
will not match as `simpson` uses the trapezoidal rule when there are only two
data points. Odd indices after the first index are shown to match with
a mathematically-derived correction.c                     \         P                  ! \        ^V P                  R,          ^,           4       Uu. uF  p\	        V RRV13,          RR7      NK  	  upRR7      # u upi )r    .Nre   r{   r   r   r8   stackr   r   r   )rZ   r   s   & r$   simpson_referencehTestCumulativeSimpson.test_cumulative_simpson_against_simpson_with_default_dx.<locals>.simpson_reference  sS    886;Aqwwr{1}6MN6M37,6MNUW Ns   !A!re   r{   rT   gؗҜ<r6  Nr   ri  )r   rI   r  r8   r9   r   r   )r,   rZ   rL   r  r  rK  r  s   &&&    r$   7test_cumulative_simpson_against_simpson_with_default_dxMTestCumulativeSimpson.test_cumulative_simpson_against_simpson_with_default_dx  s    "	
 !A37"!%!W!W1772;' "X "
 	L"**S\4J74S%ST	
r'   c                    \        V 4      R 8  # r  r  rT   s   &r$   r%   r    r  r'   c           	     8   ^
VP                   R,          ^,
          ,          p\        P                  ! ^ ^
VP                   R,          R7      pVR,          RV,          \        P                  P	                  R^\        V4      ^,
          4      ,          ,           VR&   R p\        VP                  V4      VP                  V4      R7      pV! W4      pV P                  W4      p\        VR,          VP                  VR,          VR,          ,           4      4       R# )	r  r   r   rP   c                     \         P                  ! \        ^V P                  R,          ^,           4       Uu. uF&  p\	        V RRV13,          VRRV13,          R7      NK(  	  upRR7      # u upi )r    .NrT   r   r   r  )rZ   r"   r   s   && r$   r  XTestCumulativeSimpson.test_cumulative_simpson_against_simpson.<locals>.simpson_reference  s`    88<A!QWWR[QR]<ST<Sq37qbqbz2<ST Ts   ,A,rT   Nr   ri  )
r   r8   r   r>  uniformlenr   rI   r  r   )	r,   rZ   rL   intervalr"   r  r  rK  r  s	   &&&      r$   'test_cumulative_simpson_against_simpson=TestCumulativeSimpson.test_cumulative_simpson_against_simpson  s    " qwwr{Q'KK21772;/"HRYY%6%6r1c!fqj%III"	 !A"**Q-@%!%!W!W"
 	L"**S\4J74S%ST	
r'   r!   )FT)r   r   )r   r       )Nr   r   )NT)r.  r  )r    r    r   r   )r    r    r   r   r   ) r<   r=   r>   r?   r8   r9   r  r  r   r   r   r   skip_xp_backendsr  r  r  r  r  	fail_slowslowr   hyp_numarraysrJ   array_shapesstfloatsfilterr  r  r@   rA   rB   s   @r$   rq  rq    s    	1B	QB[[X}5[[]M:!@ ; 6!@F t$[[VRYYr1%56[[Xv.[[Wi0[[X}5[[T<0: 1 6 1 / 7 %:B [[8	($*>?	($"l1CBx*PQ	($"b""b"TU*VW	)4"+;<	8$A,G	6ryy|8LM	2D14NO	-tdryy|/LM	; 	@	@<&< [[2[[

..JJ  !a"EYYsB%8??@WX

  
. [[2[[

..JJ  !a"EYYsB%8??@WX

  
r'   rq  c                      a  ] tR tRt o R tR t]P                  P                  R]	! ]
! ^^ ^4      4      ]	! ]
! ^#^^4      4      ,           4      R 4       tRtV tR# )TestLebedevi  c                    R p\         P                  ! \        VR7      ;_uu_ 4        \        P                  ! R4       RRR4       R#   + '       g   i     R# ; i)zOrder n=-1 not available...r   Nr   )r   r   NotImplementedErrorr   lebedev_rule)r,   r.  s   & r$   r/  !TestLebedev.test_input_validation  s6    /]].g>>""2& ?>>>s   AA	c                    R  p\         P                  ! ^4      w  r#W1! V4      ,          pRp\        WERR7       \        \        P                  ! V4      ^\        P
                  ,          4       R# )c                 <    \         P                  ! V ^ ,          4      # )r   )r8   r   rT   s   &r$   r~   &TestLebedev.test_quadrature.<locals>.f  s    66!A$<r'   g9-@r:  r*   N)r   r  r   r8   r   r   )r,   r~   r"   wr  rK  s   &     r$   test_quadratureTestLebedev.test_quadrature  sQ    	  %%b)!A$hu-q	1ruu9-r'   rx  c                   \         P                  ! V4      w  r#\        P                  ! R R R7      ;_uu_ 4        \        P
                  ! VP                  ^ R7      p\        VP                  ^ RR7       RRR4       \        \        P                  ! V4      ^\        P                  ,          4       R#   + '       g   i     LG; i)ignore)divideinvalidr   r  r6  N)r   r  r8   errstater   directional_statsTr   mean_resultant_lengthr   r   )r,   rx  r"   r  r  s   &&   r$   test_propertiesTestLebedev.test_properties  sw    %%e,[[(;;))!##A6CC55quE < 	q	1RUU7+	 <;s   ;B33C	r!   N)r<   r=   r>   r?   r/  r  r   r   r   r   r   r  r@   rA   rB   s   @r$   r  r    sV     '
. [[Wd5B?&;d5SRSCT>U&UV, W,r'   r  r   )5r   numpyr8   numpy.testingr   r   r   
hypothesisr   hypothesis.strategies
strategiesr  hypothesis.extra.numpyextrar  scipy.integrater   r   r	   r
   r   r   r   r   r   scipy.integrate._quadraturer   scipyr   r   r   scipy.conftestr   scipy._lib._array_apir   r   r   scipy._lib._array_api_no_0dr   r   r   r  r   rE   r_   rx   r   r   r  ro  rq  r  r  r!   r'   r$   <module>r     s     L L  " ( (; ; ; N + + . O O H;;// :3 3 3  4
X 
X 
X < &> &> !&>R 7Y' Y' Y'x '(V3 V3 )V3r 9\% \% \%~ 8h1 h1 h1V"D "T "4 "b "J %&M
 M
 'M
` 9))*, , +,r'   