K iodZddlmZddlmZddlmZddlmZddl Z ddl m Z m Z m Z mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZmZddl m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+dd l,m-Z-m.Z.m/Z/m0Z0m1Z1dd l2m3Z3dd l4m5Z5dd l6m7Z7dd l8m9Z9ddl:m;Z;ddlZ>ddl?m@Z@ddl:mAZAmBZBidddddddddddddddddddddddddddd d!d"d#d$d%d&ZCGd'd(e;ZDy))ar Fortran code printer The FCodePrinter converts single SymPy expressions into single Fortran expressions, using the functions defined in the Fortran 77 standard where possible. Some useful pointers to Fortran can be found on wikipedia: https://en.wikipedia.org/wiki/Fortran Most of the code below is based on the "Professional Programmer's Guide to Fortran77" by Clive G. Page: https://www.star.le.ac.uk/~cgp/prof77.html Fortran is a case-insensitive language. This might cause trouble because SymPy is case sensitive. So, fcode adds underscores to variable names when it is necessary to make them different for Fortran. ) annotations)Any) defaultdict)chainN) Assignment DeclarationPointer value_constfloat32float64float80 complex64 complex128int8int16int32int64intcrealintegerbool_complex_nonestderrstdout) allocatableisigndsigncmplxmerge literal_dp elementalpure intent_in intent_out intent_inout)SAddNFloatSymbol)Function) equal_valued)Eq)Range) CodePrinter) precedence PRECEDENCE)printer_context)fcode print_fcodesincostanasinacosatanatan2sinhcoshtanhlogexperfAbsabs conjugateconjgMaxmaxMinminc@eZdZUdZdZdZeeee e e iZ e dede dedede d ed ed ed ed edi Ze ddiiZeej2fididddddZded<ddddddZddiZd\fd Zed!Zfd"Z d#Z!d$Z"d%Z#d&Z$d'Z%d(Z&d)Z'd*Z(d+Z)d,Z*d-Z+d.Z,d/Z-d0Z.d1Z/d2Z0d3Z1d4Z2d5Z3d6Z4d7Z5d8Z6d9Z7d:Z8d;Z9d<Z:d=Z;d>ZdAZ?dBZ@dCZAdDZBdEZCdFZDdGZEdHZFdIZGdJZHdKZIdLZJdMZKdNZLdOZMdPZNdQZOdRZPdSZQdTZRdUZSdVZTdWZUdXZVdYZWdZZXd[ZYxZZS)] FCodePrinterzAA printer to convert SymPy expressions to strings of Fortran code_fcodeFortranzinteger(c_int)zreal*4zreal*8zreal*10z complex*8z complex*16z integer*1z integer*2z integer*4z integer*8logical iso_c_bindingc_intfixedTM) precisionuser_functions source_formatcontractstandard name_manglingzdict[str, Any]_default_settingsz.and.z.or.z.neqv.z.eqv.z.not. )andorxor equivalentnotz!=z/=c |si}i|_g|_tt|jj |j dij |_tt|jj |j dij |_t|%|tt|_ |jdi}|jj|hd}|jd|vrtd|jdztt |_y)N type_aliases type_mappingsrV>BrTZ_rYzUnknown Fortran standard: %s)mangled_symbols used_namedictrrbitemspoprcsuper__init__known_functionsgetupdate _settings ValueErrorrset module_uses)selfsettings userfuncs standards __class__s \/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/sympy/printing/fortran.pyrozFCodePrinter.__init__xsH! t'8'8'>'>'@'/||NB'G'M'M'O"QR!%(:(:(@(@(B(0 _b(I(O(O(Q#ST "#O4LL!126  ##I.0 >>* %Y 6;dnn'?))* *&s+c|jddk(rddddS|jddk(rddd dStd |jdz) NrWrSz z @ zC )codecontcommentfreez! zUnknown source format: %s)rsrt)rws r|_leadzFCodePrinter._leadsX >>/ *g 5$iHM M ^^O , 6TB B84>>/;ZZ[ [r}c|jddk(r||jvr|j}|j|jvr"|dz }|j|jvr"|jj |j||jk(r||j|<nt ||j|<|j|j}t|%|}|S)NrZT_) rsrinamelowerrjappendr+xreplacern _print_Symbol)rwexprrr{s r|rzFCodePrinter._print_Symbols >>/ *d 24///yyjjldnn4CKDjjldnn4%%djjl3499$15D((.17D((.==!5!56Dw$T* r}c| dzS)N)rwps r|_rate_index_positionz!FCodePrinter._rate_index_positions r!t r}c|SNr)rw codestrings r|_get_statementzFCodePrinter._get_statementsr}c$dj|S)Nz! {})format)rwtexts r| _get_commentzFCodePrinter._get_comments}}T""r}cDdj||j|S)Nzparameter ({} = {}))r_print)rwrvalues r|_declare_number_constz"FCodePrinter._declare_number_consts$++D$++e2DEEr}c |jj|t|j|jdft |SNrU)_number_symbolsaddr*evalfrsstrrwrs r|_print_NumberSymbolz FCodePrinter._print_NumberSymbols>   $djj 9T.U(V!WX4yr}cB|j|j|Sr) _wrap_fortran indent_code)rwliness r| _format_codezFCodePrinter._format_codes!!$"2"25"9::r}cJ|j\}fdt|DS)Nc3FK|]}tD]}||f ywr)range).0jirowss r| z8FCodePrinter._traverse_matrix_indices..s%A1U4[AAAAs!)shaper)rwmatcolsrs @r|_traverse_matrix_indicesz%FCodePrinter._traverse_matrix_indicessYY dAd AAr}c g}g}|D]n}t|j|j|jdz|jdzg\}}}|j d|d|d||j dp||fS)Ndo z = , end do)maprlabelrupperr)rwindices open_lines close_linesrvarstartstops r|_get_loop_opening_endingz%FCodePrinter._get_loop_opening_endings   )A"4;;WWaggk177Q;7 9 C   #udC D   x (  ) ;&&r}c ddlm}|j\}|jr"t dt d|t |d}n|js |jrLt ttdtd|||z t ||td}n>Qa r#qz:HnnU:a=*Q-@#c#h,PRSVWZS[]ghi]jPklHZ]E*Q-,Er#zZ[}G]^H{{8$$r}c|jdjdk7r tdg}|jtrt |jD]\}\}}|dk(r$|j d|j|znU|t|jdz k(r|dk(r|j dn#|j d|j|z|j |j||j d d j|S|jd d k\rd }|j|jdj}t|jdd}|rL|j\}}|j|}|j|} |j||| }|rL|Std)NTzAll Piecewise expressions must contain an (expr, True) statement to be used as a default condition. Without one, the generated expression may not evaluate to anything under some condition.rz if (%s) thenrelsezelse if (%s) thenend if rYrgzmerge({T}, {F}, {COND}))TFCONDzmUsing Piecewise as an expression using inline operators is not supported in standards earlier than Fortran95.)rcondrthasr enumeraterrlenjoinrsrlistrmrNotImplementedError) rwrrrecpatternrtermsrs r|_print_PiecewisezFCodePrinter._print_Piecewises 99R=   %/0 0  88J &tyy1 - 6Aq6LL$++a.!@A#dii.1,,dLL(LL!4t{{1~!EF T[[^, - LL "99U# # ^^J '2 - 0G;;tyy}112D3B(Eyy{1{{1~{{1~~~4~@  K&'JK Kr}cdj|j|jtdd|jdz|j dzS)Nz {}({}, {})AtomT)strictr)r parenthesizeparentr2rrrs r|_print_MatrixElementz!FCodePrinter._print_MatrixElementsN""4#4#4T[[6"4$5$126&&1*dffqjJ Jr}c g}g}g}|jD]g}|jr|jr|j|-|jr|jr|j|W|j|i|r|rt |}t |}|j|}|jdrd} |dd}nd} t ||krd|z}d|jt |d|jtj t |zd| d|Sd|jt |d|jtj t |zd Stj||S) N-r+z(%s)zcmplx(,z)  )) r is_numberis_realr is_imaginaryr1r(r startswithr' ImaginaryUnitr0 _print_Add) rwr pure_realpure_imaginarymixedrPRECtermtsigns r|rzFCodePrinter._print_Adds\ 99 "C}}  %3#3#3%%c* S!  " !$'E{KK%<<$D!"ADd#d* AKKY0KK 0n1E EF!&KKY0KK 0n1E EF ))$5 5r}c|jd}|jDcgc]}t||}}|j|}t |t s|j |Stj||j|Scc}wr) rsrr)func isinstancer,rr0_print_Function)rwrprecar eval_exprs r|rzFCodePrinter._print_Function+sy{+$(II.q!T ..DIIt$ )X.;;y) )..tYTYY5EF F /sBc|jddvr d}t||j\}}dj|j ||j |S)NrY)rerTz]Python % operator and SymPy's Mod() function are not supported by Fortran 66 or 77 standards.z modulo({}, {}))rsrrrr)rwrmsgxys r| _print_ModzFCodePrinter._print_Mod5sW >>* % 1>C%c* *99DAq)00QQP Pr}cy)Nz cmplx(0,1)rrs r|_print_ImaginaryUnitz!FCodePrinter._print_ImaginaryUnitBsr}ct|Srrrs r| _print_intzFCodePrinter._print_intFs 4yr}c|jr2|jr&d|jtj |zzSt j ||S)Nz cmplx(0,%s))rrrr'rr0 _print_Mulrs r|rzFCodePrinter._print_MulIsK >>d//  Q__,T12 ))$5 5r}ct|}t|jdr9|jt dd|j |j |St|jdr|j jrR|j jrd|j|j zSd|j|j zSd|j|j zStj||S)Nrr/g?z sqrt(%s.0d0)zsqrt(dble(%s))zsqrt(%s)) r1r-rArr!rbaser is_Numberr0 _print_Pow)rwrrs r|rzFCodePrinter._print_PowRs$ " % JqM*!!$))T2 $((C (yy##99&&)DKK ,BBB+dkk$)).DDD!DKK $:::))$5 5r}cdt|jt|j}}d||fzS)Nz %d.0d0/%d.0d0)intrq)rwrrrs r|_print_RationalzFCodePrinter._print_Rationales*466{CK1!Q''r}ctj||}|jd}|dkDr|d|d||dzdSd|zS)Nrrdrz%sd0)r0 _print_Floatfind)rwrprintedrs r|rzFCodePrinter._print_FloatisO**46 LL  r6%bqk71q56?; ;r}c|j|j}|j|j}|j}||jvr|n|j|}dj |||S)Nz{} {} {})rlhsrhsrel_op _relationalsr)rwrlhs_coderhs_codeops r|_print_RelationalzFCodePrinter._print_Relationalpsc;;txx(;;txx( [[T...RD4E4Eb4I  2x88r}c|jDcgc]}|j|}}|j|jjddj |dScc}w)N(rr)rrrrr)rwrrindss r|_print_IndexedzFCodePrinter._print_IndexedwsJ)-7AQ77;;tyy74II8sA#c  |j|j}|j|j}|jdj |j||j|j |j|S)Nz{0} = {0} {1} {2})rrrrrbinop)rwrr"r#s r|_print_AugmentedAssignmentz'FCodePrinter._print_AugmentedAssignment{sp;;txx(;;txx(""#6#=#= KK !4;;tzz#:DKK dT[[00 0F 77d? i$++bgg"66 6F<<0077z(FCodePrinter._print_Do..s$++c*:r})applyexcluder)r;rrr:kwargs)rwdoexclr;s` r| _print_DozFCodePrinter._print_Dos}~ 77a< KK DD 8 =?  &  )+ }2  ii:DiI   r}c|jdk(rdnd}d|zdzjdi|jfdS) Nrrr<z$({expr}, {counter} = {first}, {last}rc&j|Srr>r?s r|r@z3FCodePrinter._print_ImpliedDoLoop..s4;;s+;r}rAr)r;rrC)rwidlr;s` r|_print_ImpliedDoLoopz!FCodePrinter._print_ImpliedDoLoopsHXX]r G6t;C?GG jj;j<  r}c |j|j}t|jtr|jj \}}}n t d|j|j}dj|||dz ||S)Nz*Only iterable currently supported is Rangez3do {target} = {start}, {stop}, {step} {body} end dor)targetrrr;body) rrMriterabler/rrrNr)rwrrMrrr;rNs r| _print_ForzFCodePrinter._print_Fors~T[[) dmmU + $ 2 2 E4%&RS S{{499% &e$(!!. .r}c|jj||}|jj||j}|jj|}|r(|D]#\}}|j |j |%|Sr)rbrqrcr type_modulesrvr)rwtype_type_strrvkvs r| _print_TypezFCodePrinter._print_Types!!%%eU3%%))%<''++E2 # +1  #''* +r}cdjj|jdjfd|jDS)N{symbol}({idxs})rc3@K|]}j|ywrr>rrrws r|rz.FCodePrinter._print_Element..EDKK,Esymbolidxs)rrr_rrrwelems` r|_print_ElementzFCodePrinter._print_ElementsA!((;;t{{+E EF)  r}ct|Srr )rwexts r| _print_ExtentzFCodePrinter._print_Extents 3xr}c |j}|j}|jd}ttt fDcgc]}||j v}}|jddk(rd}n<|jddk(rdgd|jdz}ntdzt|tr td jd d k\rd jj|j t"|j vrd nd|rddj%fd|Dznd|t&|j vrdndj|j(}|dk7r|dj|zz }|St"|j vs|r tddj%fd|j |j(fD}|Scc}w)N dimensionTrrrz , intent(%s))inoutinoutz!Multiple intents specified for %sz1Pointers are not available by default in Fortran.rYrfz"{t}{vc}{dim}{intent}{alloc} :: {s}z , parameterz, dimension(%s)rc3@K|]}j|ywrr>r[s r|rz2FCodePrinter._print_Declaration..s2S4;;s3C2Sr]z , allocatable)rvcr/intentallocsz = %sz0F77 init./parameter statem. req. multiple lines.rc3@K|]}j|ywrr>r[s r|rz2FCodePrinter._print_Declaration..sRCt{{3/Rr])variabler attr_paramsr$r%r&attrscountindexrtrr rrsrrtyper rrr_)rwrrvalr/rnintentsresults` r|_print_DeclarationzFCodePrinter._print_Declarationsmmiiook*6?\5Z[66SYY&[[ == ! #F ]]4 A %#&>* % +9@@++chh'$/399$<="X[% 2Ss2S(TTac)4 )Aor++cjj) AFd{'DKK$444  cii'3)*\]]XXRCHHcjj;QRSF 5\sGc<d|jtdzS)Nz(huge(%s) + 1)r)rr!rs r|_print_InfinityzFCodePrinter._print_Infinitys$++jm"<<r?s r|r@z+FCodePrinter._print_While..sdkk#.r}rIrrrCrs` r| _print_WhilezFCodePrinter._print_Whiles4>7>>1.BMB01 1r}cy)Nz.true.rrs r|_print_BooleanTruezFCodePrinter._print_BooleanTruesr}cy)Nz.false.rrs r|_print_BooleanFalsez FCodePrinter._print_BooleanFalsesr}cg}|D]g}|jdr3|j|jd|ddjzG|j|jd|zi|S)N!rrr)rrrlstrip)rwrrzlines r|_pad_leading_columnsz!FCodePrinter._pad_leading_columnssj 9Ds# djj3d12hoo6GGH djj0478  9  r}cL tdtjztjztd  fd}g}|jddk(rd}nd}|D]}|j |j drt|d kDr|jd d d }|d k(rd }|d |}||d j}|j||sv|jd dd}|d k(st|dkrd}|d |}||d j}|j|j d||re|j||j |j dr||d }|d |j}||d j}|r||z }|j||sW||d}|d |j}||d j}|r||z }|j|j d||r[|j||S)zWrap long Fortran lines Argument: lines -- a list of lines (without \n character) A comment line is split at white space. Code lines are split with a more complex rule to give nice results. z_+-.z ()ct|kr tS|}fd}||s|dz}|dk(r|S||s|S)Nc|vxr |dz vxs=|vxr |dz vxs(|vxr |dz vxs|vxr |dz vS)Nrr)posrmy_alnummy_whites r|r@zDFCodePrinter._wrap_fortran..split_pos_code.. sch&H4a=+HJc(*HtC!G}/HJch&H4a=+HJc(*HtC!G}/H r}rr)r)rendposrsplitrrs` r|split_pos_codez2FCodePrinter._wrap_fortran..split_pos_codesT4yF"4y CJE Cjq!8!MCjJr}rWrz &rrHrrNrrerAr) rustringdigits ascii_lettersrsrrrrfindrrr2) rwrrrztrailingrrhunkrrs @@r|rzFCodePrinter._wrap_fortransv -0D0DDEw<  >>/ *f 4HH# $Dtzz)45t9r>**S!R0Cby :D:,,.DMM$'"jja4"9D B"$C#DSz#CDz002  90Et&LM MM$'F!34$T2.DSz((*CDz((*H$D d#(r2C:,,.D:,,.D(MMDJJv,>"EF  d#G# $H r}c t|tr1|j|jd}dj |S|j ddk(}|Dcgc]}|j d}}d}d}|Dcgc]*}ttt|j|,}}|Dcgc]*}ttt|j|,}}|Dcgc],}ttt|jdd g.} }d } d } d } g} t|D]|\}}|d vr| j|| ||z} |r d | | z| zz}nd | z| z}||}|s|j|gd }| j|| |rd| z} nd } | ||z } ~|s|j| S| Scc}wcc}wcc}wcc}w)z0Accepts a string of code or a list of code linesTrrWrz )rzif(zif zdo rprogram interface)renddorendifrz end programz end interface&z& r)rrr)rrr splitlinesrrsrranyrrendswithrrrr)rwr code_linesrr inc_keyword dec_keywordincreasedecrease continuationlevel cont_paddingtabwidthnew_coderpaddings r|rzFCodePrinter.indent_code?s dC ))$//$*?@J77:& &~~o.&8046U#66S d "&(S+>?@(("&(S+>?@((&*,!ST]]S%L!ABC, ,   !GAtz!% Xa[ EuX~ <=e)H,$d+D00$8; OOD !A z  Xa[ E+ !.%%h/ /S7 ((,sF>:/G//G$1G c|jrNdjdjfd|jDj |jS|j\}dj |zS)Nzgo to ({labels}), {expr}rc3@K|]}j|ywrr>r[s r|rz+FCodePrinter._print_GoTo..ts!Js$++c"2!Jr])labelsrzgo to %s)rrrrr)rwgotolbls` r| _print_GoTozFCodePrinter._print_GoToqsi 99-44yy!Jdkk!JK[[+5  ;;DC C 00 0r}cNdjdi|jfdS)Nz"program {name} {body} end program c&j|Srr>r?s r|r@z-FCodePrinter._print_Program..sS1Ar}rIrr)rwprogs` r|_print_ProgramzFCodePrinter._print_Program{s7  & D;;%A;B D Dr}cNdjdi|jfdS)NzAmodule {name} {declarations} contains {definitions} end module c&j|Srr>r?s r|r@z,FCodePrinter._print_Module..s C0@r}rIrr)rwmods` r| _print_ModulezFCodePrinter._print_Modules7  & C ::$@:A C Cr}c:|jdk(r1|jddk\r|jdjdy|jdk(r1|jddk\r|jdjdy |jdk(ry |jS) NrrYrhrPzstdint=>input_unit input_unitrzstdint=>error_unit error_unit*)rrsrvr)rwstrms r| _print_StreamzFCodePrinter._print_Streams 99 T^^J%?4%G   _ - 1 12F G YY( "t~~j'AT'I   _ - 1 12F GyyH$yy r}c.|jtk(rd}d}nHddtdtdij |j diz}j |j}|j|djfd|jD S) Nzprint {fmt}, {iolist}rz3write(%(out)s, fmt="{fmt}", advance="no"), {iolist}rj06rc3@K|]}j|ywrr>r[s r|rz,FCodePrinter._print_Print..s 7#T[[  7r])fmtiolist) format_stringrrrrqfilerrr print_args)rwpstemplaters` r| _print_PrintzFCodePrinter._print_Prints  t #.HCLVS155bggsCPH++b../C3tyy 7 709: :r}c|j\}dj|jjdd|j |S)Nz{result_name} = {arg} result_name sympy_result)rr)rr_contextrqr)rwrsrs r| _print_ReturnzFCodePrinter._print_ReturnsEww&-- ))-H C .  r}cL|j\}|rd|j|zSy)Nz return %sreturn)rr)rwfrsrs r|_print_FortranReturnz!FCodePrinter._print_FortranReturns'xx S!11 1r}c |jd}|d}n |rd|dznd}jjdd}dj|j |j dj |jDcgc]}j |jc}|rd |znd|d j fd |jD Scc}w) Nbind_Crz bind(C, name="%s")rz bind(C)rz<{entity}{name}({arg_names}){result}{bind} {arg_declarations}rz result(%s)rc3RK|]}jt| ywr)rrr[s r|rz%FCodePrinter._head..s'_# K4D(E'_s$')entityr arg_namesrzbindarg_declarations) rsrsrqrrrr parametersr_)rwrfprC bind_C_paramsrrrs` r|_headzFCodePrinter._headsx0  D?L(=+;;R\Dnn((=  ! &RWW%iiBMM RSSZZ!8 RS4?MK/R!YY'_QSQ^Q^'_`   !Ss?"Ccdj|j|j}dj|j||S)N {} function z4interface {function_head} end function end interface) function_head)rr return_typer)rwrrs r|_print_FunctionPrototypez%FCodePrinter._print_FunctionPrototypesB&&t{{2>>'BC  &tzz&"5& 6  7r}ct|jvrd}nt|jvrd}nd}dj|j |j }t ||j5dj||j|||j |jcdddS#1swYyxYw)Nz elemental zpure rr)rz,{prefix}{function_head} {body} end function )prefixrrN) r"rtr#rrrr3rrrN)rwfdrrs r|_print_FunctionDefinitionz&FCodePrinter._print_FunctionDefinitions  !F RXX FF&&t{{2>>'BC Trww 7 !f"jj4[[)   s .=B55B>czdj|jd||j|jS)Nz({subroutine_head} {body} end subroutine z subroutine )subroutine_headrN)rrrrN)rwsubs r|_print_SubroutinezFCodePrinter._print_Subroutines;  & JJ}c:SXX&   r}cdjj|jdjfd|jDS)Nzcall {name}({args})rc3@K|]}j|ywrr>r[s r|rz5FCodePrinter._print_SubroutineCall..sNDKK,Nr])rr)rrrrsubroutine_args)rwscalls` r|_print_SubroutineCallz"FCodePrinter._print_SubroutineCallsC$++UZZ(N8M8MNO,  r}cFdtfd|jDzS)Nz%s => %sc3@K|]}j|ywrr>r[s r|rz1FCodePrinter._print_use_rename..s"H4;;s#3"Hr])tupler)rwrnms` r|_print_use_renamezFCodePrinter._print_use_renamesE"Hsxx"HIIIr}c d|j|jz}|jdk7r>|ddj|jDcgc]}|j|c}zz }|jdk7r>|ddj|jDcgc]}|j|c}zz }|Scc}wcc}w)Nzuse %srz, only: )r namespacerenameronly)rwuserzrnlys r| _print_usezFCodePrinter._print_usesDKK 66 ::  dTYYCJJ'OS C(8'OPP PF 88t  j499#((-S3dkk#.>-S#TT TF (P-Ss B; C cy)Nexitrrwrs r|_print_BreakTokenzFCodePrinter._print_BreakTokensr}cy)Ncyclerrs r|_print_ContinueTokenz!FCodePrinter._print_ContinueTokensr}c~jddk\rdnd}|djfd|jDzS)NrYrhz[%s]z(/%s/)rc3@K|]}j|ywrr>r[s r|rz7FCodePrinter._print_ArrayConstructor..s"K4;;s#3"Kr])rsrelements)rwacfmtstrs` r|_print_ArrayConstructorz$FCodePrinter._print_ArrayConstructors8>>*5=8 "Kr{{"KLLLr}cdjj|jdjfd|jDS)NrYrc3@K|]}j|ywrr>r[s r|rz3FCodePrinter._print_ArrayElement.. r\r]r^)rrrrrras` r|_print_ArrayElementz FCodePrinter._print_ArrayElementsA!((;;tyy)E EF)  r}r)[r1 __module__ __qualname____doc__ printmethodlanguagerrrr rrrbrr r rrrrrrcrRrkr0r[__annotations__ _operatorsr!ropropertyrrrrrrrrrrrrrrrrr r rrrrr%r)r,r5r8rFrKrPrWrcrfr{r}rrrrrrrrrrrrrrrrrrrrr r rr __classcell__)r{s@r|rLrLFs+KKH  g*L ;L k { { { y M (L)-[-J-J)  O)~ J dL,(\\"#F ;B ' %(KTJ%6NG Q66&( 9JT F& " . B=1EN0d1DC ! :  &7(  JM r}rL)Er __future__rtypingr collectionsr itertoolsrrsympy.codegen.astrrr r r r r rrrrrrrrrrrrrrsympy.codegen.fnodesrrrrr r!r"r#r$r%r& sympy.corer'r(r)r*r+sympy.core.functionr,sympy.core.numbersr-sympy.core.relationalr. sympy.setsr/sympy.printing.codeprinterr0sympy.printing.precedencer1r2sympy.printing.printerr3r4r5rprLrr}r|r-sL&##  0/(+$2<2: 5 5 5 F   F   F  W F F F 5 5 5 5  5!" 5#*E  ;E  r}