+
    	þÎj61  ã                   ó   € ^ RI HtHtHt ^ RIHtHt ^ RIHtH	t	H
t
 ^ RIt^ RIt^ RIt^ RIt^ RIHt / tR]R&   R]R	&   ]R	,          ]R
&   / tR]R	&   ]R	,          ]R
&   R]R&   / t. RO]R&   . RO]R&   . R O]R&   . R!O]R&   . R"OtR tR#R ltR tR t. t. t] FF  w  tt]],          t]! ]]4      '       d   ]P=                  ]]34       K3  ]P=                  ]]34       KH  	  R tR t R t!R t"R t#R t$R t%R t&R t'R# )$é    )ÚxÚyÚz)ÚIS_WASMÚskip)ÚcodegenÚmake_routineÚget_code_generatorN)ÚPathzy
program main
  include "codegen.h"
  integer :: result;
  result = 0

  %(statements)s

  call exit(result)
end program
ÚF95z�
#include "codegen.h"
#include <stdio.h>
#include <math.h>

int main() {
  int result = 0;

  %(statements)s

  return result;
}
ÚC89ÚC99z™
  if (fabs(%(call)s)>%(threshold)s) {
    printf("Numerical validation failed: %(call)s=%%e threshold=%(threshold)s\n", %(call)s);
    result = -1;
  }
zÁ
  if (abs(%(call)s)>%(threshold)s) then
    write(6,"('Numerical validation failed:')")
    write(6,"('%(call)s=',e15.5,'threshold=',e15.5)") %(call)s, %(threshold)s
    result = -1;
  end if
ÚccÚgfortranÚg95Úifortc           
     ó$  € \         '       d   R# \        \        P                  R4      ;_uu_ 4       pV  F<  p\        P
                  ! W!R\        P                  R7      pV^ 8w  g   K3   RRR4       R# 	  RRR4       R#   + '       g   i     R# ; i)z>Run a series of commands and only return True if all ran fine.FÚwT)ÚstdoutÚshellÚstderrN)r   ÚopenÚosÚdevnullÚ
subprocessÚcallÚSTDOUT)ÚcommandsÚnullÚcommandÚretcodes   &   ÚW/opt/data/home/.local/lib/python3.14/site-packages/sympy/external/tests/test_codegen.pyÚtry_runr#   t   sj   € çƒwÙÜ	Œb�j‰j˜#×	Ô	 $ÛˆGÜ —o’o gÀ$Ü%×,Ñ,ô.ˆGà˜!Ž|Ø÷ 
Ñ	Ù÷ 
ñ ÷ 
Ö	ñ ús   ±1A>Á'A>Á2A>Á>B	c                ó"  € VP                  4       pV\        9   g   Q hV\        9   g   Q h\        P                  ! RR4      P                  4       pVR)9  d   \        R4      h\        P                  ! RV,          RV ,          4      p\        P                  ! 4       p\        P                  ! V4       V'       d   \        WRRR	7       M \        VR4      p	V	P                  VRRR	7       . p
V Fw  w  r¼rÞV: R
RP                  R V 4       4      : RV: R2pVR8X  d    \        V4      p\        \!        V4      4      pV
P#                  \        V,          RVRV/,          4       Ky  	  VR8X  d   RpM,VP%                  R4      '       d   RpM\'        RV,          4      h\)        V4      P+                  \        V,          RRP                  V
4      /,          4       \-        V4      pV'       d   \-        R.4      pMRpVR8X  g   VR8X  d�   V'       dy   V'       dq   R pV! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R4       V! R 4       \        P                  ! V4       \        P.                  ! V4       M8\1        R!V,          \2        P4                  R"7       \        P                  ! V4       V'       g   Q R#V: R$R%P                  V4      : 24       hV'       g   Q R&V: R'R%P                  V4      : 24       hR(# )*aU  A driver for the codegen tests.

This driver assumes that a compiler ifort is present in the PATH and that
ifort is (at least) a Fortran 90 compiler. The generated code is written in
a temporary directory, together with a main program that validates the
generated code. The test passes when the compilation and the validation
run correctly.
ÚSYMPY_TEST_CLEAN_TEMPÚalwaysÚsuccesszSSYMPY_TEST_CLEAN_TEMP must be one of the following: 'always', 'success' or 'never'.z_sympy_%s_testz%s_r   T)Úto_filesÚ(Ú,c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5i©N)Ústr)Ú.0Úargs   & r"   Ú	<genexpr>Úrun_test.<locals>.<genexpr>©   s   é € Ð7±$¨3œc #Ÿh˜h³$ùs   ‚z)-(Ú)r   r   Ú	thresholdzmain.f90ÚCzmain.cz2FIXME: filename extension unknown for language: %sÚ
statementsÚ z
./test.exeFc                 ó€   € \         P                  P                  V 4      '       d   \         P                  ! V 4       R # R # r,   )r   ÚpathÚisfileÚremove)Úfilenames   &r"   Úsafe_removeÚrun_test.<locals>.safe_removeÈ   s&   € Ü�w‰w�~‰~˜h×'Ò'Ü—	’	˜(Ö#ñ (ó    zcodegen.f90z	codegen.cz	codegen.hz	codegen.ozmain.oztest.exezTEST NOT REMOVED: %s)Úfilezfailed to compile z code with:
Ú
zfailed to execute z code from:
N)r&   r'   Únever)ÚupperÚmain_templateÚnumerical_test_templater   ÚgetenvÚlowerÚ
ValueErrorÚtempfileÚmkdtempÚgetcwdÚchdirr   r
   ÚwriteÚjoinÚfortranize_double_constantsr-   ÚappendÚ
startswithÚNotImplementedErrorr   Ú
write_textr#   ÚrmdirÚprintÚsysr   )ÚlabelÚroutinesÚnumerical_testsÚlanguager   ÚfriendlyÚcleanÚworkÚoldworkÚcode_genÚtest_stringsÚfn_nameÚargsÚexpectedr3   Úcall_stringÚf_nameÚcompiledÚexecutedr<   s   &&&&&&              r"   Úrun_testrg   �   s©  € ð �~‰~Ó€HØ”}Ô$Ð$Ð$ØÔ.Ô.Ð.Ð.ô �IŠIÐ-¨xÓ8×>Ñ>Ó@€EØÐ2Ô2ÜÐnÓoÐoô ×ÒÐ,¨xÕ7¸À½ÓG€DÜ�iŠi‹k€GÜ‡H‚HˆT„N÷ ô 	� I¸Ö=ä% h°	Ó:ˆØ�‰�x °TˆÔ:ð €LÛ.=Ñ*ˆ�xã�S—X‘XÑ7±$Ó7Ö7»ðCˆà�uÔÜ5°kÓBˆKÜ3´C¸	³NÓCˆIØ×ÑÔ3°HÕ=Ø�KØ˜ðA
õ 
ö 	ñ />ð �5ÔØ‰Ø	×	Ñ	˜S×	!Ò	!Ø‰ä!Ø@À8ÕKóMð 	Mô 	ˆƒL×ÑÜ�hÕ <°·±¸Ó1FÐ"GÕGôIô �xÓ €H÷ Ü˜L˜>Ó*‰àˆð �Ô˜U iÔ/·HÇò	$ñ 	�MÔ"Ù�KÔ Ù�KÔ Ù�KÔ Ù�JÔÙ�HÔÙ�HÔÙ�JÔÜ
�Š�ÔÜ
�Š��äÐ$ tÕ+´#·*±*Õ=Ü
�Š�Ô÷ ñ 'Û�$—)‘)˜HÕ%ð'ó 'ˆ8çñ 'Û�$—)‘)˜HÕ%ð'ó 'Š8r>   c                óª   a€ ^ RI oSP                  R4      pSP                  R4      pV3R lpR pVP                  W04      p VP                  W@4      p V # )z3
Replaces every literal float with literal doubles
Nz\d+(\.)?\d*[eE]-?\d+z\d+\.\d*(?!\d*d)c                 óH   <€ SP                  R RV P                  ^ 4      4      # )z[eE]Úd)ÚsubÚgroup)ÚmatchobjÚres   &€r"   Úsubs_expÚ-fortranize_double_constants.<locals>.subs_expè   s   ø€ Ø�v‰v�f˜c 8§>¡>°!Ó#4Ó5Ð5r>   c                 ó2   € R V P                  ^ 4      ,          # )z%sd0)rl   )rm   s   &r"   Ú
subs_floatÚ/fortranize_double_constants.<locals>.subs_floatë   s   € Ø˜Ÿ™ qÓ)Õ)Ð)r>   )rn   Úcompilerk   )Úcode_stringÚpattern_expÚpattern_floatro   rr   rn   s   &    @r"   rN   rN   à   sV   ø€ ó Ø—*‘*Ð4Ó5€KØ—J‘JÐ2Ó3€Mõ6ò*ð —/‘/ (Ó8€KØ×#Ñ# JÓ<€KàÐr>   c           	      óv   € \        R \        4      pRR.p \        RV.W0VRR7       R#   \         d     R# i ; i)ÚtestÚis_feasibleF)rZ   T)ry   )ç      ð?r{   çVçž¯Ò<)ry   )ç      ð¿r}   r|   )r	   r   rg   ÚAssertionError)rY   r   ÚroutinerX   s   &&  r"   rz   rz   ô   sJ   € ä˜6¤1Ó%€Gà%Ø&ð€OðÜ�  	¨?ÀhØõ	!áøÜô Úðús   –) ©8·8c                  ó6   € R\         9   d   \        R4       R# R# )r   z*`cc' command didn't work as expected (C89)N©r   r   ©Úinvalid_lang_compilersr   © r>   r"   Útest_C89_ccr…     ó   € ØÔ.Ô.ÜÐ9Ö:ñ /r>   c                  ó6   € R\         9   d   \        R4       R# R# )r   z*`cc' command didn't work as expected (C99)N©r   r   r‚   r„   r>   r"   Útest_C99_ccr‰     r†   r>   c                  ó6   € R\         9   d   \        R4       R# R# )r   z'`ifort' command didn't work as expectedN©r   r   r‚   r„   r>   r"   Útest_F95_ifortrŒ     s   € ØÔ1Ô1ÜÐ6Ö7ñ 2r>   c                  ó6   € R\         9   d   \        R4       R# R# )r   z*`gfortran' command didn't work as expectedN©r   r   r‚   r„   r>   r"   Útest_F95_gfortranr�     s   € ØÔ4Ô4ÜÐ9Ö:ñ 5r>   c                  ó6   € R\         9   d   \        R4       R# R# )r   z%`g95' command didn't work as expectedN©r   r   r‚   r„   r>   r"   Útest_F95_g95r’   !  s   € ØÔ/Ô/ÜÐ4Ö5ñ 0r>   c                  ó„   € RR.p R \         \        ,           \        ,          3.p\         F  w  r#\	        RWW#4       K  	  R# )ry   Úbasic_codegenN)ry   )r{   g      @g      @g      5@r|   )ry   )r}   g       @ç      Àr•   r|   )r   r   r   Úvalid_lang_commandsrg   )rX   Ú	name_exprÚlangr   s       r"   Útest_basic_codegenr™   (  s>   € à.Ø0ð€Oð œ1œq�5¤!�)Ð$Ð%€Iß-‰ˆÜ� )¸dÖMó .r>   c                  ó   € ^ RI Hp  ^ RIHp ^ RIHp ^ RIHpHpH	p ^ RI
HpHp ^ RIHp ^ RIHp	Hp
HpHpHpHp R\-        \.        4      3R	V	! \.        4      3R
V
! \.        4      3RV! \.        4      3RV! \.        4      3RV! \.        4      3RV! \.        4      3RV! \.        4      3RV! \.        4      3RV! \.        4      3RV! \.        4      3RV! \.        4      3RV! \.        4      3.p. pV FA  w  ppR F5  pV ! VP1                  \.        V4      4      pVP3                  VV3VR34       K7  	  KC  	  \4         FR  w  ppVP7                  R4      '       d   RV! \.        4      3RV! \.        4      3.pM. p\9        RVV,           VVV4       KT  	  R# )r   ©ÚN)Úln)Úlog)ÚcoshÚsinhÚtanh)ÚceilingÚfloor)Úsqrt)ÚacosÚasinÚatanÚcosÚsinÚtanÚ	test_fabsÚ	test_acosÚ	test_asinÚ	test_atanÚtest_cosÚ	test_coshÚtest_logÚtest_lnÚtest_sinÚ	test_sinhÚ	test_sqrtÚtest_tanÚ	test_tanhç›+¡†›„=r4   Ú
test_floorÚ	test_ceilÚintrinsic_math1N)çš™™™™™É?ç      à?çš™™™™™é?)Úsympy.core.evalfrœ   Úsympy.functionsr�   Ú&sympy.functions.elementary.exponentialrž   Ú%sympy.functions.elementary.hyperbolicrŸ   r    r¡   Ú#sympy.functions.elementary.integersr¢   r£   Ú(sympy.functions.elementary.miscellaneousr¤   Ú(sympy.functions.elementary.trigonometricr¥   r¦   r§   r¨   r©   rª   Úabsr   ÚsubsrO   r–   rP   rg   )rœ   r�   rž   rŸ   r    r¡   r¢   r£   r¤   r¥   r¦   r§   r¨   r©   rª   r—   rX   ÚnameÚexprÚxvalrb   r˜   r   Úname_expr_Cs                           r"   Útest_intrinsic_math1_codegenrÌ   2  sf  € å"Ý"Ý:ßHÑHßDÝ=ßZ×Zà	”cœ!“fÐØ	‘dœ1“gÐØ	‘dœ1“gÐØ	‘dœ1“gÐØ	‘Sœ“VÐØ	‘dœ1“gÐØ	‘Sœ“VÐØ	‘B”q“EÐØ	‘Sœ“VÐØ	‘dœ1“gÐØ	‘dœ1“gÐØ	‘Sœ“VÐØ	‘dœ1“gÐð€Ið €OÛ‰
ˆˆdÛ!ˆDÙ˜Ÿ™¤1 dÓ+Ó,ˆHØ×"Ñ" D¨4¨'°8¸UÐ#CÖDó "ñ  ÷ .‰ˆˆhØ�?‰?˜3×ÒØ(©%´«(Ð3°kÁ7Ì1Ã:Ð5NÐO‰KàˆKÜÐ" I°Õ$;Ø  $¨ö	2ó .r>   c                  ó^  € ^ RI Hp  ^ RIHp RV! \        \
        4      3R\        \
        ,          3.p. pV FV  w  rER FK  w  rgV ! VP                  \        V4      P                  \
        V4      4      pVP                  WFV3VR34       KM  	  KX  	  \         F  w  rš\        RW#Wš4       K  	  R# )	r   r›   )Úatan2Ú
test_atan2Útest_powr¸   Úintrinsic_math2N))r¼   çÍÌÌÌÌÌô?)r½   çš™™™™™É¿)r¾   r¾   )
r¿   rœ   rÅ   rÎ   r   r   rÇ   rO   r–   rg   )rœ   rÎ   r—   rX   rÈ   rÉ   rÊ   Úyvalrb   r˜   r   s              r"   Útest_instrinsic_math2_codegenrÕ   X  sž   € å"Ý>à	‘uœQ¤“{Ð#Ø	”Qœ•TÐð€Ið €OÛ‰
ˆÛ=‰JˆDÙ˜Ÿ™¤1 dÓ+×0Ñ0´°DÓ9Ó:ˆHØ×"Ñ" D°¨,¸À%Ð#HÖIó >ñ  ÷ .‰ˆÜÐ" IÀÖOó .r>   c                  ój  € ^ RI Hp  ^ RIHpHpHp RV! \        4      V! \        4      ,           V! \        4      ,           ^,          P                  4       3RV! V! V! V! V! V! V! V! \        \        ,           \        ,           4      4      4      4      4      4      4      4      3.p. pV Fk  w  rgR F`  w  r‰p
V ! VP                  \        V4      P                  \        V	4      P                  \        V
4      4      pVP                  WhWš3VR34       Kb  	  Km  	  \         F  w  rÍ\        RWEWÍ4       K  	  R# )	r   r›   )r¨   r©   rª   Útest1Útest2gê-�™—q=Úcomplicated_codegenN))r¼   rÒ   g333333Ó¿)r½   rÓ   g        )r¾   gÍÌÌÌÌÌ @r¾   )r¿   rœ   rÅ   r¨   r©   rª   r   r   r   ÚexpandrÇ   rO   r–   rg   )rœ   r¨   r©   rª   r—   rX   rÈ   rÉ   rÊ   rÔ   Úzvalrb   r˜   r   s                 r"   Útest_complicated_codegenrÜ   i  sþ   € Ý"ßHÑHà	‘Cœ“F™S¤›V•O¡c¬!£fÕ,¨qÕ0×8Ñ8Ó:Ð;Ø	‘#‘c™#™c¡#¡c©#©c´!´aµ%¼!µ)«nÓ*=Ó&>Ó"?Ó@ÓAÓBÓCÐDð€Ið €OÛ‰
ˆÛ SÑˆD˜Ù˜Ÿ™¤1 dÓ+×0Ñ0´°DÓ9×>Ñ>¼qÀ$ÓGÓHˆHØ×"Ñ" D°Ð*<¸hÈÐ#NÖOó !Tñ  ÷ .‰ˆÜØ! 9¸tö	Oó .r>   )zcc -c codegen.c -o codegen.ozcc -c main.c -o main.oz#cc main.o codegen.o -lm -o test.exe)z$gfortran -c codegen.f90 -o codegen.oz6gfortran -ffree-line-length-none -c main.f90 -o main.oz%gfortran main.o codegen.o -o test.exe)zg95 -c codegen.f90 -o codegen.oz1g95 -ffree-line-length-huge -c main.f90 -o main.oz g95 main.o codegen.o -o test.exe)z!ifort -c codegen.f90 -o codegen.ozifort -c main.f90 -o main.oz"ifort main.o codegen.o -o test.exe)r�   rˆ   r‹   rŽ   r‘   )T)(Ú	sympy.abcr   r   r   Úsympy.testing.pytestr   r   Úsympy.utilities.codegenr   r	   r
   rU   r   rH   r   Úpathlibr   rC   rD   Úcompile_commandsÚcombinations_lang_compilerr#   rg   rN   rz   r–   rƒ   r˜   Úcompilerr   rO   r…   r‰   rŒ   r�   r’   r™   rÌ   rÕ   rÜ   r„   r>   r"   Ú<module>rä      sm  ð÷0 Ñ ß .ß MÑ MÛ 
Û 	Û Û Ý ð
 €ð
€ˆeÑ ð€ˆeÑ ð % UÕ+€ˆeÑ ð Ð ð"Ð ˜Ñ ð "9¸Õ!?Ð ˜Ñ ð"Ð ˜Ñ ð Ð òÐ �Ñ ò Ð �Ñ òÐ �Ñ òÐ �Ñ òÐ ò
ô\'ò~ò(ð Ð ØÐ Û0�N€Dˆ(Ø Õ)€HÙ�4˜×"Ò"Ø×"Ñ" D¨(Ð#3Ö4à×%Ñ% t¨XÐ&6Ö7ñ 1ò;ò
;ò
8ò
;ò
6òNò#2òLPô"Or>   