+
    ,i                     R   ^ RI t ^ RIHt ^ RIHtHtHtHtHtH	t	 ^ RI
t^ RI
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Ht ^ RIHt ^ RIH t H!t" ^]P                  ! ]#4      PH                  ,          t%]! ]#4      PH                  t&]PN                  ]PP                  ]PR                  ]PT                  ]PV                  .t,]P2                  .t-],]-,           t.R	 t/R
 t0R t1R t2R t3R t4R t5]R 4       t6 ! R R4      t7 ! R R]74      t8 ! R R]74      t9R t:R t;R t< ! R R4      t=R t>] P~                  P                  R 4       tA] P~                  P                  R 4       tBR tCR  tDR! tE] P~                  P                  R"^
]P                  3^d]P                  3.4      R# 4       tI] P~                  P                  R$ 4       tJ] P~                  P                  R%. R3O4      R& 4       tK] P~                  P                  R'. R3O4      R( 4       tL] P~                  P                  R%. R3O4      ] P~                  P                  R)R*R+.4      R, 4       4       tM] P~                  P                  R- 4       tN] P~                  P                  R%. R3O4      ] P~                  P                  R)R*R+.4      R. 4       4       tOR/ tPR0 tQ] P~                  P                  R'].4      R1 4       tR] P~                  P                  R']PN                  ]PP                  ]PR                  ]PT                  .4      R2 4       tSR# )4    N)	lru_cache)assert_warnsassert_assert_allcloseassert_equalassert_array_equalsuppress_warnings)finfopowernanisclosesqrtexpsincos)optimize)	_zeros_pynewtonroot_scalarOptimizeResult)getfullargspec_no_self)	get_tests	functionsc                 >    V ^,          ^V ,          ,
          ^,
          #     xs   &A/usr/lib/python3/dist-packages/scipy/optimize/tests/test_zeros.pyf1r!   !   s    6AE>A    c                 "    ^V ,          ^,
          # r   r   r   s   &r    f1_1r$   %   s    q519r"   c                 "    R ^ V ,          ,           #        @r   r   s   &r    f1_2r(   )   s    Q;r"   c                 B    \        V 4      \        V 4      \        V 4      3# N)r!   r$   r(   r   s   &r    f1_and_p_and_ppr+   -   s    a5$q'47""r"   c                 8    \        V 4      \        V 4      ,
          # r*   r   r   r   s   &r    f2r.   2       q6CF?r"   c                 8    \        V 4      \        V 4      ,           # r*   )r   r   r   s   &r    f2_1r1   6   r/   r"   c                 8    \        V 4      \        V 4      ,           # r*   r-   r   s   &r    f2_2r3   :   r/   r"   c                     V # r*   r   r   s   &r    f_lrucachedr5   ?   s    Hr"   c                      a  ] tR t^Dt o ^]P
                  ! ]4      P                  ,          t^]P
                  ! ]4      P                  ,          t	RR lt
RR ltRR ltRtV tR# )TestScalarRootFindersNc           	        . pT;'       g    .  F7  pWq9  d   R RRRRR/P                  Ww4      pVP                  W,          4       K9  	  \        R/ VB pVP                  RRRR	/4       T;'       g    .  F  pW,          W&   K  	  VP                  R
4      p	VP                  RR4      p
 V! VRV
/VB w  rWV3#   \         d3    T	\
        P                  ! \        RR\
        P                  T4      T3u # i ; i)ax0bx1funcffull_outputTdispFrootargsr   )	getappenddictupdate	ExceptionzerosRootResultsr   
_EVALUEERR)selftcmethodsig_args_keyssig_kwargs_keyskwargsmethod_argskmethod_kwargsrA   	func_argsrrrs   &&&&&,       r    _run_one_test#TestScalarRootFinders._run_one_testJ   s   $$"$A{$T637;;AAru%	 % vmT65AB &&B&A!uM ' vvf~FF62&		VKIiI=IEAR< 	V**3B8H8H&QSUUU	Vs   +B; ;:C87C8c                X   \        V4      p\        VP                  '       * 4       \        VP                  4      p\        VP
                  4      V,
          pVP
                  RV p	. p
VR9   dA   VR9   d*   V
P                  R4       VR9   d   V
P                  R4       V P                  VR&   MV P                  VR&   V P                  VR&   V Uu. uF#  p\        V P                  ! W3RV	RV
/VB 4      NK%  	  ppT;'       g    . pV Uu. uF  q^,          P                  '       d   K  VNK!  	  ppV Uu. uF  qR,          R	,          V9  g   K  VNK  	  ppV Uu. uF  qR,          R	,          NK  	  pp\        \        V4      V.^ . .4       RV P                  RV P                  /pVP                  ! R/ VB  VR,          pVP                  RVR,          4      pV Uu. uF  q^,          P                  '       g   K  VNK!  	  ppV Uu. uF  q^,          P                  NK  	  ppV Uu. uF  q^ ,          NK  	  pp\!        VVV4       UUUu. uF?  w  ppp\#        VVVVR
7      '       d   K  VR,          R	,          V9  g   K5  V.V,           NKA  	  ppppV UUUUu. uF1  w  ppppVR,          ! V.VP                  R\%        4       4      O5!  NK3  	  ppppp\!        VV4       UUu. uF  w  ppV^ 8w  g   K  V.V,           NK  	  ppp\        V\        V4      .. ^ .4       V Uu. uF  pV^,          P&                  NK  	  ppV Uu. uF  pVNK  	  p p\        VV 4       R# u upi u upi u upi u upi u upi u upi u upi u upppi u uppppi u uppi u upi u upi )zRun test-cases using the specified method and the supplied signature.

Extract the arguments for the method call from the test case
dictionary using the supplied keys for the method's signature.Nfprimefprime2tolxtolrtolrO   rP   ID)r_   atolr>   rB   )secantr   halley)r   rc   )rc   rC   r   )_getfullargspecr   
kwonlyargslendefaultsrB   rE   r^   r_   listrX   	convergedr   rG   rD   rA   zipr   tuplerN   )!rL   testsrN   name
known_failrQ   sig	nDefaults	nRequiredrO   rP   rM   resultseltnotcvgdnotcvged_IDStolsr_   ra   cvgdapproxcorrectr9   cnotclosearootfulloutfvsfvresultmethod_from_result_expected_methods!   &&&&&,                           r    	run_testsTestScalarRootFinders.run_testsa   sv    f%CNN"#%	MI-	),11++&&x0:%#**95 IIF5M!YYF6N!YYF6N CHIBGB **7&37+7/57 8BG 	 I
  %%2
")B'3Q1A1A33'B")M'3WT]*-L33'M189#B9c,'6B@ 		64995fF|xxtF|,&;wa&*:*:w;)-.#a&++.%)*Tcq66T*/267D/I 9/I)!Q14d;; BZ7 QC#II/I 9
 -56,4(5!Wb #wu7rvvfeg67,4 	 6.1#x.@L.@72sB!GJRD3JJ.@LhH.Q8=DEW6fQi..WE)01A41'9?I CM9 <.*96LE1sl   )M*M/+M/7M4M4M9#M>M>N/NN3N
N#7N
.N?N-N"N'c                J    \        WR7      pV P                  ! WrV3RV/VB  R# )zmRun a collection of tests using the specified method.

The name is used to determine some optional arguments.
smoothnessrn   N)r   r   )rL   
collectionrN   rm   r   rn   rQ   rl   s   &&&&&&, r    run_collection$TestScalarRootFinders.run_collection   s&    
 *<udLzLVLr"   r   )NNr*   )__name__
__module____qualname____firstlineno__npr
   floatepsr^   r_   rX   r   r   __static_attributes____classdictcell____classdict__s   @r    r7   r7   D   sO      rxx"""Drxx"""DV.9:vM Mr"   r7   c                     a  ] tR t^t o ]P
                  P                  R]4      ]P
                  P                  R]4      R 4       4       t	]P
                  P                  R]4      ]P
                  P                  R]4      R 4       4       t
]P
                  P                  R]4      ]P
                  P                  R]4      R 4       4       t]P
                  P                  R]4      R 4       t]P
                  P                  R]P                  ]P                  ]P                   .4      R 4       t]P
                  P                  R]4      R 4       tR	 tR
tV tR# )TestBracketMethodsrN   functionc           	     8   R \        ^4      rC\        W!P                  W4.VV P                  V P                  R7      pVP
                  '       g   Q h\        VP                  RV P                  V P                  R7       VP                  VP                  8X  g   Q hR#       ?)rN   bracketr:   r^   r_         ?ra   r_   N)	r   r   r   r^   r_   ri   r   rA   rN   rL   rN   r   r9   r;   rV   s   &&&   r    test_basic_root_scalar)TestBracketMethods.test_basic_root_scalar   sp     4711&Q!YYTYY8{{{{$))$))Dxx6??***r"   c           	         R \        ^4      rCV! W#W@P                  V P                  RR7      w  rVVP                  '       g   Q h\	        VRV P                  V P                  R7       R# )r   T)r^   r_   r?   r   r   N)r   r^   r_   ri   r   )rL   rN   r   r9   r;   rA   rV   s   &&&    r    test_basic_individual(TestBracketMethods.test_basic_individual   sR     471aiidii%)+ {{{{c				Br"   c           	     ^   R \        ^4      rC\        W!P                  \        P                  ! W4.4      W0P
                  V P                  R7      pVP                  '       g   Q h\        VP                  RV P
                  V P                  R7       VP                  VP                  8X  g   Q hR# r   )r   r   r   r   arrayr^   r_   ri   r   rA   rN   r   s   &&&   r    test_bracket_is_array(TestBracketMethods.test_bracket_is_array   sz     471 "! 0QYY!YY( {{{{$))$))Dxx6??***r"   c                B    V P                  R WP                  ^R7       R# )apsr   N)r   r   )rL   rN   s   &&r    test_aps_collection&TestBracketMethods.test_aps_collection   s    E6??qIr"   c                v    V\         P                  8X  d   R 0M/ pV P                  RWP                  VR7       R# )zfun7.4chandrupatla)rn   N)rI   ridderr   r   )rL   rN   rn   s   && r    test_chandrupatla_collection/TestBracketMethods.test_chandrupatla_collection   s6     $*U\\#9hZr
NFOO'1 	 	3r"   c                n    R^r2V! \         W#RR7      w  rEVP                  '       g   Q h\        V^ 4       R# )   Tr?   NrC   )r5   ri   r   )rL   rN   r9   r;   rA   rV   s   &&    r    test_lru_cached_individual-TestBracketMethods.test_lru_cached_individual   s3     11a={{{{a r"   c           	         \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! R R^ RR7       RRR4       R#   + '       g   i     R# ; i)zmaxiter must be >= 0matchc                 "    V ^,          ^,
          # r   r   r   s   &r    <lambda>2TestBracketMethods.test_gh_22934.<locals>.<lambda>   s    1a4!8r"   maxiterNrC   )pytestraises
ValueErrorrI   brentqrL   s   &r    test_gh_22934 TestBracketMethods.test_gh_22934   s7    ]]:-CDDLL+RB? EDDDs   AA	r   N)r   r   r   r   r   markparametrizebracket_methodststutils_functionsr   r   r   r   rI   bisectr   toms748r   r   r   r   r   r   s   @r    r   r      sW    [[X7[[Z);<
+ = 8
+ [[X7[[Z);<	C = 8	C [[X7[[Z);<+ = 8+ [[X7J 8J [[Xell(-(7 8383
 [[X7! 8!@ @r"   r   c                     a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR t]P                   P"                  R 4       tR tR t]P                   P"                  R 4       tR tR t]P                   P1                  R]! 4       RR/.4      R 4       t]P                   P1                  RRR.4      R 4       tR tRtV tR# )
TestNewtonc           	     |    R .pVRR.,          pR F'  pV P                  V\        P                  R^VR7       K)  	  R# )	aps.13.00z	aps.12.05	aps.12.17r   r   rn   Nr   complexr   rI   r   rL   rn   r   s   &  r    test_newton_collections"TestNewton.test_newton_collections   sE    !]
{K00
,J
ELL(+,   E -r"   c           	     h    . ROpR F'  pV P                  V\        P                  R^VR7       K)  	  R# )	aps.12.06rc   r   N)r   z	aps.12.07z	aps.12.08z	aps.12.09z	aps.12.10z	aps.12.11z	aps.12.12z	aps.12.13z	aps.12.14z	aps.12.15z	aps.12.16r   z	aps.12.18r   r   r   r   s   &  r    test_halley_collections"TestNewton.test_halley_collections   s8    0
 -J
ELL(+,   E -r"   c           	        \         \        \        3\        \        \
        33 F  w  rp\        P                  ! V^RR7      p\        V! V4      ^ RR7       \        P                  ! V^^RR7      p\        V! V4      ^ RR7       \        P                  ! V^VRR7      p\        V! V4      ^ RR7       \        P                  ! V^W#RR7      p\        V! V4      ^ RR7       K  	  R# )   ư>r]   ra   )r<   r]   )r[   r]   )r[   r\   r]   N)	r!   r$   r(   r.   r1   r3   rI   r   r   )rL   r>   f_1f_2r   s   &    r    test_newtonTestNewton.test_newton   s    t,r4.>?KACQt,AAaD!$/QaT2AAaD!$/Q#48AAaD!$/Q#EAAaD!$/ @r"   c           	     l   \         \        \        3\        \        \
        33 F4  w  rp\        VR^VRR7      p\        V! VP                  4      ^ RR7       K6  	  \         \        \        3\        \        \
        33 F3  w  rp\        VR^RR7      p\        V! VP                  4      ^ RR7       K5  	  R# )z#Invoke newton through root_scalar()r   r   )rN   r:   r[   r^   r   rN   r:   r^   N	r!   r$   r(   r.   r1   r3   r   r   rA   rL   r>   r   r   rV   s   &    r    test_newton_by_nameTestNewton.test_newton_by_name  s    t,r4.>?KACAh1StLAAaffIqt4 @  t,r4.>?KACAh14@AAaffIqt4 @r"   c           	        \         \        \        3\        \        \
        33 Fb  w  rp\        VR^^RR7      p\        V! VP                  4      ^ RR7       \        VR^^RR7      p\        V! VP                  4      ^ RR7       Kd  	  \         \        \        3\        \        \
        33 F3  w  rp\        VR^RR7      p\        V! VP                  4      ^ RR7       K5  	  R# )z#Invoke secant through root_scalar()rb   r   rN   r:   r<   r^   r   r   Nr   r   s   &    r    test_secant_by_nameTestNewton.test_secant_by_name  s    t,r4.>?KACAh1FAAaffIqt4Ah1FAAaffIqt4	 @
  t,r4.>?KACAh14@AAaffIqt4 @r"   c           
         \         \        \        3\        \        \
        33 F4  w  rp\        VR^W#RR7      p\        V! VP                  4      ^ RR7       K6  	  R# )z#Invoke halley through root_scalar()rc   r   )rN   r:   r[   r\   r^   r   Nr   r   s   &    r    test_halley_by_nameTestNewton.test_halley_by_name  sN    t,r4.>?KACAh1#&$@AAaffIqt4 @r"   c           
     p   R p\         P                  ! \        VR7      ;_uu_ 4        \        \        R\
        ^RR7       RRR4       Rp\         P                  ! \        VR7      ;_uu_ 4        \        \        R\        ^RR7       RRR4       R#   + '       g   i     LY; i  + '       g   i     R# ; i)z$fprime2 must be specified for halleyr   rc   r   )rN   r[   r:   r^   Nz#fprime must be specified for halley)rN   r\   r:   r^   )r   r   r   r   r!   r$   r(   )rL   messages   & r    test_root_scalar_fail TestNewton.test_root_scalar_fail   sp    8]]:W558DQTJ 67]]:W558TadK 65 65 655s   B.B$B!	$B5	c                   R pR pR p\         P                  ! . RO4      p\         P                  ! \        ^
4      4      R,           R,          pWERR^
R3pR.^
,          p\        P
                  ! WW&4      pRp	\        W4       \        P
                  ! WW&VR	7      p\        W4       \        P
                  ! WVR
7      p\        W4       R# )ztest newton with arrayc                     V^ ,          W^,          ,          ,           pV^,          V^,          \         P                  ! W!^,          ,          4      R,
          ,          ,
          W!^,          ,          ,
          V ,
          # )r   r   r   r   r   r9   r;   s   &* r    r!   (TestNewton.test_array_newton.<locals>.f1+  sQ    !qQ4xAQ4!A$"&&qT"2S"899A!HDqHHr"   c                    V^,          V^,          ,          pV^,          ) \         P                  ! V^ ,          V^,          ,          W,          ,           4      ,          V,          V^,          V^,          ,          ,
          ^,
          # r   r   r   s   &* r    r$   *TestNewton.test_array_newton.<locals>.f1_1/  s[    !qtAaD5266!A$1+"566:QqTAaD[H1LLr"   c                     V^,          V^,          ,          pV^,          ) \         P                  ! V^ ,          V^,          ,          W,          ,           4      ,          V^,          ,          # r   r   r   s   &* r    r(   *TestNewton.test_array_newton.<locals>.f1_23  sI    !qtAaD5266!A$1+"566A==r"   r   g      @&.>Mbp?n2d?)r\   rB   N)
g4O@gNk@g]0J@g]Qݚt@g~EO5@g$J ?g~5,@gXCڭ@gͮ9@@gӍ@)
gԩ˰@g9~4b'@gaq(@g0p@gk"z?g4se?gU+F@gwQu%@gd6)@g)i!@)r   r   r   rangerI   r   r   )
rL   r!   r$   r(   a0a1rB   r:   r   
x_expecteds
   &         r    test_array_newtonTestNewton.test_array_newton(  s    	I	M	> XX 
  ffU2Y#%,ub'2URZLL,

 	&LLT:&LLd+&r"   c                d   R  pR p\         P                  ! ^R4      p\        P                  ! WVR7      p\	        V! V4      R4       \         P
                  ! ^4      p\        P                  ! WVR7      p\	        V! V4      R4       \        P                  ! W4      p\	        V! V4      R4       R# )c                 "    V ^,           R,           # )r                 ?r   r   s   &r    r>   /TestNewton.test_array_newton_complex.<locals>.fP  s    q58Or"   c                     R # r   r   r   s   &r    r[   4TestNewton.test_array_newton_complex.<locals>.fprimeS  s    r"   r  )r[           N)r   fullrI   r   r   ones)rL   r>   r[   tr   s   &    r    test_array_newton_complex$TestNewton.test_array_newton_complexO  s    		 GGArNLLf-!b! GGAJLLf-!b!LL!b!r"   c                    \         P                  ! R R^.\        P                  ! ^^.4      .R7      p\	        VR4       R# )z8test secant doesn't continue to iterate zero derivativesc                 .    W ,          V^ ,          ,
          # r   r   r   r9   s   &*r    r   >TestNewton.test_array_secant_active_zero_der.<locals>.<lambda>d  s    qsQqTzr"   gˡE}@)r:   rB   N)f~@g      @)rI   r   r   r   r   rL   r   s   & r    !test_array_secant_active_zero_der,TestNewton.test_array_secant_active_zero_derb  s7    LL1uaj!xxR12434r"   c                    \         P                  ! R  R.^,          RR.3R7      p\        VR4       \         P                  ! R ^.^,          ^^.3R7      p\        VR4       R# )c                      W^,          ,
          # r   r   yzs   &&r    r   7TestNewton.test_array_newton_integers.<locals>.<lambda>j  
    aq&jr"         @g      .@g      1@r  c                      W^,          ,
          # r   r   r$  s   &&r    r   r'  n  r(  r"   N)gNO@r  )rI   r   r   r  s   & r    test_array_newton_integers%TestNewton.test_array_newton_integersh  sY    LL03%!) $d|o/ABLL01#'"bLABr"   c           	        \        \        \        P                  R  RR.R 4       \        P
                  ! \        4      ;_uu_ 4        \        P                  ! R RR.R RR7      p\        VP                  ^ 4       VP                  P                  4       '       g   Q hVP                  P                  4       '       d   Q h RRR4       R#   + '       g   i     R# ; i)c                 "    V ^,          ^,
          # r   r   r%  s   &r    r   @TestNewton.test_array_newton_zero_der_failures.<locals>.<lambda>u  s    q!taxr"   r  c                     ^V ,          # r   r   r/  s   &r    r   r0  u  s    QUr"   c                 "    V ^,          ^,
          # r   r   r/  s   &r    r   r0  x  s    QTAXr"   c                     ^V ,          # r   r   r/  s   &r    r   r0  y  s    QqSr"   Tr   N)r   RuntimeWarningrI   r   r   warnsr   rA   zero_derallri   any)rL   rr   s   & r    #test_array_newton_zero_der_failures.TestNewton.test_array_newton_zero_der_failuresq  s     	^U\\'"b?	D \\.))ll#5Bx#0dDGGLL!,##''))))((,,..... *)))s   A6C?CC	c                   R  pR pR pR p\        VR^VR7      p\        VR^RR7      p\        VP                  VP                  RR7       \        ^VP                  ,          VP                  4       \        VR	^W#R
7      p\        VR	^RR7      p\        VP                  VP                  RR7       \        ^VP                  ,          VP                  4       R# )c                 >    V ^,          ^V ,          ,
          ^,
          # r   r   r   s   &r    r!   +TestNewton.test_newton_combined.<locals>.f1  s    6AE>A%%r"   c                 "    ^V ,          ^,
          # r   r   r   s   &r    r$   -TestNewton.test_newton_combined.<locals>.f1_1  s    q519r"   c                 "    R ^ V ,          ,           # r&   r   r   s   &r    r(   -TestNewton.test_newton_combined.<locals>.f1_2  s    Q;r"   c                 `    V ^,          ^V ,          ,
          ^,
          ^V ,          ^,
          R3# r   r'   r   r   s   &r    r+   8TestNewton.test_newton_combined.<locals>.f1_and_p_and_pp  s'    a4!A#:a<1Q++r"   r   )rN   r:   r[   T:0yE>r   rc   )rN   r:   r[   r\   )rN   r:   r\   N)r   r   rA   r   function_calls)rL   r!   r$   r(   r+   sol0sols   &      r    test_newton_combinedTestNewton.test_newton_combined~  s    	&			, 2h1TB/(qN		388$7Qs)))4+>+>?2h1TP/(q$O		388$7Qs)))4+>+>?r"   c           
        ^p. ROp\        ^4       EF  pRRRR/pR\        .R\        ..RV  F	  w  rgWuV&   K  	  \        P                  ! \
        V3RR	/VB w  r\        V	P                  4       \        WP                  4       \        V	P                  V	P                  3W4,          4       V^ 8X  d&   V	P                  V	P                  ^,           8:  g   Q hM.\        V	P                  V^,           V	P                  ,          4       V	P                  ^,
          p
\        P                  ! \
        V3R
V
RR	/VB w  r\        V	P                  '       * 4       \        WP                  4       \        V	P                  V
4       V^8X  g   EKz  RV
 R2p\        P                  ! \        VR7      ;_uu_ 4        \        P                  ! \
        V3R
V
RR/VB w  rRRR4       EK  	  R#   + '       g   i     EK  ; i)r   r]   r   r?   Tr[   r\   Nr@   Fr   zFailed to converge after z iterations, value is .*r   ))      )   
   )r   	   )r  r$   r(   rI   r   r!   r   ri   r   rA   
iterationsrF  r   r   RuntimeError)rL   capsysr:   expected_countsderivsrQ   rS   vr   rV   itersmsgs   &&          r    test_newton_full_output"TestNewton.test_newton_full_output  s   
 3AhFT=$9F"D)It+<=gvFq	 G <<B=U=f=DAAKK FF#!,,(8(89?;RS{''1<<!+;;;;Q--
all/JK LL1$E<<BLLELVLDAO$FF#u-{ 2%8PQ]]<s;; <<BSSDSFSDA <;3 2 <;;s   6#G((G:c           	     
   R  pR p\        \        \        P                  VRVRR7       \        P
                  ! \        RR7      ;_uu_ 4        \        P                  ! VRV4       RRR4       R#   + '       g   i     R# ; i)c                 "    V ^,          R,
          # rC  r   r   s   &r    r=   0TestNewton.test_deriv_zero_warning.<locals>.func  s    6C<r"   c                     ^V ,          # r   r   r   s   &r    dfunc1TestNewton.test_deriv_zero_warning.<locals>.dfunc  s    q5Lr"   r  Fr@   zDerivative was zeror   N)r   r4  rI   r   r   r   rR  )rL   r=   r_  s   &  r    test_deriv_zero_warning"TestNewton.test_deriv_zero_warning  sT    	 	^U\\4e%P]]</DEELLsE* FEEEs   A11B	c                    \         P                  ! R ^.4      pVP                  4       p\        \         P                  V\         P
                  4       \        W4       R# )皙?N)r   r   copyr   r   r   r   )rL   r:   x0_copys   &  r    test_newton_does_not_modify_x0)TestNewton.test_newton_does_not_modify_x0  s;    XXsAh'')rvvr266"2'r"   c                6   R  p\        VR^RR7      p\        VR^^RR7      p\        V^^RRR7      ^,          p\        V! VP                  4      ^ RR7       VP                  P                  \        4       8X  g   Q h\        V! VP                  4      ^ RR7       VP                  P                  \        4       8X  g   Q h\        V! VP                  4      ^ RR7       VP                  P                  \        4       8X  g   Q hVP                  VP                  u;8X  d   VP                  8w  g   Q h Q hVP                  VP                  ^,
          u;8X  d>   VP                  u;8X  d,   VP                  u;8w  d   VP                  ^,          8X  g   Q h Q hR	# )
c                 T    \         P                  ! V 4      '       g   Q h\        V 4      # r*   )r   isscalarr!   r   s   &r    r>   +TestNewton.test_gh17570_defaults.<locals>.f  s    ;;q>>!>a5Lr"   r   r   r   rb   r   T)r:   r<   r]   r?   r   N)r   r   r   rA   shaperk   rQ  rF  )rL   r>   res_newton_defaultres_secant_default
res_secants   &    r    test_gh17570_defaults TestNewton.test_gh17570_defaults  s   	 )8M(8a.24 A!tFqI
 	,112ADA!&&,,777,112ADA!&&,,777*//*AD9$$/// #''??1%001 	2 1 	2 1 #--%44q87((7 &007 &44Q6	7 	8 7 	8 7r"   rQ   rN   r   c                    R  p\         P                  ! V3R^RR/VB pVP                  '       g   Q h\        VP                  ^4       R# )c                 D    V^8X  g   Q hV^8X  g   Q hW,          V,
          # r   r   r   s   &&&r    r>   'TestNewton.test_args_gh19090.<locals>.f  s$    6M66M6FQJr"   r:   rB   N)r   r   )r   r   ri   r   rA   )rL   rQ   r>   ress   &&  r    test_args_gh19090TestNewton.test_args_gh19090  sD    	 
 ""1BBB6B}}}}!$r"   rb   c                "   R  p\         P                  ! V^VR7      pVP                  '       g   Q h\        \	        VP
                  4      R4       VP
                  P                  \        P                  ! \        P                  4      8X  g   Q hR# )c                 "    V R,          ^,
          # )r   r   r   r   s   &r    r>   )TestNewton.test_int_x0_gh19280.<locals>.f  s    b519r"   )r:   rN   Ng;f?)	r   r   ri   r   absrA   dtyper   float64)rL   rN   r>   rw  s   &&  r    test_int_x0_gh19280TestNewton.test_int_x0_gh19280  s`    
	 ""16:}}}}CHHw/xx~~"**!5555r"   c           	     8   \         P                  ! \        R R7      ;_uu_ 4        \        P                  ! \
        ^R	R7       RRR4       \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! \
        ^RR
R7       RRR4       \         P                  ! \        RR7      ;_uu_ 4        \        P                  ! \
        ^^R7       RRR4       R#   + '       g   i     L; i  + '       g   i     Lo; i  + '       g   i     R# ; i)ztol too smallr   r   r   Nzmaxiter must be greater than 0)r]   r   zx1 and x0 must be different)r<   ưi)r   r   r   rI   r   r!   r   s   &r    test_newton_special_parameters)TestNewton.test_newton_special_parameters  s     ]]:_==LLQE* > ]]:-MNNLLQD#6 O ]]:-JLLLLQ1% ML >= ON MLLs#   C"/C5:D"C2	5D	D	r   N)r   r   r   r   r   r   r   r   r   r   r   r
  r  r   r+  r   r   thread_unsafer9  rI  rY  rb  rh  rr  r   rF   rx  r  r  r   r   r   s   @r    r   r      s     EE	05	55L%'N"&5C [[
/ 
/@*"TH [[+ +( 8D [[X80D'EF% G% [[X(';<6 =6
& 
&r"   r   c            	         a R oV3R lp \         P                  \         P                  .p\        ;r#V F+  pV! V RRW#R7      p\	        SWRVRVP
                   2R7       K-  	  R# )re  c                    < V S,
          # r*   r   r   rA   s   &r    r>   test_gh_5555.<locals>.f      4xr"       cAr^   r_   zmethod )ra   r_   err_msgN    ח)rI   r   r   TOLr   r   )r>   methodsr^   r_   rN   rw  rA   s         @r    test_gh_5555r    s`    D ||U\\*GDQc8c4")&//): ;	= r"   c            	          R  p Rp^\         ,          p\        P                  \        P                  .pV F  pV! V ^ ^WR7      p\	        RWQVR7       K  	  R# )c                 &    V R 8  d   R# V R,
          # )r   333333?gr   r   s   &r    r>   test_gh_5557.<locals>.f(  s    s7Ks7Nr"   gRQ?r  r  r   N)
_FLOAT_EPSrI   r   brenthr   )r>   ra   r_   r  rN   rw  s         r    test_gh_5557r    sO     Dz>D||U\\*GQ143S$7 r"   c                     a Rp RpW3 F[  w  r#p\         P                  ! V4      o\        P                  \        P                  3 F  pV! V3R lW#4      p\        WF4       K  	  K]  	  R# )      |@c                 >   < \         P                  ! V 4      S,
          # r*   r   )r   rz   s   &r    r   9test_brent_underflow_in_root_bracketing.<locals>.<lambda>A  s    266!9Q;r"   N)g      |g     ug      y)g     u@r  g      y@)r   r   rI   r  r   r   )underflow_scenariooverflow_scenarior9   r;   rA   rN   rw  rz   s          @r    'test_brent_underflow_in_root_bracketingr  6  s[    
 2-)=
dFF4L||U\\2F.5CD& 3 >r"   c                   Z   a  ] tR tRt o ]P
                  ! R^,^.^ RR7      tR tR tRt	V t
R# )	TestRootResultsiE  r   r   )rA   rQ  rF  flagrN   c                H    R p\        \        V P                  4      V4       R# )z      converged: True
           flag: converged
 function_calls: 46
     iterations: 44
           root: 1.0
         method: newtonN)r   reprrV   )rL   expected_reprs   & r    	test_reprTestRootResults.test_reprI  s    I 	T$&&\=1r"   c                J    \        V P                  \        4      '       g   Q hR # r*   )
isinstancerV   r   r   s   &r    	test_typeTestRootResults.test_typeO  s    $&&.1111r"   r   N)r   r   r   r   rI   rJ   rV   r  r  r   r   r   s   @r    r  r  E  s/     sr"1!)	+A22 2r"   r  c            	        R p R pR p\        RR4      pR
p\        P                  ! WWAVRR7      p\        V ! V.VO5!  ^ RR7       V.^
,          pR
p\        P                  ! WWAVRR7      p\        V ! V.VO5!  ^ RR7       R	# )z&Test Halley's works with complex rootsc                 v    V^ ,          V ^,          ,          V^,          V ,          ,           V^,          ,           # r  r   r  s   &*r    r>   test_complex_halley.<locals>.fU  s*    tad{QqTAX%!,,r"   c                 L    ^V^ ,          ,          V ,          V^,          ,           # r   r   r  s   &*r    r    test_complex_halley.<locals>.f_1X  s    1Q4x!|ad""r"   c                 t    ^V^ ,          ,          p \        V 4      pV.V,          #   \         d    Tu # i ; ir   )rf   	TypeError)r   r9   retvalsizes   &*  r    r    test_complex_halley.<locals>.f_2[  sA    QqT	#q6D 8d?"  	M	s   ' 77r   r'   r   )rB   r[   r\   r]   r   N)r'   g      @r)  )r   rI   r   r   )r>   r   r   r&  coeffsr%  s         r    test_complex_halleyr  S  s    -## 	SAFQCTJAAaM&M140	
bAFQCTJAAaM&M140r"   c                   \         P                  ! \        4      P                  R,          pRV,
          RV,           ,          p\	        4       ;_uu_ 4       pVP                  \        R4       \        P                  ! R V.^
,          R7      pRRR4       \        X^d.^
,          4       Rp\	        4       ;_uu_ 4       pVP                  \        R4       \        P                  ! R	 VR
R7      pRRR4       \        V^4       \        P                  ! \        RR7      ;_uu_ 4        \        P                  ! R VRR7      pRRR4       Rp\	        4       ;_uu_ 4       pVP                  \        R4       \        P                  ! R VR
R7      pRRR4       \        VR4       \        P                  ! \        RR7      ;_uu_ 4        \        P                  ! R VRR7      pRRR4       R#   + '       g   i     ELg; i  + '       g   i     EL; i  + '       g   i     L; i  + '       g   i     L; i  + '       g   i     R# ; i)zBTest secant method with a non-zero dp, but an infinite newton stepgQ?g      i@r'   zRMS ofc                 "    V R ,
          ^,          # )g      Y@r   r/  s   &r    r   %test_zero_der_nz_dp.<locals>.<lambda>}  s    AI>r"   r:   NTolerance ofc                 "    V R ,
          ^,          # r  r   r/  s   &r    r   r        AG>r"   F)r:   r@   r   c                 "    V R ,
          ^,          # r  r   r/  s   &r    r   r    r  r"   Tc                 "    V R ,           ^,          # r  r   r/  s   &r    r   r    r  r"   c                 "    V R ,           ^,          # r  r   r/  s   &r    r   r    r  r"   g.ЗK.?g.ЗK.rC   )r   r
   r   r   r	   filterr4  rI   r   r   r   r   rR  )rS  dxp0supr   s   &    r    test_zero_der_nz_dpr  o  s    
%			$B "*r	"B			

>8,LL1rdRi@ 
 Aurz"	$B			

>>2LL1buE 
 Aq	|>	:	:LL1btD 
;	%B			

>>2LL1buE 
 Ar	|>	:	:LL1btD 
;	:# 
		 
		 
;	: 
	 
;	:	:s<   8G+=1G?&H1H&H9+G<	?H	H#	&H6	9I
	c            
       a Rp RoRpRpRpW,          V ,          V,          pV3R lp\         P                  ! \        4      ;_uu_ 4        \        P                  ! V. RO^W@.RR	7      pVP
                  P                  4       '       d   Q h R
R
R
4       \         P                  ! \        4      ;_uu_ 4        \        P                  ! VR.^,          ^W@.RR	7      pR
R
R
4       R
#   + '       g   i     La; i  + '       g   i     R
# ; i)z(Test that array newton fails as expectedre  ga2U0*#?g@g\mJA?gCl@c           	         < ^\         P                  ! V 4      ,          ^\         P                  ! SR,          V,          RV,          \         P                  ! V 4      ,          ,           4      ,          ,           # )r   g@gGz@)r   r   log10)darcy_frictionredia	roughnesss   &&&r    colebrook_eqn1test_array_newton_failures.<locals>.colebrook_eqn  s[    BGGN++BHHY_s2!BY)@@A B BB 	Cr"   {Gz?T)r:   r   rB   r?   N)r  g?gvÖ?g333333?)	r   r5  r4  rI   r   ri   r7  r   rR  )diameterrhomuureynolds_numberr  r   r  s          @r    test_array_newton_failuresr    s     HI
C	BAg(2-OC 
n	%	%7!,$
 ##''))))) 
& 
|	$	$tfqj!!,$
 
%	$ 
&	% 
%	$	$s   
AC%6%C8%C5	8D		c                    R p \         P                  ! V ^ R7      p\        V^ \         P                  \         P                  R7       \         P                  ! V ^ .^
,          R7      p\        V^ \         P                  \         P                  R7       R pR p\         P                  ! V ^ VR7      p\        V^ \         P                  \         P                  R7       \         P                  ! V ^ VVR7      p\        V^ \         P                  \         P                  R7       \         P                  ! V ^ .^
,          VR7      p\        V^ \         P                  \         P                  R7       \         P                  ! V ^ .^
,          VVR7      p\        V^ \         P                  \         P                  R7       \         P                  ! V RVR7      p\        V^ \         P                  \         P                  R7       \         P                  ! V R.^
,          VR7      p\        V^ \         P                  \         P                  R7       R	# )
z@Test that Newton or Halley don't warn if zero derivative at rootc                 0    V ^,          V ^,          ,
          # r   r   r   s   &r    f_zeroder_root9test_gh8904_zeroder_at_root_fails.<locals>.f_zeroder_root  s    !tad{r"   r  r   c                 >    ^V ^,          ,          ^V ,          ,
          # r   r   r   s   &r    fder/test_gh8904_zeroder_at_root_fails.<locals>.fder  s    1a4x!a%r"   c                 "    ^V ,          ^,
          # )rL  r   r   s   &r    fder20test_gh8904_zeroder_at_root_fails.<locals>.fder2  s    sQwr"   )r:   r[   )r:   r[   r\   r   N)rI   r   r   _xtol_rtol)r  rV   r  r  s       r    !test_gh8904_zeroder_at_root_failsr    su    	^*AAqu{{=^B/AAqu{{=  	^$7AAqu{{=^$"	$AAqu{{=^Bt<AAqu{{=^Bt"	$AAqu{{= 	^D9AAqu{{=^b>AAqu{{=r"   c                    a ^	oV3R lp V3R lpV3R lpRp\        WVRR7      w  rEVP                  '       g   Q h\        WWRR7      w  rEVP                  '       g   Q hR# )	zvTest that Halley's method realizes that the 2nd order adjustment
is too big and drops off to the 1st order adjustment.c                 Z   < \        V R S,          4      \        SR S,          4      ,
          # r  r   r   ns   &r    r>   test_gh_8881.<locals>.f  s"    QAq#a%00r"   c                 F   < \        V R S,
          S,          4      S,          # r  r  r  s   &r    fptest_gh_8881.<locals>.fp  s    QQ	"1$$r"   c                    < \        V R ^S,          ,
          S,          4      R S,          ,          R S,
          ,          S,          # r  r  r  s   &r    fpptest_gh_8881.<locals>.fpp  s3    QQqS!$A.#a%8::r"   re  T)r[   r?   r[   r\   r?   N)r   ri   )r>   r  r  r:   rtrV   r  s         @r    test_gh_8881r    s`     	
A1%; 
B 16EB;;;; 1dCEB;;;;r"   c            
     (   R p R pR p\         P                  ! R	.\         P                  R7      p\        WWRR7      w  rEVP                  '       g   Q h\         P                  ! R	R
.\         P                  R7      p\
        P                  ! \        4      ;_uu_ 4        \        P                  ! WWRR7      pRRR4       R p\        P                  ! WWRR7      pVP                  P                  4       '       g   Q hR#   + '       g   i     LP; i)zS
Test that shape is preserved for array inputs even if fprime or fprime2 is
scalar
c                     V ^,          # r   r   r   s   &r    r>   ,test_gh_9608_preserve_array_shape.<locals>.f  s    !tr"   c                     ^V ,          # r   r   r   s   &r    r  -test_gh_9608_preserve_array_shape.<locals>.fp      1ur"   c                     ^# r   r   r   s   &r    r  .test_gh_9608_preserve_array_shape.<locals>.fpp  s    r"   r~  Tr  Nc                 x    \         P                  ! \         P                  ! V 4      ^\         P                  R7      # )r   r  )r   r  rn  float32r   s   &r    	fpp_array4test_gh_9608_preserve_array_shape.<locals>.fpp_array  s!    wwrxx{ARZZ88r"   r   )
r   r   r  r   ri   r   r   
IndexErrorrI   r7  )	r>   r  r  r:   r  rV   x0_arrayr   r  s	            r    !test_gh_9608_preserve_array_shaper    s    
 
2$bjj	)B1dCEB;;;;xxR

3H	z	"	"T
 
#
9 \\	BtF !!!! 
#	"s   DD	z maximum_iterations,flag_expectedc                >   \         P                  ! R R^RRRV RRR7	      pV^,          P                  V8X  g   Q hV\         P                  8X  d   V^,          P                  V 8X  g   Q hR# V\         P
                  8X  d   V^,          P                  V 8  g   Q hR# R# )	zQ
Test that if the maximum iterations is exceeded that the flag is not
converged.
c                 Z    R V ,          R,
          V ,          R,           V ,          R,
          # )g333333?gffffff@g333333@g      @r   r   s   &r    r   6test_gh9254_flag_if_maxiter_exceeded.<locals>.<lambda>(  s    CECK?S(!+c1r"   r   TF)r?   r@   Nir   )rI   r   r  CONVERRrQ  	CONVERGED)maximum_iterationsflag_expectedr   s   && r    $test_gh9254_flag_if_maxiter_exceededr    s     \\1RT4!3u&F !9>>]***%ay##'9999	%//	)ay##&8888 
*r"   c            	     x   R p R p\        \        \        P                  V RVRR7       \        P
                  ! \        RR7      ;_uu_ 4        \        P                  ! V RV4       RRR4       \        P                  ! V \        R	R	4      V4      p\        V\        R
R4      4       R#   + '       g   i     LJ; i)zBTest that if disp is true then zero derivative raises RuntimeErrorc                      W ,          ^,           # r   r   r   s   &r    r>   /test_gh9551_raise_error_if_disp_true.<locals>.f8  s    sQwr"   c                     ^V ,          # r   r   r   s   &r    f_p1test_gh9551_raise_error_if_disp_true.<locals>.f_p;  s    s
r"   r   Fra  zY^Derivative was zero\. Failed to converge after \d+ iterations, value is [+-]?\d*\.\d+\.$r   Ng      $@r  )	r   r4  rI   r   r   r   rR  r   r   )r>   r  rA   s      r    $test_gh9551_raise_error_if_disp_truer  4  s     q#sG	/
0 
0 	QS!	
0
 <<74.4DD'#s+,
0 
0s   B))B9	solver_namec                     R  p\        \        V 4      p\        P                  ! \        RR7      ;_uu_ 4        V! V^ ^4       RRR4       R#   + '       g   i     R# ; i)c                 "    \         P                  # r*   )r   r   r   s   &r    r>   test_gh3089_8394.<locals>.fM  s    vvr"   zThe function value at x...r   N)getattrrI   r   r   r   )r  r>   solvers   &  r    test_gh3089_8394r  H  sB    
 UK(F	z)E	F	Fq!Q 
G	F	F	Fs   AA	rN   c                 .  a V3R  lo^ Sn         \        SRV R7      pVP                  RJ g   Q hVP                  P	                  R4      '       g   Q hVP
                  SP                   8X  g   Q h\        VP                  4      VP                  9   g   Q hR# )c                 V   < S;P                   ^,          un         \        P                  # r  )_countr   r   r   r>   s   &r    r>   test_gh18171.<locals>.f[  s    	Avvr"   )r   rN   FzThe function value at xN)r   r   )r  r   ri   r  
startswithrF  strrA   )rN   rw  r>   s   & @r    test_gh18171r#  U  s     AH
a
7C==E!!!8889999)))sxx=CHH$$$r"   rs_interfaceTFc                   a V'       d   R  M\        \        V 4      pV3R lo^ Sn        V! S^ ^
RR7      pV'       d    VP                  SP                  8X  g   Q hR# V^,          P                  SP                  8X  g   Q hR# )c                     \        WV3R 7      # )r   r   r>   r9   r;   rQ   s   &&&,r    r   %test_function_calls.<locals>.<lambda>m      QA)Gr"   c                 V   < S;P                   ^,          un         V ^,          ^,
          # r  )callsr  s   &r    r>   test_function_calls.<locals>.fp  s    	1!taxr"   Tr   N)r  rI   r-  rF  )r  r$  r  rw  r>   s   &&  @r    test_function_callsr/  g  sr      H#*5+#>  AG
Art
,C!!QWW,,,1v$$///r"   c            
        R p \         P                  ! \        RR7      ;_uu_ 4        \        V RRRR7      pRRR4       XP                  '       d   Q hVP
                  R8X  g   Q h\         P                  ! \        RR7      ;_uu_ 4        \        V RRR	R
R7      ^,          pRRR4       VP                  '       d   Q hVP
                  R8X  g   Q hR#   + '       g   i     L; i  + '       g   i     LL; i)zDTest that zero slope with secant method results in a converged=Falsec                 Z    V \         P                  ! V ) V ,          4      ,          R ,
          # )gQ?r   r   s   &r    lhs*test_gh_14486_converged_false.<locals>.lhs  s     2661"Q$<$&&r"   r  r   rb   r   )rN   r:   r<   Nzconvergence errorFT)r:   r<   r@   r?   g333333ÿ)r   r5  r4  r   ri   r  r   )r2  rw  s     r    test_gh_14486_converged_falser4  }  s    ' 
nN	;	;#h5SA 
<}}}88****	nN	;	;SUsDI!L 
<}}}88**** 
<	;
 
<	;s   CC'C$	'C7	c           	         V'       d   R  M\        \        V 4      pR p\        P                  ! \        RR7      ;_uu_ 4        V! VRRRR7       RRR4       V! VRRRR7      pV'       d   TMV^,          pVP
                  '       g   Q h\        VP                  ^ RR	7       V! VR\        R
4      RR7      pV'       d   TMV^,          pVP
                  '       g   Q h\        VP                  ^ RR	7       R#   + '       g   i     L; i)c                     \        WV3R 7      # r'  r(  r)  s   &&&,r    r   test_gh5584.<locals>.<lambda>  r+  r"   c                     R V ,          # )gN~hr   r   s   &r    r>   test_gh5584.<locals>.f  s    axr"   z...must have different signsr   g?Tr   NrE  r   z-0.0g      gٿ)	r  rI   r   r   r   ri   r   rA   r   )r  r$  r  r>   rw  s   &&   r    test_gh5584r:    s      H#*5+#>  
z)G	H	Hq$$/ 
I D#4
0C#3q6C====CHHad+ D%-T
:C#3q6C====CHHad+ 
I	Hs   C99D		c            
         R  p Rp\         P                  ! \        4      P                  p\        P
                  ! V RRV^V,          R7      pV ! V4      p\        P
                  ! V RRV^V,          R7      pV ! V4      pWF8  g   Q hRV^,          R RVR R2p\        P                  ! \        VR	7      ;_uu_ 4        \        P
                  ! V RRW^,          R7       R
R
R
4       R
#   + '       g   i     R
# ; i)c                 >    V ^,          ^V ,          ,
          ^,
          # r   r   r   s   &r    r>   test_gh13407.<locals>.f  s    !taczA~r"   gYng|=g    _Br  zrtol too small \(gz < z\)r   N)	r   r
   r   r   rI   r   r   r   r   )r>   r^   r   r<   r!   x4f4r   s           r    test_gh13407rA    s     D
((5/

C	q%Dqu	=B	
2B	q%Dqu	=B	
2B7N7 #3q5)3s1gR8G	z	1	1a4!e< 
2	1	1	1s   <"C((C9	c                      R  p \        V R4      p\        V^RR7       \        V RRRR7      p\        VP                  ^RR7       R# )c                     V ^,
          # r  r   )r&  s   &r    r>   &test_newton_complex_gh10103.<locals>.f  r  r"   g-q=r   rb   )r:   r<   rN   Ny      ?      ?y       @      ?)r   r   r   rA   )r>   rw  s     r    test_newton_complex_gh10103rE    s>    
D/CC'
aDVH
=CCHHae,r"   c           	          R p\         P                  ! \        VR7      ;_uu_ 4        V ! \        RRRR7       RRR4       R#   + '       g   i     R# ; i)z2'float' object cannot be interpreted as an integerr   r  r   gR@r   N)r   r   r  r!   )rN   r   s   & r    test_maxiter_int_check_gh10236rG    s8     CG	y	0	0r3U+ 
1	0	0	0s   AA	c                   a R oR	p^\         P                  ! \        4      P                  ,          ^,          pV3R lp\        P
                  ! \        RR7      ;_uu_ 4        V ! VR
RVR\        R7       RRR4       \        P
                  ! \        RR7      ;_uu_ 4        V ! VR
RVRVR7       RRR4       R#   + '       g   i     LM; i  + '       g   i     R# ; i)re  c                    < V S,
          # r*   r   r  s   &r    r>   (test_bisect_special_parameter.<locals>.f  r  r"   zxtol too smallr   r  r   )rB   r^   r_   Nzrtol too small)r  r  rO  r  r  r  )r   r
   r   r   r   r   r   r  )rN   rB   rtolbadr>   rA   s   &   @r    test_bisect_special_parameterrL    s    
 D&D"((5/%%%)G 
z)9	:	:asE< 
;	z)9	:	:asDw? 
;	: 
;	:	:	:	:s   "B:!C:C
	C	)r   r  r   r   r   )Tr   	functoolsr   numpy.testingr   r   r   r   r   r	   numpyr   r
   r   r   r   r   r   r   r   scipyr   scipy.optimizer   rI   r   r   r   scipy._lib._utilr   rd   scipy.optimize._tstutilsr   r   r   r   r   r  r  r   r   r   r  r   r   gradient_methodsall_methodsr!   r$   r(   r+   r.   r1   r3   r5   r7   r   r   r  r  r  r  r  r   r  r  r  r  r  r  r   r  r	  r  r  r  r#  r/  r4  r:  rA  rE  rG  rL  r   r"   r    <module>rV     sM    . .
  A A A , , G P5\
<<u||U\\=="LL>  00#

  ^M ^MBA@. A@Hd&& d&N	=80'2 218 E E@ 
 
D,>`4"D &%--3013939$ - -& LNN LN%N%  LN$70 8N0& + +  LN$7, 8N,4=.
- ;/, 0, ELL%,,$)LL%,,$@ A@A@r"   