+
    i                        ^ 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IHtHtHtHtHtHt ^ RIHt ^ RIHt ^ R	IHtHt ^ R
IHt ^ RIHtH t  ^ RI!H"t"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/ ^ RI0H1t1 ^ RI2H3t3H4t4H5t5 ^ RI6H7t7H8t8H9t9H:t:H;t;H<t<H=t=H>t>H?t?H@t@HAtAHBtBHCtC ^ RIHDtD ^ RIHEtE ^ RIFHGtGHHtHHItIHJtJHKtK ^ RILHMtMHNtN ^ RIOHPtPHQtQ ^ RIRHStSHTtT ^ RIUHVtVHWtW ^ RIXHYtY ^ RIZH[t[ R t\R t]R  t^R! t_R" t`R# taR$ tbR% tcR& tdR' teR( tfR) tgR* thR+ tiR, tjR- tkR. tlR/ tmR0 tnR1 toR2 tpR3 tqR4 trR5 tsR6 ttR7 tuR8 tvR9 twR: txR; tyR< tzR= t{R> t|R? t}R@ t~RA tRB tRC tRD tRE tRF tRG tRH tRI# )J    )Add)Expr)FunctionLambdadiff)Mod)Catalan
EulerGammaGoldenRatio)EFloatIIntegerRationalpi)Eq)S)Dummysymbols)	factorial)	conjugatesign)explog)sqrt)	Piecewise)atan2cossin)gamma)Integral)Range)For
Assignment
aug_assign)DeclarationVariablefloat32float64value_constrealbool_WhileFunctionPrototypeFunctionDefinitionintegerReturnElement)UnevaluatedExpr)
Relational)AndOrNot
EquivalentXor)MatrixMatrixSymbol)fcodeFCodePrinter)IndexedBaseIdx)ArraySymbolArrayElement)implemented_function)raisesc                     \        R RR7      w  rp\        W,           4      p\        \        W,           4      4      p\	        VRR7      R8X  g   Q h\        R4      w  rVp\        Wg,           4      p\        \        WX,           4      4      p	\	        V	RR7      ^,          P                  4       R	8X  g   Q h\	        V	R
R/R7      P                  4       R8X  g   Q hR# )zp q rT)r+   freesource_formatzexp(p + (q + r))x y zFhumanzexp(re(x) + re(y + z))rerealpartuser_functionsz"exp(realpart(x) + realpart(y + z))N)r   r3   absr   r<   lstrip)
pqrq_rexprxyzy_zexpr2s
             _/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/printing/tests/test_fortran.pytest_UnevaluatedExprr\   #   s    gD)GA!
!%
 Cs15z?DV,0BBBBgGA!
!%
 CAE
OEe$Q'..04LLLLj'9:AACGkkkk    c                  j    \        R 4      p  ! R R\        4      p\        V! V 4      4      R8X  g   Q hR# )rV   c                   &   a  ] tR t^2t o R tRtV tR# )test_printmethod.<locals>.nintc                T    R VP                  V P                  ^ ,          4      ,          # )znint(%s))_printargs)selfprinters   &&r[   _fcode%test_printmethod.<locals>.nint._fcode3   s    tyy| <<<r]    N)__name__
__module____qualname____firstlineno__rf   __static_attributes____classdictcell__)__classdict__s   @r[   nintr`   2   s     	= 	=r]   rp   z      nint(x)N)r   r   r<   )rV   rp   s     r[   test_printmethodrq   /   s/    A=x = a>_,,,r]   c                  .  a \        R 4      o\        RRR7      p \        RRR7      p\        \        S4      ^_RR7      R8X  g   Q h\        \        V 4      ^_RR7      R	8X  g   Q h\        \        V4      ^_RR7      R
8X  g   Q h\        \        V3R l4       R# )rV   rW   Tr0   rX   )complexrE   )standardrG   z#merge(0d0, dsign(1d0, x), x == 0d0)zmerge(0, isign(1, y), y == 0)z/merge(cmplx(0d0, 0d0), z/abs(z), abs(z) == 0d0)c                  ,   < \        \        S 4      4      # N)r<   r   rV   s   r[   <lambda>!test_fcode_sign.<locals>.<lambda>?   s    d1gr]   N)r   r<   r   rC   NotImplementedError)rW   rX   rV   s     @r[   test_fcode_signr|   8   s    clAc4 Ac4 Aa2V<@eeeea2V<@____a2V<@qqqq
 67r]   c                     \        R 4      w  r\        RRR7      p\        V ^,          4      R8X  g   Q h\        W^,          ,          4      R8X  g   Q h\        ^\        V 4      R,          WV ,          ,
          ,          ,          V ^,          V,           ,          4      R8X  g   Q h\        \        V 4      4      R8X  g   Q h\        \        V4      4      R	8X  g   Q h\        V R
,          4      R8X  g   Q h\        \        V 4      4      R8X  g   Q h\        \        ^
4      4      R8X  g   Q h\        V R,          4      R8X  g   Q h\        V R,          RRR7      R8X  g   Q h\        V \	        ^^4      ,          4      R8X  g   Q hR# )x,ynTrs   z
      x**3z      x**(y**3)g      @z,      (3.5d0*sin(x))**(-x + y**x)/(x**2 + y)z      sqrt(x)z      sqrt(dble(n))g      ?z      sqrt(10.0d0)z      1d0/xrW   rE   rF   zy = x**(-2.0d0)z      x**(3.0d0/7.0d0)Ng      g       )r   r<   r   r   r   )rV   rW   r   s      r[   test_fcode_Powr   B   sI   5>DAT"AA;,&&&T0000CF3J!d(++QTAX6767 7 7a>_,,,a>2222C=O+++a>_,,,b?2222D>]***D#V48IIIIHQN"#'????r]   c                     \        R 4      p \        \        ^^4      4      R8X  g   Q h\        \        ^^	4      4      R8X  g   Q h\        \        ^R4      4      R8X  g   Q h\        \        RR4      4      R8X  g   Q h\        V \        ^^4      ,           4      R8X  g   Q h\        \        ^^4      V ,          4      R8X  g   Q hR# )	rV   z      3.0d0/7.0d0z      2z      -3.0d0/7.0d0z      x + 3.0d0/7.0d0z      (3.0d0/7.0d0)*xNi)r   r<   r   rx   s    r[   test_fcode_Rationalr   T   s    A!Q $7777"a!Y...!R!%9999"b!"&9999Xa^#$(????!Q!"&====r]   c                  r    \        \        ^C4      4      R8X  g   Q h\        \        R4      4      R8X  g   Q hR# )C   z      67z      -1N)r<   r   rh   r]   r[   test_fcode_Integerr   ^   s0    ++++++r]   c                  r    \        \        R 4      4      R8X  g   Q h\        \        R4      4      R8X  g   Q hR# )g      E@z      42.0000000000000d0z      -1.00000000000000d+20Ng@x)r<   r   rh   r]   r[   test_fcode_Floatr   c   s2    t!;;;;u"????r]   c                    aa \        R 4      w  oo\        \        S4      \        S4      ,          4      R8X  g   Q h\	        \
        VV3R l4       \	        \
        VV3R l4       \	        \
        VV3R l4       \	        \
        VV3R l4       R	 F<  p \        \        SS4      V R7      R8X  g   Q h\        SS,          V R7      R8X  d   K<  Q h	  R# )
r~   z      sin(x)**cos(y)c                  2   < \        \        S S4      ^BR7      # B   ru   r<   r   rV   rW   s   r[   ry   &test_fcode_functions.<locals>.<lambda>k       c!Qi"(Er]   c                  ,   < \        S S,          ^BR7      # r   r<   r   s   r[   ry   r   l       a!eb(Ar]   c                  2   < \        \        S S4      ^MR7      # M   r   r   r   s   r[   ry   r   m   r   r]   c                  ,   < \        S S,          ^MR7      # r   r   r   s   r[   ry   r   n   r   r]   r   z      modulo(x, y)N)Z   _   i  i  )r   r<   r   r   rC   r{   r   )ru   rV   rW   s    @@r[   test_fcode_functionsr   h   s    5>DAqQ3q6!"&<<<<
 EF
 AB
 EF
 AB(SAY26JJJJQUX.2FFFF )r]   c            	         \        4       p \        R 4      w  rr4rVp\        \        V4      \	        W,          4      ,           \        WW,          4      ,           4      R8X  g   Q h\        \        V4      ^V,          V,          V\        ^^4      ,          ,          ,           4      R8X  g   Q h\        \        V4      \	        W,          4      ,           \        WW,          4      ,           RR7      R8X  g   Q h\        V\        V4      ,
          RR7      R8X  g   Q hV P                  V\	        V4      ,          V,           RR7      R	8X  g   Q hV P                  V\	        V4      ,          R
R7      R8X  g   Q hV P                  VRR7      R8X  g   Q h\        RRR7      w  r\        R4      p
\        R4      p\        R4      p\        RV	4      p\        RV4      p\        WV3,          W,          ,          WK,          RR7      R8X  g   Q hR# )zx,x_,x__,y,X,X_,Yz&      exp(x_) + sin(x*y) + cos(X__*Y_)z(      2*X_**(7.0d0/2.0d0)*Y*x + exp(x__)F)name_manglingz#      exp(x_) + sin(x*y) + cos(X*Y)z      x - cos(X)me	assign_toz      me = X*sin(x_) + x__muz      mu = X*sin(x_)adz      ad = x__n,mTrs   ArV   rW   ir   rE   r   rG   zndo i = 1, m
   y(i) = 0
end do
do i = 1, m
   do I_ = 1, n
      y(i) = A(i, I_)*x(I_) + y(i)
   end do
end doN)
r=   r   r<   r   r   r   r   doprintr>   r?   )obrV   x_x__rW   XX_Yr   mr   r   r   s                r[   	test_caser   t   s   	B 34AqAR3qs8#c!#h./@A A ASAaCE"hq!n"4445BC C CR3qs8#c!#h.eD=> > >SV515GGGG::aAhmt:48TTTT::aAh$:/3IIII::bD:)-====5$'DACACACACACAa4VD-57 7 7r]   c            
          \        R 4      p \        ^
4      P                  ^4      pRp\        V \        ^
4      ,          4      RV,          8X  g   Q h\        V \        ^
4      ,          4      RV,          8X  g   Q h\        V \        \	        ^
4      4      ,          4      RV,          8X  g   Q h\        \        \	        ^
4      4      4      RV,          8X  g   Q h\        \        ^
4      4      R\        ^
4      P                  ^4      ,          8X  g   Q h\        V \        \        ^
4      4      ,          4      RV,          8X  g   Q h\        V \        \        \	        ^
4      4      4      ,          4      RV,          8X  g   Q hR# )rV   z0.8340324452479558d0z      x*%sd0z
      %sd0z
      x*%sN)r   r   evalfr<   r   r   )rV   log10_17loglog10_17s      r[   "test_fcode_functions_with_integersr      s   s|A2w}}R H(KSW(!::::SW(!::::S2Z NX$====QrUx 7777R>\CGMM",=====SR\!"l[&@@@@SQrU_$%)CCCCr]   c                     ^p \        4       p\        \        4      R\        P                  ! V 4      ,          8X  g   Q h\        \        4      R\        P                  ! V 4      ,          8X  g   Q h\        \
        4      R\
        P                  ! V 4      ,          8X  g   Q h\        \        4      R\        P                  ! V 4      ,          8X  g   Q h\        \        4      R\        P                  ! V 4      ,          8X  g   Q h\        \        ^R7      R\        P                  ! ^4      ,          8X  g   Q h\        \        RR7      \        VP                  \        P                  ! V 4      4      30\        4       R	38X  g   Q h\        \        RR7      \        VP                  \        P                  ! V 4      4      30\        4       R
38X  g   Q h\        \
        RR7      \
        VP                  \
        P                  ! V 4      4      30\        4       R38X  g   Q h\        \        RR7      \        VP                  \        P                  ! V 4      4      30\        4       R38X  g   Q h\        \        RR7      \        VP                  \        P                  ! V 4      4      30\        4       R38X  g   Q h\        \        ^RR7      \        VP                  \        P                  ! ^4      4      30\        4       R38X  g   Q hR# )   z.      parameter (Catalan = %sd0)
      Catalanz4      parameter (EulerGamma = %sd0)
      EulerGammaz"      parameter (E = %sd0)
      Ez6      parameter (GoldenRatio = %sd0)
      GoldenRatioz$      parameter (pi = %sd0)
      pi)	precisionFrI   z      Catalanz      EulerGammaz      Ez      GoldenRatioz      pi)r   rJ   N)
r=   r<   r	   r   r
   r   r   r   rb   set)precrQ   s     r[   test_fcode_NumberSymbolr      s   DA>NQXQ^Q^_cQddddd WZdZjZjkoZp pppp8<qwwt}LLLL!Z]h]n]nos]t!tttt9?"((4.PPPP
aCbhhqkQR R R&	!((7==./0,2365/+K K K K5)
AHH=  0! /"#&5*<.> > > >% 
QXXaggdm$	%&y%: : : :E*ahh$?! 1" 0#$'E+>/@ @ @ @5!
ahhrxx~&	'(#%&= = = =q.
ahhrxx{#	$%suj3: : : :r]   c                  h   \        \        4      R 8X  g   Q h\        R4      p \        ^\        ,          4      R8X  g   Q h\        ^^\        ,          ,           4      R8X  g   Q h\        ^^\        ,          ,           V ,           4      R8X  g   Q h\        \        V ,          4      R8X  g   Q h\        ^^\        ,          ,           V ,
          4      R8X  g   Q h\        RRR7      p \        ^V ,          4      R	8X  g   Q h\        \        V ,          4      R8X  g   Q h\        ^V ,           4      R
8X  g   Q hR# )z      cmplx(0,1)rV   z      cmplx(0,4)z      cmplx(3,4)z      cmplx(3,4) + xz      cmplx(0,1)*xz      cmplx(3,4) - xT)	imaginaryz	      5*xz      x + 3N)r<   r   r   rx   s    r[   test_fcode_complexr      s    8))))A1:++++QqS>////QqS1!77771:----QqS1!7777t$A1:$$$1:----Q<=(((r]   c                      \        R 4      w  r\        \        V 4      4      R8X  g   Q h\        \        W4      4      R8X  g   Q h\        \	        V 4      4      R8X  g   Q hR# )r~   z      sin(x)z      atan2(x, y)z      conjg(x)N)r   r<   r   r   r   r   s     r[   test_implicitr      sS    5>DAQ=N***q!44441"2222r]   c                     \        R 4      p \        R4      p\        \        4      ;_uu_ 4        \	        \        V 4      4       RRR4       \	        \        \        V 4      4      RR7      R8X  g   Q h\        \        4      ;_uu_ 4        \	        V! V 4      4       RRR4       R#   + '       g   i     Li; i  + '       g   i     R# ; i)rV   gNF)strictzHC     Not supported in Fortran:
C     Integral
      Integral(sin(x), x))r   r   rC   r{   r<   r    r!   r   )rV   r   s     r[   test_not_fortranr      s    AA	#	$	$eAh 
%#a&!%0  5A  A  A  A	#	$	$ad 
%	$ 
%	$ 
%	$	$s   B$B7$B4	7C	c                  T   \        R 4      p \        \        V 4      RR/R7      R8X  g   Q h\        R 4      p \        \        V 4      RR/R7      R8X  g   Q h\	        R4      p\        V! V 4      RR	/R7      R
8X  g   Q h\        RRR7      p\        \        V4      RR/R7      R8X  g   Q hR# )rV   r   zsinrM   z      zsin(x)r    mygammaz      mygamma(x)r   greatz      great(x)r   Trs   r   fctz      fct(n)N)r   r<   r   r    r   r   )rV   r   r   s      r[   test_user_functionsr      s    AQ8OKKKAa'9!57:LM M MA1sGn59IIIIT"A!k5%9;>LM M Mr]   c            	      .   \        R 4      p \        R\        V ^V ,          4      4      p\        V! V 4      4      R8X  g   Q h\        R\        V ^\        ,          V ,          4      4      p\        V! V 4      4      R\        P
                  ! ^4      ,          8X  g   Q h\        R4      p\        R\        RRR7      4      p\        R\        W ^V ,           ,          ^V ,           ,          4      4      p\        V! W#,          4      W#,          R	7      R
8X  g   Q hR# )rV   r   z	      2*xz(      parameter (pi = %sd0)
      2*pi/xr   r   r   Trs   r   zI      do i = 1, n
         A(i) = (A(i) + 1)*(A(i) + 2)*A(i)
      end doN)r   rB   r   r<   r   r   r>   r?   )rV   r   r   r   s       r[   test_inline_functionr      s    AS&AaC.1A1;+%%%S&AbDF"34A1;	
    	CACd+,AS&q1uIq1u,=">?A14AD)	  r]   c                  V    \        R 4      p \        \        V 4      RR7      R8X  g   Q hR# )rV   sr   z      s = sin(x)N)r   r<   r   rx   s    r[   test_assign_tor      s%    AQ3'+====r]   c                      \        R 4      w  r\        W,           ^
,          P                  4       RR7      R8X  g   Q h\        ^4       Uu. uF  q V,          NK  	  pp\        \	        V!  4      R8X  g   Q hR# u upi )r~   varr   z      var = x**10 + 10*x**9*y + 45*x**8*y**2 + 120*x**7*y**3 + 210*x**6*
     @ y**4 + 252*x**5*y**5 + 210*x**4*y**6 + 120*x**3*y**7 + 45*x**2*y
     @ **8 + 10*x*y**9 + y**10zR      x**10 + x**9 + x**8 + x**7 + x**6 + x**5 + x**4 + x**3 + x**2 + x
     @ + 1N)r   r<   expandranger   )rV   rW   r   es       r[   test_line_wrappingr      s|    5>DA152+%%'59	)  
 Ry!y!AyA!a>	   	"s   
A8c                  l   \        R 4      w  r\        \        W8  W^,           8  4      RR7      R8X  g   Q h\        \        W8  W^,           8  4      RR7      R8X  g   Q h\        \	        W8  W^,           8  RR7      RR7      R8X  g   Q h\        \        W8  W^,           8  4      RR7      R8X  g   Q hR	# )
x yrE   rF   zx < y .and. y < x + 1zx < y .or. y < x + 1Fevaluatezx < y .neqv. y < x + 1zx < y .eqv. y < x + 1N)r   r<   r5   r6   r9   r8   r   s     r[   test_fcode_precedencer   
  s    5>DAQUAAI&f=     AE11u9%V<  QUAAI6!9: : :AE11u9-VD     r]   c            	      0   \        R 4      w  rp\        \        V 4      RR7      R8X  g   Q h\        \        W4      RR7      R8X  g   Q h\        \        V \        V4      4      RR7      R8X  g   Q h\        \        \        V 4      V4      RR7      R8X  g   Q h\        \        \        V 4      \        V4      4      RR7      R8X  g   Q h\        \        \        W4      RR	7      RR7      R
8X  g   Q h\        \	        W4      RR7      R8X  g   Q h\        \	        V \        V4      4      RR7      R8X  g   Q h\        \	        \        V 4      V4      RR7      R8X  g   Q h\        \	        \        V 4      \        V4      4      RR7      R8X  g   Q h\        \        \	        W4      RR	7      RR7      R8X  g   Q h\        \        \	        W4      V 4      RR7      R8X  g   Q h\        \        \	        W 4      V4      RR7      R8X  g   Q h\        \        \	        W4      V4      RR7      R8X  g   Q h\        \	        \        W4      V 4      RR7      R8X  g   Q h\        \	        \        W 4      V4      RR7      R8X  g   Q h\        \	        \        W4      V4      RR7      R8X  g   Q h\        \        WV4      RR7      R8X  g   Q h\        \        W\        V4      4      RR7      R8X  g   Q h\        \        V \        V4      V4      RR7      R8X  g   Q h\        \        \        V 4      W4      RR7      R8X  g   Q h\        \        \        WV4      RR	7      RR7      R8X  g   Q h\        \	        WV4      RR7      R8X  g   Q h\        \	        W\        V4      4      RR7      R8X  g   Q h\        \	        V \        V4      V4      RR7      R8X  g   Q h\        \	        \        V 4      W4      RR7      R8X  g   Q h\        \        \	        WV4      RR	7      RR7      R8X  g   Q hR # )!rH   rE   rF   z.not. xz	x .and. yzx .and. .not. yzy .and. .not. xz.not. x .and. .not. yFr   z.not. (x .and. y)zx .or. yzx .or. .not. yzy .or. .not. xz.not. x .or. .not. yz.not. (x .or. y)zx .and. (y .or. z)zy .and. (x .or. z)zz .and. (x .or. y)zx .or. y .and. zzy .or. x .and. zzz .or. x .and. yzx .and. y .and. zzx .and. y .and. .not. zzx .and. z .and. .not. yzy .and. z .and. .not. xz.not. (x .and. y .and. z)zx .or. y .or. zzx .or. y .or. .not. zzx .or. z .or. .not. yzy .or. z .or. .not. xz.not. (x .or. y .or. z)N)r   r<   r7   r5   r6   rV   rW   rX   s      r[   test_fcode_Logicalr     s   gGA!Qv.);;;Q&1[@@@QAv6:KKKKSVQv6:KKKKSVSV$F;     SY/vF   A0J>>>As1vf59IIIICFAf59IIIICFCF#6:  RX.fE   RXq!8<PPPPRXq!8<PPPPRXq!8<PPPPCIq!8<NNNNCIq!8<NNNNCIq!8<NNNNQ1V48KKKKQ3q6"&9!" " "QA"&9!" " "SVQ"&9!" " "Sq\E2&I#$ $ $ A!F37HHHHA#a&!8     As1vq!8     CFA!8     Ra[51H!" " "r]   c            
         \        R 4      w  rp\        \        WRR7      RR7      R8X  g   Q h\        \        V \        V4      RR7      RR7      R8X  g   Q h\        \        \        V 4      VRR7      RR7      R8X  g   Q h\        \        \        V 4      \        V4      RR7      RR7      R8X  g   Q h\        \        \        WRR7      RR7      RR7      R	8X  g   Q h\        \	        W4      RR7      R
8X  g   Q h\        \	        V \        V4      4      RR7      R8X  g   Q h\        \	        \        V 4      V4      RR7      R8X  g   Q h\        \	        \        V 4      \        V4      4      RR7      R8X  g   Q h\        \        \	        W4      RR7      RR7      R8X  g   Q h\        \	        \        W4      V 4      RR7      R8X  g   Q h\        \	        \        W 4      V4      RR7      R8X  g   Q h\        \	        \        W4      V4      RR7      R8X  g   Q h\        \        \	        W4      V 4      RR7      R8X  g   Q h\        \        \	        W 4      V4      RR7      R8X  g   Q h\        \        \	        W4      V4      RR7      R8X  g   Q h\        \	        \        W4      V 4      RR7      R8X  g   Q h\        \	        \        W 4      V4      RR7      R8X  g   Q h\        \	        \        W4      V4      RR7      R8X  g   Q h\        \        \	        W4      V 4      RR7      R8X  g   Q h\        \        \	        W 4      V4      RR7      R8X  g   Q h\        \        \	        W4      V4      RR7      R8X  g   Q h\        \	        \        WRR7      V 4      RR7      R8X  g   Q h\        \	        \        W RR7      V4      RR7      R8X  g   Q h\        \	        \        WRR7      V4      RR7      R8X  g   Q h\        \        \	        W4      V RR7      RR7      R8X  g   Q h\        \        \	        W 4      VRR7      RR7      R8X  g   Q h\        \        \	        W4      VRR7      RR7      R 8X  g   Q h\        \        \        W4      V RR7      RR7      R!8X  g   Q h\        \        \        W 4      VRR7      RR7      R"8X  g   Q h\        \        \        W4      VRR7      RR7      R#8X  g   Q h\        \        \        WRR7      V 4      RR7      R$8X  g   Q h\        \        \        W RR7      V4      RR7      R%8X  g   Q h\        \        \        WRR7      V4      RR7      R&8X  g   Q h\        \        \        W4      V RR7      RR7      R'8X  g   Q h\        \        \        W 4      VRR7      RR7      R(8X  g   Q h\        \        \        W4      VRR7      RR7      R)8X  g   Q h\        \        \        WRR7      V 4      RR7      R*8X  g   Q h\        \        \        W RR7      V4      RR7      R+8X  g   Q h\        \        \        WRR7      V4      RR7      R,8X  g   Q h\        \        WVRR7      RR7      R-8X  g   Q h\        \        W\        V4      RR7      RR7      R.8X  g   Q h\        \        V \        V4      VRR7      RR7      R/8X  g   Q h\        \        \        V 4      WRR7      RR7      R08X  g   Q hR1# )2rH   Fr   rE   rF   z
x .neqv. yzx .neqv. .not. yzy .neqv. .not. xz.not. x .neqv. .not. yz.not. (x .neqv. y)z	x .eqv. yzx .eqv. .not. yzy .eqv. .not. xz.not. x .eqv. .not. yz.not. (x .eqv. y)zx .eqv. y .and. zzy .eqv. x .and. zzz .eqv. x .and. yzx .and. (y .eqv. z)zy .and. (x .eqv. z)zz .and. (x .eqv. y)zx .eqv. y .or. zzy .eqv. x .or. zzz .eqv. x .or. yzx .or. (y .eqv. z)zy .or. (x .eqv. z)zz .or. (x .eqv. y)zx .eqv. (y .neqv. z)zy .eqv. (x .neqv. z)zz .eqv. (x .neqv. y)zx .neqv. (y .eqv. z)zy .neqv. (x .eqv. z)zz .neqv. (x .eqv. y)zx .neqv. y .and. zzy .neqv. x .and. zzz .neqv. x .and. yzx .and. (y .neqv. z)zy .and. (x .neqv. z)zz .and. (x .neqv. y)zx .neqv. y .or. zzy .neqv. x .or. zzz .neqv. x .or. yzx .or. (y .neqv. z)zy .or. (x .neqv. z)zz .or. (x .neqv. y)zx .neqv. y .neqv. zzx .neqv. y .neqv. .not. zzx .neqv. z .neqv. .not. yzy .neqv. z .neqv. .not. xN)r   r<   r9   r7   r8   r5   r6   r   s      r[   test_fcode_Xlogicalr   G  s*   gGA!QE*&A  QA/vF  SVQ/vF  SVSVe4!9: : :S.?!56 6 6 A!8KGGGAs1v&f=  CFA&f=  CFCF+6B     Z%6!45 5 5 CIq)@  CIq)@  CIq)@  Z%q)@  Z%q)@  Z%q)@   BqHa(?  BqHa(?  BqHa(?  Jq$a(?  Jq$a(?  Jq$a(?   Cu5q9!78 8 8Cu5q9!78 8 8Cu5q9!78 8 8Z%q59!78 8 8Z%q59!78 8 8Z%q59!78 8 8 SYE2&I  SYE2&I  SYE2&I  S.2&I  S.2&I  S.2&I   RXq51H  RXq51H  RXq51H  Cu-q1H  Cu-q1H  Cu-q1H   Q1u-VD  Q3q6E2&I#$ $ $QAE2&I#$ $ $SVQE2&I#$ $ $r]   c                     \        R 4      w  r\        \        WR4      RR7      R8X  g   Q h\        \        WR4      RR7      R8X  g   Q h\        \        WR4      RR7      R8X  g   Q h\        \        WR	4      RR7      R
8X  g   Q h\        \        WR4      RR7      R8X  g   Q h\        \        WR4      RR7      R8X  g   Q hR# )r   z==rE   rF   zx == yz!=zx /= yz>=zx >= yz<=zx <= y>zx > y<zx < yN)r   r<   r4   r   s     r[   test_fcode_Relationalr     s    5>DAA$'v>(JJJA$'v>(JJJA$'v>(JJJA$'v>(JJJA#&f=HHHA#&f=HHHr]   c            	        a \        R 4      p \        W ^8  3V ^,          R34      o\        \        V3R l4       \	        S^_R7      pRpW8X  g   Q h\	        \        W ^8  3V ^,          R34      RR7      R8X  g   Q h\        V 4      V ,          p\        V 4      V ,          p\        ^
4       F  p\        W04      p\        W@4      pK  	  Rp\	        \        W0^ 8  3VR34      R	R7      pW8X  g   Q h\	        \        W ^8  3V ^,          V ^8  3\        V 4      R34      ^_R7      pR
pW8X  g   Q h\        W ^8  3V ^,          V ^8  3\        V 4      V ^ 8  34      o\        \        V3R l4       R# )rV   Tc                     < \        S 4      # rw   r   rU   s   r[   ry   &test_fcode_Piecewise.<locals>.<lambda>  s	    dr]   r   z      merge(x, x**2, x < 1)r   r   zR      if (x < 1) then
         var = x
      else
         var = x**2
      end ifa/        if (x < 0) then
         weird_name = -cos(x)/x + 10*sin(x)/x**2 + 90*cos(x)/x**3 - 720*
     @ sin(x)/x**4 - 5040*cos(x)/x**5 + 30240*sin(x)/x**6 + 151200*cos(x
     @ )/x**7 - 604800*sin(x)/x**8 - 1814400*cos(x)/x**9 + 3628800*sin(x
     @ )/x**10 + 3628800*cos(x)/x**11
      else
         weird_name = -sin(x)/x - 10*cos(x)/x**2 + 90*sin(x)/x**3 + 720*
     @ cos(x)/x**4 - 5040*sin(x)/x**5 - 30240*cos(x)/x**6 + 151200*sin(x
     @ )/x**7 + 604800*cos(x)/x**8 - 1814400*sin(x)/x**9 - 3628800*cos(x
     @ )/x**10 + 3628800*sin(x)/x**11
      end if
weird_namez1      merge(x, merge(x**2, sin(x), x > 1), x < 1)c                     < \        S 4      # rw   r   r   s   r[   ry   r     s	    uT{r]   N)
r   r   rC   r{   r<   r   r   r   r   
ValueError)rV   codeexpectedabr   rU   s         @r[   test_fcode_Piecewiser     sk   AaQZ!Q$.D
 34#D,HA1u:1d|4F	   	AqAAqA2YJJ 
	  A1u:4y1\JDA1u:1a!e}s1vtnEPRSDBHaQZ!Q$AQQ@D
:*+r]   c                      \        4       p . ROpV P                  V4      p. ROpV F  p\        V4      ^H8:  d   K  Q h	  \        W#4       F  w  rVWV8X  d   K  Q h	  \        V4      \        V4      8X  g   Q hR# )bC     This is a long comment on a single line that must be wrapped properly to produce nice outputN)r   zf      this = is + a + long + and + nasty + fortran + statement + that * must + be + wrapped + properlyzg      this = is + a + long + and + nasty + fortran + statement +  that * must + be + wrapped + properlyzh      this = is + a + long + and + nasty + fortran + statement +   that * must + be + wrapped + properlyzd      this = is + a + long + and + nasty + fortran + statement + that*must + be + wrapped + properlyzf      this = is + a + long + and + nasty + fortran + statement +   that*must + be + wrapped + properlyzg      this = is + a + long + and + nasty + fortran + statement +    that*must + be + wrapped + properlyzh      this = is + a + long + and + nasty + fortran + statement +     that*must + be + wrapped + properlyze      this = is + a + long + and + nasty + fortran + statement + that**must + be + wrapped + properlyzf      this = is + a + long + and + nasty + fortran + statement +  that**must + be + wrapped + properlyzg      this = is + a + long + and + nasty + fortran + statement +   that**must + be + wrapped + properlyzh      this = is + a + long + and + nasty + fortran + statement +    that**must + be + wrapped + properlyzi      this = is + a + long + and + nasty + fortran + statement +     that**must + be + wrapped + properlyzc      this = is + a + long + and + nasty + fortran + statement(that)/must + be + wrapped + properlyzg      this = is + a + long + and + nasty + fortran +     statement(that)/must + be + wrapped + properly)zBC     This is a long comment on a single line that must be wrappedz%C     properly to produce nice outputzG      this = is + a + long + and + nasty + fortran + statement + that *%     @ must + be + wrapped + properlyzH      this = is + a + long + and + nasty + fortran + statement +  that *r   G      this = is + a + long + and + nasty + fortran + statement +   thatz'     @ * must + be + wrapped + properlyzF      this = is + a + long + and + nasty + fortran + statement + that*r   zH      this = is + a + long + and + nasty + fortran + statement +   that*r   H      this = is + a + long + and + nasty + fortran + statement +    thatz&     @ *must + be + wrapped + properly@      this = is + a + long + and + nasty + fortran + statement +z*     @ that*must + be + wrapped + properlyzG      this = is + a + long + and + nasty + fortran + statement + that**r   zH      this = is + a + long + and + nasty + fortran + statement +  that**r   r   '     @ **must + be + wrapped + properlyr   r   r   z+     @ that**must + be + wrapped + properlyzE      this = is + a + long + and + nasty + fortran + statement(that)/r   zH      this = is + a + long + and + nasty + fortran +     statement(that)z&     @ /must + be + wrapped + properly)r=   _wrap_fortranlenzip)re   lineswrapped_linesexpected_lineslinewr   s          r[   test_wrap_fortranr     sx    nGE" ))%0MN@ 4yB M2vv 3}^!4444r]   c                  Z    \        4       p . ROp. ROpV P                  V4      V8X  g   Q hR# )H      this_variable_is_very_long_because_we_try_to_test_line_break=1.0d0N)r  zI      this_variable_is_very_long_because_we_try_to_test_line_break =1.0d0zK      this_variable_is_very_long_because_we_try_to_test_line_break  = 1.0d0zL      this_variable_is_very_long_because_we_try_to_test_line_break   = 1.0d0zM      this_variable_is_very_long_because_we_try_to_test_line_break    = 1.0d0zK      this_variable_is_very_long_because_we_try_to_test_line_break = 10.0d0)r  D      this_variable_is_very_long_because_we_try_to_test_line_break =     @ 1.0d0zE      this_variable_is_very_long_because_we_try_to_test_line_break  =r  zF      this_variable_is_very_long_because_we_try_to_test_line_break   =r  zG      this_variable_is_very_long_because_we_try_to_test_line_break    =r  r  z     @ 10.0d0r=   r   re   r   r   s      r[   test_wrap_fortran_keep_d0r    s2    nGEH   '8333r]   c                  (    \        \        R  4       R# )c                  .    \        \        ^4      RR7      # )   garbage)method)r<   r   rh   r]   r[   ry   test_settings.<locals>.<lambda>6  s    eAaD;r]   N)rC   	TypeErrorrh   r]   r[   test_settingsr  5  s    
9;<r]   c                  z    \        R 4      w  r\        \        V 4      \        V4      ,           RR7      R8X  g   Q hR# )r~   rE   rF   zsin(y) + cos(x)N)r   r<   r   r   r   s     r[   test_free_form_code_liner  9  s/    5>DAQ#a&7;LLLLr]   c                      \        R 4      w  r\        \        V 4      \        V4      ,           ^,          P	                  4       RR7      pRpW#8X  g   Q hR# )r~   rE   rF   zsin(y)**7 + 7*sin(y)**6*cos(x) + 21*sin(y)**5*cos(x)**2 + 35*sin(y)**4* &
      cos(x)**3 + 35*sin(y)**3*cos(x)**4 + 21*sin(y)**2*cos(x)**5 + 7* &
      sin(y)*cos(x)**6 + cos(x)**7N)r   r<   r   r   r   )rV   rW   resultr   s       r[    test_free_form_continuation_liner  >  sK    5>DASVc!f_*224FKF	- 
 r]   c                  ^    \        R R/4      p R.pRR.pV P                  V4      V8X  g   Q hR# )rG   rE   z^! This is a long comment on a single line that must be wrapped properly to produce nice outputzG! This is a long comment on a single line that must be wrapped properlyz! to produce nice outputNr  r  s      r[   test_free_form_comment_liner  I  sA    OV45GnoEQ"$H   '8333r]   c                  t   \        R RR7      w  r\        R4      p\        R4      p\        R4      p\        RV4      p\        RV 4      pRp\        W%V3,          W6,          ,          WE,          R	R
7      pWRR/,          8X  g6   WRR/,          8X  g%   WRR/,          8X  g   WRR/,          8X  g   Q hR# R# R# R# )r   Trs   r   rV   rW   r   jz_do i = 1, m
   y(i) = 0
end do
do i = 1, m
   do j = 1, n
      y(i) = %(rhs)s
   end do
end dorE   r   rhszy(i) + A(i, j)*x(j)zy(i) + x(j)*A(i, j)zx(j)*A(i, j) + y(i)zA(i, j)*x(j) + y(i)N)r   r>   r?   r<   )	r   r   r   rV   rW   r   r  r   r   s	            r[   
test_loopsr  R  s    5$'DACACACACACA	  a4VDD'<==='<==='<==='<===? > > > > >r]   c                  
   \        R R\        R7      w  r\        R4      p\        R4      p\        W4      p RRV P                  P
                  RVP
                  /,          p\        W ,          W0,          RR	7      pWT8X  g   Q hR
# )zi mT)r0   clsrV   rW   zMdo i_%(icount)i = 1, m_%(mcount)i
   y(i_%(icount)i) = x(i_%(icount)i)
end doicountmcountrE   r   N)r   r   r>   r?   labeldummy_indexr<   )r   r   rV   rW   r   r   s         r[   test_dummy_loopsr   l  sx    5$E2DACACAA	A	 
177&&!--@	AH
 V<Dr]   c                     ^p \        RV 3R7      p\        RV 3R7      p\        RV ^,
          3R7      p\        RV ^,
          4      p\        W4,          W^,           ,          W,          ,
          W$^,           ,          W$,          ,
          ,          4      p\        VP                  VP
                  RR7      pVP                  R4      '       g   Q hR	# )
   rW   shaperV   Dyr   F)r   contract+Dy(i) = (y(i + 1) - y(i))/(x(i + 1) - x(i))N)r>   r?   r   r<   r  lhsendswith)len_yrW   rV   r%  r   r   code0s          r[   2test_fcode_Indexed_without_looking_for_contractionr,  {  s    ECx(ACx(A	T%'	,BCqAQ3q1vad{+,A!%%15559E>>GHHHHr]   c                  T  a ^p \        RV 3R7      p\        RV 3R7      p\        RV ^,
          3R7      p\        RV ^,
          4      p\        W4,          W^,           ,          W,          ,
          W$^,           ,          W$,          ,
          ,          4      p\        \	        VP
                  VP                  4      4      pVP                  R4      '       g   Q h ! R R\        \        4      oVP                  V3R	 lVP                  \        4       4       4      p\        W4,          W^,           ,          W,          ,
          W$^,           ,          W$,          ,
          ,          4      p\        \	        VP
                  VP                  4      4      pVP                  R4      '       g   Q hR
# )r"  rW   r#  rV   r%  r   r'  c                       ] tR tRtRtR# ).test_element_like_objects.<locals>.ElementExpri  rh   N)ri   rj   rk   rl   rm   rh   r]   r[   ElementExprr/    s    r]   r0  c              3   `   <"   T F#  qS! VP                   VP                  4      3x  K%  	  R # 5irw   )nameindices).0r   r0  s   & r[   	<genexpr>,test_element_like_objects.<locals>.<genexpr>  s%     T<Qq;qvvqyy12<Qs   +.N)r@   r?   r   r<   r$   r(  r  r)  r2   r   subsatomsrA   )r*  rW   rV   r%  r   r   r+  r0  s          @r[   test_element_like_objectsr9    s'   ECx(ACx(A	T%'	,BCqAQ3q1vad{+,A*QUUAEE*+E>>GHHHHgt  	
TAGGL<QTTAQ3q1vad{+,A*QUUAEE*+E>>GHHHHr]   c                       ! R  R\         4      p V ! 4       p\        R4      pVP                  \        V4      R4      R8X  g   Q hR# )c                   J    ] tR tRt]P
                  P                  4       tRtR# )1test_derived_classes.<locals>.MyFancyFCodePrinteri  rh   N)ri   rj   rk   rl   r=   _default_settingscopyrm   rh   r]   r[   MyFancyFCodePrinterr<    s    (::??Ar]   r?  rV   borkz      bork = sin(x)N)r=   r   r   r   )r?  re   rV   s      r[   test_derived_classesrA    sA    Bl B "#GA??3q66*.CCCCr]   c                  Z    R p Rp\        RR/4      pVP                  V 4      pW18X  g   Q hR# )au  subroutine test(a)
integer :: a, i, j

do
do 
do j = 1, 5
if (a>b) then
if(b>0) then
a = 3
donot_indent_me = 2
do_not_indent_me_either = 2
ifIam_indented_something_went_wrong = 2
if_I_am_indented_something_went_wrong = 2
end should not be unindented here
end if
endif
end do
end do
enddo
end subroutine

subroutine test2(a)
integer :: a
do
a = a + 1
end do 
end subroutine
a  subroutine test(a)
integer :: a, i, j

do
   do 
      do j = 1, 5
         if (a>b) then
            if(b>0) then
               a = 3
               donot_indent_me = 2
               do_not_indent_me_either = 2
               ifIam_indented_something_went_wrong = 2
               if_I_am_indented_something_went_wrong = 2
               end should not be unindented here
            end if
         endif
      end do
   end do
enddo
end subroutine

subroutine test2(a)
integer :: a
do
   a = a + 1
end do 
end subroutine
rG   rE   N)r=   indent_code)	codelinesr   rQ   r  s       r[   test_indentrE    sA    	 <	 : 	ov./A]]9%Fr]   c            	         \        R 4      w  rp\        W,          \        ^V ,           V^ 8  3VR34      \        V4      .4      p\	        R^^4      p\        W44      R8X  g   Q h\        ^VR
,          ,          V ^ 8  3VR
,          R34      \        VR,          4      ,           VR,          ,           p\        V^_R7      R8X  g   Q h\	        R^^4      p\	        R^^4      p\        \        VR,          4      ^ \        VR
,          4      .VR,          VR
,          ,           VR,          ^.^VR,          ,          VR,          ,          \        VR,          4      ^,           ^ ..4      p\        W4      R8X  g   Q hR	# )zx,y,zTr   z      A(1, 1) = x*y
      if (y > 0) then
         A(2, 1) = x + 2
      else
         A(2, 1) = y
      end if
      A(3, 1) = sin(z)r   z?      merge(2*A(3, 1), A(3, 1), x > 0) + sin(A(2, 1)) + A(1, 1)rR   Mz      M(1, 1) = sin(q(2, 1))
      M(2, 1) = q(2, 1) + q(3, 1)
      M(3, 1) = 2*q(5, 1)/q(2, 1)
      M(1, 2) = 0
      M(2, 2) = q(4, 1)
      M(3, 2) = sqrt(q(1, 1)) + 4
      M(1, 3) = cos(q(3, 1))
      M(2, 3) = 5
      M(3, 3) = 0N)   r   )   r   r   r   )   r   )r	  r   )r   r:   r   r   r;   r<   r   r   )	rV   rW   rX   matr   rU   rR   rG  r   s	            r[   test_Matrix_printingrM    sh   gGA!
!#y!a%14y93q6B
CCS!QA=	!" " " a$iQ'!D'49C$LH1T7RD#IK K K 	S!QAS!QAQsVaQsV-	
3!C&!D'1%	
1T71S6	4#<!+Q/1 	2A ;		 	 	r]   c            	          \        R 4      w  r\        V \        ^ ^
^4      \        WV,          4      .4      p\	        V4      pVR8X  g   Q hR# )r   z2      do x = 0, 9, 2
         y = x*y
      end doN)r   r#   r"   r$   r<   )rV   rW   fsols       r[   test_fcode_ForrQ    sO    5>DAAuQAA1u!5 67A
(C " # # #r]   c                     R  p \        RRR7      p\        P                  ! V4      p\        V4      pV ! VR4       \        R4      w  rE\        V\        ^*\
        0R7      p\        V4      pV ! VR4       \        V\        R7      p\        V4      p	V ! V	R	4       V ! \        R
4       V ! \        R4       V ! \        R
\        \        /R7       V ! \        R\        \        /R7       R# )c                 4    \        V 3R ^_RR/VB V8X  g   Q hR# )ru   rG   rE   Nr   )rU   refkwargss   &&,r[   check%test_fcode_Declaration.<locals>.check  s$    TGBGfGG3NNNr]   r   Trs   zinteger*4 :: ir   )valueattrszreal*4, parameter :: x = 42typezlogical :: yzreal*4zreal*8)type_aliasesN)	r   r'   deducedr&   r(   r*   r,   r)   r+   )
rV  r   var1dcl1rV   rW   var2dcl2bvar3dcl3s
             r[   test_fcode_Declarationrd    s    O 	T"AADtD	$ ! 5>DAAwb>DE	%./AE"DtD	$	'8	'8	$g7	$g7r]   c                  (   \        R ^^4      p \        R^^4      p\        R^^4      p\        V R,          4      R8X  g   Q h\        ^V R,          ,          4      R8X  g   Q hVR,          P                  W V,
          4      p\        V4      R8X  g   Q hR# )r   BCz      A(1, 1)z      3*A(1, 1)z      (A - B)(1, 1)NrJ  )r;   r<   r7  )r   rf  rg  Fs       r[   test_MatrixElement_printingri  '  s    S!QAS!QAS!QA4>_,-,QtW!2232	$QAA8,,-,r]   c                  Z    \        R 4      p \        \        V R^4      RR7      R8X  g   Q hR# )rV   +rE   rF   z	x = x + 1N)r   r<   r%   rx   s    r[   test_aug_assignrl  4  s)    AAsA&f=LLLr]   c            
          \        R 4      p \        \        \        V 4      ^8  \	        V R^4      .4      RR7      R8X  g   Q hR# )rV   -rE   rF   z)do while (abs(x) > 1)
   x = x - 1
end doN)r   r<   r-   rO   r%   rx   s    r[   
test_Whilero  9  sD    As1vzJq#q$9#:;6R	  r]   c                     a \        R 4      p \        RRR7      p\        V \        R7      p\        V\        R7      p\	        \        RW#.4      o\        \        V3R l4       R# )rV   r   Trs   rZ  powerc                     < \        S 4      # rw   r   )fp1s   r[   ry   .test_FunctionPrototype_print.<locals>.<lambda>J  	    c
r]   N)r   r'   r+   r0   r.   rC   r{   )rV   r   vxvnrs  s       @r[   test_FunctionPrototype_printrx  B  sN    AT"A	!$	B	!'	"B
D'B8
4C  23r]   c                    a \        R 4      p \        RRR7      p\        V \        R7      p\        V\        R7      p\	        W V,          4      \        V 4      .p\        \        RW#.V4      o\        \        V3R l4       R# )rV   r   Trs   rZ  rq  c                     < \        S 4      # rw   r   )fd1s   r[   ry   /test_FunctionDefinition_print.<locals>.<lambda>V  ru  r]   N)	r   r'   r+   r0   r$   r1   r/   rC   r{   )rV   r   rv  rw  bodyr{  s        @r[   test_FunctionDefinition_printr~  M  sg    AT"A	!$	B	!'	"BqQ$+D
T7RHd
;C  23r]   N)sympy.core.addr   sympy.core.exprr   sympy.core.functionr   r   r   sympy.core.modr   
sympy.corer	   r
   r   sympy.core.numbersr   r   r   r   r   r   sympy.core.relationalr   sympy.core.singletonr   sympy.core.symbolr   r   (sympy.functions.combinatorial.factorialsr   $sympy.functions.elementary.complexesr   r   &sympy.functions.elementary.exponentialr   r   (sympy.functions.elementary.miscellaneousr   $sympy.functions.elementary.piecewiser   (sympy.functions.elementary.trigonometricr   r   r   'sympy.functions.special.gamma_functionsr    sympy.integrals.integralsr!   sympy.sets.fancysetsr"   sympy.codegenr#   r$   r%   sympy.codegen.astr&   r'   r(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   sympy.logic.boolalgr5   r6   r7   r8   r9   sympy.matricesr:   r;   sympy.printing.fortranr<   r=   sympy.tensorr>   r?   sympy.tensor.array.expressionsr@   rA   sympy.utilities.lambdifyrB   sympy.testing.pytestrC   r\   rq   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r   r,  r9  rA  rE  rM  rQ  rd  ri  rl  ro  rx  r~  rh   r]   r[   <module>r     sk      8 8  9 9 C C $ " . > B = 9 : F F 9 . & 5 5! ! ! ! , , = = / 6 ) D 9 '	l-8@$>,
@
	G7>
D:0)3
M&>
	 ."b`$FI(,V95x44=M
4?4II&D=~ F#82
.M
4	4r]   