+
    i                     j   ^ RI t ^ RIHtHtHtHt ^ RIHt ^ RIH	t	H
t
 ^ RIHt ^ RIHtHtHtHt ^ RIHtHt ^ RIHt ^ R	IHt ^ R
IHt ^ R
IHt ^ RI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4      t,]! R4      t-R t.]'R 4       t/]'R 4       t0R t1]']+! R4      R 4       4       t2R t3R# )    N)logMinMaxsqrt)Float)Symbolsymbols)cos)
AssignmentRaiseRuntimeError_QuotedString)newtons_methodnewtons_method_function)expm1)bind_C)render_as_module)import_module)ccode)compile_link_import_stringshas_chas_fortran)	may_xfail)skipraisesskip_under_pyodidecython	wurlitzerc            	          \        R 4      w  rp\        V 4      V ^,          ,
          p\        W0W!4      pVP                  \	        W) VP                  V 4      ,          4      4      '       g   Q hR# )z	x dx atolN)r	   r
   r   hasr   diff)xdxatolexpralgos        a/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/codegen/tests/test_algorithms.pytest_newtons_methodr(      sV    +&KA4q6AqD=D$4,D88Jr51#567777    c            	         \        R RR7      p \        V 4      V ^,          ,
          p\        W4      p\        '       g   \	        R4       \        4       '       g   \	        R4       RR/p\        P                  ! 4       ;_uu_ 4       p\        RR\        V4      ,           3R	R
P                  R4      R,           3.WCR7      w  rV\        VP                  R4      R,
          4      R8  g   Q h RRR4       R#   + '       g   i     R# ; i)r"   Trealcython not installed.No C compiler found.stdc99znewton.c%#include <math.h>
#include <stdio.h>
_newton.pyx#cython: language_level={}
3zIcdef extern double newton(double)
def py_newton(x):
    return newton(x)
)	build_dircompile_kwargs      ?ߺv?-q=N)r   r
   r   r   r   r   tempfileTemporaryDirectoryr   r   formatabs	py_newton)r"   r%   func
compile_kwfoldermodinfos          r'   #test_newtons_method_function__ccoderD      s    sAq6AqD=D"4+D6$%77#$J		$	$	&	&&/ 149$K@ A;BB3G66 81
 8	 3==%67%??? 
'	&	&	&s   A$C44D	c            	         \        R RR7      p \        V 4      V ^,          ,
          p\        W\        RR7      .R7      p\        '       g   \        R4       \        4       '       g   \        R4       \        V.R4      p\        P                  ! 4       ;_uu_ 4       p\        R	V3R
RP                  R4      R,           3.VR7      w  rV\        VP                  R4      R,
          4      R8  g   Q h RRR4       R#   + '       g   i     R# ; i)r"   Tr+   newton)name)attrsr-   zNo Fortran compiler found.
mod_newtonz
newton.f90r2   r3   r4   zRcdef extern double newton(double*)
def py_newton(double x):
    return newton(&x)
)r5   r7   r8   r9   N)r   r
   r   r   r   r   r   f_moduler:   r;   r   r<   r=   r>   )r"   r%   r?   f_modrA   rB   rC   s          r'   #test_newtons_method_function__fcoderL   4   s    sAq6AqD=D"46x3H2IJD6$%==)*dV\*E		$	$	&	&&/5!;BB3G77 91
 	 3==%67%??? 
'	&	&	&s   AC::D	c                      \        R RR7      p \        V 4      V ^,          ,
          p\        W4      p\        V4      p/ p\	        W4V4       \        RV4      p\        VR,
          4      R8  g   Q hR# )r"   Tr+   znewton(0.5)r8   r9   N)r   r
   r   	py_moduleexecevalr=   )r"   r%   r?   py_mod	namespaceress         r'   $test_newtons_method_function__pycoderT   K   se    sAq6AqD=D"4+Dt_FII&
}i
(Cs^#$u,,,r)   z,Emscripten does not support process spawningc            	        aa \        R 4      ;p w  orpV\        VS,          4      ,          VS^,          ,          ,
          o\        \        VV3R l4       \        p\        SSWR7      p\        4       '       g   \        R4       \        '       g   \        R4       RR/p\        P                  ! 4       ;_uu_ 4       p\        RR\        V4      ,           3R	R
P                  R4      R,           3.WgR7      w  rV'       d:   \        P                  4       ;_uu_ 4       w  rVP                  R4      pRRR4       MVP                  R4      p\!        XR,
          4      R8  g   Q hV'       g   \        R4       X
P#                  4       XP#                  4       rVR8X  g   Q hV
R8X  g   Q h RRR4       R#   + '       g   i     Lx; i  + '       g   i     R# ; i)zx A k pc                     < \        S S4      # N)r   )r%   r"   s   r'   <lambda>@test_newtons_method_function__ccode_parameters.<locals>.<lambda>[   s    6tQ?r)   )debugr.   r-   r/   r0   znewton_par.cr1   z_newton_par.pyxr3   r4   zycdef extern double newton(double, double, double, double)
def py_newton(x, A=1, k=1, p=1):
    return newton(x, A, k, p)
)r6   r5   r7   Nr8   r9   zAC-level output only tested when package 'wurlitzer' is available. zx=         0.5
x=      1.1121 d_x=     0.61214
x=     0.90967 d_x=    -0.20247
x=     0.86726 d_x=   -0.042409
x=     0.86548 d_x=  -0.0017867
x=     0.86547 d_x= -3.1022e-06
x=     0.86547 d_x= -9.3421e-12
x=     0.86547 d_x=  3.6902e-17
)r	   r
   r   
ValueErrorr   r   r   r   r   r:   r;   r   r   r<   pipesr>   r=   read)argsAkpuse_wurlitzerr?   r@   rA   rB   rC   outerrresultr%   r"   s                @@r'   .test_newtons_method_function__ccode_parametersrg   V   s     	**D:1aAS1X:!Q$D
:?@M"4DFD77#$6$%J		$	$	&	&&/ 149$K@ A!?!F!Fs!K"?"? A1
 %8	 ""jss+ #" ]]3'F6N*+e333TU88:sxxzSbyy 	 	 		 	/ 
'	& #" 
'	&	&s+   >A GF4	2:G-<G4G?GG	c                  F  aaa \        R RRR7      w  op or\        RRRR7      pW!,
          ^,
          pSV ,
          V,          p\        V 4      \        \        \        S4      \        V 4      ,
          V,          4      ) 4      ,           pV\        V4      ,
          pR oRRVVV3R l/R	RR
 /RRR //pWp3p	R! EFW  p
RV SSW3R^<RRRV
RVRRRRRSS3R\	        \        \        R4      4      4      /	pVP                  4        UUu/ uF   w  rV\        V	RV R2/\        V3/ VB B bK"  	  pppVP                  4        UUu/ uF  w  rV\        V4      bK  	  ppp/ p/ pVP                  4        F(  w  r/ ;pVV&   \        VVV4       VV R2,          VV&   K*  	  \        R4      pRRR	RRR/pRpVP                  4        FL  w  ppV! VRR^2^d4      pVVV,          ,          pV
'       d
   V^,          p\        VV,
          4      V8  d   KL  Q h	  EKZ  	  R # u uppi u uppi )"za b c N_geo N_totT)r,   nonnegativei)integerri   c                 ,    \        \        W4      V4      # rW   )r   r   )lowr%   highs   &&&r'   _clamp:test_newtons_method_function__rtol_cse_nan.<locals>._clamp   s    3s>4((r)   clamped_newtondelta_fnc                    < S! \        SV,          4      V,
          R ,          V ) V P                  V4      ,          \        SV,          4      V,
          R ,          4      # )gGz?)r   r!   )er"   ro   acs   &&r'   rX   <test_newtons_method_function__rtol_cse_nan.<locals>.<lambda>   sC    F!A#Yq[$BqvvayL!A#Yq[$5
r)   halleyc                     RW P                  V4      ,          ,          ^V P                  V4      ^,          ,          W P                  V^4      ,          ,
          ,          # )   r!   rt   r"   s   &&r'   rX   rw      s@    R66!9-=qA~PQRXRXYZ\]R^P^?^-_r)   
halley_altc                     V ) V P                  V4      ,          ^W P                  V4      ,          V P                  V^4      ,          ^,          V P                  V4      ,          ,
          ,          # )   r|   r}   s   &&r'   rX   rw      sO    !AFF1Iq66!9QVVTUVW[AXYZAZ[\[a[abc[dAd?d1er)   paramsitermaxrZ   csecounterr$   g0.++rtolgؗҬ<bounds
handle_nanzencountered NaN.	func_name_bz"13.2261515064168768938151923226496gMg<g      @g{Gz?g      Y@N)FT)r	   r   r   r   r   r   r   itemsr   dictrN   rO   r   r=   )bN_geoN_totrj   N_ari	delta_ariln_delta_geoeqb_logmeth_kwr_   use_csekwargsra   kwr?   vrQ   rR   root_find_bnsrefreftolguessmethrf   reqro   ru   rv   s                             @@@r'   *test_newtons_method_function__rtol_cse_nanr      sQ   #$7dPTUAq!UsDd3AMAE1eIq6CAs1vu'<!= =>>LS^+G) 	: (
 
 	:`az#fgG :D q!Q-y"gtUT[q&&&%Aa5%l;M.N OP

 jqivivixyix`e`a*D[qcH[VHZWYHZ[[ixy.2jjl;lda!Yq\/l;	LLNDA ""B1BO1#R\KN # 89"E8UL%P%++-JD$%sB4FfTl"Cqv|$s*** .# ! z;s   &HH)4r:   sympyr   r   r   r   sympy.core.numbersr   sympy.core.symbolr   r	   (sympy.functions.elementary.trigonometricr
   sympy.codegen.astr   r   r   r   sympy.codegen.algorithmsr   r   sympy.codegen.cfunctionsr   sympy.codegen.fnodesr   sympy.codegen.futilsr   rJ   sympy.codegen.pyutilsrN   sympy.externalr   sympy.printing.codeprinterr   sympy.utilities._compilationr   r   r   !sympy.utilities._compilation.utilr   sympy.testing.pytestr   r   r   r   r   r(   rD   rL   rT   rg   r    r)   r'   <module>r      s     % % $ - 8 L L L * ' = ? ( , X X 7 A A	x	 +&	8 @ @. @ @,- BC. D .b++r)   