+
    iB                     $   ^ RI 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 ^ RIHt ^ RIHtHt ^ RIHtHtHtHtHtHtHtHtHtHtHt ^ R	I H!t! ^ R
I"H#t# RGR lt$R t%R t&R t'R t(R t)R t*R t+R t,R t-R t.R t/R t0R t1R t2R t3R t4R t5R t6R t7R t8R  t9R! t:R" t;R# t<R$ t=R% t>R& t?R' t@R( tAR) tBR* tCR+ tDR, tER- tFR. tGR/ tHR0 tIR1 tJR2 tKR3 tLR4 tMR5 tNR6 tOR7 tPR8 tQR9 tRR: tSR; tTR< tUR= tVR> tWR? tXR@ tYRA tZRB t[RC t\RD t]RE t^RF# )H    )StringIO)symbolsEqpiCatalanLambdaDummyEquality)Symbol)erf)Integral)MatrixMatrixSymbol)codegenmake_routineCCodeGen
C89CodeGen
C99CodeGenInputArgumentCodeGenErrorFCodeGenCodeGenArgumentListErrorOutputArgumentInOutArgument)raises)implemented_functionc                n    \        4       pV ! WW#V4       VP                  4       pVP                  4        V# )a  Wrapper for dump_fn. dump_fn writes its results to a stream object and
this wrapper returns the contents of that stream as a string. This
auxiliary function is used by many tests below.

The header and the empty lines are not generated to facilitate the
testing of the output.
)r   getvalueclose)dump_fnroutinesprefixheaderemptyoutputsources   &&&&&  `/var/www/html/photoedit/myenv/lib/python3.14/site-packages/sympy/utilities/tests/test_codegen.py
get_stringr)      s1     ZFHfe4__F
LLNM    c                    aa	a
aa \        R 4      w  oo
ooS
S,           S,          o	\        \        V	V
V3R l4       \        \        VV	V
VV3R l4       \        R\	        SS	4      SS
SS.R7      p V P
                   Uu. uF  qP                  NK  	  upSS
SS.8X  g   Q hV P
                   Uu. uF  p\        V4      NK  	  up\        \        \        \        .8X  g   Q h\        R\	        SS	4      SS
S.R7      p V P
                   Uu. uF  p\        V4      NK  	  up\        \        \        .8X  g   Q h^ RIHpHp \        VRR.4      w  rE\        RR	R
7      pV! RV4      p\        R\	        WG,          WW,          4      WTV.R7      p V P
                   Uu. uF  qP                  NK  	  upVP                  VP                  V.8X  g   Q h\!        S
S,          S,          S
^^3S^^34      o	\        R\	        SS	4      SS
SS.R7      p V P
                   Uu. uF  qP                  NK  	  upSS
SS.8X  g   Q hR# u upi u upi u upi u upi u upi )za x y zc                  $   < \        R S SS.R7      # testargument_sequencer   )exprxzs   r(   <lambda>-test_Routine_argument_order.<locals>.<lambda>&   s    \&$V.%r*   c                  :   < \        R \        S S4      SSS.R7      # r-   )r   r   )ar2   r3   yr4   s   r(   r5   r6   (   s"    \&"QC%&1I./r*   r.   r/   IndexedBaseIdxABmTintegeriN)r   r   r   r   r   	argumentsnametyper   r   r   sympy.tensorr;   r<   maplabelr   )rargr;   r<   r=   r>   r?   rB   r8   r2   r3   r9   r4   s           @@@@@r(   test_Routine_argument_orderrK   #   s   #JAq!QE19D
# &% &
# &/ &/ 0VR4[Q1aLIA!".#XX.1aA,>>>"#++/+3T#Y+/}nm4G G G GVR4[Q1IFA"#++/+3T#Y+/}m46 6 6 6 .{S#J'DAT"ACAVRad^ayIA!".#XX.177AGGQ2GGGGAaCEAq!9q!Qi0DVR4[Q1aLIA!".#XX.1aA,>>>! // 0 / /s   >H<.I	IIIc                  X    \        4       p \        V P                  . 4      pVR 8X  g   Q hR# )z$#include "file.h"
#include <math.h>
Nr   r)   dump_ccode_genr'   s     r(   test_empty_c_coderQ   >   s(    |H,F????r*   c                      \        4       p \        V P                  . R R7      pVR,          R8X  g   Q hVR,          R8X  g   Q hR# )Tr$   NR   NzR/******************************************************************************
 *   NNa  *
 *                                                                            *
 *              See http://www.sympy.org/ for more information.               *
 *                                                                            *
 *                       This file is part of 'project'                       *
 ******************************************************************************/
#include "file.h"
#include <math.h>
NrM   rO   s     r(   test_empty_c_code_with_commentrX   D   sR    |HD9F#;]   $< ["   r*   c                  X    \        4       p \        V P                  . 4      pVR 8X  g   Q hR# )z9#ifndef PROJECT__FILE__H
#define PROJECT__FILE__H
#endif
N)r   r)   dump_hrO   s     r(   test_empty_c_headerr[   V   s(    |H,FSSSSr*   c                      \        R 4      w  rpW,           V,          p\        RV4      p\        4       p\        VP                  V.4      pRpWg8X  g   Q hR# )x,y,zr.   #include "file.h"
#include <math.h>
double test(double x, double y, double z) {
   double test_result;
   test_result = z*(x + y);
   return test_result;
}
Nr   r   r   r)   rN   r3   r9   r4   r2   routinerP   r'   expecteds           r(   test_simple_c_coderc   \   sX    gGA!E19D64(G|H'3F	  r*   c                      \        R 4      w  rpW,           V,          p\        RV4      p\        4       p\        VP                  V.4      pRpWg8X  g   Q hR# )zif, typedef, whiler.   z#include "file.h"
#include <math.h>
double test(double if_, double typedef_, double while_) {
   double test_result;
   test_result = while_*(if_ + typedef_);
   return test_result;
}
N)r   r   r   r)   rN   r`   s           r(   test_c_code_reserved_wordsre   n   sY    *+GA!EQ;D64(G|H'3F	  r*   c                      \        R \        \        ,          4      p \        4       p\	        VP
                  V .4      pR\        P                  ! ^4      ,          pW#8X  g   Q hR# )r.   z#include "file.h"
#include <math.h>
double test() {
   double test_result;
   double const Catalan = %s;
   test_result = pow(M_PI, Catalan);
   return test_result;
}
N)r   r   r   r   r)   rN   evalfra   rP   r'   rb   s       r(   test_numbersymbol_c_coderi      sS    62w;/G|H'3F	 	b	H r*   c                      \        R 4      w  rpW,           p\        RW2W.R7      p\        4       p\        VP                  V.4      pRpWg8X  g   Q hR# )r]   r.   r/   z#include "file.h"
#include <math.h>
double test(double z, double x, double y) {
   double test_result;
   test_result = x + y;
   return test_result;
}
Nr_   r`   s           r(   test_c_code_argument_orderrk      sX    gGA!5D64q9EG|H'3F	  r*   c                      \        R 4      w  rpW,           V,          p\        RV4      p\        4       p\        VP                  V.4      pRpWg8X  g   Q hR# )r]   r.   d#ifndef PROJECT__FILE__H
#define PROJECT__FILE__H
double test(double x, double y, double z);
#endif
N)r   r   r   r)   rZ   r`   s           r(   test_simple_c_headerrn      sX    gGA!E19D64(G|H'3F	  r*   c                  |    \        R 4      w  rpW,           V,          pRR.p\        RV3RRRRR7      pWT8X  g   Q hR# )	r]   r.   CfileFr$   r%   N)file.cr^   )file.hrm   r   r   )r3   r9   r4   r2   rb   results         r(   test_simple_c_codegenrw      sP    gGA!E19D		H fd^S&eLFr*   c                     aa \        R 4      w  rpW,           V,          pW,
          V,          p\        RW4.4      o\        4       o\        \        VV3R l4       R# )r]   r.   c                  2   < \        S P                  S.4      # Nr)   rZ   rP   ra   s   r(   r5   )test_multiple_results_c.<locals>.<lambda>       HOOgY!Gr*   N)r   r   r   r   r   r3   r9   r4   expr1expr2rP   ra   s        @@r(   test_multiple_results_cr      sM    gGA!UAIEUAIE	G |H
<GHr*   c                  (    \        \        R  4       R# )c                      \        R . 4      # r.   r1    r*   r(   r5   #test_no_results_c.<locals>.<lambda>       |FB7r*   Nr   
ValueErrorr   r*   r(   test_no_results_cr          
:78r*   c                  n   ^ 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      pRV ! V4      3R	V! V4      3R
V	! V4      3RV
! V4      3RV! V4      3RV! V4      3RV! V4      3RV! V4      3RV! V4      3RV! V4      3RV! V4      3RV! V4      3RV! V4      3RV! V4      3RV! V4      3.p\+        VRRRRR7      pV^ ,          ^ ,          R8X  g   Q hV^ ,          ^,          R8X  g   Q hV^,          ^ ,          R8X  g   Q hV^,          ^,          R8X  g   Q hR# ) r   Abslogcoshsinhtanh)ceilingfloorsqrtacosasinatancossintanr3   	test_fabs	test_acos	test_asin	test_atan	test_ceiltest_cos	test_cosh
test_floortest_logtest_lntest_sin	test_sinh	test_sqrttest_tan	test_tanhC89rq   Frr   rs   a  #include "file.h"
#include <math.h>
double test_fabs(double x) {
   double test_fabs_result;
   test_fabs_result = fabs(x);
   return test_fabs_result;
}
double test_acos(double x) {
   double test_acos_result;
   test_acos_result = acos(x);
   return test_acos_result;
}
double test_asin(double x) {
   double test_asin_result;
   test_asin_result = asin(x);
   return test_asin_result;
}
double test_atan(double x) {
   double test_atan_result;
   test_atan_result = atan(x);
   return test_atan_result;
}
double test_ceil(double x) {
   double test_ceil_result;
   test_ceil_result = ceil(x);
   return test_ceil_result;
}
double test_cos(double x) {
   double test_cos_result;
   test_cos_result = cos(x);
   return test_cos_result;
}
double test_cosh(double x) {
   double test_cosh_result;
   test_cosh_result = cosh(x);
   return test_cosh_result;
}
double test_floor(double x) {
   double test_floor_result;
   test_floor_result = floor(x);
   return test_floor_result;
}
double test_log(double x) {
   double test_log_result;
   test_log_result = log(x);
   return test_log_result;
}
double test_ln(double x) {
   double test_ln_result;
   test_ln_result = log(x);
   return test_ln_result;
}
double test_sin(double x) {
   double test_sin_result;
   test_sin_result = sin(x);
   return test_sin_result;
}
double test_sinh(double x) {
   double test_sinh_result;
   test_sinh_result = sinh(x);
   return test_sinh_result;
}
double test_sqrt(double x) {
   double test_sqrt_result;
   test_sqrt_result = sqrt(x);
   return test_sqrt_result;
}
double test_tan(double x) {
   double test_tan_result;
   test_tan_result = tan(x);
   return test_tan_result;
}
double test_tanh(double x) {
   double test_tanh_result;
   test_tanh_result = tanh(x);
   return test_tanh_result;
}
rt   a  #ifndef PROJECT__FILE__H
#define PROJECT__FILE__H
double test_fabs(double x);
double test_acos(double x);
double test_asin(double x);
double test_atan(double x);
double test_ceil(double x);
double test_cos(double x);
double test_cosh(double x);
double test_floor(double x);
double test_log(double x);
double test_ln(double x);
double test_sin(double x);
double test_sinh(double x);
double test_sqrt(double x);
double test_tan(double x);
double test_tanh(double x);
#endif
N)$sympy.functions.elementary.complexesr   &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   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   r   r   r3   	name_exprrv   s                    r(   test_ansi_math1_codegenr      s_   8:HHD=ZZA	c!f	d1g	d1g	d1g	gaj!	SV	d1g	uQx 	SV	CF	SV	d1g	d1g	SV	d1gI" Yve5IF!9Q<8###!9Q<	F  $ !9Q<8###!9Q<	0
 
 
r*   c                  ,   ^ RI Hp  \        R4      w  rRV ! W4      3RW,          3.p\        VRRRRR7      pV^ ,          ^ ,          R	8X  g   Q hV^ ,          ^,          R
8X  g   Q hV^,          ^ ,          R8X  g   Q hV^,          ^,          R8X  g   Q hR# )r   atan2x,y
test_atan2test_powr   rq   Frr   rs   a*  #include "file.h"
#include <math.h>
double test_atan2(double x, double y) {
   double test_atan2_result;
   test_atan2_result = atan2(x, y);
   return test_atan2_result;
}
double test_pow(double x, double y) {
   double test_pow_result;
   test_pow_result = pow(x, y);
   return test_pow_result;
}
rt   z#ifndef PROJECT__FILE__H
#define PROJECT__FILE__H
double test_atan2(double x, double y);
double test_pow(double x, double y);
#endif
Nr   r   r   r   )r   r3   r9   r   rv   s        r(   test_ansi_math2_codegenr     s    >5>DA	uQ{#	QTI Yve5IF!9Q<8###!9Q<	N  
 !9Q<8###!9Q<	  r*   c                     ^ RI Hp HpHp \	        R4      w  r4pRV! V4      V ! V4      ,           V! V4      ,           ^,          P                  4       3RV ! V ! V ! V ! V ! V ! V ! V ! W4,           V,           4      4      4      4      4      4      4      4      3.p\        VRRRRR7      pV^ ,          ^ ,          R	8X  g   Q hV^ ,          ^,          R
8X  g   Q hV^,          ^ ,          R8X  g   Q hV^,          ^,          R8X  g   Q hR# )r   r   r   r   r]   test1test2r   rq   Frr   rs   a-  #include "file.h"
#include <math.h>
double test1(double x, double y, double z) {
   double test1_result;
   test1_result = pow(sin(x), 7) + 7*pow(sin(x), 6)*cos(y) + 7*pow(sin(x), 6)*tan(z) + 21*pow(sin(x), 5)*pow(cos(y), 2) + 42*pow(sin(x), 5)*cos(y)*tan(z) + 21*pow(sin(x), 5)*pow(tan(z), 2) + 35*pow(sin(x), 4)*pow(cos(y), 3) + 105*pow(sin(x), 4)*pow(cos(y), 2)*tan(z) + 105*pow(sin(x), 4)*cos(y)*pow(tan(z), 2) + 35*pow(sin(x), 4)*pow(tan(z), 3) + 35*pow(sin(x), 3)*pow(cos(y), 4) + 140*pow(sin(x), 3)*pow(cos(y), 3)*tan(z) + 210*pow(sin(x), 3)*pow(cos(y), 2)*pow(tan(z), 2) + 140*pow(sin(x), 3)*cos(y)*pow(tan(z), 3) + 35*pow(sin(x), 3)*pow(tan(z), 4) + 21*pow(sin(x), 2)*pow(cos(y), 5) + 105*pow(sin(x), 2)*pow(cos(y), 4)*tan(z) + 210*pow(sin(x), 2)*pow(cos(y), 3)*pow(tan(z), 2) + 210*pow(sin(x), 2)*pow(cos(y), 2)*pow(tan(z), 3) + 105*pow(sin(x), 2)*cos(y)*pow(tan(z), 4) + 21*pow(sin(x), 2)*pow(tan(z), 5) + 7*sin(x)*pow(cos(y), 6) + 42*sin(x)*pow(cos(y), 5)*tan(z) + 105*sin(x)*pow(cos(y), 4)*pow(tan(z), 2) + 140*sin(x)*pow(cos(y), 3)*pow(tan(z), 3) + 105*sin(x)*pow(cos(y), 2)*pow(tan(z), 4) + 42*sin(x)*cos(y)*pow(tan(z), 5) + 7*sin(x)*pow(tan(z), 6) + pow(cos(y), 7) + 7*pow(cos(y), 6)*tan(z) + 21*pow(cos(y), 5)*pow(tan(z), 2) + 35*pow(cos(y), 4)*pow(tan(z), 3) + 35*pow(cos(y), 3)*pow(tan(z), 4) + 21*pow(cos(y), 2)*pow(tan(z), 5) + 7*cos(y)*pow(tan(z), 6) + pow(tan(z), 7);
   return test1_result;
}
double test2(double x, double y, double z) {
   double test2_result;
   test2_result = cos(cos(cos(cos(cos(cos(cos(cos(x + y + z))))))));
   return test2_result;
}
rt   z#ifndef PROJECT__FILE__H
#define PROJECT__FILE__H
double test1(double x, double y, double z);
double test2(double x, double y, double z);
#endif
Nr   r   r   r   r   expandr   )r   r   r   r3   r9   r4   r   rv   s           r(   test_complicated_codegenr   ,  s    HHgGA!	CFSVOc!f,q088:;	#c#c#c#c!%!)n*=&>"?@ABCDI Yve5IF!9Q<8###!9Q<.	0 0 0b !9Q<8###!9Q<	  r*   c            	      `   ^ RI Hp Hp ^ RIHp V! RRR7      w  r4V ! R4      pV ! R4      pV ! R4      pV! R	V4      pV! R
V4      p	\        R\        Wx,          WXV	3,          Wi,          ,          4      3RRRRR7      w  w  rw  rV
R8X  g   Q hRpWRRW,          V	,           ,          /,          8X  gl   WRRWV,          ,           ,          /,          8X  gI   WRRW,          V	,           ,          /,          8X  g&   WRRWV,          ,           ,          /,          8X  g   Q hVR8X  g   Q hVR8X  g   Q hR# )r   r:   r   n mTr@   r=   r3   r9   rB   jmatrix_vectorC99rq   Frr   rs   a  #include "file.h"
#include <math.h>
void matrix_vector(double *A, int m, int n, double *x, double *y) {
   for (int i=0; i<m; i++){
      y[i] = 0;
   }
   for (int i=0; i<m; i++){
      for (int j=0; j<n; j++){
         y[i] = %(rhs)s + y[i];
      }
   }
}
rhs
A[%s]*x[j]
x[j]*A[%s]rt   z|#ifndef PROJECT__FILE__H
#define PROJECT__FILE__H
void matrix_vector(double *A, int m, int n, double *x, double *y);
#endif
NrF   r;   r<   sympy.core.symbolr   r   r   r;   r<   r   nr?   r=   r3   r9   rB   r   f1codef2	interfacerb   s                  r(   test_loops_cr   p  s;   -)5$'DACACACACACA")	"QT1T714<015&V[#]JR >>	  |qsQw'?@@@|qQ3w'?@@@|qsQw'?@@@|qQ3w'?@@@B A >>	  r*   c                     ^ RI Hp Hp \        RR\        R7      w  r#V ! R4      pV ! R4      pV! W#4      pRRVP
                  P                  R	VP                  /,          p\        R
\        WR,          WB,          4      4      p\        4       p\        4       p	\        V	P                  V.4      p
W8X  g   Q h\        \        4      ;_uu_ 4        \        VP                  V.4       RRR4       R#   + '       g   i     R# ; i)r   r:   i mTrA   clsr3   r9   z#include "file.h"
#include <math.h>
void test_dummies(int m_%(mno)i, double *x, double *y) {
   for (int i_%(ino)i=0; i_%(ino)i<m_%(mno)i; i_%(ino)i++){
      y[i_%(ino)i] = x[i_%(ino)i];
   }
}
inomnotest_dummiesN)rF   r;   r<   r   r	   rH   dummy_indexr   r   r   r   r)   rN   r   NotImplementedError)r;   r<   rB   r?   r3   r9   rb   rI   c89c99r   s              r(   test_dummy_loops_cr     s    -5$E2DACACAA	A	 
##UAMM:;H 	^Rad^4A
,C
,Ccjj1#&D	#	$	$3::s# 
%	$	$	$s   C..C?	c            	         ^ RI Hp Hp ^ RIHp V! RRR7      w  r4rVV ! RWF3R7      pV ! R4      pV ! R	4      p	V! R
WT^,
          34      p
V! RV4      p\        R\        W,          WzV3,          W,          ,          4      3RRRRR7      w  w  rw  rVR8X  g   Q hRRV^,
          RR/,          pVVRRW,          V,           ,          /,          8X  go   VVRRWV,          ,           ,          /,          8X  gK   VVRRW,          V,           ,          /,          8X  g'   VVRRWV,          ,           ,          /,          8X  g   Q hVR8X  g   Q hVR8X  g   Q hR# )r   r:   r   n m o pTr@   r=   shaper3   r9   rB   r   r   r   rq   Frr   rs   a#  #include "file.h"
#include <math.h>
void matrix_vector(double *A, int m, int n, int o, int p, double *x, double *y) {
   for (int i=o; i<%(upperi)s; i++){
      y[i] = 0;
   }
   for (int i=o; i<%(upperi)s; i++){
      for (int j=0; j<n; j++){
         y[i] = %(rhs)s + y[i];
      }
   }
}
upperir   %(rhs)sr   r   rt   z#ifndef PROJECT__FILE__H
#define PROJECT__FILE__H
void matrix_vector(double *A, int m, int n, int o, int p, double *x, double *y);
#endif
Nr   r;   r<   r   r   r?   opr=   r3   r9   rB   r   r   r   r   r   rb   s                    r(   test_partial_loops_cr     sf    .)D1JA!Cv&ACACAC!UACA")	"QT1T714<015&V[#]JR >>	 
1q5%+,H H|qsQw'?@@@H|qQ3w'?@@@H|qsQw'?@@@H|qQ3w'?@@@B A >>	  r*   c            	         ^ RI Hp  ^ RIHpHp \        R4      w  r4p\        RV ! WB! V4      4      V! V4      .4      p\        4       pVP                  V.RRRR7      pV^ ,          ^ ,          R8X  g   Q hR	p	V^ ,          ^,          V	8X  g   Q hR
# )r   r
   r   r   r]   foor.   Frr   test.cz#include "test.h"
#include <math.h>
double foo(double x, double *y) {
   (*y) = sin(x);
   double foo_result;
   foo_result = cos(x);
   return foo_result;
}
N	sympy.core.relationalr   r   r   r   r   r   r   write
r   r   r   r3   r9   r4   rI   crv   rb   s
             r(   test_output_arg_cr     s    .CgGA!UXaQ0#a&9:AAWWaS&eW<F!9Q<8###	  !9Q<8###r*   c            	         ^ RI Hp  ^ RIHpHp \        R4      w  r4p\        RV ! WB! V4      4      V! V4      .4      p\        4       pVP                  V.RRRR7      pV^ ,          ^ ,          R8X  g   Q hR	p	V^ ,          ^,          V	8X  g   Q hR
# )r   r
   r   zif, while, zr   r.   Frr   r   z#include "test.h"
#include <math.h>
double foo(double if_, double *while_) {
   (*while_) = sin(if_);
   double foo_result;
   foo_result = cos(if_);
   return foo_result;
}
Nr   r   s
             r(    test_output_arg_c_reserved_wordsr     s    .Cn%GA!UXaQ0#a&9:AAWWaS&eW<F!9Q<8###	  !9Q<8###r*   c                  Z   \        R ^^4      p \        R^^4      p\        V 4      p\        V4      pW#,          p\        RRR7      pVP                  RV4      pRVP                  R
,          n        RVP                  R
,          n        \        VP                  V.RR7      pRpWx8X  g   Q hR	# )r=   br.   T)projectcser   out)r#   z#include "test.h"
#include <math.h>
void c(double *A, double *b, double *out) {
   out[0] = A[0]*b[0] + A[1]*b[1] + A[2]*b[2];
   out[1] = A[3]*b[0] + A[4]*b[1] + A[5]*b[2];
   out[2] = A[6]*b[0] + A[7]*b[1] + A[8]*b[2];
}
N)	r   r   r   ra   rC   
result_var_namer)   rN   )	A_symb_symr=   r   r   cgenrI   r   rb   s	            r(   test_multidim_c_argument_cser    s    a#Ea#EuAuA	AF-DS!A!&AKKO!AKKOdkkA3v6D	  r*   c                  H   \        R 4      w  rp\        R4      w  r4\        R^^4      p\        V\        ^^V ..4      4      p\        W@V,           V,          4      p\        V^V ,          4      pRWgV.3p	Rp
\	        V	RRRRWW!WS3R7      pV^ ,          ^,          pW8X  g   Q hR# )	r]   B,Cr=   r.   z#include "test.h"
#include <math.h>
void test(double x, double *C, double z, double y, double *A, double *B) {
   (*C) = z*(x + y);
   A[0] = 1;
   A[1] = 2;
   A[2] = x;
   (*B) = 2*x;
}
r   Fr$   r%   r0   Nr   r   r   r   r   )r3   r9   r4   r>   rp   r=   r   r   expr3r   rb   rv   r'   s                r(    test_ccode_results_named_orderedr    s    gGA!5>DAS!QAQAq	{+,EQQ	"EQ!E%./I	  YVE()aA'9;FAYq\Fr*   c                  0   \        R ^^4      p \        R^^4      p\        R^^4      p\        R^^4      pR\        WR
,          4      \        W R,          4      \        W0R,          4      .3p\        VRRRRR7      pV^ ,          ^,          pRpWg8X  g   Q hR	# )r=   r>   rp   Dr.   r   Frr   a  #include "test.h"
#include <math.h>
void test(double *A, double *B, double *C, double *D) {
   B[0] = A[0];
   B[1] = A[1];
   B[2] = A[2];
   C[0] = A[3];
   C[1] = A[4];
   C[2] = A[5];
   D[0] = A[2];
   D[1] = A[5];
   D[2] = A[8];
   D[3] = A[11];
   D[4] = A[14];
}
Nr   NNN   r  r     r   r   r   r=   r>   rp   r  r   rv   r'   rb   s           r(   test_ccode_matrixsymbol_slicer  8  s    S!QAS!QAS!QAS!QA(1g."1g."1g.0 1I Yve5IFAYq\F	 " r*   c            
      :   \        R 4      w  rr#\        R^^4      pR\        V\        W,          .W,          W#,          ,           .W,          V,          V,          ..4      4      .3p\	        RR7      p\        WVRRR7      pV^ ,          ^,          pRp	W8X  g   Q hR# )	za b c der.   T)r   F)rP   r$   r%   z#include "test.h"
#include <math.h>
void test(double a, double b, double c, double d, double *e) {
   const double x0 = a*b;
   const double x1 = c*d;
   e[0] = x0;
   e[1] = x0 + x1;
   e[2] = x0*x1;
}
N)r   r   r   r   r   r   )
r8   r   r   dr  r   	generatorrv   r'   rb   s
             r(   test_ccode_cser  U  s    #JA!S!QA(1fqseacACi[13q57)-L&MNOPIT"IY5NFAYq\F	  r*   c                      \        R ^^4      p Rp\        4       p\        WRRV 3R7      pV^ ,          ^,          pRpWE8X  g   Q hR# )r3   F)rP   r$   r%   r0   z#include "test.h"
#include <math.h>
double test(double *x) {
   double test_result;
   test_result = 1.0;
   return test_result;
}
N)r.   g      ?)r   r   r   )r3   r   r  rv   r'   rb   s         r(   test_ccode_unused_array_argr  i  sU    S!QAI
IY5bcaefFAYq\F	  r*   c            	          \        R ^^4      p \        R^^4      p\        RRR7      pRV ^ ,          V ^,          ,           3p\        VRRRWV3R7      pV^ ,          ^,          pR	pWV8X  g   Q hR
# )XYr4   Tr@   testBugrp   F)languager$   r%   r0   z#include "testBug.h"
#include <math.h>
double testBug(double *X, double *Y, int z) {
   double testBug_result;
   testBug_result = X[0] + X[1];
   return testBug_result;
}
N)r   r   r   )r!  r"  r4   r   rv   r'   rb   s          r(    test_ccode_unused_array_arg_funcr%  |  s~    S1AS1Ad#AAaD1Q4K(IYU%\]bc[deFAYq\F	  r*   c                  X    \        4       p \        V P                  . 4      pVR 8X  g   Q hR#  Nr   r)   dump_f95rO   s     r(   test_empty_f_coder+    s'    zH))2.FR<<r*   c                      \        4       p \        V P                  . R R7      pVR,          R8X  g   Q hVR,          R8X  g   Q hR# )TrS   rT   zR!******************************************************************************
!*rV   a  *
!*                                                                            *
!*              See http://www.sympy.org/ for more information.               *
!*                                                                            *
!*                       This file is part of 'project'                       *
!******************************************************************************
Nr)  rO   s     r(   test_empty_f_code_with_headerr-    sU    zH))2d;F#;]   $< [`   r*   c                  X    \        4       p \        V P                  . 4      pVR 8X  g   Q hR# r'  )r   r)   rZ   rO   s     r(   test_empty_f_headerr/    s%    zH,FR<<r*   c                      \        R 4      w  rpW,           V,          p\        RV4      p\        4       p\        VP                  V.4      pRpWg8X  g   Q hR# )r]   r.   REAL*8 function test(x, y, z)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
REAL*8, intent(in) :: z
test = z*(x + y)
end function
Nr   r   r   r)   r*  r`   s           r(   test_simple_f_coder3    sZ    gGA!E19D64(GzH))G95F	  r*   c                      \        R \        \        ,          4      p \        4       p\	        VP
                  V .4      pR\        P                  ! ^4      : R\        P                  ! ^4      : R2pW#8X  g   Q hR# )r.   zDREAL*8 function test()
implicit none
REAL*8, parameter :: Catalan = zd0
REAL*8, parameter :: pi = z#d0
test = pi**Catalan
end function
N)r   r   r   r   r)   r*  rg   rh   s       r(   test_numbersymbol_f_coder5    sZ    62w;/GzH))G95F 
r	BHHRL*H r*   c                      \        R 4      p \        R\        V 4      \        RV ,          4      ,
          4      p\        4       p\	        VP
                  V.4      pRpW48X  g   Q V4       hR# )r3   r.   zhREAL*8 function test(x)
implicit none
REAL*8, intent(in) :: x
test = erf(x) + erf(2.0d0*x)
end function
N)r   r   r   r   r)   r*  )r3   ra   rP   r'   rb   s        r(   test_erf_f_coder8    s`    A63q6CQK#78GzH))G95F	  %v%r*   c                      \        R 4      w  rpW,           p\        RW2W.R7      p\        4       p\        VP                  V.4      pRpWg8X  g   Q hR# )r]   r.   r/   zREAL*8 function test(z, x, y)
implicit none
REAL*8, intent(in) :: z
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
test = x + y
end function
Nr2  r`   s           r(   test_f_code_argument_orderr:    sZ    gGA!5D64q9EGzH))G95F	  r*   c                      \        R 4      w  rpW,           V,          p\        RV4      p\        4       p\        VP                  V.4      pRpWg8X  g   Q hR# )r]   r.   interface
REAL*8 function test(x, y, z)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
REAL*8, intent(in) :: z
end function
end interface
N)r   r   r   r)   rZ   r`   s           r(   test_simple_f_headerr=    sX    gGA!E19D64(GzH'3F	  r*   c                  |    \        R 4      w  rpW,           V,          p\        RV3RRRRR7      pRR.pWE8X  g   Q hR# )	r]   r.   F95rq   Frr   N)file.f90r1  )rt   r<  ru   )r3   r9   r4   r2   rv   rb   s         r(   test_simple_f_codegenrA    sT    gGA!E19D	ve5BF		H& r*   c                     aa \        R 4      w  rpW,           V,          pW,
          V,          p\        RW4.4      o\        4       o\        \        VV3R l4       R# )r]   r.   c                  2   < \        S P                  S.4      # rz   r{   r|   s   r(   r5   )test_multiple_results_f.<locals>.<lambda>"  r~   r*   N)r   r   r   r   r   r   s        @@r(   test_multiple_results_frE    sM    gGA!UAIEUAIE	G zH
<GHr*   c                  (    \        \        R  4       R# )c                      \        R . 4      # r   r1   r   r*   r(   r5   #test_no_results_f.<locals>.<lambda>&  r   r*   Nr   r   r*   r(   test_no_results_frI  %  r   r*   c                  B   ^ RI Hp  ^ RIHp ^ RIHpHpHp ^ RIH	p ^ RI
HpHpHpHp	Hp
Hp \#        R4      pRV ! V4      3RV! V4      3R	V! V4      3R
V! V4      3RV	! V4      3RV! V4      3RV! V4      3RV! V4      3RV
! V4      3RV! V4      3RV! V4      3RV! V4      3RV! V4      3.p\%        VRRRRR7      pV^ ,          ^ ,          R8X  g   Q hRpV^ ,          ^,          V8X  g   Q hV^,          ^ ,          R8X  g   Q hRpV^,          ^,          V8X  g   Q hR# )r   r   r   r   r   r   r3   test_absr   r   r   r   r   r   r   r   r   r   r   r   r?  rq   Frr   r@  a   REAL*8 function test_abs(x)
implicit none
REAL*8, intent(in) :: x
test_abs = abs(x)
end function
REAL*8 function test_acos(x)
implicit none
REAL*8, intent(in) :: x
test_acos = acos(x)
end function
REAL*8 function test_asin(x)
implicit none
REAL*8, intent(in) :: x
test_asin = asin(x)
end function
REAL*8 function test_atan(x)
implicit none
REAL*8, intent(in) :: x
test_atan = atan(x)
end function
REAL*8 function test_cos(x)
implicit none
REAL*8, intent(in) :: x
test_cos = cos(x)
end function
REAL*8 function test_cosh(x)
implicit none
REAL*8, intent(in) :: x
test_cosh = cosh(x)
end function
REAL*8 function test_log(x)
implicit none
REAL*8, intent(in) :: x
test_log = log(x)
end function
REAL*8 function test_ln(x)
implicit none
REAL*8, intent(in) :: x
test_ln = log(x)
end function
REAL*8 function test_sin(x)
implicit none
REAL*8, intent(in) :: x
test_sin = sin(x)
end function
REAL*8 function test_sinh(x)
implicit none
REAL*8, intent(in) :: x
test_sinh = sinh(x)
end function
REAL*8 function test_sqrt(x)
implicit none
REAL*8, intent(in) :: x
test_sqrt = sqrt(x)
end function
REAL*8 function test_tan(x)
implicit none
REAL*8, intent(in) :: x
test_tan = tan(x)
end function
REAL*8 function test_tanh(x)
implicit none
REAL*8, intent(in) :: x
test_tanh = tanh(x)
end function
rt   aA  interface
REAL*8 function test_abs(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_acos(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_asin(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_atan(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_cos(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_cosh(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_log(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_ln(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_sin(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_sinh(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_sqrt(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_tan(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
interface
REAL*8 function test_tanh(x)
implicit none
REAL*8, intent(in) :: x
end function
end interface
N)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   r   r3   r   rv   rb   s                   r(   test_intrinsic_math_codegenrL  )  sK   8:HH=ZZA	SV	d1g	d1g	d1g	SV	d1g	SV	CF	SV	d1g	d1g	SV	d1gI Yve5IF!9Q<:%%%@	 F !9Q<8###!9Q<8###M	 ` !9Q<8###r*   c                  4   ^ RI Hp  \        R4      w  rRV ! W4      3RW,          3.p\        VRRRRR7      pV^ ,          ^ ,          R	8X  g   Q hR
pV^ ,          ^,          V8X  g   Q hV^,          ^ ,          R8X  g   Q hRpV^,          ^,          V8X  g   Q hR# )r   r   r   r   r   r?  rq   Frr   r@  zREAL*8 function test_atan2(x, y)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
test_atan2 = atan2(x, y)
end function
REAL*8 function test_pow(x, y)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
test_pow = x**y
end function
rt   a  interface
REAL*8 function test_atan2(x, y)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
end function
end interface
interface
REAL*8 function test_pow(x, y)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
end function
end interface
Nr   )r   r3   r9   r   rv   rb   s         r(   test_intrinsic_math2_codegenrN    s    >5>DA	uQ{#	QTI Yve5IF!9Q<:%%%	  !9Q<8###!9Q<8###	   !9Q<8###r*   c                  
   ^ RI Hp HpHp \	        R4      w  r4pRV! V4      V ! V4      ,           V! V4      ,           ^,          P                  4       3RV ! V ! V ! V ! V ! V ! V ! V ! W4,           V,           4      4      4      4      4      4      4      4      3.p\        VRRRRR7      pV^ ,          ^ ,          R	8X  g   Q hR
pV^ ,          ^,          V8X  g   Q hV^,          ^ ,          R8X  g   Q hRpV^,          ^,          V8X  g   Q hR# )r   r   r]   r   r   r?  rq   Frr   r@  a{  REAL*8 function test1(x, y, z)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
REAL*8, intent(in) :: z
test1 = sin(x)**7 + 7*sin(x)**6*cos(y) + 7*sin(x)**6*tan(z) + 21*sin(x) &
      **5*cos(y)**2 + 42*sin(x)**5*cos(y)*tan(z) + 21*sin(x)**5*tan(z) &
      **2 + 35*sin(x)**4*cos(y)**3 + 105*sin(x)**4*cos(y)**2*tan(z) + &
      105*sin(x)**4*cos(y)*tan(z)**2 + 35*sin(x)**4*tan(z)**3 + 35*sin( &
      x)**3*cos(y)**4 + 140*sin(x)**3*cos(y)**3*tan(z) + 210*sin(x)**3* &
      cos(y)**2*tan(z)**2 + 140*sin(x)**3*cos(y)*tan(z)**3 + 35*sin(x) &
      **3*tan(z)**4 + 21*sin(x)**2*cos(y)**5 + 105*sin(x)**2*cos(y)**4* &
      tan(z) + 210*sin(x)**2*cos(y)**3*tan(z)**2 + 210*sin(x)**2*cos(y) &
      **2*tan(z)**3 + 105*sin(x)**2*cos(y)*tan(z)**4 + 21*sin(x)**2*tan &
      (z)**5 + 7*sin(x)*cos(y)**6 + 42*sin(x)*cos(y)**5*tan(z) + 105* &
      sin(x)*cos(y)**4*tan(z)**2 + 140*sin(x)*cos(y)**3*tan(z)**3 + 105 &
      *sin(x)*cos(y)**2*tan(z)**4 + 42*sin(x)*cos(y)*tan(z)**5 + 7*sin( &
      x)*tan(z)**6 + cos(y)**7 + 7*cos(y)**6*tan(z) + 21*cos(y)**5*tan( &
      z)**2 + 35*cos(y)**4*tan(z)**3 + 35*cos(y)**3*tan(z)**4 + 21*cos( &
      y)**2*tan(z)**5 + 7*cos(y)*tan(z)**6 + tan(z)**7
end function
REAL*8 function test2(x, y, z)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
REAL*8, intent(in) :: z
test2 = cos(cos(cos(cos(cos(cos(cos(cos(x + y + z))))))))
end function
rt   a4  interface
REAL*8 function test1(x, y, z)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
REAL*8, intent(in) :: z
end function
end interface
interface
REAL*8 function test2(x, y, z)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
REAL*8, intent(in) :: z
end function
end interface
Nr   )	r   r   r   r3   r9   r4   r   rv   rb   s	            r(   test_complicated_codegen_f95rP  	  s   HHgGA!	CFSVOc!f,q088:;	#c#c#c#c!%!)n*=&>"?@ABCDI Yve5IF!9Q<:%%%	 < !9Q<8###!9Q<8###	 $ !9Q<8###r*   c            	      r   ^ RI Hp Hp ^ RIHp V! RRR7      w  r4\        V R4      w  rVpV! RV4      pV! RV4      p	\        R	\        Wx,          WXV	3,          Wi,          ,          4      3R
RRRR7      w  w  rw  rV
R8X  g   Q hRpWRR/,          8X  g   WRR/,          8X  g   Q hVR8X  g   Q hVR8X  g   Q hR# )r   r:   r   zn,mTr@   AxyrB   r   r   r?  rq   Frr   r@  a~  subroutine matrix_vector(A, m, n, x, y)
implicit none
INTEGER*4, intent(in) :: m
INTEGER*4, intent(in) :: n
REAL*8, intent(in), dimension(1:m, 1:n) :: A
REAL*8, intent(in), dimension(1:n) :: x
REAL*8, intent(out), dimension(1:m) :: y
INTEGER*4 :: i
INTEGER*4 :: j
do i = 1, m
   y(i) = 0
end do
do i = 1, m
   do j = 1, n
      y(i) = %(rhs)s + y(i)
   end do
end do
end subroutine
r   A(i, j)*x(j)x(j)*A(i, j)rt   a  interface
subroutine matrix_vector(A, m, n, x, y)
implicit none
INTEGER*4, intent(in) :: m
INTEGER*4, intent(in) :: n
REAL*8, intent(in), dimension(1:m, 1:n) :: A
REAL*8, intent(in), dimension(1:n) :: x
REAL*8, intent(out), dimension(1:m) :: y
end subroutine
end interface
N)rF   r;   r<   r   r   rG   r   r   r   s                  r(   
test_loopsrU  G  s    -)5$'DA+u%GA!CACA")	"QT1T714<015&V[#]JR 	 * un555E>2223 3>>		  r*   c                  Z   ^ RI Hp Hp \        RR\        R7      w  r#V ! R4      pV ! R4      pV! W#4      pRRVP
                  P                  R	VP                  /,          p\        R
\        WR,          WB,          4      4      p\        4       p\        VP                  V.4      p	W8X  g   Q hR# )r   r:   r   Tr   r3   r9   a>  subroutine test_dummies(m_%(mcount)i, x, y)
implicit none
INTEGER*4, intent(in) :: m_%(mcount)i
REAL*8, intent(in), dimension(1:m_%(mcount)i) :: x
REAL*8, intent(out), dimension(1:m_%(mcount)i) :: y
INTEGER*4 :: i_%(icount)i
do i_%(icount)i = 1, m_%(mcount)i
   y(i_%(icount)i) = x(i_%(icount)i)
end do
end subroutine
icountmcountr   N)rF   r;   r<   r   r	   rH   r   r   r   r   r)   r*  )
r;   r<   rB   r?   r3   r9   rb   rI   r   r   s
             r(   test_dummy_loops_f95rY  z  s    -5$E2DACACAA	A		 
177&&!--@AH 	^Rad^4A
Aajj1#&Dr*   c            	         ^ RI Hp Hp ^ RIHp V! RRR7      w  r4rVV! R4      w  rxp	V ! V4      V! W64      V! WE4      3,          pV ! V4      V! WE4      ,          pV ! V	4      V! W64      ,          p	\        R\        WWx,          ,           4      3RR	R
R
R7      w  w  rw  rV
R8X  g   Q hRpWRR/,          8X  g   WRR/,          8X  g   Q hVR8X  g   Q hVR8X  g   Q hR# )r   r:   r   zi,j,n,mTr@   zA,x,yr   r?  rq   Frr   r@  aa  subroutine matrix_vector(A, m, n, x, y)
implicit none
INTEGER*4, intent(in) :: m
INTEGER*4, intent(in) :: n
REAL*8, intent(in), dimension(1:m, 1:n) :: A
REAL*8, intent(in), dimension(1:n) :: x
REAL*8, intent(inout), dimension(1:m) :: y
INTEGER*4 :: i
INTEGER*4 :: j
do i = 1, m
   do j = 1, n
      y(i) = %(rhs)s + y(i)
   end do
end do
end subroutine
r   rS  rT  rt   a  interface
subroutine matrix_vector(A, m, n, x, y)
implicit none
INTEGER*4, intent(in) :: m
INTEGER*4, intent(in) :: n
REAL*8, intent(in), dimension(1:m, 1:n) :: A
REAL*8, intent(in), dimension(1:n) :: x
REAL*8, intent(inout), dimension(1:m) :: y
end subroutine
end interface
Nr   )r;   r<   r   rB   r   r   r?   r=   r3   r9   r   r   r   r   rb   s                  r(   test_loops_InOutr[    s    -)D1JA!gGA!As1y#a)+,AAs1y!AAs1y!A")	"QAC.)5&e#UJR 	 $ ~666~6668 7>>		  r*   c                     ^ RI Hp Hp ^ RIHp V! RRR7      w  r4rVV ! RWF3R7      pV ! R4      pV ! R	4      p	V! R
WT^,
          34      p
V! RV4      p\        R\        W,          WzV3,          W,          ,          4      3RRRRR7      w  w  rw  rRRRR\        V^,
          4      R\        ^V,           4      R\        V^,
          V,
          4      /,          pVVRR/,          8X  g   VVRR/,          8X  g   Q hR# R# )r   r:   r   r   Tr@   r=   r   r3   r9   rB   r   r   r?  rq   Frr   a  subroutine matrix_vector(A, m, n, o, p, x, y)
implicit none
INTEGER*4, intent(in) :: m
INTEGER*4, intent(in) :: n
INTEGER*4, intent(in) :: o
INTEGER*4, intent(in) :: p
REAL*8, intent(in), dimension(1:m, 1:p) :: A
REAL*8, intent(in), dimension(1:n) :: x
REAL*8, intent(out), dimension(1:%(iup-ilow)s) :: y
INTEGER*4 :: i
INTEGER*4 :: j
do i = %(ilow)s, %(iup)s
   y(i) = 0
end do
do i = %(ilow)s, %(iup)s
   do j = 1, n
      y(i) = %(rhs)s + y(i)
   end do
end do
end subroutine
r   r   iupilowziup-ilowrS  rT  N)rF   r;   r<   r   r   r   r   strr   s                    r(   test_partial_loops_fr`    s    .)D1JA!Cv&ACACAC!UACA")	"QT1T714<015&V[#]JR	* 	ys1q5zAE
CA	N		+H8 8un555E>2223 32 6r*   c            	         ^ RI Hp  ^ RIHpHp \        R4      w  r4p\        RV ! WB! V4      4      V! V4      .4      p\        4       pVP                  V.RRRR7      pV^ ,          ^ ,          R8X  g   Q hV^ ,          ^,          R	8X  g   Q hR
# )r   r
   r   r]   r   r.   Frr   ztest.f90z~REAL*8 function foo(x, y)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(out) :: y
y = sin(x)
foo = cos(x)
end function
N)	r   r   r   r   r   r   r   r   r   )	r   r   r   r3   r9   r4   rI   r   rv   s	            r(   test_output_arg_frb    s    .CgGA!UXaQ0#a&9:A
AWWaS&eW<F!9Q<:%%%!9Q<	  r*   c            
         ^ RI Hp Hp ^ RIHp V! RRR7      w  r4\        V R4      w  rVpV! RV4      p\        4       p	\        R\        W3V^,           ,          4      4      p
\        R	\        Wx,          V
! Wh,          4      4      4      p\        V	P                  V.4      pR
pRpWV,          8X  g   WVRRR1,          ,          8X  g   Q hR# R# )r   r:   r   r   Tr@   rR  rB   functest_inlinezsubroutine test_inline(m, x, y)
implicit none
INTEGER*4, intent(in) :: m
REAL*8, intent(in), dimension(1:m) :: x
REAL*8, intent(out), dimension(1:m) :: y
INTEGER*4 :: i
do i = 1, m
   y(i) = %s*%s
end do
end subroutine
N)zx(i)z
(x(i) + 1)r  )rF   r;   r<   r   r   rG   r   r   r   r   r   r)   r*  )r;   r<   r   r   r?   r=   r3   r9   rB   r   rd  ra   r   rb   argss                  r(   test_inline_functionrg    s    -)5$'DA+u%GA!CA
AqQU)(<=D="QT4:*>?Gajj7),D		  "Dd?"4":%%& &% #r*   c                      \        R 4      p ^ pV  F  pW,          pK  	  \        RV4      p\        4       p\        VP                  V.4      pRpWV8X  g   Q hR# )zx:20r.   a  REAL*8 function test(x0, x1, x10, x11, x12, x13, x14, x15, x16, x17, x18, &
      x19, x2, x3, x4, x5, x6, x7, x8, x9)
implicit none
REAL*8, intent(in) :: x0
REAL*8, intent(in) :: x1
REAL*8, intent(in) :: x10
REAL*8, intent(in) :: x11
REAL*8, intent(in) :: x12
REAL*8, intent(in) :: x13
REAL*8, intent(in) :: x14
REAL*8, intent(in) :: x15
REAL*8, intent(in) :: x16
REAL*8, intent(in) :: x17
REAL*8, intent(in) :: x18
REAL*8, intent(in) :: x19
REAL*8, intent(in) :: x2
REAL*8, intent(in) :: x3
REAL*8, intent(in) :: x4
REAL*8, intent(in) :: x5
REAL*8, intent(in) :: x6
REAL*8, intent(in) :: x7
REAL*8, intent(in) :: x8
REAL*8, intent(in) :: x9
test = x0 + x1 + x10 + x11 + x12 + x13 + x14 + x15 + x16 + x17 + x18 + &
      x19 + x2 + x3 + x4 + x5 + x6 + x7 + x8 + x9
end function
Nr2  )r3   r2   symra   rP   r'   rb   s          r(   test_f_code_call_signature_wraprj     s]    AD 64(GzH))G95FH8 r*   c                  P   a a \        R 4      w  oo \        \        V V3R l4       R# )zx,Xc                  0   < \        R SS ,          3RR4      # )r.   f95r#   )r   r!  r3   s   r(   r5   !test_check_case.<locals>.<lambda>J  s    &!A#x!Hr*   N)r   r   r   rn  s   @@r(   test_check_caserp  H  s    5>DAq
<HIr*   c                      \        R 4      p \        R RR7      p \        RW,          3RR4       R#   \         d?   pTP                  ^ ,          P	                  R4      '       d   \        R4      h Rp?R# Rp?ii ; i)	r3   T)my_assumptionr.   rm  r#   zFortran ignores case.z$This exception should not be raised!N)r   r   r   rf  
startswithAssertionError)x1x2r  s      r(   test_check_case_false_positiverw  M  sn    
 
B	D	)BI1 I66!9 788 !GHH 9Is   1 A:3A55A:c                      \        R 4      w  rR^V ,          3.p\        VRRRR7      p\        VRRRRR7      pV^ ,          ^,          V^ ,          ^,          8X  g   Q hRW,          3p\        VRRRR7      p\        VRRRRR7      pV^ ,          ^,          V^ ,          ^,          8X  g   Q hR\        W.W,           W,
          ..4      3p\        VRRRR7      p\        VRRRRR7      pV^ ,          ^,          V^ ,          ^,          8X  g   Q hR# )r   r   r?  Frr   r   N)r   r   r   )r3   r9   r   rv   	expresults        r(    test_c_fortran_omit_routine_namerz  [  s   5>DA1IYe5AF	5%UKI!9Q<9Q<?***IYe5AF	5%UKI!9Q<9Q<?***ac
345IYe5AF	5%UKI!9Q<9Q<?***r*   c                  (   \        R 4      w  rpW,           p\        W.V^..4      pRW433p\        VRRRRR7      pV^ ,          ^,          pRpVP                  4       ^,          p	V	P	                  R4      p
V
^,          pVRV/,          pWx8X  g   Q hR# )	r]   r.   rm  Frr   a2  REAL*8 function test(x, y, z, out_%(hash)s)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
REAL*8, intent(in) :: z
REAL*8, intent(out), dimension(1:2, 1:2) :: out_%(hash)s
out_%(hash)s(1, 1) = x
out_%(hash)s(2, 1) = z
out_%(hash)s(1, 2) = y
out_%(hash)s(2, 2) = 16
test = x + y
end function
_hashN)r   r   r   
splitlinessplit)r3   r9   r4   e1e2r   rv   r'   rb   r8   r   r   s               r(   test_fcode_matrix_outputr  m  s    gGA!	
B	!!R!	"B""IYve5IFAYq\F	  	AA	A
A$C63-'Hr*   c                  H   \        R 4      w  rp\        R4      w  r4\        R^^4      p\        V\        ^^V ..4      4      p\        W@V,           V,          4      p\        V^V ,          4      pRWgV.3p	\	        V	RRRRWWWS3R7      p
V
^ ,          ^,          pRpW8X  g   Q hR# )	r]   r	  r=   r.   rm  Fr
  a!  subroutine test(x, z, y, C, A, B)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: z
REAL*8, intent(in) :: y
REAL*8, intent(out) :: C
REAL*8, intent(out) :: B
REAL*8, intent(out), dimension(1:1, 1:3) :: A
C = z*(x + y)
A(1, 1) = 1
A(1, 2) = 2
A(1, 3) = x
B = 2*x
end subroutine
Nr  )r3   r9   r4   r>   rp   r=   r   r   r  r   rv   r'   rb   s                r(    test_fcode_results_named_orderedr    s    gGA!5>DAS!QAQAq	{+,EQQ	"EQ!E%./IYve5()aA'9;FAYq\F	   r*   c                  0   \        R ^^4      p \        R^^4      p\        R^^4      p\        R^^4      pR\        WR
,          4      \        W R,          4      \        W0R,          4      .3p\        VRRRRR7      pV^ ,          ^,          pRpWg8X  g   Q hR	# )r=   r>   rp   r  r.   rm  Frr   a  subroutine test(A, B, C, D)
implicit none
REAL*8, intent(in), dimension(1:2, 1:3) :: A
REAL*8, intent(out), dimension(1:1, 1:3) :: B
REAL*8, intent(out), dimension(1:1, 1:3) :: C
REAL*8, intent(out), dimension(1:2, 1:1) :: D
B(1, 1) = A(1, 1)
B(1, 2) = A(1, 2)
B(1, 3) = A(1, 3)
C(1, 1) = A(2, 1)
C(1, 2) = A(2, 2)
C(1, 3) = A(2, 3)
D(1, 1) = A(1, 3)
D(2, 1) = A(2, 3)
end subroutine
Nr  r  r  r  r  s           r(   test_fcode_matrixsymbol_slicer    s    S!QAS!QAS!QAS!QA(1g."1g."1g.0 1I Yve5IFAYq\F	 " r*   c                     \        R ^^4      p RV R	,          3p\        VRRRRR7      pV^ ,          ^,          pRpVP                  4       ^,          pVP                  R4      pV^,          pVRV/,          pW48X  g   Q hR# )
r=   r.   rm  Frr   zsubroutine test(A, out_%(hash)s)
implicit none
REAL*8, intent(in), dimension(1:2, 1:3) :: A
REAL*8, intent(out), dimension(1:2, 1:1) :: out_%(hash)s
out_%(hash)s(1, 1) = A(1, 2)
out_%(hash)s(2, 1) = A(2, 2)
end subroutine
r|  r}  N)r  r  )r   r   r~  r  )r=   r   rv   r'   rb   r8   r   r   s           r(   &test_fcode_matrixsymbol_slice_autonamer    s    S!QA4!IYve5IFAYq\F	  	AA	A
A$C63-'Hr*   c                      \        R 4      w  rr#\        RW,          3RRRV3R7      pV^ ,          ^,          pRpWV8X  g   Q hRp\        RW,          V,           3RRRW#3R7      pV^ ,          ^,          pWV8X  g   Q hR# )	zx y z tfr?  F)r$   r%   global_varszPREAL*8 function f(x)
implicit none
REAL*8, intent(in) :: x
f = x*y
end function
z#include "f.h"
#include <math.h>
double f(double x, double y) {
   double f_result;
   f_result = x*y + z;
   return f_result;
}
rp   Nru   )r3   r9   r4   trv   r'   rb   s          r(   test_global_varsr    s    #JA!c13ZuE"#'FAYq\F	  	  c13q5\3uE"#)FAYq\Fr*   c                     ^ RI Hp  ^ RIHp V ! RRR//R7      p\	        R4      w  r4V! W4,           4      p\        VR.R	7      pR
p\        RV3RRVR7      pV^ ,          ^,          p	W8X  g   Q h\        VR7      pVP                  P                  R4       Rp\        RV3RRVR7      pV^ ,          ^,          p	W8X  g   Q hR# )r   C99CodePrinter)expuser_functionsr  fastexp)settingszx yz#include "fastexp.h")printerpreprocessor_statementsz#include "expr.h"
#include "fastexp.h"
double expr(double x, double y) {
   double expr_result;
   expr_result = fastexp(x + y);
   return expr_result;
}
r2   F)r$   r%   rP   )r  z#include "expr.h"
#include <math.h>
#include "fastexp.h"
double expr(double x, double y) {
   double expr_result;
   expr_result = fastexp(x + y);
   return expr_result;
}
N)	sympy.printing.cr  r   r  r   r   r   r  append)
r  r  r  r3   r9   r2   genrb   rv   r'   s
             r(   test_custom_codegenr    s    /:'7%9K&LMG5>DAqu:D W.D-EGC	  fd^EMFAYq\F W
%C&&'=>	  fd^EMFAYq\Fr*   c            	          ^ RI Hp   ! R RV 4      p\        R4      pV^,          pRR.p\        RV3RRRRV! 4       R	7      pWT8X  g   Q hR
# )r   r  c                   &   a  ] tR tRt o R tRtV tR# )*test_c_with_printer.<locals>.CustomPrinteri*  c                    R P                  V P                  VP                  4      V P                  VP                  4      4      # )zfastpow({}, {}))format_printbaser  )selfr2   s   &&r(   
_print_Pow5test_c_with_printer.<locals>.CustomPrinter._print_Pow+  s6    $++DKK		,B,0KK,AC Cr*   r   N)__name__
__module____qualname____firstlineno__r  __static_attributes____classdictcell__)__classdict__s   @r(   CustomPrinterr  *  s     	C 	Cr*   r  r3   r.   rp   rq   F)r$   r%   r  N)rs   z#include "file.h"
#include <math.h>
double test(double x) {
   double test_result;
   test_result = fastpow(x, 3);
   return test_result;
}
)rt   zP#ifndef PROJECT__FILE__H
#define PROJECT__FILE__H
double test(double x);
#endif
)r  r  r   r   )r  r  r3   r2   rb   rv   s         r(   test_c_with_printerr  '  sb    /C C
 	Aa4D		H fd^SUVcVefFr*   c                     ^ RI p RV P                  P                  n        \	        RRR7      p\	        RRR7      p\        RW,           3RRRRR	7      pV^ ,          ^,          pR
pWE8X  g   Q h\	        R4      p\	        RRR7      p\        RW,           3RRRRR	7      pV^ ,          ^,          pRpWE8X  g   Q hRV P                  P                  n        R# )r   NTr3   )realr9   r.   rm  Frr   zsREAL*8 function test(x, y)
implicit none
REAL*8, intent(in) :: x
REAL*8, intent(in) :: y
test = x + y
end function
z{COMPLEX*16 function test(x, y)
implicit none
COMPLEX*16, intent(in) :: x
REAL*8, intent(in) :: y
test = x + y
end function
)sympy.utilities.codegen	utilitiesr   COMPLEX_ALLOWEDr   )sympyr3   r9   rv   r'   rb   s         r(   test_fcode_complexr  D  s    ".2EOO+sAsAfQS\5&eLFQilF	  sAsAfQS\5&eLFQilF	  .3EOO+r*   N)rq   FF)_ior   
sympy.corer   r   r   r   r   r	   r   r   r   r   'sympy.functions.special.error_functionsr   sympy.integrals.integralsr   sympy.matricesr   r   r  r   r   r   r   r   r   r   r   r   r   r   sympy.testing.pytestr   sympy.utilities.lambdifyr   r)   rK   rQ   rX   r[   rc   re   ri   rk   rn   rw   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r%  r+  r-  r/  r3  r5  r8  r:  r=  rA  rE  rI  rL  rN  rP  rU  rY  r[  r`  rb  rg  rj  rp  rw  rz  r  r  r  r  r  r  r  r  r   r*   r(   <module>r     st    > > * $ 7 . /    ( 9?6@$T$$"$,	I99x0AH'T$.)X$*$*.4:(&& $&$&6	I9o$d+$\;$|0f0.b,3^&&6%PJ
I+$:<<.8,\:4r*   