+
    ‹°³j  ã                   ó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        Úd/home/luca/screen-checking/.venv/lib/python3.14/site-packages/sympy/codegen/tests/test_algorithms.pyÚtest_newtons_methodr(      sV   € Ü˜+Ó&�K€Aˆ4Üˆq‹6�A�q•D�=€DÜ˜$ 4Ó,€DØ�8‰8”J˜r 5¨¯©°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Üˆq‹6�A�q•D�=€DÜ" 4Ó+€Dç‹6ÜÐ$Ô%Ü�7Š7ÜÐ#Ô$à˜�€JÜ	×	$Ò	$×	&Ô	&¨&Ü/Øð 1Ü49¸$³Kõ@ð AàÐ;×BÑBÀ3Ó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Üˆq‹6�A�q•D�=€DÜ" 4´6¸xÔ3HÐ2IÔJ€Dç‹6ÜÐ$Ô%Ü�=Š=ÜÐ)Ô*ä�d�V˜\Ó*€EÜ	×	$Ò	$×	&Ô	&¨&Ü/Ø˜5Ð!ØÐ;×BÑBÀ3Ó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Üˆq‹6�A�q•D�=€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  r‰V'       d:   \        P                  4       ;_uu_ 4       w  r«V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       rºV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   ø€ Ô6°t¸QÔ?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.Ú zïx=         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‰:ˆ1ˆa�AØŒS��1•‹X�:˜˜!˜Q�$�Õ€DÜ
Œ:Õ?Ô@Ü€Mä" 4¨¨DÔF€Dä�7Š7ÜÐ#Ô$ß‹6ÜÐ$Ô%à˜�€JÜ	×	$Ò	$×	&Ô	&¨&Ü/Øð 1Ü49¸$³Kõ@ð AàÐ!?×!FÑ!FÀsÓ!Kð"?õ"?ð Að1
ð %ô8‰	ˆ÷ Ü—‘×"Ô"¡j sØŸ™ sÓ+�÷ #Ð"ð —]‘] 3Ó'ˆFä�6˜NÕ*Ó+¨eÔ3Ð3Ð3çÜÐTÔUà—8‘8“:˜sŸx™x›zˆSØ�bŒyÐˆ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  rÍV\        V	RV R2/\        V3/ VB B bK"  	  pppVP                  4        UUu/ uF  w  rÏV\        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   € Ü”3�s“> 4Ó(Ð(r)   Úclamped_newtonÚdelta_fnc                 ó¾   <€ S! \        SV,          4      V,
          R ,          V ) V P                  V4      ,          \        SV,          4      V,
          R ,          4      # )g®Gáz®ï?)r   r!   )Úer"   ro   ÚaÚcs   &&€€€r'   rX   Ú<test_newtons_method_function__rtol_cse_nan.<locals>.<lambda>•   sC   ø€ ±FÜ�!�A•#‹Y�q�[˜$ÕØˆBˆq�v‰v�a‹y�LÜ�!�A•#‹Y�q�[˜$Õô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°·6±6¸!³9µÕ-=¸qÀÇÁÈÃÈAÅ½~ÐPQ×RXÑRXÐYZÐ\]Ó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   € °!°°A·F±F¸1³Iµ¸qÀÇ6Á6È!Ã9ÅÈQÏVÉVÐTUÐVWË[ÕAXÐYZÕAZÐ[\×[aÑ[aÐbcÓ[dÕAdÕ?dÖ1er)   ÚparamsÚitermaxrZ   ÚcseÚcounterr$   g0Žä.ÿ++Úrtolg¼‰Ø—²Ò¬<ÚboundsÚ
handle_nanzencountered NaN.Ú	func_nameÚ_bz"13.2261515064168768938151923226496gMgâñžµ<g      @g{®Gáz„?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  ú€ Ü#Ð$7¸dÐPTÔUÑ€A€qˆ!ˆUÜˆs˜D¨dÔ3€AØ�M˜AÕ€EØ�1•�e•€IÜ�q“6œC¤¬¨A«¬s°1«v­°uÕ'<Ó!=Ð =Ó>Õ>€LØœS ›^Õ+€Gò)ð 	˜:ö (
ð ð
 	�:Ñ`ÐaØ�zÑ#fÐgð€Gð ˆ:€DÜ ˆà�q˜!˜Q Ð-¨y¸"¸gÀtÈUÐT[Ø�q˜& &¨&°%¸ÀAÀaÀ5Øœ%¤¬lÐ;MÓ.NÓ OÓPð
ˆð
 jq×ivÑivÔixÔyÑixÑ`eÐ`a�Ô*¨DÐ[¸q¸cÀ¸HÐ[ÌÈVÑHZÐWYÑHZÑ[Ò[ÑixˆÑyØ.2¯j©j¬lÔ;©l¡d a�!”Y˜q“\’/©lˆÑ;Øˆ	ØˆØ—L‘L–N‰DˆAØ "Ð"ˆB�˜1‘Ü��B˜ŒOØ 1 # R �\ˆK˜‹Nñ #ô Ð8Ó9ˆØ" E¨8°U¸LÈ%ÐPˆØˆØ%×+Ñ+Ö-‰JˆD�$Ù˜%  s¨B°Ó4ˆFØ�f˜T•lÕ"ˆ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)   