§
    PŠtjÖ ã                  óÒ  — d Z ddlmZ ddlmZmZmZmZmZm	Z	 ddl
mZ ddlmZ ddlmZmZmZmZmZmZmZmZmZmZmZ ddlmZmZ ddlmZmZm Z  dd	l!m"Z"m#Z# dd
l$m%Z% ddl&m'Z'm(Z( ddl)m*Z*m+Z+ ddl,m-Z-m.Z. ddl/m0Z0 ddl1m2Z2m3Z3 ddl4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@mAZAmBZBmCZC ddlDmEZE ddlFmGZG ddlHmIZImJZJ ddlKmLZL ddlMmNZN ddlOmPZP ddlQmRZRmSZSmTZTmUZUmVZVmWZWmXZXmYZYmZZZm[Z[m\Z\ ddl]m^Z^ ddl_m`Z`maZambZbmcZc ddldmeZe ddlfmgZg ddlhmiZimjZj ddlkmlZlmmZmmnZnmoZo ddlpmqZqmrZr ddlsmtZtmuZu dd lvmwZw dd!lxmyZy dd"lzm{Z{m|Z| dd#l}m~Z~mZm€Z€m�Z�m‚Z‚mƒZƒm„Z„m…Z… dd$l†m‡Z‡ dd%lˆm‰Z‰ dd&lŠm‹Z‹ dd'lŒm�Z� dd(lŽm�Z� dd)l�m‘Z‘m’Z’ dd*l“Z“d+„ Z”d,„ Z•d-„ Z–d.„ Z—dKd/„Z˜d0„ Z™d1„ Zšd2„ Z›dLd6„Zœd7„ Z�dg g fd8„Zžd9„ ZŸd:„ Z d;„ Z¡d<„ Z¢d=„ Z£d>„ Z¤dKd?„Z¥d@„ Z¦e9dA„ e8dB„ iZ§dC„ Z¨dD„ Z©e‡dEdFœdG„¦   «         ZªdH„ Z«dI„ Z¬ddJl­m®Z®m¯Z¯m°Z° d*S )Ma  
This module contain solvers for all kinds of equations:

    - algebraic or transcendental, use solve()

    - recurrence, use rsolve()

    - differential, use dsolve()

    - nonlinear (numerically), use nsolve()
      (you will need a good starting point)

é    )Úannotations)ÚSÚAddÚSymbolÚDummyÚExprÚMul)Úcheck_assumptions)Úfactor_terms)Ú
expand_mulÚ
expand_logÚ
DerivativeÚAppliedUndefÚUndefinedFunctionÚnfloatÚFunctionÚexpand_power_expÚ_mexpandÚexpandÚexpand_func)Ú	fuzzy_notÚ	fuzzy_and)ÚFloatÚRationalÚ_illegal)Úinteger_logÚilcm)ÚPow)ÚEqÚNe)ÚorderedÚdefault_sort_key)ÚsympifyÚ_sympify)Úpreorder_traversal)ÚAndÚBooleanAtom)ÚlogÚexpÚLambertWÚcosÚsinÚtanÚacosÚasinÚatanÚAbsÚreÚimÚargÚsqrtÚatan2)Úbinomial)ÚHyperbolicFunction)Úpiecewise_foldÚ	Piecewise)ÚTrigonometricFunction)ÚIntegral)Údivisors)ÚsimplifyÚcollectÚpowsimpÚposifyÚ	powdenestÚ	nsimplifyÚdenomÚ
logcombineÚ
sqrtdenestÚfractionÚseparatevars)Ú
sqrt_depth)ÚTR1ÚTR2iÚTR10ÚTR11)Úrebuild)ÚNonInvertibleMatrixError)ÚMatrixÚzeros)ÚrootsÚcancelÚfactorÚPoly)Úsympy_eqs_to_ringÚsolve_lin_sys)ÚGeneratorsNeededÚPolynomialError)Úgcd)Úlambdify)Ú
filldedentÚdebugf)Úconnected_componentsÚgenerate_bellÚuniqÚiterableÚis_sequenceÚsubsetsÚflattenÚsift)Úconserve_mpmath_dps)Úfindroot)Úsolve_poly_system)ÚGeneratorType)Údefaultdict)ÚcombinationsÚproductNc                ó&  ‡— t          | ¦  «        st          |¦  «        rt          d¦  «        ‚t          |¦  «        }t          t          |¦  «        ¦  «        }i Šd}|D ]5}t	          |t
          ¦  «        s|‰vrt          d|z  ¦  «        ‰|<   |dz  }Œ6g }| D ]I}t          |dd¦  «        }|�|                      |‰¦  «        ¦  «         Œ4|                     |¦  «         ŒJd„ ‰ 	                    ¦   «         D ¦   «         }|ˆfd„|D ¦   «         |fS )	aø  
    Return (e, s, d) where e and s are versions of *eqs* and
    *symbols* in which any non-Symbol objects in *symbols* have
    been replaced with generic Dummy symbols and d is a dictionary
    that can be used to restore the original expressions.

    Examples
    ========

    >>> from sympy.solvers.solvers import recast_to_symbols
    >>> from sympy import symbols, Function
    >>> x, y = symbols('x y')
    >>> fx = Function('f')(x)
    >>> eqs, syms = [fx + 1, x, y], [fx, y]
    >>> e, s, d = recast_to_symbols(eqs, syms); (e, s, d)
    ([_X0 + 1, x, y], [_X0, y], {_X0: f(x)})

    The original equations and symbols can be restored using d:

    >>> assert [i.xreplace(d) for i in eqs] == eqs
    >>> assert [d.get(i, i) for i in s] == syms

    z%Both eqs and symbols must be iterabler   zX%dé   ÚsubsNc                ó   — i | ]\  }}||“Œ	S © rq   )Ú.0ÚkÚvs      úS/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/sympy/solvers/solvers.pyú
<dictcomp>z%recast_to_symbols.<locals>.<dictcomp>o   s   € Ð1Ð1Ð1™˜˜1ˆq�!Ð1Ð1Ð1ó    c                ó<   •— g | ]}‰                      ||¦  «        ‘ŒS rq   ©Úget)rr   ÚiÚswap_syms     €ru   ú
<listcomp>z%recast_to_symbols.<locals>.<listcomp>p   s'   ø€ Ð4Ð4Ð4¨!�8—<’<  1Ñ%Ô%Ð4Ð4Ð4rw   )
ra   Ú
ValueErrorÚlistr!   Ú
isinstancer   r   ÚgetattrÚappendÚitems)	ÚeqsÚsymbolsÚorigr{   ÚsÚnew_fÚisubsÚrestorer|   s	           @ru   Úrecast_to_symbolsr‹   F   s?  ø€ õ0 �C‰=Œ=ð B�X gÑ.Ô.ð BÝÐ@ÑAÔAÐAÝ�‰=Œ=€DÝ•7˜7Ñ#Ô#Ñ$Ô$€GØ€HØ	€AØð ð ˆÝ˜!�VÑ$Ô$ð 	¨°(Ð):Ð):Ý ¨¡	Ñ*Ô*ˆH�Q‰KØ�‰FˆAøØ€EØð ð ˆÝ˜˜6 4Ñ(Ô(ˆØÐØ�LŠL˜˜˜x™œÑ)Ô)Ð)Ð)à�LŠL˜‰OŒOˆOˆOØ1Ð1 §¢Ñ 0Ô 0Ð1Ñ1Ô1€GØÐ4Ð4Ð4Ð4¨tÐ4Ñ4Ô4°gÐ=Ð=rw   c                ód   — t          | t          ¦  «        o| j        pt          | t          ¦  «        S )z$Return True if e is a Pow or is exp.)r€   r   Úis_Powr)   ©Úes    ru   Ú_ispowr�   s   s(   € å�a�ÑÔÐC A¤HÐ$Bµ
¸1½cÑ0BÔ0BÐCrw   c                óÀ   — t          ¦   «         }t          | |¦  «        D ]>}|j        r |j        j        r|j        j        rŒ"|j        }|                     |¦  «         Œ?|S ©N)ÚsetÚdenomsr�   r)   Ú	is_NumberÚis_zeroÚbaseÚadd)Úfr…   ÚdensÚds       ru   Ú_simple_densrœ   x   sg   € õ
 ‰5Œ5€DÝ�A�wÑÔð ð ˆØŒ8ð 	˜œœð 	ØŒuŒ}ð ØØ”ˆAØ�Š�‰ŒˆˆØ€Krw   c                ó‚  ‡— t          | ¦  «        }t          ¦   «         }|D ]]}t          |t          ¦  «        sŒt	          |¦  «        }|t
          j        u rŒ6|                     t          j	        |¦  «        ¦  «         Œ^‰s|S t          ‰¦  «        dk    rt          ‰d         ¦  «        r‰d         Šˆfd„|D ¦   «         S )aV  
    Return (recursively) set of all denominators that appear in *eq*
    that contain any symbol in *symbols*; if *symbols* are not
    provided then all denominators will be returned.

    Examples
    ========

    >>> from sympy.solvers.solvers import denoms
    >>> from sympy.abc import x, y, z

    >>> denoms(x/y)
    {y}

    >>> denoms(x/(y*z))
    {y, z}

    >>> denoms(3/x + y/z)
    {x, z}

    >>> denoms(x/2 + y/z)
    {2, z}

    If *symbols* are provided then only denominators containing
    those symbols will be returned:

    >>> denoms(1/x + 1/y + 1/z, y, z)
    {y, z}

    rn   r   c                óL   •‡— h | ]Št          ˆfd „‰D ¦   «         ¦  «        ¯‰’Œ S )c              3  ó*   •K  — | ]}|‰j         v V — Œd S r’   ©Úfree_symbols)rr   r‡   r›   s     €ru   ú	<genexpr>z#denoms.<locals>.<setcomp>.<genexpr>·   s*   øè è € Ð"HÐ"H¸1 1¨¬Ð#6Ð"HÐ"HÐ"HÐ"HÐ"HÐ"Hrw   ©Úany)rr   r›   r…   s    @€ru   ú	<setcomp>zdenoms.<locals>.<setcomp>·   s<   øø€ ÐIÐIÐI�!�sÐ"HÐ"HÐ"HÐ"HÀÐ"HÑ"HÔ"HÑHÔHÐIˆAÐIÐIÐIrw   )r%   r“   r€   r   rD   r   ÚOneÚupdater	   Ú	make_argsÚlenra   )Úeqr…   Úpotrš   ÚpÚdens    `    ru   r”   r”   ‡   sÏ   ø€ õ@ ˜RÑ
 Ô
 €CÝ‰5Œ5€DØð (ð (ˆõ ˜!�TÑ"Ô"ð 	ØÝ�A‰hŒhˆØ•!”%ˆ<ˆ<ØØ�Š•C”M #Ñ&Ô&Ñ'Ô'Ð'Ð'Øð !ØˆÝ	ˆW‰Œ˜Ò	Ð	Ý�G˜A”JÑÔð 	!Ø˜a”jˆGØIÐIÐIÐI�tÐIÑIÔIÐIrw   c                óH
  ‡‡‡— ddl m} ‰                     dd¦  «        }‰�|‰iŠn.t          |t          ¦  «        r|Šnd}t          ||‰fz  ¦  «        ‚t          | ¦  «        r-| st          d¦  «        ‚t          ˆˆfd„| D ¦   «         ¦  «        S t          | ¦  «        } | j	        r| j
        S t          | t          ¦  «        r|                      ¦   «         } n²t          | t          t          f¦  «        r–| j        t           j        t           j        fv r| j        } | j        \  }}t          |t*          ¦  «        r|                      ‰¦  «        } | j        sdS n2t          | t          ¦  «        rt1          | j        | j         d¬	¦  «        } t          | t*          ¦  «        rt5          | ¦  «        S | j        s| sd
S t9          t:          ¦  «        Št=          ˆfd„‰                     ¦   «         D ¦   «         ¦  «        rdS d}	‰                     dd
¦  «        }
	 |	dz  }	|	dk    r`|                      ‰¦  «        }t          |t@          ¦  «        r| !                    |¦  «        d         }| "                    ¦   «         ‰z  rdS �n|	dk    rx|j	        so |j#        tI          ‰ %                    ¦   «         ¦  «        d| iŽsdS | &                    ¦   «         \  }}tO          | (                    ¦   «         d         d
¬¦  «        }�n–|	dk    rœ|rdS ‰                     dd
¦  «        r‰D ]}tS          ‰|         ¦  «        ‰|<   ŒtS          |                      ‰¦  «        ¦  «        }‰                     dd
¦  «        r,tU          |¦  «        \  }}tO          |d
¬¦  «        }|j	        r|}nôtW          tY          |¦  «        ¦  «        }t9          ¦   «         }d}|D ]W}||v rŒ| -                    |¦  «         |j.        r|j/        j0        sd
}n!|j1        rd
}nt          |td          ¦  «        rd
}|r nŒX|du rdS ‰                     dd
¦  «        r|                     |¦  «        }tg          |j
        ¦  «        }|�&|j	        r| 4                    tj          ¦  «        rdS | S n_|j6        r|dk    S |
rN|j	        rGto          | 8                    d¦  «         8                    dd
¬¦  «        ¦  «        dk     t           j        u S �ŒÞ‰                     dd¦  «        rts          j:        d‰z  ¦  «         dS dS )aƒ  
    Checks whether sol is a solution of equation f == 0.

    Explanation
    ===========

    Input can be either a single symbol and corresponding value
    or a dictionary of symbols and values. When given as a dictionary
    and flag ``simplify=True``, the values in the dictionary will be
    simplified. *f* can be a single equation or an iterable of equations.
    A solution must satisfy all equations in *f* to be considered valid;
    if a solution does not satisfy any equation, False is returned; if one or
    more checks are inconclusive (and none are False) then None is returned.

    Examples
    ========

    >>> from sympy import checksol, symbols
    >>> x, y = symbols('x,y')
    >>> checksol(x**4 - 1, x, 1)
    True
    >>> checksol(x**4 - 1, x, 0)
    False
    >>> checksol(x**2 + y**2 - 5**2, {x: 3, y: 4})
    True

    To check if an expression is zero using ``checksol()``, pass it
    as *f* and send an empty dictionary for *symbol*:

    >>> checksol(x**2 + x - x*(x + 1), {})
    True

    None is returned if ``checksol()`` could not conclude.

    flags:
        'numerical=True (default)'
           do a fast numerical check if ``f`` has only one symbol.
        'minimal=True (default is False)'
           a very fast, minimal testing.
        'warn=True (default is False)'
           show a warning if checksol() could not conclude.
        'simplify=True (default)'
           simplify solution before substituting into function and
           simplify the function before trying specific simplifications
        'force=True (default is False)'
           make positive all symbols without assumptions regarding sign.

    r   )ÚUnitÚminimalFNz;Expecting (sym, val) or ({sym: val}, None) but got (%s, %s)zno functions to checkc              3  ó4   •K  — | ]}t          |‰fi ‰¤ŽV — Œd S r’   ©Úchecksol)rr   ÚfiÚflagsÚsols     €€ru   r¢   zchecksol.<locals>.<genexpr>ú   s5   øè è € Ð@Ð@¸� " cÐ3Ð3¨UÐ3Ð3Ð@Ð@Ð@Ð@Ð@Ð@rw   ©ÚevaluateTc              3  óf   •K  — | ]+\  }}t          |¦  «                             ¦   «         ‰z  V — Œ,d S r’   )r#   Úatoms)rr   rs   rt   Úillegals      €ru   r¢   zchecksol.<locals>.<genexpr>  s>   øè è € Ð
@Ð
@©D¨A¨q�7�1‰:Œ:×ÒÑÔ Ñ'Ð
@Ð
@Ð
@Ð
@Ð
@Ð
@rw   éÿÿÿÿÚ	numericalrn   r>   ©Ú	recursiveé   Úforceé   é   )Úchopg•Ö&è.>Úwarnz(
	Warning: could not verify solution %s.);Úsympy.physics.unitsr¯   rz   r€   Údictr~   ra   r   r$   Ú	is_numberr–   rU   Úas_exprr   r    Úrhsr   ÚtrueÚfalseÚreversedÚargsr'   ro   Ú
is_Booleanr   ÚlhsÚboolÚis_Relationalr“   r   r¤   rƒ   r	   Úas_independentrº   Úis_constantr   ÚkeysÚas_content_primitiver   Úas_numer_denomr>   rA   r%   r   r˜   r�   r)   Ú
is_IntegerÚis_Functionr   r   Úhasr*   Úis_RationalÚabsÚnÚwarningsrÅ   )r™   Úsymbolr¶   rµ   r¯   r°   ÚmsgÚBÚEÚattemptr½   ÚvalÚ_rs   ÚrepsÚexvalr«   ÚseenÚsaw_pow_funcr¬   Únzr»   s     ``                 @ru   r³   r³   º   s‡  øøø€ ðb )Ð(Ð(Ð(Ð(Ð(à�iŠi˜	 5Ñ)Ô)€Gà
€Ø�sˆmˆˆÝ	�F�DÑ	!Ô	!ð .ØˆˆàKˆÝ˜ ¨˜}Ñ,Ñ-Ô-Ð-å��{„{ð AØð 	6ÝÐ4Ñ5Ô5Ð5ÝÐ@Ð@Ð@Ð@Ð@¸aÐ@Ñ@Ô@Ñ@Ô@Ð@å�‰Œ€Aà„{ð ØŒyÐå�!•TÑÔð 3Ø�IŠI‰KŒKˆˆÝ	�A��B�xÑ	 Ô	 ð 	3ØŒ5•Q”V�QœWÐ%Ð%Ð%Ø”
ˆAØŒv‰ˆˆ1Ý�a�Ñ%Ô%ð 	3Ø—’�s‘”ˆAØ”<ð Ø�ðå˜�2ÑÔð 	3Ý�A”E˜AœE˜6¨EÐ2Ñ2Ô2ˆAå�!•[Ñ!Ô!ð Ý�A‰wŒwˆØŒ_ð  Qð Øˆtå•(‰mŒm€GÝ
Ð
@Ð
@Ð
@Ð
@°C·I²I±K´KÐ
@Ñ
@Ô
@Ñ@Ô@ð Øˆuà€GØ—	’	˜+ tÑ,Ô,€IðIFØ�1‰ˆØ�aŠ<ˆ<Ø—&’&˜‘+”+ˆCÝ˜#�sÑ#Ô#ð 2Ø×(Ò(¨Ñ.Ô.¨qÔ1�Ø�yŠy‰{Œ{˜WÑ$ð Ø�uñà˜Š\ˆ\Ø”=ð HØ&�s”­¨S¯XªX©Z¬ZÑ(8Ô(8ÐOÀwÀ;ÐOÐOð !Ø ˜5à×1Ò1Ñ3Ô3‘��3Ý˜s×1Ò1Ñ3Ô3°AÔ6À$ÐGÑGÔG�ùØ˜Š\ˆ\Øð Ø�Ø�yŠy˜ TÑ*Ô*ð .Øð .ð .�AÝ% c¨!¤fÑ-Ô-�C˜‘F�Fõ ˜1Ÿ6š6 #™;œ;Ñ'Ô'ˆCØ�yŠy˜ $Ñ'Ô'ð  Ý" 3™KœK‘	��Tå  °Ð5Ñ5Ô5�Ø”?ð  à�Cøõ %¥Z°¡_¤_Ñ5Ô5ˆCÝ‘5”5ˆDØ ˆLØð ð �Ø˜�9�9ØØ—’˜‘”�Ø”8ð ( A¤EÔ$4ð (Ø#'�L�LØ”]ð (Ø#'�L�LÝ Õ#4Ñ5Ô5ð (Ø#'�LØð Ø�Eðà˜uÐ$Ð$Ø�uØ�yŠy˜ $Ñ'Ô'ð %à—h’h˜t‘n”n�Ý˜3œ;Ñ'Ô'ˆBØˆ~ð ”=ð   S§W¢W­XÑ%6Ô%6ð  ð  ˜4ð �v�ØØŒ?ð 	Ø˜!’8ˆOØð 	F˜œð 	FÝ˜Ÿš˜b™	œ	Ÿš B¨T˜Ñ2Ô2Ñ3Ô3°dÒ:½q¼vÐEÐEñSIFðV ‡y‚y�˜ÑÔð JÝŒÐBÀSÑHÑIÔIÐIÐIÐIðJð Jrw   c           
     ó   ‡‡0‡1‡2‡3‡4‡5‡6‡7‡8‡9— ddl m} d}d}|D ]9Š4|                     ‰4t          |                     ‰4|¦  «        ¦  «        ¦  «        }Œ:|                     dd¦  «        }|                     dd¦  «        }|                     dd¦  «        }t          | ¦  «         }	|                     d	d
¦  «        �%|                     dd
¦  «        st          d¦  «        ‚|                     dd¦  «        r|	rt          t          d¦  «        ¦  «        ‚d„ Š1ˆ1fd„| ‰fD ¦   «         \  } Šd
}
‰s½ t          ¦   «         j	        d„ | D ¦   «         Ž Št          ‰¦  «        t          | ¦  «        k     r^| D ][}t          |¦  «        }|D ]G}t          |t          ¦  «        r0|sd|d<   ‰                     |¦  «         |                     ¦   «          ŒHŒ\d}
t!          t#          ‰¦  «        ¦  «        Šn¥t          ‰¦  «        dk    rt          ‰d         ¦  «        r‰d         Š‰ot%          ‰t&          ¬¦  «        }
t!          t)          ‰¦  «        ¦  «        }t          |¦  «        t          ‰¦  «        k    rd}
t!          t#          ‰¦  «        ¦  «        Šn|Št          ‰¦  «        t          t          ‰¦  «        ¦  «        k    rt          d¦  «        ‚|                     dt          ¦   «         ¦  «        Š2‰2rSt          ‰2t,          ¦  «        r‰2gŠ2 t          ¦   «         j	        d„ t/          ‰2¦  «        D ¦   «         Ž Š2ˆ2fd„‰D ¦   «         Št          | t           ¦  «        rd„ | D ¦   «         } t1          | ¦  «        D �]\  }}t          |t2          t4          f¦  «        �r dd„ |j        D ¦   «         v r|j        |j        z
  }nØ|j        \  }}t          |t<          ¦  «        r||}}t          |t<          ¦  «        rnt          |t4          ¦  «        r| }|j        r|t@          j!        u r| n|}nm|j"        r|c S |j#        r| j"        r| c S tI          t          d¦  «        ¦  «        ‚t          |t2          ¦  «        rtK          |j        |j         d¬¦  «        }|| |<   |j        rjt          ‰¦  «        dk    rt          d¦  «        ‚|r7‰d         j&        r*tO          j(        t          d‰d         z  ¦  «        ¦  «          || ‰¬¦  «        c S t          |tR          ¦  «        r| *                    ¦   «         | |<   | |          +                    ˆfd „d!„ ¦  «        | |<   | |         j,        ru	 | |          -                    ¦   «         | |<   n# t          $ r t          d"¦  «        ‚w xY wd}	|  .                    t!          | |         ¦  «        ¦  «         t@          j/        | |<   | |         j0        }|rŸtc          d#„ |D ¦   «         ¦  «        r†| |          2                    ¦   «         \  }}| |          3                    th          tj          tl          tn          ¦  «        Š3|r5|r3||k    r-tq          ˆ3fd$„||fD ¦   «         ¦  «        s|	rd}	||g| ||dz   …<   �Œtq          d%„ | D ¦   «         ¦  «        r|rg t          ¦   «         fS g S t1          | ¦  «        D ]ˆ\  }}	 |}| +                    tr          ˆfd&„¦  «        }||k    rnŒ(| :                    tr          ¦  «        D ]} |j;        ‰Ž rtI          d'|z  ¦  «        ‚Œ| +                    tl          d(„ ¦  «        }|| |<   Œ‰d)„ | D ¦   «         }|rÌg }‰D ]mŠ7‰7j<        s‰7j=        rŒtq          ˆ7fd*„|D ¦   «         ¦  «        rA| >                    ‰7ti          ‰7¦  «        t@          j?        tk          ‰7¦  «        z  z   f¦  «         Œn|rX|D ]L\  Š7Š6ˆ6ˆ7fd+„| D ¦   «         ‰7‰6z
  gz   } ‰ .                    ti          ‰7¦  «        tk          ‰7¦  «        g¦  «         ŒM|	rd}	d|d<   t�          | ‰¦  «        \  } ŠŠ8t          ‰¦  «        }g }| D ][}d}|j0        |z  rd}n3|jA        r|jB        r|jC        rŒ'g c S d}n| D                    ¦   «         rd}|r| >                    |¦  «         Œ\|s|r‰t          ¦   «         fS g S |} ~t          ¦   «         }t          ¦   «         Š5| D ]å}t          |¦  «        }|D ]Ñ}t          |t,          ¦  «        rt          |tŠ          ¦  «        rn�t          |t          ¦  «        s+|j        r$||v s |jF        s|jG        s|jH        r|r	|jI        r|s|jJ        th          tj          fvrŒƒ||vr6|                     |¦  «         |j0        |z  r‰5                     |¦  «         nŒ½|                     ¦   «          ŒÒŒæ~t—          t!          t™          ‰5d,„ ‰5D ¦   «         ¦  «        ¦  «        ¦  «        Š5ˆ5fd-„| D ¦   «         } ˆ8fd.„‰5 M                    ¦   «         D ¦   «         Š5d}|                     d/d¦  «        durEt1          | ¦  «        D ]5\  }}| ;                    tœ          ¦  «        rd}tŸ          |d¬0¦  «        | |<   Œ6t¡          | d         ‰¦  «        |d1<   ˆ0ˆfd2„Š0t1          | ¦  «        D ]"\  }} ‰0|¦  «        rt£          |¦  «        | |<   Œ#d3„ | D ¦   «         }t          |¦  «        dk    �rt¥          |d4„ d¬5¦  «        \  }}ˆfd6„||fD ¦   «         \  }}i Š9|D ]y} | j        d         }! |!jS        ‰Ž \  }"}#|#‰v s|# ‰v rT|"jB        st©          ¦   «         n|"}$t«          |  J                    |#|$z   ¦  «        ¦  «         V                    |$|"i¦  «        ‰9| <   Œz|rdt          |¦  «        d7k    rQt          |¦  «        dk    rt¯          d8„ |D ¦   «         Ž n|d         j        d         }%|D ]}t±          ||%¦  «        ‰9|<   Œˆ9fd9„| D ¦   «         } |	rEd
}&t          ‰¦  «        dk    rt³          | d         ‰|¦  «        }&|&stµ          | d         g‰¢R i |¤Ž}&nt·          | ‰fi |¤Ž\  }'}&t¹          |&¦  «        t           u sJ ‚|&r&t¹          |&d         ¦  «        t–          u s
J |&¦   «         ‚|                     dd¦  «        }(ˆfd:„})|(s|rd
}*n‡|	r_t          ‰¦  «        dk    rˆfd;„}*nlt          |&¦  «        dk    r*t          |&d         ¦  «        t          ‰¦  «        k    rd<„ }*n/|
r|)}*n*d=„ }*n&|&r"|'rt          |&¦  «        dk    rd>„ }*n|
r|)}*nd?„ }*nd
}*‰5r$t¹          |&¦  «        t           u rˆ5fd@„|&D ¦   «         }&‰8rFˆ8fdA„‰D ¦   «         Št1          |&¦  «        D ](\  }}+ˆ8fdB„|+ M                    ¦   «         D ¦   «         |&|<   Œ)|                     dCd¦  «        },|r8|&r6|                     d/d
¦  «        € t»          |&d¬D¦  «        }&t½          |&¦  «        }&|,rÄ|&rÂ|                     dd¦  «        }g }-g }.|&D ]^}+t¿          dE„ |+ M                    ¦   «         D ¦   «         ¦  «        }/|/du rŒ2|. >                    |+¦  «         |/€|- >                    |+¦  «         Œ_|.}&|rC|-rAtO          j(        t          dFdG `                    dH„ |-D ¦   «         ¦  «        z   ¦  «        ¦  «         |&s|r‰t          ¦   «         fS g S |s'dI„ |&D ¦   «         }&|& a                    tÄ          ¬J¦  «         |s|(s |*|&¦  «        S |(r|&S |
r‰Š4n@t!          t#          t          tÇ          dK„ |&D ¦   «         ¦  «        ¦  «        ¦  «        ¦  «        Š4‰4ˆ4fdL„|&D ¦   «         fS )Ma(F  
    Algebraically solves equations and systems of equations.

    Explanation
    ===========

    Currently supported:
        - polynomial
        - transcendental
        - piecewise combinations of the above
        - systems of linear and polynomial equations
        - systems containing relational expressions
        - systems implied by undetermined coefficients

    Examples
    ========

    The default output varies according to the input and might
    be a list (possibly empty), a dictionary, a list of
    dictionaries or tuples, or an expression involving relationals.
    For specifics regarding different forms of output that may appear, see :ref:`solve_output`.
    Let it suffice here to say that to obtain a uniform output from
    `solve` use ``dict=True`` or ``set=True`` (see below).

        >>> from sympy import solve, Poly, Eq, Matrix, Symbol
        >>> from sympy.abc import x, y, z, a, b

    The expressions that are passed can be Expr, Equality, or Poly
    classes (or lists of the same); a Matrix is considered to be a
    list of all the elements of the matrix:

        >>> solve(x - 3, x)
        [3]
        >>> solve(Eq(x, 3), x)
        [3]
        >>> solve(Poly(x - 3), x)
        [3]
        >>> solve(Matrix([[x, x + y]]), x, y) == solve([x, x + y], x, y)
        True

    If no symbols are indicated to be of interest and the equation is
    univariate, a list of values is returned; otherwise, the keys in
    a dictionary will indicate which (of all the variables used in
    the expression(s)) variables and solutions were found:

        >>> solve(x**2 - 4)
        [-2, 2]
        >>> solve((x - a)*(y - b))
        [{a: x}, {b: y}]
        >>> solve([x - 3, y - 1])
        {x: 3, y: 1}
        >>> solve([x - 3, y**2 - 1])
        [{x: 3, y: -1}, {x: 3, y: 1}]

    If you pass symbols for which solutions are sought, the output will vary
    depending on the number of symbols you passed, whether you are passing
    a list of expressions or not, and whether a linear system was solved.
    Uniform output is attained by using ``dict=True`` or ``set=True``.

        >>> #### *** feel free to skip to the stars below *** ####
        >>> from sympy import TableForm
        >>> h = [None, ';|;'.join(['e', 's', 'solve(e, s)', 'solve(e, s, dict=True)',
        ... 'solve(e, s, set=True)']).split(';')]
        >>> t = []
        >>> for e, s in [
        ...         (x - y, y),
        ...         (x - y, [x, y]),
        ...         (x**2 - y, [x, y]),
        ...         ([x - 3, y -1], [x, y]),
        ...         ]:
        ...     how = [{}, dict(dict=True), dict(set=True)]
        ...     res = [solve(e, s, **f) for f in how]
        ...     t.append([e, '|', s, '|'] + [res[0], '|', res[1], '|', res[2]])
        ...
        >>> # ******************************************************* #
        >>> TableForm(t, headings=h, alignments="<")
        e              | s      | solve(e, s)  | solve(e, s, dict=True) | solve(e, s, set=True)
        ---------------------------------------------------------------------------------------
        x - y          | y      | [x]          | [{y: x}]               | ([y], {(x,)})
        x - y          | [x, y] | [(y, y)]     | [{x: y}]               | ([x, y], {(y, y)})
        x**2 - y       | [x, y] | [(x, x**2)]  | [{y: x**2}]            | ([x, y], {(x, x**2)})
        [x - 3, y - 1] | [x, y] | {x: 3, y: 1} | [{x: 3, y: 1}]         | ([x, y], {(3, 1)})

        * If any equation does not depend on the symbol(s) given, it will be
          eliminated from the equation set and an answer may be given
          implicitly in terms of variables that were not of interest:

            >>> solve([x - y, y - 3], x)
            {x: y}

    When you pass all but one of the free symbols, an attempt
    is made to find a single solution based on the method of
    undetermined coefficients. If it succeeds, a dictionary of values
    is returned. If you want an algebraic solutions for one
    or more of the symbols, pass the expression to be solved in a list:

        >>> e = a*x + b - 2*x - 3
        >>> solve(e, [a, b])
        {a: 2, b: 3}
        >>> solve([e], [a, b])
        {a: -b/x + (2*x + 3)/x}

    When there is no solution for any given symbol which will make all
    expressions zero, the empty list is returned (or an empty set in
    the tuple when ``set=True``):

        >>> from sympy import sqrt
        >>> solve(3, x)
        []
        >>> solve(x - 3, y)
        []
        >>> solve(sqrt(x) + 1, x, set=True)
        ([x], set())

    When an object other than a Symbol is given as a symbol, it is
    isolated algebraically and an implicit solution may be obtained.
    This is mostly provided as a convenience to save you from replacing
    the object with a Symbol and solving for that Symbol. It will only
    work if the specified object can be replaced with a Symbol using the
    subs method:

        >>> from sympy import exp, Function
        >>> f = Function('f')

        >>> solve(f(x) - x, f(x))
        [x]
        >>> solve(f(x).diff(x) - f(x) - x, f(x).diff(x))
        [x + f(x)]
        >>> solve(f(x).diff(x) - f(x) - x, f(x))
        [-x + Derivative(f(x), x)]
        >>> solve(x + exp(x)**2, exp(x), set=True)
        ([exp(x)], {(-sqrt(-x),), (sqrt(-x),)})

        >>> from sympy import Indexed, IndexedBase, Tuple
        >>> A = IndexedBase('A')
        >>> eqs = Tuple(A[1] + A[2] - 3, A[1] - A[2] + 1)
        >>> solve(eqs, eqs.atoms(Indexed))
        {A[1]: 1, A[2]: 2}

        * To solve for a function within a derivative, use :func:`~.dsolve`.

    To solve for a symbol implicitly, use implicit=True:

        >>> solve(x + exp(x), x)
        [-LambertW(1)]
        >>> solve(x + exp(x), x, implicit=True)
        [-exp(x)]

    It is possible to solve for anything in an expression that can be
    replaced with a symbol using :obj:`~sympy.core.basic.Basic.subs`:

        >>> solve(x + 2 + sqrt(3), x + 2)
        [-sqrt(3)]
        >>> solve((x + 2 + sqrt(3), x + 4 + y), y, x + 2)
        {y: -2 + sqrt(3), x + 2: -sqrt(3)}

        * Nothing heroic is done in this implicit solving so you may end up
          with a symbol still in the solution:

            >>> eqs = (x*y + 3*y + sqrt(3), x + 4 + y)
            >>> solve(eqs, y, x + 2)
            {y: -sqrt(3)/(x + 3), x + 2: -2*x/(x + 3) - 6/(x + 3) + sqrt(3)/(x + 3)}
            >>> solve(eqs, y*x, x)
            {x: -y - 4, x*y: -3*y - sqrt(3)}

        * If you attempt to solve for a number, remember that the number
          you have obtained does not necessarily mean that the value is
          equivalent to the expression obtained:

            >>> solve(sqrt(2) - 1, 1)
            [sqrt(2)]
            >>> solve(x - y + 1, 1)  # /!\ -1 is targeted, too
            [x/(y - 1)]
            >>> [_.subs(z, -1) for _ in solve((x - y + 1).subs(-1, z), 1)]
            [-x + y]

    **Additional Examples**

    ``solve()`` with check=True (default) will run through the symbol tags to
    eliminate unwanted solutions. If no assumptions are included, all possible
    solutions will be returned:

        >>> x = Symbol("x")
        >>> solve(x**2 - 1)
        [-1, 1]

    By setting the ``positive`` flag, only one solution will be returned:

        >>> pos = Symbol("pos", positive=True)
        >>> solve(pos**2 - 1)
        [1]

    When the solutions are checked, those that make any denominator zero
    are automatically excluded. If you do not want to exclude such solutions,
    then use the check=False option:

        >>> from sympy import sin, limit
        >>> solve(sin(x)/x)  # 0 is excluded
        [pi]

    If ``check=False``, then a solution to the numerator being zero is found
    but the value of $x = 0$ is a spurious solution since $\sin(x)/x$ has the well
    known limit (without discontinuity) of 1 at $x = 0$:

        >>> solve(sin(x)/x, check=False)
        [0, pi]

    In the following case, however, the limit exists and is equal to the
    value of $x = 0$ that is excluded when check=True:

        >>> eq = x**2*(1/x - z**2/x)
        >>> solve(eq, x)
        []
        >>> solve(eq, x, check=False)
        [0]
        >>> limit(eq, x, 0, '-')
        0
        >>> limit(eq, x, 0, '+')
        0

    **Solving Relationships**

    When one or more expressions passed to ``solve`` is a relational,
    a relational result is returned (and the ``dict`` and ``set`` flags
    are ignored):

        >>> solve(x < 3)
        (-oo < x) & (x < 3)
        >>> solve([x < 3, x**2 > 4], x)
        ((-oo < x) & (x < -2)) | ((2 < x) & (x < 3))
        >>> solve([x + y - 3, x > 3], x)
        (3 < x) & (x < oo) & Eq(x, 3 - y)

    Although checking of assumptions on symbols in relationals
    is not done, setting assumptions will affect how certain
    relationals might automatically simplify:

        >>> solve(x**2 > 4)
        ((-oo < x) & (x < -2)) | ((2 < x) & (x < oo))

        >>> r = Symbol('r', real=True)
        >>> solve(r**2 > 4)
        (2 < r) | (r < -2)

    There is currently no algorithm in SymPy that allows you to use
    relationships to resolve more than one variable. So the following
    does not determine that ``q < 0`` (and trying to solve for ``r``
    and ``q`` will raise an error):

        >>> from sympy import symbols
        >>> r, q = symbols('r, q', real=True)
        >>> solve([r + q - 3, r > 3], r)
        (3 < r) & Eq(r, 3 - q)

    You can directly call the routine that ``solve`` calls
    when it encounters a relational: :func:`~.reduce_inequalities`.
    It treats Expr like Equality.

        >>> from sympy import reduce_inequalities
        >>> reduce_inequalities([x**2 - 4])
        Eq(x, -2) | Eq(x, 2)

    If each relationship contains only one symbol of interest,
    the expressions can be processed for multiple symbols:

        >>> reduce_inequalities([0 <= x  - 1, y < 3], [x, y])
        (-oo < y) & (1 <= x) & (x < oo) & (y < 3)

    But an error is raised if any relationship has more than one
    symbol of interest:

        >>> reduce_inequalities([0 <= x*y  - 1, y < 3], [x, y])
        Traceback (most recent call last):
        ...
        NotImplementedError:
        inequality has more than one symbol of interest.

    **Disabling High-Order Explicit Solutions**

    When solving polynomial expressions, you might not want explicit solutions
    (which can be quite long). If the expression is univariate, ``CRootOf``
    instances will be returned instead:

        >>> solve(x**3 - x + 1)
        [-1/((-1/2 - sqrt(3)*I/2)*(3*sqrt(69)/2 + 27/2)**(1/3)) -
        (-1/2 - sqrt(3)*I/2)*(3*sqrt(69)/2 + 27/2)**(1/3)/3,
        -(-1/2 + sqrt(3)*I/2)*(3*sqrt(69)/2 + 27/2)**(1/3)/3 -
        1/((-1/2 + sqrt(3)*I/2)*(3*sqrt(69)/2 + 27/2)**(1/3)),
        -(3*sqrt(69)/2 + 27/2)**(1/3)/3 -
        1/(3*sqrt(69)/2 + 27/2)**(1/3)]
        >>> solve(x**3 - x + 1, cubics=False)
        [CRootOf(x**3 - x + 1, 0),
         CRootOf(x**3 - x + 1, 1),
         CRootOf(x**3 - x + 1, 2)]

    If the expression is multivariate, no solution might be returned:

        >>> solve(x**3 - x + a, x, cubics=False)
        []

    Sometimes solutions will be obtained even when a flag is False because the
    expression could be factored. In the following example, the equation can
    be factored as the product of a linear and a quadratic factor so explicit
    solutions (which did not require solving a cubic expression) are obtained:

        >>> eq = x**3 + 3*x**2 + x - 1
        >>> solve(eq, cubics=False)
        [-1, -1 + sqrt(2), -sqrt(2) - 1]

    **Solving Equations Involving Radicals**

    Because of SymPy's use of the principle root, some solutions
    to radical equations will be missed unless check=False:

        >>> from sympy import root
        >>> eq = root(x**3 - 3*x**2, 3) + 1 - x
        >>> solve(eq)
        []
        >>> solve(eq, check=False)
        [1/3]

    In the above example, there is only a single solution to the
    equation. Other expressions will yield spurious roots which
    must be checked manually; roots which give a negative argument
    to odd-powered radicals will also need special checking:

        >>> from sympy import real_root, S
        >>> eq = root(x, 3) - root(x, 5) + S(1)/7
        >>> solve(eq)  # this gives 2 solutions but misses a 3rd
        [CRootOf(7*x**5 - 7*x**3 + 1, 1)**15,
        CRootOf(7*x**5 - 7*x**3 + 1, 2)**15]
        >>> sol = solve(eq, check=False)
        >>> [abs(eq.subs(x,i).n(2)) for i in sol]
        [0.48, 0.e-110, 0.e-110, 0.052, 0.052]

    The first solution is negative so ``real_root`` must be used to see that it
    satisfies the expression:

        >>> abs(real_root(eq.subs(x, sol[0])).n(2))
        0.e-110

    If the roots of the equation are not real then more care will be
    necessary to find the roots, especially for higher order equations.
    Consider the following expression:

        >>> expr = root(x, 3) - root(x, 5)

    We will construct a known value for this expression at x = 3 by selecting
    the 1-th root for each radical:

        >>> expr1 = root(x, 3, 1) - root(x, 5, 1)
        >>> v = expr1.subs(x, -3)

    The ``solve`` function is unable to find any exact roots to this equation:

        >>> eq = Eq(expr, v); eq1 = Eq(expr1, v)
        >>> solve(eq, check=False), solve(eq1, check=False)
        ([], [])

    The function ``unrad``, however, can be used to get a form of the equation
    for which numerical roots can be found:

        >>> from sympy.solvers.solvers import unrad
        >>> from sympy import nroots
        >>> e, (p, cov) = unrad(eq)
        >>> pvals = nroots(e)
        >>> inversion = solve(cov, x)[0]
        >>> xvals = [inversion.subs(p, i) for i in pvals]

    Although ``eq`` or ``eq1`` could have been used to find ``xvals``, the
    solution can only be verified with ``expr1``:

        >>> z = expr - v
        >>> [xi.n(chop=1e-9) for xi in xvals if abs(z.subs(x, xi).n()) < 1e-9]
        []
        >>> z1 = expr1 - v
        >>> [xi.n(chop=1e-9) for xi in xvals if abs(z1.subs(x, xi).n()) < 1e-9]
        [-3.0]

    Parameters
    ==========

    f :
        - a single Expr or Poly that must be zero
        - an Equality
        - a Relational expression
        - a Boolean
        - iterable of one or more of the above

    symbols : (object(s) to solve for) specified as
        - none given (other non-numeric objects will be used)
        - single symbol
        - denested list of symbols
          (e.g., ``solve(f, x, y)``)
        - ordered iterable of symbols
          (e.g., ``solve(f, [x, y])``)

    flags :
        dict=True (default is False)
            Return list (perhaps empty) of solution mappings.
        set=True (default is False)
            Return list of symbols and set of tuple(s) of solution(s).
        exclude=[] (default)
            Do not try to solve for any of the free symbols in exclude;
            if expressions are given, the free symbols in them will
            be extracted automatically.
        check=True (default)
            If False, do not do any testing of solutions. This can be
            useful if you want to include solutions that make any
            denominator zero.
        numerical=True (default)
            Do a fast numerical check if *f* has only one symbol.
        minimal=True (default is False)
            A very fast, minimal testing.
        warn=True (default is False)
            Show a warning if ``checksol()`` could not conclude.
        simplify=True (default)
            Simplify all but polynomials of order 3 or greater before
            returning them and (if check is not False) use the
            general simplify function on the solutions and the
            expression obtained when they are substituted into the
            function which should be zero.
        force=True (default is False)
            Make positive all symbols without assumptions regarding sign.
        rational=True (default)
            Recast Floats as Rational; if this option is not used, the
            system containing Floats may fail to solve because of issues
            with polys. If rational=None, Floats will be recast as
            rationals but the answer will be recast as Floats. If the
            flag is False then nothing will be done to the Floats.
        manual=True (default is False)
            Do not use the polys/matrix method to solve a system of
            equations, solve them one at a time as you might "manually."
        implicit=True (default is False)
            Allows ``solve`` to return a solution for a pattern in terms of
            other functions that contain that pattern; this is only
            needed if the pattern is inside of some invertible function
            like cos, exp, etc.
        particular=True (default is False)
            Instructs ``solve`` to try to find a particular solution to
            a linear system with as many zeros as possible; this is very
            expensive.
        quick=True (default is False; ``particular`` must be True)
            Selects a fast heuristic to find a solution with many zeros
            whereas a value of False uses the very slow method guaranteed
            to find the largest number of zeros possible.
        cubics=True (default)
            Return explicit solutions when cubic expressions are encountered.
            When False, quartics and quintics are disabled, too.
        quartics=True (default)
            Return explicit solutions when quartic expressions are encountered.
            When False, quintics are disabled, too.
        quintics=True (default)
            Return explicit solutions (if possible) when quintic expressions
            are encountered.

    See Also
    ========

    rsolve: For solving recurrence relationships
    sympy.solvers.ode.dsolve: For solving differential equations

    rn   )Úreduce_inequalities©ÚcubicsÚquarticsÚquinticsTÚimplicitFrÅ   r“   ÚquickNÚ
particularz/when using `quick`, `particular` should be Truezø
            The 'particular/quick' flag is usually used with systems of
            equations. Either pass your equation in a list or
            consider using a solver like `diophantine` if you are
            looking for a solution in integers.c                ój   — t          t          t          t          | ¦  «        r| n| g¦  «        ¦  «        S r’   )r   Úmapr#   ra   ©Úws    ru   Ú_sympified_listzsolve.<locals>._sympified_listb  s+   € Ý•C�¥h¨q¡k¤kÐ!:  ¸°sÑ;Ô;Ñ<Ô<Ð<rw   c              3  ó.   •K  — | ]} ‰|¦  «        V — Œd S r’   rq   )rr   r÷   rø   s     €ru   r¢   zsolve.<locals>.<genexpr>d  s-   øè è € Ð;Ð;¨�/�/ !Ñ$Ô$Ð;Ð;Ð;Ð;Ð;Ð;rw   c                ó   — g | ]	}|j         ‘Œ
S rq   r    ©rr   r´   s     ru   r}   zsolve.<locals>.<listcomp>l  s   € Ð<Ð<Ð<°B ¤Ð<Ð<Ð<rw   rÇ   r   )Úincludezduplicate symbols givenÚexcludec                ó   — g | ]	}|j         ‘Œ
S rq   r    )rr   r�   s     ru   r}   zsolve.<locals>.<listcomp>Œ  s   € ÐIÐIÐI°1 ¤ÐIÐIÐIrw   c                ó   •— g | ]}|‰v¯|‘Œ	S rq   rq   )rr   r‡   rý   s     €ru   r}   zsolve.<locals>.<listcomp>�  s#   ø€ Ð:Ð:Ð:˜¨°'Ð)9Ð)9�1Ð)9Ð)9Ð)9rw   c                ó.   — g | ]}|t           j        u¯|‘ŒS rq   )r   rË   ©rr   r‡   s     ru   r}   zsolve.<locals>.<listcomp>”  s   € Ð-Ð-Ð-�1˜Q¥a¤f˜_˜_ˆQ˜_˜_˜_rw   ÚImmutableDenseMatrixc                ó6   — g | ]}t          |¦  «        j        ‘ŒS rq   )ÚtypeÚ__name__©rr   Úas     ru   r}   zsolve.<locals>.<listcomp>™  s!   € Ð)LÐ)LÐ)L¸q­$¨q©'¬'Ô*:Ð)LÐ)LÐ)Lrw   z�
                            Unanticipated argument of Eq when other arg
                            is True or False.
                        r·   z'can only solve for one symbol at a timezm
                    	Warning: assumptions about variable '%s' are
                    not handled currently.©r…   c                óB   •— t          | t          ¦  «        o	 | j        ‰Ž S r’   )r€   r8   Úhas_free)r÷   r…   s    €ru   ú<lambda>zsolve.<locals>.<lambda>Â  s&   ø€ ¥j°Õ4FÑ&GÔ&Gð '!ØˆAŒJ˜Ð ð rw   c                ó6   — |                       t          ¦  «        S r’   )Úrewriter)   rö   s    ru   r  zsolve.<locals>.<lambda>Ã  s   € ¨A¯IªIµc©N¬N€ rw   z1solve cannot handle matrices with symbolic shape.c              3  ó2   K  — | ]}|j         p|j        V — Œd S r’   )Úis_extended_realÚis_imaginaryr  s     ru   r¢   zsolve.<locals>.<genexpr>Ó  s,   è è € ÐMÐMÀ!˜Ô+Ð=¨q¬~ÐMÐMÐMÐMÐMÐMrw   c              3  óv   •K  — | ]3}|                      t          t          t          t          ¦  «        ‰z
  V — Œ4d S r’   )rº   r2   r3   r4   r6   )rr   r{   Úhads     €ru   r¢   zsolve.<locals>.<genexpr>×  sS   øè è € ð 2Ið 2IØ:;�A—G’G�B¥¥C­Ñ/Ô/°#Ñ5ð2Ið 2Ið 2Ið 2Ið 2Ið 2Irw   c              3  óN   K  — | ] }t          |t          t          f¦  «        V — Œ!d S r’   )r€   rÑ   r'   rû   s     ru   r¢   zsolve.<locals>.<genexpr>Þ  s1   è è € Ð
;Ð
;°2�:�b�4¥Ð-Ñ.Ô.Ð
;Ð
;Ð
;Ð
;Ð
;Ð
;rw   c                óž   •—  | j         ‰Ž r4t          t          | ¦  «        ¦  «                             t          ¦  «        nt          | ¦  «        S r’   )rÚ   rH   r1   r  r:   )r4   r…   s    €ru   r  zsolve.<locals>.<lambda>ç  sC   ø€ Ø=D¸S¼WÀgÐ=Nð •�S ™XœXÑ&Ô&×.Ò.­yÑ9Ô9Ð9Ý˜‘X”Xð rw   z6solving %s when the argument is not real or imaginary.c                ó€   — t          | ¦  «                             t          ¦  «                             t          ¦  «        S r’   )r4   r  r6   r0   )r  s    ru   r  zsolve.<locals>.<lambda>ó  s&   € ¥s¨1¡v¤v§~¢~µeÑ'<Ô'<×'DÒ'DÅTÑ'JÔ'J€ rw   c                óR   — g | ]$}|                      t          t          ¦  «        ¯"|‘Œ%S rq   ©rÚ   r2   r3   rû   s     ru   r}   zsolve.<locals>.<listcomp>ù  s)   € Ð.Ð.Ð.�B˜rŸvšv¥b­"™~œ~Ð.ˆRÐ.Ð.Ð.rw   c              3  óx   •K  — | ]4}|                      t          ‰¦  «        t          ‰¦  «        ¦  «        V — Œ5d S r’   r  )rr   r´   r‡   s     €ru   r¢   zsolve.<locals>.<genexpr>   s=   øè è € Ð8Ð8¨B�2—6’6�"˜Q™%œ%¥ A¡¤Ñ'Ô'Ð8Ð8Ð8Ð8Ð8Ð8rw   c                ó>   •— g | ]}|                      ‰‰i¦  «        ‘ŒS rq   ©Úxreplace)rr   r´   rÊ   r‡   s     €€ru   r}   zsolve.<locals>.<listcomp>  s)   ø€ Ð7Ð7Ð7¨r�R—[’[ ! S Ñ*Ô*Ð7Ð7Ð7rw   c                ó*   — g | ]}t          ¦   «         ‘ŒS rq   ©r   ©rr   rå   s     ru   r}   zsolve.<locals>.<listcomp>R  s   € Ð-KÐ-KÐ-K¸!­e©g¬gÐ-KÐ-KÐ-Krw   c                ó:   •— g | ]}|                      ‰¦  «        ‘ŒS rq   ©ro   )rr   r´   Únon_invertss     €ru   r}   zsolve.<locals>.<listcomp>S  s%   ø€ Ð*Ð*Ð* "ˆ�Š�Ñ	Ô	Ð*Ð*Ð*rw   c                ój   •— g | ]/\  }}||                      ‰¦  «                             ‰¦  «        f‘Œ0S rq   )r  ro   ©rr   rs   rt   r|   s      €ru   r}   zsolve.<locals>.<listcomp>W  s<   ø€ Ð\Ð\Ð\ÁÀÀ1�A�q—z’z (Ñ+Ô+×0Ò0°Ñ:Ô:Ð;Ð\Ð\Ð\rw   Úrational)r$  Ú_denominatorsc                óf   •— | j         r
 | j        ‰Ž S t          ˆfd„| j        D ¦   «         ¦  «        S )Nc              3  ó.   •K  — | ]} ‰|¦  «        V — Œd S r’   rq   )rr   r  Ú_has_piecewises     €ru   r¢   z0solve.<locals>._has_piecewise.<locals>.<genexpr>l  s-   øè è € Ð5Ð5¨�>�> !Ñ$Ô$Ð5Ð5Ð5Ð5Ð5Ð5rw   )Úis_PiecewiserÚ   r¤   rÎ   )r�   r(  r…   s    €€ru   r(  zsolve.<locals>._has_piecewisei  s@   ø€ ØŒ>ð 	#Ø�1”5˜'�?Ð"ÝÐ5Ð5Ð5Ð5¨a¬fÐ5Ñ5Ô5Ñ5Ô5Ð5rw   c                óL   — h | ]!}|                      t          ¦  «        D ]}|’ŒŒ"S rq   )rº   r;   )rr   r´   Úts      ru   r¥   zsolve.<locals>.<setcomp>v  s2   € ÐDÐDÐD�2 B§H¢HÕ-BÑ$CÔ$CÐDÐD˜qˆQÐDÐDÐDÐDrw   c                ó&   — | j         d         j        S ©Nr   )rÎ   Úis_Add©Úxs    ru   r  zsolve.<locals>.<lambda>x  s   € ¨1¬6°!¬9Ô+;€ rw   )Úbinaryc                ó,   •— g | ]}ˆfd „|D ¦   «         ‘ŒS )c                ó(   •— g | ]} |j         ‰Ž ¯|‘ŒS rq   )r
  ©rr   r{   r…   s     €ru   r}   z$solve.<locals>.<listcomp>.<listcomp>y  s'   ø€ Ð<Ð<Ð<˜Q z q¤z°7Ð';Ð<�qÐ<Ð<Ð<rw   rq   )rr   Úlr…   s     €ru   r}   zsolve.<locals>.<listcomp>y  s.   ø€ ÐSÐSÐSÀÐ<Ð<Ð<Ð< !Ð<Ñ<Ô<ÐSÐSÐSrw   rÀ   c                ó(   — g | ]}|j         d          ‘ŒS ©r   )rÎ   ©rr   r{   s     ru   r}   zsolve.<locals>.<listcomp>ƒ  s   € Ð2Ð2Ð2 q˜œ œÐ2Ð2Ð2rw   c                ó:   •— g | ]}|                      ‰¦  «        ‘ŒS rq   r  )rr   r´   Útreps     €ru   r}   zsolve.<locals>.<listcomp>†  s%   ø€ Ð+Ð+Ð+ 2ˆR�[Š[˜ÑÔÐ+Ð+Ð+rw   c                ó    •— ˆfd„| D ¦   «         S )Nc                óH   •‡— g | ]Št          ˆfd „‰D ¦   «         ¦  «        ‘ŒS )c                ó<   •— g | ]}‰                      ||¦  «        ‘ŒS rq   ry   )rr   r0  r{   s     €ru   r}   z6solve.<locals>.<lambda>.<locals>.<listcomp>.<listcomp>œ  s%   ø€ Ð$BÐ$BÐ$B°Q Q§U¢U¨1¨a¡[¤[Ð$BÐ$BÐ$Brw   ©Útupler4  s    @€ru   r}   z+solve.<locals>.<lambda>.<locals>.<listcomp>œ  s7   øø€ ÐOÐOÐOÈ�eÐ$BÐ$BÐ$BÐ$B¸'Ð$BÑ$BÔ$BÑCÔCÐOÐOÐOrw   rq   ©r‡   r…   s    €ru   r  zsolve.<locals>.<lambda>œ  s   ø€ ÐOÐOÐOÐOÈQÐOÑOÔO€ rw   c                ó    •— ˆfd„| D ¦   «         S )Nc                ó,   •— g | ]}|‰d                   ‘ŒS r7  rq   r4  s     €ru   r}   z+solve.<locals>.<lambda>.<locals>.<listcomp>¡  s!   ø€ Ð9Ð9Ð9°!  '¨!¤*¤Ð9Ð9Ð9rw   rq   r@  s    €ru   r  zsolve.<locals>.<lambda>¡  s   ø€ Ð9Ð9Ð9Ð9°qÐ9Ñ9Ô9€ rw   c                ó   — | d         S r-  rq   ©r‡   s    ru   r  zsolve.<locals>.<lambda>¤  s
   € ˜q œt€ rw   c                ó   — | S r’   rq   rD  s    ru   r  zsolve.<locals>.<lambda>¨  s   € ˜q€ rw   c                ó   — | d         S r-  rq   rD  s    ru   r  zsolve.<locals>.<lambda>®  s
   €  1 Q¤4€ rw   c                ó   — | S r’   rq   rD  s    ru   r  zsolve.<locals>.<lambda>²  s   €  1€ rw   c                óP   •— g | ]"}ˆfd „|                      ¦   «         D ¦   «         ‘Œ#S )c                óB   •— i | ]\  }}||                      ‰¦  «        “ŒS rq   r   )rr   rs   rt   r!  s      €ru   rv   z$solve.<locals>.<listcomp>.<dictcomp>¸  s+   ø€ ÐBÐBÐB±°°1�Q˜Ÿš˜{Ñ+Ô+ÐBÐBÐBrw   ©rƒ   )rr   r‡   r!  s     €ru   r}   zsolve.<locals>.<listcomp>¸  sF   ø€ ð ð ð Øð CÐBÐBÐB¸¿º¹	¼	ÐBÑBÔBð ð ð rw   c                ó<   •— g | ]}‰                      ||¦  «        ‘ŒS rq   ry   )rr   rs   r|   s     €ru   r}   zsolve.<locals>.<listcomp>Å  s'   ø€ Ð7Ð7Ð7¨!�8—<’<  1Ñ%Ô%Ð7Ð7Ð7rw   c                ój   •— i | ]/\  }}‰                      ||¦  «        |                     ‰¦  «        “Œ0S rq   )rz   ro   r#  s      €ru   rv   zsolve.<locals>.<dictcomp>Ç  sI   ø€ ð /ð /ð /Ù˜!˜Qð $Ÿ<š<¨¨1Ñ-Ô-¨q¯vªv°hÑ/?Ô/?ð /ð /ð /rw   Úcheck)Úexponentc              3  ó@   K  — | ]\  }}t          |fi |j        ¤ŽV — Œd S r’   )r
   Úassumptions0)rr   Úsymbrä   s      ru   r¢   zsolve.<locals>.<genexpr>Ú  sM   è è € ð 8ð 8Ù'˜d Cõ ,¨CÐEÐE°4Ô3DÐEÐEð 8ð 8ð 8ð 8ð 8ð 8rw   zl
                	Warning: assumptions concerning following solution(s)
                cannot be checked:
	ú, c              3  ó4   K  — | ]}t          |¦  «        V — Œd S r’   )Ústrr  s     ru   r¢   zsolve.<locals>.<genexpr>ç  s(   è è € Ð3Ð3 Q�#˜a™&œ&Ð3Ð3Ð3Ð3Ð3Ð3rw   c                óF   ‡— g | ]Šˆfd „t          ‰¦  «        D ¦   «         ‘ŒS )c                ó"   •— i | ]}|‰|         “ŒS rq   rq   )rr   rs   r‡   s     €ru   rv   z$solve.<locals>.<listcomp>.<dictcomp>ô  s   ø€ Ð1Ð1Ð1 �Q˜˜!œÐ1Ð1Ð1rw   )r!   r  s    @ru   r}   zsolve.<locals>.<listcomp>ô  s4   ø€ ÐDÐDÐD°aÐ1Ð1Ð1Ð1¥g¨a¡j¤jÐ1Ñ1Ô1ÐDÐDÐDrw   ©Úkeyc              3  óX   K  — | ]%}t          |                     ¦   «         ¦  «        V — Œ&d S r’   )r?  rÕ   r8  s     ru   r¢   zsolve.<locals>.<genexpr>	  s0   è è € Ð$GÐ$G¸¥U¨1¯6ª6©8¬8¡_¤_Ð$GÐ$GÐ$GÐ$GÐ$GÐ$Grw   c                óH   •‡— h | ]Št          ˆfd „‰D ¦   «         ¦  «        ’ŒS )c                ó<   •— g | ]}‰                      ||¦  «        ‘ŒS rq   ry   )rr   Úkir‡   s     €ru   r}   z#solve.<locals>.<setcomp>.<listcomp>
  s%   ø€ Ð0Ð0Ð0¨�a—e’e˜B ‘m”mÐ0Ð0Ð0rw   r>  )rr   r‡   rs   s    @€ru   r¥   zsolve.<locals>.<setcomp>
  s7   øø€ ÐDÐDÐD°a�uÐ0Ð0Ð0Ð0¨aÐ0Ñ0Ô0Ñ1Ô1ÐDÐDÐDrw   )dÚinequalitiesrì   Ú
setdefaultrÑ   rz   ra   r~   r\   r“   Úunionr©   r%   r€   r   r˜   Úskipr   r!   rb   ri   r`   Úpopr   r#   Ú	enumerater   r    rÎ   rÐ   rÊ   r'   rÒ   r   rÌ   Ú	is_SymbolrÏ   ÚNotImplementedErrorr   rP  rÞ   rÅ   rU   rÉ   ÚreplaceÚ	is_MatrixÚas_explicitÚextendÚZeror¡   ÚallÚas_real_imagrº   r2   r3   r4   r6   r¤   r1   ÚfindrÚ   Úis_realr  r‚   ÚImaginaryUnitr‹   rÈ   r•   r–   rÔ   r:   r.  Úis_Mulr�   rÙ   ÚfuncrÇ   Úziprƒ   r   rC   rœ   r9   re   rÓ   r   rL   r  rZ   rM   Ú_solve_undeterminedÚ_solveÚ_solve_systemr  r   Ú_remove_duplicate_solutionsr   ÚjoinÚsortr"   rd   ):r™   r…   rµ   rì   ÚhintsÚdefaultrñ   rÅ   Úas_setÚbare_fÚordered_symbolsr´   r«   r¬   Ú_symbolsr{   ÚLÚRÚfreeiÚfrÚwasr�   ÚfreimÚirfÚsymsetÚnewfÚokrè   ÚfloatsÚtargsr˜   Úotherr+  r  ÚindÚdeprÝ   r—   ÚsolutionÚlinearÚas_dictÚtuple_formatÚunpackr¶   rM  Úgot_NoneÚno_Falsert   r(  rø   rý   r  rs   r!  rÊ   r‡   r|   r:  s:    `                                              @@@@@@@@@@ru   Úsolver”  j  s  øøøøøøøøøøø€ ð` 2Ð1Ð1Ð1Ð1Ð1ð /€EØ€GØð Cð CˆØ×"Ò" 1¥d¨5¯9ª9°Q¸Ñ+@Ô+@Ñ&AÔ&AÑBÔBˆˆð �yŠy˜ UÑ+Ô+€Hð �9Š9�V˜UÑ#Ô#€Dð �YŠY�u˜eÑ$Ô$€Fõ ˜!‘”ˆ_€Fð ‡y‚y�˜$ÑÔÐ+Ø�yŠy˜ tÑ,Ô,ð 	PÝÐNÑOÔOÐOØ‡y‚y�˜uÑ%Ô%ð 5¨&ð 5Ý�ð %3ñ 4ô 4ñ 5ô 5ð 	5ð=ð =ð =à;Ð;Ð;Ð;¨q°'¨lÐ;Ñ;Ô;�J€A€wð
 €OØð à•#‘%”%”+Ð<Ð<¸!Ð<Ñ<Ô<Ð=ˆÝˆw‰<Œ<�#˜a™&œ&Ò Ð Øð #ð #�Ý(¨Ñ,Ô,�Øð #ð #�AÝ! !¥\Ñ2Ô2ð #Ø%ð 1Ø,0˜E &™MØŸš A™œ˜ØŸš™
œ
˜
øð#ð  ˆÝ•w˜wÑ'Ô'Ñ(Ô(ˆˆåˆw‰<Œ<˜1ÒÐ¥¨'°!¬*Ñ!5Ô!5ÐØ˜a”jˆGØ!ð /¥k°'Ý -ð'/ñ '/ô '/ˆå�˜W™œÑ&Ô&ˆÝˆx‰=Œ=�C ™LœLÒ(Ð(Ø#ˆOÝ�7 7Ñ+Ô+Ñ,Ô,ˆGˆGàˆGõ ˆ7�|„|•s�3˜w™<œ<Ñ(Ô(Ò(Ð(ÝÐ2Ñ3Ô3Ð3à�iŠi˜	¥3¡5¤5Ñ)Ô)€GØð ;Ý�g�tÑ$Ô$ð 	 Ø�iˆGØ•#‘%”%”+ÐIÐI½ÀÑ8HÔ8HÐIÑIÔIÐJˆØ:Ð:Ð:Ð:˜gÐ:Ñ:Ô:ˆõ �!•TÑÔð .Ø-Ð-˜Ð-Ñ-Ô-ˆõ ˜1‘”ð D'ñ D'‰ˆˆ2Ý�b�2�r˜(Ñ#Ô#ñ 	Ø%Ð)LÐ)LÀBÄGÐ)LÑ)LÔ)LÐLÐLØ”V˜bœf‘_��à”w‘��1Ý˜a¥Ñ-Ô-ð  Ø˜a�q�AÝ˜a¥Ñ-Ô-ð >Ý! "¥bÑ)Ô)ð Ø˜B˜Ø”ð 
Ø#$­¬ < <˜a˜R˜R°Q˜˜Øœð Ø ˜˜˜Øœð ¨A¨2¬.ð Ø !˜r˜	˜	˜	å1µ*ð >ñ 3ô 3ñ ô ð õ   ¥BÑ'Ô'ð >Ý˜RœV b¤f W°uÐ=Ñ=Ô=�BØˆAˆa‰Dð Ôð 	;Ý�7‰|Œ|˜qÒ Ð Ý Ð!JÑKÔKÐKØð =˜ œ
Ô/ð =Ý”�jð *.à07¸´
ñ*;ñ <ô <ñ =ô =ð =ð 'Ð& q°'Ð:Ñ:Ô:Ð:Ð:Ð:õ �b�$ÑÔð 	 Ø—:’:‘<”<ˆAˆa‰Dð �Œt�|Š|ð !ð !ð !ð !Ø":Ð":ñ<ô <ˆˆ!‰ð ˆQŒ4Œ>ð 		ðØ˜”t×'Ò'Ñ)Ô)��!‘�øÝð ð ð Ý ØGñô ð ðøøøð ˆFØ�HŠH•T˜!˜Aœ$‘Z”ZÑ Ô Ð Ý”6ˆAˆa‰Dð �!”Ô!ˆØð 	'•SÐMÐMÀuÐMÑMÔMÑMÔMð 	'Ø�q”T×&Ò&Ñ(Ô(‰FˆB�à�A”$—*’*�R¥¥S­%Ñ0Ô0ˆCØð '�bð '˜R 2šX˜X­cð 2Ið 2Ið 2Ið 2IØ@BÀB¸xð2Iñ 2Iô 2Iñ /Iô /I˜Xàð #Ø"�FØ! 2˜h��!�Q˜‘U�(‘ùõ Ð
;Ð
;¸Ð
;Ñ
;Ô
;Ñ;Ô;ð Øð 	Ø•s‘u”u�9ÐØˆ	å˜1‘”ð ð ‰ˆˆ2ð	ØˆCØ—’�Cð "ð "ð "ð "ñ ô ˆBð �bŠyˆyØð	ð —’�‘”ð 	5ð 	5ˆAØˆqŒu�gˆð 5Ý)ð +0Ø23ñ+4ñ 5ô 5ð 5ð5ð
 �ZŠZ�ÐJÐJÑKÔKˆð ˆˆ!‰ˆð /Ð.˜!Ð.Ñ.Ô.€EØð !ØˆØð 	?ð 	?ˆAØŒyð ˜AœNð ØåÐ8Ð8Ð8Ð8°%Ð8Ñ8Ô8Ñ8Ô8ð ?Ø—
’
˜A�r !™uœu¥q¤µr¸!±u´uÑ'<Ñ<Ð=Ñ>Ô>Ð>øØð 	!Øð /ð /‘��3Ø7Ð7Ð7Ð7Ð7°QÐ7Ñ7Ô7¸1¸s¹7¸)ÑC�Ø—’¥ 1¡¤¥r¨!¡u¤u˜~Ñ.Ô.Ð.Ð.Øð Ø�Ø ˆE�&‰Mõ -¨Q°Ñ8Ô8Ñ€A€w�å�‰\Œ\€Fð €DØð ð ˆð ˆØŒ?˜VÑ#ð 	ØˆBˆBàŒ|ð Ø”<ð Ø”zð !Ø Ø�I�I�IØ��à—>’>Ñ#Ô#ð Ø�BØð 	Ø�KŠK˜‰OŒOˆOøØð Øð 	"Ø�C™EœE�>Ð!Øˆ	Ø€AØõ
 ‰5Œ5€DÝ‘%”%€KØð ð ˆÝ  Ñ$Ô$ˆØð 	ð 	ˆAÝ˜a¥Ñ&Ô&ð ­*°Q½	Ñ*BÔ*Bð ØÝ˜Q¥Ñ%Ô%ð Øœðà˜�K�KØ”Hð  Ø !¤ð  à”Hð  à%-ð  ð ”Mð  ð +3ð  ð 9:¼ÅrÍ2ÀhÐ8NÐ8NØØ˜$��Ø—’˜‘”�Ø”> FÑ*ð Ø—O’O AÑ&Ô&Ð&Ð&àØ�HŠH‰JŒJˆJˆJð!	ð" 	Ý•t�C Ð-KÐ-K¸{Ð-KÑ-KÔ-KÑLÔLÑMÔMÑNÔN€KØ*Ð*Ð*Ð*¨Ð*Ñ*Ô*€Að ]Ð\Ð\Ð\È×HYÒHYÑH[ÔH[Ð\Ñ\Ô\€Kð €FØ‡y‚y�˜TÑ"Ô"¨%Ð/Ð/Ý˜q‘\”\ð 	4ð 	4‰EˆAˆrØ�vŠv•e‰}Œ}ð 4Ø�Ý  ¨dÐ3Ñ3Ô3��!‘øõ *¨!¨A¬$°Ñ8Ô8€Eˆ/Ñð6ð 6ð 6ð 6ð 6ð 6õ ˜1‘”ð &ð &‰ˆˆ2Øˆ>˜"ÑÔð 	&Ý! "Ñ%Ô%ˆAˆa‰Døð EÐD˜ÐDÑDÔD€EÝ
ˆ5�z„z�A‚~�~Ý˜%Ð!;Ð!;ÀDÐIÑIÔI‰
ˆˆUØSÐSÐSÐSÀsÈEÀlÐSÑSÔS‰
ˆˆUØˆØð 	Cð 	CˆAØ”�q”	ˆAØ'�qÔ'¨Ð1‰HˆC�Ø�gˆ~ˆ~ # ¨  à#&¤=Ð9•E‘G”G�G°c�Ý˜qŸvšv c¨A¡g™œÑ/Ô/×8Ò8¸!¸S¸ÑBÔB��Q‘øØð 	(•S˜‘Z”Z 1’_�_Ý7:¸5±z´zÀA²~°~•3Ð2Ð2¨EÐ2Ñ2Ô2Ð3Ð3È5ÐQRÌ8Ì=ÐYZÔK[ˆDØð (ð (�Ý˜q $™-œ-��Q‘�Ø+Ð+Ð+Ð+¨Ð+Ñ+Ô+ˆð
 ð >ØˆÝˆw‰<Œ<˜1ÒÐÝ*¨1¨Q¬4°¸%Ñ@Ô@ˆHØð 	7Ý˜a œdÐ6 WÐ6Ð6Ð6°Ð6Ð6ˆHøå(¨¨GÐ=Ð=°uÐ=Ð=Ñˆ�Ý�‰>Œ>�TÐ!Ð!Ð!Ð!ØÐ>�4 ¨¤Ñ,Ô,µÐ4Ð4Ð4°hÑ4Ô4Ð4ð
 �iŠi˜ Ñ&Ô&€Gð PÐOÐOÐO€LØð �&ð ØˆˆØ	ð Ýˆw‰<Œ<˜1ÒÐØ9Ð9Ð9Ð9ˆFˆFÝ�‰]Œ]˜aÒÐ¥C¨°¬Ñ$4Ô$4½¸G¹¼Ò$DÐ$Dà#�^ˆFˆFØð 	!Ø!ˆFˆFà �[ˆFˆFàð 
	Øð %�#˜h™-œ-¨1Ò,Ð,ð (˜��Ø ð %Ø%��à$˜��àˆFð ð •t˜H‘~”~­Ð-Ð-ðð ð ð Øðñ ô ˆð ð /Ø7Ð7Ð7Ð7¨wÐ7Ñ7Ô7ˆÝ Ñ)Ô)ð 	/ð 	/‰FˆAˆsð/ð /ð /ð /Ø"%§)¢)¡+¤+ð/ñ /ô /ˆH�Q‰KˆKð �IŠI�g˜tÑ$Ô$€Eð ð 9�(ð 9˜uŸyšy¨°TÑ:Ô:ÐBÝ˜(¨UÐ3Ñ3Ô3ˆå.¨xÑ8Ô8ˆàð 6�ð 6Ø�yŠy˜ Ñ'Ô'ˆØˆØˆØð 	%ð 	%ˆCÝð 8ð 8Ø+.¯9ª9©;¬;ð8ñ 8ô 8ñ 8ô 8ˆAà�EˆzˆzØØ�OŠO˜CÑ Ô Ð ØˆyØ—’ Ñ$Ô$Ð$øàˆØð 	6�Hð 	6ÝŒM�*ð &/ð —	’	Ð3Ð3¨(Ð3Ñ3Ô3Ñ3Ô3ñ&4ñ 5ô 5ñ 6ô 6ð 6ð ð Øð 	"Ø�C™EœE�>Ð!Øˆ	ð ð ,ØDÐD¸8ÐDÑDÔDˆØ�ŠÕ*ˆÑ+Ô+Ð+àð  �gð  Øˆv�hÑÔÐàð Øˆð ð KØˆˆõ •��WÐ$GÐ$G¸hÐ$GÑ$GÔ$GÑGÔGÑHÔHÑIÔIÑJÔJˆØÐDÐDÐDÐD¸8ÐDÑDÔDÐDÐDs   Õ#VÖVc           	     óž   — | j         t          |¦  «        z
  r3t          | |fi t          |dd¬¦  «        ¤Ž}t	          |¦  «        dk    r|S dS dS )aÛ  solve helper to return a list with one dict (solution) else None

    A direct call to solve_undetermined_coeffs is more flexible and
    can return both multiple solutions and handle more than one independent
    variable. Here, we have to be more cautious to keep from solving
    something that does not look like an undetermined coeffs system --
    to minimize the surprise factor since singularities that cancel are not
    prohibited in solve_undetermined_coeffs.
    TN)rÇ   r“   rn   )r¡   r“   Úsolve_undetermined_coeffsrÇ   r©   )Úgr…   rµ   r¶   s       ru   rr  rr    sc   € ð 	„~�˜G™œÑ$ð Ý'¨¨7ÐWÐWµd¸5ÀtÐQUÐ6VÑ6VÔ6VÐWÐWˆÝˆs‰8Œ8�qŠ=ˆ=ØˆJðð àˆ=rw   c           	     ó¼  ‡‡4‡5‡6‡7‡8‡9‡:‡;‡<— d}t          |¦  «        dk    �r9g }t          ¦   «         }t          ¦   «         }g }|D ]˜}t          | |g¬¦  «        \  }	}
|	|k    rd‰                     dd¦  «        rt	          |
¦  «        }
|
j        }||z  rŒO||z  }|                     |	¦  «         |                     |	|
i¦  «         Œ�|	r|                     |¦  «         Œ™|s|S |D ]a}	 t          | |fi ‰¤ŽŠ9‰9D ]=}||         j        |z  rŒ|                     |¦  «         |                     |¦  «         Œ>ŒR# t          $ r Y Œ^w xY w|r|S t          || z  ¦  «        ‚|d         Š:|  
                    ˆ:fd„d„ ¦  «        } ‰                     d	d¦  «        x‰d	<   x}}| j        rÉt          ¦   «         }| j        D ]g}|t          j        t          j        t          j        hv rt          ¦   «         } n1t%          |‰:fi ‰¤ŽŠ9|                     t          ‰9¦  «        ¦  «         Œhˆ:fd
„|D ¦   «         }|r3‰                     dt)          | |¦  «        ¦  «        Š6ˆ6ˆfd„|D ¦   «         }d}d‰d<   �n+| j        �rut          ¦   «         }t-          d„ | j        D ¦   «         ¦  «        r|                      ¦   «         } dx}}| j        D �]\  }}t/          ||¦  «        }t/          || ¦  «        }|j        r7|                     ¦   «         dk    rt          t3          d|z  ¦  «        ¦  «        ‚t%          |‰:fi ‰¤Ž}|D ]¤}||v rŒ	 |                     ‰:|¦  «        }
t7          |
dd¦  «        }|� |dd„ ¬¦  «        }
n# t8          $ r Y ŒLw xY w|
dk    rŒW|
dk    r|                     |¦  «         Œs|                     t;          ||
ft          j        df¦  «        ¦  «         Œ¥�Œˆ:fd„|D ¦   «         S t          | |¬¦  «        \  Š7}‰7j        s|t          j        u rg S ‰7j        r*‰                     dd¦  «        rt	          |¦  «        }‰7|igS d}‰7j         sœˆ:fd„‰7 !                    tD          ¦  «        D ¦   «         }t          |¦  «        dk    rc|d         }| #                    ‰:¦  «        d          $                    ¦   «         d         }|‰:k    r"	 tK          ‰7|¦  «        }n# tL          $ r Y nw xY wd}d}	 |€tK          ‰7¦  «        }|€tO          d‰7z  ¦  «        ‚nB# tP          $ r5 t	          ‰7¦  «        }|‰7k    rt          |‰:fi ‰¤ŽcY S tO          d¦  «        ‚w xY wˆ:fd„|j)        D ¦   «         }d„ Š4t          |¦  «        dk    �rktU          tW          ˆ4fd„|D ¦   «         Ž ¦  «        \  }}t          |¦  «        }t          |¦  «        dk    stY          d„ |D ¦   «         ¦  «        �sXd„ |D ¦   «         } d„ | D ¦   «         Š<| ‰<z
  }!|!�s{t          |  -                    ‰<¦  «        ¦  «        dk    �rTd}"‰7j         �rt          ‰7j        ¦  «        dk    rë‰7j        }#ˆ<fd „|#D ¦   «         xŠ;\  }$}%tY          d!„ ‰;D ¦   «         ¦  «        r¸d"„ ‰;D ¦   «         \  }$}%t]          |$t^          ¦  «        r|%|$}%}$|#ddd#…         }#t]          |$t`          ¦  «        rpt]          |%t^          ¦  «        r[|$j        d         |%j        d         k    r?tc          |#d         |#d         z  ¦  «        dz    2                    ¦   «         \  }"}&|&j3        sd}"|"€'ti          ‰7¦  «         5                    tl          ¦  «        }"|"‰7k    rd‰d	<   t          |"‰:fi ‰¤Ž}|‰d	<   |du r®| r¬tU          to          | ¦  «        ¦  «        } | d         }'tq          d$¦  «        Š;‰7                     |'‰;¦  «        }(|( 9                    ‰:¦  «        sNt          |(‰;fi ‰¤Ž})tU          to          t%          ‰;|'z
  ‰:fi ‰¤Ž¦  «        ¦  «        d         Š5ˆ5ˆ:fd%„|)D ¦   «         }|du rd&|z  }�n]|                     ¦   «         }*tq          d$¦  «        Š;t%          |*‰;z
  ‰:fi ‰¤ŽŠ8t]          |*tt          tv          f¦  «        r`d'„ }+‰7 
                    d(„ |+¦  «                             |*‰;¦  «        }(|( 9                    ‰:¦  «        st          |(‰;fi ‰¤ŽŠ9ˆ9ˆ:fd)„‰8D ¦   «         }�n«t          |¦  «        dk    �r—tK          ‰7|d         d¬*¦  «        }‰                     d+d¦  «        �shdŠ9| <                    ¦   «         },d‰d+<   d,}-ˆfd-„|-D ¦   «         }.t{          |fi |.¤ŽŠ9t}          ‰9 ?                    ¦   «         ¦  «        |,k     rX	 | @                    ¦   «         Š9nc# t          $ r5 ‰                     d.d¦  «        st          t3          d/¦  «        ¦  «        ‚Y n%w xY wtU          ‰9 A                    ¦   «         ¦  «        Š9‰9�€|jB        }*|*‰:k    rC	 tq          d$¦  «        Š;t%          |*‰;z
  ‰:fi ‰¤ŽŠ8ˆ9ˆ;fd0„‰8D ¦   «         Š9n# t          $ r dŠ9Y nw xY wd}‰9�,t          ‰9¦  «        dk    r‰                     dd¦  «        ‰d<   ‰9�ˆ:fd1„‰9D ¦   «         }|du rØ‰                     d2d¦  «        rÂ	 t‡          ‰7‰:¦  «        }*n# tN          t          f$ r d}*Y nw xY w|*r”|*\  }/}0|0r4|0\  }1}2t%          |2‰:fi ‰¤Žd         Š8ˆ8fd3„t          |/|1fi ‰¤ŽD ¦   «         }3n/	 t          t%          |/‰:fi ‰¤Ž¦  «        }3n# t          $ r d}3Y nw xY w|3�'ˆ:fd4„|3D ¦   «         }‰                     dd¦  «        ‰d<   n	 |du rF‰                     d+d¦  «         	 t‰          ‰7‰:fi ‰¤ŽŠ9‰9�ˆ:fd5„‰9D ¦   «         }n# tL          $ r Y nw xY w|du r't          d6 E                    ||| z  g¦  «        ¦  «        ‚t�          |¦  «        }‰                     dd¦  «        r d7„ |D ¦   «         }t�          |¦  «        }d‰d<   |rt)          | |¦  «        Š6ˆ6ˆfd8„|D ¦   «         }|rˆ7ˆfd9„|D ¦   «         }|S ):a=  Return a checked solution for *f* in terms of one or more of the
    symbols in the form of a list of dictionaries.

    If no method is implemented to solve the equation, a NotImplementedError
    will be raised. In the case that conversion of an expression to a Poly
    gives None a ValueError will be raised.
    z2No algorithms are implemented to solve equation %srn   r  r>   Tr   c                óX   •— t          | t          ¦  «        o|                      ‰¦  «        S r’   )r€   r7   rÚ   )r�   rß   s    €ru   r  z_solve.<locals>.<lambda>a  s    ø€ �J q­(Ñ3Ô3ÐE¸¿º¸f¹¼€ rw   c                ó    — t          | ¦  «        S r’   )r   rŽ   s    ru   r  z_solve.<locals>.<lambda>b  s   € •+˜a‘.”.€ rw   rM  c                ó   •— g | ]}‰|i‘ŒS rq   rq   ©rr   rt   rß   s     €ru   r}   z_solve.<locals>.<listcomp>r  s   ø€ Ð.Ð.Ð. !�6˜1�+Ð.Ð.Ð.rw   r%  c                óN   •‡— g | ] Št          ˆˆfd „‰D ¦   «         ¦  «        °‰‘Œ!S )c              3  ó4   •K  — | ]}t          |‰fi ‰¤ŽV — Œd S r’   r²   )rr   r­   rµ   r‡   s     €€ru   r¢   z$_solve.<locals>.<listcomp>.<genexpr>y  sE   øè è € ð ð °c�  aÐ1Ð1¨5Ð1Ð1ð ð ð ð ð ð rw   r£   )rr   r‡   rš   rµ   s    @€€ru   r}   z_solve.<locals>.<listcomp>x  sc   øø€ ð ð ð ˜AÝð ð ð ð ð Øðñ ô ñ ô ð�að ð ð rw   Fc              3  ó*   K  — | ]\  }}|j         V — Œd S r’   )r–   )rr   r�   Úcs      ru   r¢   z_solve.<locals>.<genexpr>‚  s(   è è € Ð,Ð,™T˜Q ˆqŒyÐ,Ð,Ð,Ð,Ð,Ð,rw   az  
                    An expression is already zero when %s.
                    This means that in this *region* the solution
                    is zero but solve can only represent discrete,
                    not interval, solutions. If this is a spurious
                    interval it might be resolved with simplification
                    of the Piecewise conditions.Ú_eval_simplifyNrÀ   c                ó   — dS ©Nrn   rq   r/  s    ru   r  z_solve.<locals>.<lambda>Ÿ  s   € Àa€ rw   )ÚratioÚmeasurec                ó   •— g | ]}‰|i‘ŒS rq   rq   )rr   Úrrß   s     €ru   r}   z_solve.<locals>.<listcomp>­  s   ø€ Ð,Ð,Ð, �˜�Ð,Ð,Ð,rw   c                ó&   •— g | ]}‰|j         v ¯|‘ŒS rq   r    )rr   r{   rß   s     €ru   r}   z_solve.<locals>.<listcomp>½  s/   ø€ ð -ð -ð -˜aØ˜Qœ^Ð+Ð+ð Ø+Ð+Ð+rw   Ú zcould not convert %s to Polyz#expression appears to be a constantc                ó>   •— g | ]}|                      ‰¦  «        ¯|‘ŒS rq   )rÚ   )rr   r—  rß   s     €ru   r}   z_solve.<locals>.<listcomp>ß  s(   ø€ Ð6Ð6Ð6�a¨¯ª¨f©¬Ð6�Ð6Ð6Ð6rw   c                óÞ   — |                       ¦   «         \  }}|j        r	||j        fS |j        s| dfS |                     ¦   «         \  }}|j        r|t
          j        ur||z  |j        fS | dfS )z”Return (b**e, q) for x = b**(p*e/q) where p/q is the leading
            Rational of the exponent of x, e.g. exp(-2*x/3) -> (exp(x), 3)
            rn   )Úas_base_exprÛ   Úqro  Úas_coeff_Mulr   r¦   )r0  Úbr�   r   Úees        ru   Ú
_as_base_qz_solve.<locals>._as_base_qá  s}   € ð —=’=‘?”?‰DˆAˆqØŒ}ð Ø˜!œ#�v�Ø”8ð Ø˜!�t�Ø—N’NÑ$Ô$‰EˆAˆrØŒ}ð " ­!¬%  Ø˜"‘u˜aœc�zÐ!Ø�a�4ˆKrw   c                ó&   •— g | ]} ‰|¦  «        ‘ŒS rq   rq   )rr   r—  r±  s     €ru   r}   z_solve.<locals>.<listcomp>ú  s!   ø€ Ð"?Ð"?Ð"?°Q : :¨a¡=¤=Ð"?Ð"?Ð"?rw   c              3  ó"   K  — | ]
}|d k    V — ŒdS ©rn   Nrq   )rr   r­  s     ru   r¢   z_solve.<locals>.<genexpr>ý  s&   è è € Ð(<Ð(<°A¨¨aªÐ(<Ð(<Ð(<Ð(<Ð(<Ð(<rw   c                ó    — h | ]}|j         ¯	|’ŒS rq   )rÙ   )rr   r¯  s     ru   r¥   z_solve.<locals>.<setcomp>þ  s   € Ð;Ð;Ð;˜q¨Q¬]Ð;˜Ð;Ð;Ð;rw   c                ó<   — h | ]}t          |t          ¦  «        ¯|’ŒS rq   )r€   r;   r  s     ru   r¥   z_solve.<locals>.<setcomp>   s7   € ð :ð :ð :˜aÝ˜qÕ"7Ñ8Ô8ð:˜ð :ð :ð :rw   c                ój   •— g | ]/}|                      t          ¦  «                             ‰¦  «        ‘Œ0S rq   )rº   r   Úintersection)rr   r{   Útrigs     €ru   r}   z_solve.<locals>.<listcomp>  sH   ø€ ð $2ð $2ð $2Ø&'ð %&§G¢G­HÑ$5Ô$5×$BÒ$BØ ñ%"ô %"ð $2ð $2ð $2rw   c              3  ó<   K  — | ]}t          |¦  «        d k    V — ŒdS r´  ©r©   r8  s     ru   r¢   z_solve.<locals>.<genexpr>
  s,   è è € Ð6Ð6¨q�s 1™vœv¨š{Ð6Ð6Ð6Ð6Ð6Ð6rw   c                ó6   — g | ]}|                      ¦   «         ‘ŒS rq   )ra  r8  s     ru   r}   z_solve.<locals>.<listcomp>  s    € Ð#7Ð#7Ð#7° A§E¢E¡G¤GÐ#7Ð#7Ð#7rw   r¼   r+  c                ó>   •— g | ]}‰‰                      |¦  «        i‘ŒS rq   r   )rr   r¶   Úcv_invrß   s     €€ru   r}   z_solve.<locals>.<listcomp>/  s*   ø€ Ð!PÐ!PÐ!PÀ 6¨6¯;ª;°sÑ+;Ô+;Ð"<Ð!PÐ!PÐ!Prw   zmultiple generators %sc                ór   — |                       ¦   «         \  }}t          |¦  «        }t          ||z  ¦  «        S r’   )r¬  r   r   )r¬   r¯  r�   s      ru   Ú_expandz_solve.<locals>._expandD  s0   € Ø Ÿ}š}™œ™˜˜1Ý& q™MœM˜Ý/°°1±Ñ5Ô5Ð5rw   c                ó:   — | j         pt          | t          ¦  «        S r’   )r�   r€   r)   rö   s    ru   r  z_solve.<locals>.<lambda>I  s   €  !¤(Ð"@­j¸½CÑ.@Ô.@€ rw   c                óH   •— g | ]}‰D ]}‰|                      |¦  «        i‘ŒŒS rq   r   )rr   r{   r‡   Úsolnrß   s      €€ru   r}   z_solve.<locals>.<listcomp>M  s5   ø€ Ð!QÐ!QÐ!Q¸!ÈDÐ!QÐ!QÀq 6¨1¯6ª6°!©9¬9Ð"5Ð!QÐ!QÐ!QÐ!Qrw   )Ú	compositeÚtsolverí   c                ó<   •— i | ]}|‰                      |¦  «        “ŒS rq   ry   )rr   Úhrµ   s     €ru   rv   z_solve.<locals>.<dictcomp>`  s%   ø€ Ð:Ð:Ð:¨q˜1˜eŸiši¨™lœlÐ:Ð:Ð:rw   Ú
incompletea  
    Neither high-order multivariate polynomials
    nor sorting of EX-domain polynomials is supported.
    If you want to see any results, pass keyword incomplete=True to
    solve; to see numerical values of roots
    for univariate expressions, use nroots.
    c                óF   •— h | ]}‰D ]}|                      ‰|¦  «        ’ŒŒS rq   r   )rr   r{   r‡   rÃ  r+  s      €€ru   r¥   z_solve.<locals>.<setcomp>  s2   ø€ Ð#LÐ#LÐ#L°QÀtÐ#LÐ#LÀ! A§F¢F¨1¨a¡L¤LÐ#LÐ#LÐ#LÐ#Lrw   c                ó   •— g | ]}‰|i‘ŒS rq   rq   rœ  s     €ru   r}   z_solve.<locals>.<listcomp>�  s   ø€ Ð8Ð8Ð8¨a˜v q˜kÐ8Ð8Ð8rw   Ú_unradc                ó:   •— h | ]}‰                      |¦  «        ’ŒS rq   r   )rr   ÚxiÚinvs     €ru   r¥   z_solve.<locals>.<setcomp>   s#   ø€ ÐKÐKÐK¨2˜#Ÿ(š( 2™,œ,ÐKÐKÐKrw   c                ó   •— g | ]}‰|i‘ŒS rq   rq   rœ  s     €ru   r}   z_solve.<locals>.<listcomp>§  s   ø€ Ð6Ð6Ð6¨a˜v q˜kÐ6Ð6Ð6rw   c                ó   •— g | ]}‰|i‘ŒS rq   rq   rœ  s     €ru   r}   z_solve.<locals>.<listcomp>´  s   ø€ Ð4Ð4Ð4¨!˜6 1˜+Ð4Ð4Ð4rw   ú
c                ó,   ‡— g | ]Šˆfd „‰D ¦   «         ‘ŒS )c                óF   •— i | ]}|‰|                               ¦   «         “ŒS rq   )r>   )rr   rs   r›   s     €ru   rv   z%_solve.<locals>.<listcomp>.<dictcomp>¿  s'   ø€ Ð1Ð1Ð1¨!�1�a˜”d—m’m‘o”oÐ1Ð1Ð1rw   rq   )rr   r›   s    @ru   r}   z_solve.<locals>.<listcomp>¿  s.   ø€ ÐBÐBÐB°aÐ1Ð1Ð1Ð1¨qÐ1Ñ1Ô1ÐBÐBÐBrw   c                óN   •‡— g | ] Št          ˆˆfd „‰D ¦   «         ¦  «        °‰‘Œ!S )c              3  ó4   •K  — | ]}t          |‰fi ‰¤ŽV — Œd S r’   r²   ©rr   r›   rµ   r§  s     €€ru   r¢   z$_solve.<locals>.<listcomp>.<genexpr>Ë  sI   øè è € ð )ð )Øõ # 1 aÐ1Ð1¨5Ð1Ð1ð )ð )ð )ð )ð )ð )rw   r£   ©rr   r§  rš   rµ   s    @€€ru   r}   z_solve.<locals>.<listcomp>Ê  sc   øø€ ð *ð *ð *˜Ýð )ð )ð )ð )ð )Ø#'ð)ñ )ô )ñ )ô )ð*�!ð *ð *ð *rw   c                ó4   •— g | ]}t          ‰|fi ‰¤Žd u¯|‘ŒS ©Fr²   )rr   r§  Úf_numrµ   s     €€ru   r}   z_solve.<locals>.<listcomp>Ï  s?   ø€ ð <ð <ð <˜Ý˜5 !Ð-Ð- uÐ-Ð-°UÐ:Ð:ð Ø:Ð:Ð:rw   )Gr©   r“   Úsolve_linearrz   r>   r¡   r˜   r‚   rs  rd  re  ra  ro  rÎ   r   ÚNegativeInfinityÚComplexInfinityÚInfinityÚ_vsolver§   rœ   r)  r¤   r&   r–   r\   ro   r�   Ú	TypeErrorr:   ÚNaNrc  r.  rº   r   rÓ   r¬  rU   rY   r~   rX   Úgensr   rq  rj  r¸  r€   r+   r,   rK   r×   r•   rJ   r  r-   r!   r   rÚ   r   r)   ÚdegreerR   ÚsumÚvaluesÚ	all_rootsrÕ   ÚgenÚunradÚ_tsolverv  ru  )=r™   r…   rµ   Únot_impl_msgÚnonlin_sÚgot_sÚrhs_sÚresultr‡   rÍ  rt   Úvfreer¶   Ú	checkdensrM  ÚmÚcondÚnegÚexprÚcndÚ
candidatesÚ	candidater¡  ÚpolyÚadd_argsrç  Úspartrà   Úsimplified_frâ  ÚbasesÚqsÚfuncsrŠ  r†  Ú_argsr  r¯  Ú_dÚf1ÚftryÚcv_solsÚurÀ  Údegrx  Úsolversrª   ÚcovÚisymÚieqÚrvr±  r¾  rš   rÚ  rÎ  rÃ  rß   r+  r¹  s=     `                                                 @@@@@@@@@ru   rs  rs    sÛ  øøøøøøøøøø€ ð H€Lå
ˆ7�|„|�qÒÑð ˆÝ‘”ˆÝ‘”ˆØˆØð 	#ð 	#ˆAÝ  ¨Q¨CÐ0Ñ0Ô0‰EˆB�Ø�QŠwˆwà—9’9˜Z¨Ñ.Ô.ð $Ý  ™œ�AØœ�Ø˜5‘=ð ð Ø˜‘�Ø—	’	˜"‘”�Ø—’˜r 1˜gÑ&Ô&Ð&Ð&Øð #Ø—’ Ñ"Ô"Ð"øØð 	ØˆMØð 
	ð 
	ˆAð	Ý˜a Ð,Ð, eÐ,Ð,�Øð 'ð '�CØ˜1”vÔ*¨UÑ2ð !à Ø—I’I˜a‘L”L�LØ—M’M #Ñ&Ô&Ð&Ð&ð'øõ 'ð ð ð Ø�ðøøøàð 	8ØˆMå% l°QÑ&6Ñ7Ô7Ð7ð �QŒZ€Fð 	
�	Š	ÐEÐEÐEÐEØ Ð ñ	"ô 	"€Að */¯ª°7¸DÑ)AÔ)AÐA€Eˆ'�NÐA�Y ð 	„xð f9Ý‘”ˆØ”ð 	%ð 	%ˆAØ•QÔ'­Ô):½A¼JÐGÐGÐGÝ™œ�Ø�Ý˜1˜fÐ.Ð.¨Ð.Ð.ˆDØ�MŠM�#˜d™)œ)Ñ$Ô$Ð$Ð$Ø.Ð.Ð.Ð. vÐ.Ñ.Ô.ˆØð 	ð —9’9˜_­l¸1¸gÑ.FÔ.FÑGÔGˆDðð ð ð ð  ð ñ ô ˆFð
 ˆØ!ˆˆjÑÑà	
Œñ P9Ý‘”ˆÝÐ,Ð, Q¤VÐ,Ñ,Ô,Ñ,Ô,ð 	Ø—
’
‘”ˆAàÐˆˆsØœð $	(ñ $	(‰IˆD�#õ �s˜C‘=”=ˆDÝ�c˜D˜5‘/”/ˆCàŒ|ð = §¢¡¤°5Ò 8Ð 8Ý)­*ð 64ð 7;ñ6;ñ +<ô +<ñ =ô =ð =õ !  vÐ7Ð7°Ð7Ð7ˆJà'ð (ð (�	Ø Ð&Ð&àðØŸ	š	 &¨)Ñ4Ô4�AÝ%,¨QÐ0@À$Ñ%GÔ%G�NØ%Ð1à*˜N°¸K¸KÐHÑHÔH˜øøÝ ð ð ð à�Hðøøøð ˜’:�:ØØ˜’9�9Ø—J’J˜yÑ)Ô)Ð)Ð)à—J’J�yØ" A˜Ýœ ˜ñ 'ô  'ñ (ô (ð (ð (ñ%(ð. -Ð,Ð,Ð, VÐ,Ñ,Ô,Ð,õ " !¨WÐ5Ñ5Ô5‰
ˆˆsØŒ=ð 	"˜C¥1¤5˜L˜LØˆIØŒ_ð 	"à�yŠy˜ TÑ*Ô*ð $Ý˜s‘m”m�Ø˜C�L�>Ð!àˆàŒ|ð 
	ð-ð -ð -ð - 5§;¢;­sÑ#3Ô#3ð -ñ -ô -ˆHå�8‰}Œ} Ò!Ð!Ø˜q”k�Ø×*Ò*¨6Ñ2Ô2°1Ô5×AÒAÑCÔCÀAÔF�Ø˜F’?�?ðÝ# E¨5Ñ1Ô1˜˜øÝ*ð ð ð Ø˜ðøøøð ˆØˆð		DØˆ|Ý˜E‘{”{�Øˆ|Ý Ð!?À%Ñ!GÑHÔHÐHð øåð 	Dð 	Dð 	DÝ# E™?œ?ˆLØ˜uÒ$Ð$Ý˜l¨FÐ<Ð<°eÐ<Ð<Ð<Ð<Ð<ÝÐBÑCÔCÐCð		Døøøð 7Ð6Ð6Ð6˜4œ9Ð6Ñ6Ô6ˆð	ð 	ð 	õ ˆt‰9Œ9�qŠ=‰=õ �SÐ"?Ð"?Ð"?Ð"?¸$Ð"?Ñ"?Ô"?Ð@ÑAÔA‰IˆE�2Ý˜‘J”JˆEå�5‰zŒz˜AŠ~ˆ~¥SÐ(<Ð(<¸Ð(<Ñ(<Ô(<Ñ%<Ô%<‰~Ø;Ð; EÐ;Ñ;Ô;�ð:ð : 5ð :ñ :ô :�à ™�Øñ /¥ U×%7Ò%7¸Ñ%=Ô%=Ñ!>Ô!>ÀÒ!BÑ!BØ�DØ”|ñ 0­¨E¬J©¬¸1Ò(<Ð(<à %¤
˜ð$2ð $2ð $2ð $2Ø+0ð$2ñ $2ô $2ð 2˜™D˜A˜qåÐ6Ð6°AÐ6Ñ6Ô6Ñ6Ô6ð 0Ø#7Ð#7°QÐ#7Ñ#7Ô#7™D˜A˜qÝ)¨!­SÑ1Ô1ð 4Ø'(¨! 1 Ø(-¨d¨d°¨d¬ Ý)¨!­SÑ1Ô1ð 0µjÀÅCñ 7&ô 7&ð 0Ø*+¬&°¬)°q´v¸a´yÒ*@Ð*@å,0°°q´¸%À¼(Ñ1BÑ,CÔ,CÀaÑ,Gß&4¢nÑ&6Ô&6ñ !)  bà')¤|ð !0Ø+/ DØ�|Ý" 5™zœz×1Ò1µ#Ñ6Ô6˜Ø˜u’}�}ð */˜˜g™Ý!'¨¨fÐ!>Ð!>¸Ð!>Ð!>˜Ø).˜˜g™ð ˜U�?�? u�?Ý ¥¨¡¤Ñ0Ô0�EØ˜qœ�BÝ˜c™
œ
�Aà Ÿ:š: b¨!Ñ,Ô,�Dð  Ÿ8š8 FÑ+Ô+ð QÝ"(¨¨qÐ":Ð":°EÐ":Ð":˜Ý!%¥g­g°a¸"±f¸fÐ.NÐ.NÈÐ.NÐ.NÑ&OÔ&OÑ!PÔ!PÐQRÔ!S˜Ø!PÐ!PÐ!PÐ!PÐ!PÈÐ!PÑ!PÔ!P˜à˜U�?�?Ø2°TÑ9�Cùð —I’I‘K”K�Ý˜#‘J”J�Ý˜a !™e VÐ5Ð5¨uÐ5Ð5�Ý˜a¥#¥s Ñ,Ô,ð Rð6ð 6ð 6ð !Ÿ=š=Ø@Ð@Øñ!ô !ç!%¢ a¨¡¤ð ð  Ÿ8š8 FÑ+Ô+ð RÝ% d¨AÐ7Ð7°Ð7Ð7˜Ø!QÐ!QÐ!QÐ!QÐ!Q¸sÐ!QÑ!QÔ!Q˜ùå�‰YŒY˜!Š^‰^õ ˜˜t Aœw°$Ð7Ñ7Ô7ˆDð —9’9˜X uÑ-Ô-ñ 59Ø�Ø—k’k‘m”m�Ø"&��h‘Ø:�Ø:Ð:Ð:Ð:°EÐ:Ñ:Ô:�Ý˜TÐ-Ð- WÐ-Ð-�Ý�t—{’{‘}”}Ñ%Ô%¨Ò+Ð+ð!Ø#Ÿ~š~Ñ/Ô/˜˜øÝ.ð !ð !ð !Ø$Ÿyšy¨°tÑ<Ô<ð 
!Ý&9Ý *ð ,ñ !	ô !	ñ'
ô '
ð !
ð !˜Dð!øøøõ   §	¢	¡¤Ñ,Ô,�DàÐ#Øœ�AØ˜F’{�{ð(Ý % c¡
¤
˜AÝ")¨!¨a©%°Ð"AÐ"A¸5Ð"AÐ"A˜CØ#LÐ#LÐ#LÐ#LÐ#L¸#Ð#LÑ#LÔ#L˜D˜DøÝ2ð (ð (ð (à#'˜D˜D˜Dð(øøøð !&˜ØÐ'Ý˜t™9œ9 qš=˜=ð 16·	²	¸*ÀeÑ0LÔ0L˜E *Ñ-ØÐ#Ø8Ð8Ð8Ð8°4Ð8Ñ8Ô8�Fð �€€à�9Š9�X˜tÑ$Ô$ð 	ðÝ˜% Ñ(Ô(��øÝÕ 3Ð4ð ð ð Ø���ðøøøàð Ø‘��CØð "Ø #‘I�D˜#Ý! # vÐ7Ð7°Ð7Ð7¸Ô:�CØKÐKÐKÐKµ¸¸DÐ1JÐ1JÀEÐ1JÐ1JÐKÑKÔK�B�Bð"Ý ¥¨¨VÐ!=Ð!=°uÐ!=Ð!=Ñ>Ô>˜˜øÝ.ð "ð "ð "Ø!˜˜˜ð"øøøà�>Ø6Ð6Ð6Ð6°2Ð6Ñ6Ô6�Fð ).¯	ª	°*¸eÑ(DÔ(D�E˜*Ñ%øàð �€€Ø�	Š	�(˜DÑ!Ô!Ð!ð	Ý˜5 &Ð2Ð2¨EÐ2Ð2ˆDØÐØ4Ð4Ð4Ð4¨tÐ4Ñ4Ô4�øøÝð 	ð 	ð 	ØˆDð	øøøð �€€Ý! $§)¢)¨S°,ÀÑ2BÐ,CÑ"DÔ"DÑEÔEÐEå(¨Ñ0Ô0€Fà‡y‚y�˜TÑ"Ô"ð "ØBÐB¸6ÐBÑBÔBˆå,¨VÑ4Ô4ˆð "ˆˆjÑàð *õ ˜A˜wÑ'Ô'ˆð*ð *ð *ð *ð *˜Vð *ñ *ô *ˆð ð <ð<ð <ð <ð <ð <˜Vð <ñ <ô <ˆà€Ms£   Ã%AD4Ä4
EÅ EÌ97M1Í1
M>Í=M>ÓS Ó
S$Ó#S$Ó,%T Ô-UÕUæ
f æ<gçgè/i éiéiê/k  ë këkìl3 ì3mímîn* î*
n7î6n7Ú	solutionsúlist[dict[Expr, Expr]]Úreturnc                óÎ   — t          ¦   «         }g }| D ]Q}t          |                     ¦   «         ¦  «        }||vr*|                     |¦  «         |                     |¦  «         ŒR|S )z&Remove duplicates from a list of dicts)r“   Ú	frozensetrƒ   r‚   r˜   )r  Úsolutions_setÚsolutions_newr¶   Úsolsets        ru   ru  ru  Ô  sp   € õ ‘E”E€MØ€Màð &ð &ˆÝ˜3Ÿ9š9™;œ;Ñ'Ô'ˆØ˜Ð&Ð&Ø× Ò  Ñ%Ô%Ð%Ø×Ò˜fÑ%Ô%Ð%øàÐrw   c                ó>  ‡ ‡‡8‡9‡:‡;‡<‡=‡>‡?‡@— ‰ sdg fS ‰                      dd¦  «        �rl‰ }t          |¦  «        Š@ˆ@fd„‰ D ¦   «         }g }d„ t          |¦  «        D ¦   «         Š?t          ‰ ¦  «        D ]:\  }}‰ d|…         D ]*}||         ||         z  r|                     ||f¦  «         Œ+Œ;||f}	t	          |	¦  «        }
t          |
¦  «        dk    rÂg }d}|
D ]}}t          ¦   «         }|D ]}|||         z  }Œt          |ˆ?fd„¬	¦  «        }d‰d<   t          ||fi ‰¤Ž\  }}|r|o|}t          |t          ¦  «        s|g}|                     |¦  «         Œ~g }t          |Ž D ].}|                     t          d
„ |D ¦   «         ¦  «        ¦  «         Œ/||fS g }t          ¦   «         Š9g }g }g Š>d}‰                     dd¦  «        }‰                     dd¦  «        x}}t          ‰ ¦  «        D ]Ë\  }}‰9                     t          ||¦  «        ¦  «         t          |g|¢R Ž \  }}||v r|rt!          |d|g¦  «        d         |k    }||z
  }|                     ¦   «         d         }|r|                     |¦  «         Œ‘ |j        |ddiŽ}|�|                     |¦  «         Œ¶|                     |¦  «         ŒÌ|�rt'          d„ |D ¦   «         ¦  «        �rt          |¦  «        t          |¦  «        }}t)          ||dz   ¦  «        } t          |¦  «        D ]T\  }}|                     ¦   «         D ]:\  }!}"	 |!                     d¦  «        }|"| ||f<   Œ## t.          $ r |" | ||f<   Y Œ7w xY wŒU‰                      dd¦  «        rt1          | g|¢R i ‰¤Ž}nt3          | g|¢R i ‰¤Ž}|r|gng }|r-|r)t          |d                              ¦   «         ¦  «        Š>�nþg Š>�núd}t          |¦  «        t          |¦  «        k    �rx t          ¦   «         j        d„ |D ¦   «         Ž }#t          t9          |#                     |¦  «        ¦  «        ¦  «        }#t          ¦   «         }$g }t=          |#t?          t          |#¦  «        t          |¦  «        ¦  «        ¦  «        D ]®}%	 tA          |g|%¢R Ž }&|&rŒt          |&¦  «        D ]|}'d}(|'D ]!Š;|$rtC          ˆ;fd„|$D ¦   «         ¦  «        rd}(Œ"|(sR|$                     |%¦  «         |                     t          t          tE          |%|'¦  «        ¦  «        ¦  «        ¦  «         Œ}ŒŸ# tF          $ r Y Œ«w xY w|$rt          |$¦  «        Š>n| $                    d„ |D ¦   «         ¦  «         n_	 tA          |g|¢R Ž }|r|Š>ˆ>fd„t          |¦  «        D ¦   «         }n1# tF          $ r$ | $                    d„ |D ¦   «         ¦  «         g Š>Y nw xY w|pi g}|�r@d}d!ˆ:fd„	Š8t          |¦  «        Š:tK          ¦   «         })t9          |ˆ8fd„¦  «        D �]}*g }+g },d}-|D �]Ù}'t          ¦   «         }$|* &                    |'¦  «        }.|rE|'rCtO          |)|)|.d¬¦  «        }/|/�.|/r|+                     |'¦  «         n|,                     |'¦  «         Œm ‰8|.d¬¦  «        }0|0s|'r|+                     |'¦  «          �ne|0D �]+}1	 tQ          |.|1fi ‰¤Ž}2n# tF          $ r Y Œw xY w|2D ]îŠ=|$rtC          ˆ=fd„|$D ¦   «         ¦  «        rŒ |' )                    ¦   «         Š<|' *                    ¦   «         D ]\  }3}4|4 &                    |1‰=¦  «        ‰<|3<   Œ‰=‰<|1<   t          ‰< *                    ¦   «         ¦  «        }5|+D ]I}t          |¦  «        t          |5¦  «        k     r'ˆ<fd„| *                    ¦   «         D ¦   «         }6|6|5z
  s nŒJ|+                     ‰<¦  «         Œïd}-|$ +                    |1¦  «         �Œ-|-stG          d|.z  ¦  «        ‚�ŒÛ|+}|,D ]}/|/|v r| ,                    |/¦  «         Œ�Œ|sdg fS t[          |¦  «        }7‰                     d|7¦  «        r'|D ]}'|'D ]}3t]          |'|3         ¦  «        |'|3<   ŒŒ d‰d<   |rˆ9ˆfd„|D ¦   «         }|r|sˆ ˆfd„|D ¦   «         }d „ |D ¦   «         }||fS )"z±return ``(linear, solution)`` where ``linear`` is True
    if the system was linear, else False; ``solution``
    is a list of dictionaries giving solutions for the symbols
    FÚ_splitTc                ó&   •— i | ]}||j         ‰z  “ŒS rq   r    )rr   r�   Úsymssets     €ru   rv   z!_solve_system.<locals>.<dictcomp>ï  s"   ø€ Ð?Ð?Ð?°A�A�q”~¨Ñ/Ð?Ð?Ð?rw   c                ó   — i | ]\  }}||“Œ	S rq   rq   )rr   r{   Úsyms      ru   rv   z!_solve_system.<locals>.<dictcomp>ñ  s   € Ð?Ð?Ð?¡& ! S�s˜AÐ?Ð?Ð?rw   Nrn   c                ó   •— ‰|          S r’   rq   )r0  Úsym_indicess    €ru   r  z_solve_system.<locals>.<lambda>   s   ø€ ¸+Àa¼.€ rw   rW  c              3  óH   K  — | ]}|                      ¦   «         D ]}|V — ŒŒd S r’   rJ  )rr   ÚsdÚitems      ru   r¢   z _solve_system.<locals>.<genexpr>  sR   è è € ð !,ð !,¨"Ø "§¢¡
¤
ð!,ð !,Øð "&ð !,ð !,ð !,ð !,ð !,ð !,ð !,rw   ÚmanualrM  r   Ú	extensionc              3  ó$   K  — | ]}|j         V — Œd S r’   )Ú	is_linear©rr   r¬   s     ru   r¢   z _solve_system.<locals>.<genexpr>,  s$   è è € Ð*Ð*˜qˆqŒ{Ð*Ð*Ð*Ð*Ð*Ð*rw   ró   c                ó   — g | ]	}|j         ‘Œ
S rq   r    r"  s     ru   r}   z!_solve_system.<locals>.<listcomp>H  s   € Ð$CÐ$CÐ$C¸ Q¤^Ð$CÐ$CÐ$Crw   c              3  ó*   •K  — | ]}|‰j         v V — Œd S r’   r    )rr   ÚssÚr1s     €ru   r¢   z _solve_system.<locals>.<genexpr>T  s>   øè è € ð 5<ð 5<Ø/1ð 68¸2¼?Ð5Jð 5<ð 5<ð 5<ð 5<ð 5<ð 5<rw   c                ó6   — g | ]}|                      ¦   «         ‘ŒS rq   ©rÉ   ©rr   r—  s     ru   r}   z!_solve_system.<locals>.<listcomp>a  ó    € Ð">Ð">Ð">°1 1§9¢9¡;¤;Ð">Ð">Ð">rw   c           
     ód   •— g | ],}t          t          t          ‰|¦  «        ¦  «        ¦  «        ‘Œ-S rq   )rÇ   r   rq  )rr   r§  Úsolved_symss     €ru   r}   z!_solve_system.<locals>.<listcomp>g  s3   ø€ Ð!WÐ!WÐ!WÀa¥$¥t­C°¸QÑ,?Ô,?Ñ'@Ô'@Ñ"AÔ"AÐ!WÐ!WÐ!Wrw   c                ó6   — g | ]}|                      ¦   «         ‘ŒS rq   r(  r)  s     ru   r}   z!_solve_system.<locals>.<listcomp>i  r*  rw   c                óR   •‡ ‡— ‰ j         ‰z  Šˆ ˆfd„}|rt          ‰|¬¦  «        Š‰S )Nc                ó:  •— ‰                      | ¦  «        }|€$t          j        t          j        t          j        f}nM|                     ¦   «         j        }|                     ¦   «         t          |‰z  ¦  «        t          |¦  «        f}|t          | ¦  «        fz   S r’   )Úas_polyr   rÞ  ÚLCr¡   rã  r©   r"   )r  ÚepÚ
complexityÚ
coeff_symsr�   r
  s       €€ru   rX  z,_solve_system.<locals>._ok_syms.<locals>.key}  sx   ø€ Ø—Y’Y˜s‘^”^�Ø�:Ý"#¤*­a¬j½!¼*Ð!E�J�Jà!#§¢¡¤Ô!5�JØ"$§)¢)¡+¤+­s°:À±?Ñ/CÔ/CÅSÈÁ_Ä_Ð!U�JØ!Õ%5°cÑ%:Ô%:Ð$<Ñ<Ð<rw   rW  )r¡   Úsorted)r�   rw  rX  r
  Úlegals   `  @€ru   Ú_ok_symsz_solve_system.<locals>._ok_symsv  sP   øøø€ Ø” %Ñ'ˆBð=ð =ð =ð =ð =ð =ð ð )Ý˜B CÐ(Ñ(Ô(�ØˆIrw   c                ó4   •— t           ‰| ¦  «        ¦  «        S r’   r»  )rå   r7  s    €ru   r  z_solve_system.<locals>.<lambda>�  s   ø€ ­C°°¸±´Ñ,<Ô,<€ rw   ©r°   )rw  c              3  ó*   •K  — | ]}|‰j         v V — Œd S r’   r    )rr   r%  r¶   s     €ru   r¢   z _solve_system.<locals>.<genexpr>²  s+   øè è € Ð(PÐ(PÀB¨¨sÔ/?Ð)?Ð(PÐ(PÐ(PÐ(PÐ(PÐ(Prw   c                óD   •— h | ]\  }}||                      ‰¦  «        f’ŒS rq   r  )rr   rs   rt   Úrnews      €ru   r¥   z _solve_system.<locals>.<setcomp>¿  s/   ø€ Ð2_Ð2_Ð2_ÉTÈQÐPQ°A°q·z²zÀ$Ñ7GÔ7GÐ3HÐ2_Ð2_Ð2_rw   zcould not solve %sr>   c                óN   •‡— g | ] Št          ˆˆfd „‰D ¦   «         ¦  «        °‰‘Œ!S )c              3  ó4   •K  — | ]}t          |‰fi ‰¤ŽV — Œd S r’   r²   rÖ  s     €€ru   r¢   z+_solve_system.<locals>.<listcomp>.<genexpr>å  s5   øè è € Ð=Ð=°1•x  1Ð.Ð.¨Ð.Ð.Ð=Ð=Ð=Ð=Ð=Ð=rw   r£   r×  s    @€€ru   r}   z!_solve_system.<locals>.<listcomp>ä  sN   øø€ ð ?ð ?ð ?˜ÝÐ=Ð=Ð=Ð=Ð=¸Ð=Ñ=Ô=Ñ=Ô=ð?�!ð ?ð ?ð ?rw   c                óN   •‡— g | ] Št          ˆˆfd „‰D ¦   «         ¦  «        °‰‘Œ!S )c              3  ó8   •K  — | ]}t          |‰fi ‰¤Žd u V — ŒdS )FNr²   )rr   r�   rµ   r§  s     €€ru   r¢   z+_solve_system.<locals>.<listcomp>.<genexpr>é  s:   øè è € ÐGÐG¸A•x  1Ð.Ð.¨Ð.Ð.°%Ð7ÐGÐGÐGÐGÐGÐGrw   r£   )rr   r§  Úexprsrµ   s    @€€ru   r}   z!_solve_system.<locals>.<listcomp>è  sU   øø€ ð Ið Ið I˜ÝÐGÐGÐGÐGÐGÀÐGÑGÔGÑGÔGðI�!ð Ið Ið Irw   c                ó   — g | ]}|¯|‘ŒS rq   rq   )rr   r§  s     ru   r}   z!_solve_system.<locals>.<listcomp>ë  s   € Ð%Ð%Ð%�A 1Ð%ˆaÐ%Ð%Ð%rw   rÙ  )/ra  r“   rb  r‚   r^   r©   r5  rt  r€   r   rl   rÇ   rz   r§   rœ   Ú_invertrÛ  r×   r0  rj  rQ   ÚtermsÚindexr~   Úminsolve_linear_systemÚsolve_linear_systemrÕ   r_  r!   r¸  rc   Úminrh   r¤   rq  rd  rh  r   ro   r³   rß  Úcopyrƒ   r˜   ÚremoverÑ   r>   )ArA  r…   rµ   ÚVÚexprsymsrâ   rÝ   Úe1Úe2ÚGÚsubexprsÚsubsolsrŽ  ÚsubexprÚsubsymsr�   Ú_linearÚsubsolÚsolsÚsoldictsÚpolysÚfailedrî  r  rð  rM  Újr—  r{   r›   rø  rñ  ÚmatrixÚmonomÚcoeffÚfreerì  ÚsymsÚresr§  r`  r  rª   Ú	newresultÚbad_resultsÚhitÚeq2r¯  Úok_symsr‡   rÃ  rs   rt   ÚisetÚi_items_updatedÚdefault_simplifyr7  rš   r6  r&  r<  r¶   r,  r  r  sA   ` `                                                     @@@@@@@@@ru   rt  rt  ã  s€  øøøøøøøøøøø€ ð
 ð Ø�bˆyÐà‡y‚y�˜4Ñ Ô ñ " àˆÝ�g‘,”,ˆØ?Ð?Ð?Ð?¸Ð?Ñ?Ô?ˆØˆØ?Ð?­I°gÑ,>Ô,>Ð?Ñ?Ô?ˆÝ˜uÑ%Ô%ð 	'ð 	'‰EˆAˆrØ˜B˜Q˜B”ið 'ð '�à˜B”< (¨2¤,Ñ.ð 'Ø—H’H˜b "˜XÑ&Ô&Ð&øð'ð ˆqˆDˆÝ'¨Ñ*Ô*ˆÝˆx‰=Œ=˜1ÒÐØˆGØˆFØ#ð 'ð '�Ý™%œ%�Ø ð +ð +�AØ˜x¨œ{Ñ*�G�GÝ  Ð0HÐ0HÐ0HÐ0HÐIÑIÔI�Ø"'��h‘Ý"/°¸Ð"JÐ"JÀEÐ"JÐ"J‘�˜Øð 0Ø#Ð/¨�FÝ! &­$Ñ/Ô/ð &Ø$˜X�FØ—’˜vÑ&Ô&Ð&Ð&àˆDÝ# WÐ-ð -ð -�Ø—’�Dð !,ð !,°ð !,ñ !,ô !,ñ ,ô ,ñ -ô -ð -ð -à˜4�<Ðà€EÝ‰5Œ5€DØ€FØ€FØ€KØ€FØ�YŠY�x Ñ'Ô'€FØŸ	š	 '¨4Ñ0Ô0Ð0€I�å˜%Ñ Ô ð ð ‰ˆˆ1Ø�Š•L  GÑ,Ô,Ñ-Ô-Ð-Ý�qÐ#˜7Ð#Ð#Ð#‰ˆˆ1Ø�ˆ<ˆ<Øð 9Ý% a¨¨Q¨CÑ0Ô0°Ô3°qÒ8�Ø�‰EˆØ×ÒÑÔ˜qÔ!ˆØð 	Ø�MŠM˜!ÑÔÐØàˆqŒy˜'Ð2¨TÐ2Ð2ˆàÐØ�LŠL˜ÑÔÐÐà�MŠM˜!ÑÔÐÐàñ ?%ÝÐ*Ð* EÐ*Ñ*Ô*Ñ*Ô*ñ >	%Ý�u‘:”:�s 7™|œ|ˆqˆAÝ˜1˜a !™e‘_”_ˆFå$ UÑ+Ô+ð .ð .‘��4Ø$(§J¢J¡L¤Lð .ð .‘L�E˜5ð.Ø!ŸKšK¨™NœN˜Ø',˜˜q !˜t™˜øÝ%ð .ð .ð .Ø(- v˜˜q !˜t™˜˜ð.øøøð	.ð �yŠy˜ uÑ-Ô-ð HÝ/°ÐJ¸ÐJÐJÐJÀEÐJÐJ��å,¨VÐG°gÐGÐGÐGÀÐGÐG�Ø!'Ð/�f�X�X¨RˆFØð %Øð %Ý"& v¨a¤y§~¢~Ñ'7Ô'7Ñ"8Ô"8�K‘Kà"$�Kùð ˆFÝ�7‰|Œ|�c %™jœjÒ(Ñ(à"•s‘u”u”{Ð$CÐ$C¸UÐ$CÑ$CÔ$CÐD�Ý�G D×$5Ò$5°gÑ$>Ô$>Ñ?Ô?Ñ@Ô@�Ý™œ�Ø�Ý# D­#­c°$©i¬i½¸U¹¼Ñ*DÔ*DÑEÔEð ð �Dðå/°Ð=¸Ð=Ð=Ð=˜Øð LÝ%(¨¡X¤Xð 
Lð 
L Ø', Ø*+ð !4ð !4 BØ',ð %4µð 5<ð 5<ð 5<ð 5<Ø5:ð5<ñ 5<ô 5<ñ 2<ô 2<ð %4ð 04¨øØ'+ð !LØ$)§L¢L°Ñ$6Ô$6Ð$6Ø$*§M¢Mµ$µt½CÀÀa¹L¼LÑ7IÔ7IÑ2JÔ2JÑ$KÔ$KÐ$KøøøÝ.ð ð ð Ø˜ðøøøàð @Ý"& u¡+¤+�K�Kà—M’MÐ">Ð">¸Ð">Ñ">Ô">Ñ?Ô?Ð?Ð?ð%Ý.¨uÐ?°wÐ?Ð?Ð?�FØð XØ&-˜Ø!WÐ!WÐ!WÐ!WÍ3ÈvÉ;Ì;Ð!WÑ!WÔ!W˜øøÝ*ð %ð %ð %Ø—M’MÐ">Ð">¸Ð">Ñ">Ô">Ñ?Ô?Ð?Ø"$�K�K�Kð%øøøð
 ˆ^˜�t€Fàñ `)Øˆð	ð 	ð 	ð 	ð 	ð 	õ( �G‘”ˆå‰GŒGˆÝ˜&Ð"<Ð"<Ð"<Ð"<Ñ=Ô=ð B	)ñ B	)ˆBØˆIØˆKØˆCØð >)ñ >)�Ý™œ�à—g’g˜a‘j”j�ð ð 
!˜Qð 
!Ý   A s°DÐ9Ñ9Ô9�AØ�}ð ð 2Ø%×,Ò,¨QÑ/Ô/Ð/Ð/à'×.Ò.¨qÑ1Ô1Ð1Ø ð #˜( 3¨TÐ2Ñ2Ô2�Øð Øð ,Ø!×(Ò(¨Ñ+Ô+Ð+Ø‘EØ ð !ñ !�Að!Ý& s¨AÐ7Ð7°Ð7Ð7˜˜øÝ.ð !ð !ð !Ø ˜ð!øøøð
  $ð 3ð 3˜Ø ð %¥SÐ(PÐ(PÐ(PÐ(PÈ%Ð(PÑ(PÔ(PÑ%PÔ%Pð %à$Ø Ÿvšv™xœx˜Ø$%§G¢G¡I¤Ið 5ð 5™D˜A˜qØ&'§f¢f¨Q°¡n¤n˜D ™G˜Gà"%˜˜Q™å" 4§:¢:¡<¤<Ñ0Ô0˜Ø!*ð 
3ð 
3˜AÝ" 1™vœv­¨D©	¬	Ò1Ð1à2_Ð2_Ð2_Ð2_ÐUV×U\ÒU\ÑU^ÔU^Ð2_Ñ2_Ô2_ Ø'6¸Ñ'=ð !*ð %* Eøð &×,Ò,¨TÑ2Ô2Ð2øØ�CØ—I’I˜a‘L”L�L‘LØð JÝ-Ð.BÀSÑ.HÑIÔIÐIñJð #�Ø$ð )ð )�AØ˜F�{�{ØŸš aÑ(Ô(Ð(øùàð Ø�bˆyÐõ ˜F‘|”|ÐØ‡y‚y�Ð-Ñ.Ô.ð "Øð 	&ð 	&ˆAØð &ð &�Ý  !¤‘~”~��!‘�ð&à!ˆˆjÑàð ?ð?ð ?ð ?ð ?ð ?˜Vð ?ñ ?ô ?ˆð ð I�Vð IðIð Ið Ið Ið I˜Vð Iñ Iô Iˆð &Ð%˜Ð%Ñ%Ô%€FØ�6ˆ>ÐsI   Ì2MÍM$Í#M$ÒBT0Ô0
T=Ô<T=Õ3,V  Ö +W×WÚ8[Û
[	Û[	c           	     óŽ  ‡‡‡— t          | t          ¦  «        r/|rt          t          d|z  ¦  «        ¦  «        ‚| j        }| j        } d}| |z
  }|                     ¦   «         \  }}|st          j        t          j	        fS |j
        }|s|}nšd„ |D ¦   «         }	|	rwt          |	¦  «        dk    r|	d         }	t          |¦  «        dk    rd|›d|d         ›d�}
nd|›d	t          |¦  «        ›d�}
t          t          d
|	›d|
›d�¦  «        ¦  «        ‚|                     |¦  «        }|                     |¦  «        }|st          j        t          j	        fS t          t          ¦  «        }|                     t"          ¦  «        D ],}|j
        |z  }|D ]}||                              |¦  «         ŒŒ-d}t'          |t(          ¬¦  «        D �]@Št          |‰         t          ¦  «        rd„ |‰         D ¦   «         |‰<   |                     |‰         ¦  «        }|                     ‰¦  «        Š‰j
        }‰rÔ|r!t/          ˆfd„|D ¦   «         ¦  «        s||k    r±d}‰t          j        u r n¡‰‰j
        vr–d‰z  |                     ‰d¦  «        z  Š|€t3          ||¦  «        }t/          ˆˆfd„|D ¦   «         ¦  «        sLd„ ‰                     t4          ¦  «        D ¦   «         }t7          ‰                     |¦  «        ¦  «        Š‰‰fc S �ŒB|rt          j        t          j	        fS |j        rt          j        t          j        fS ||fS )aÙ  
    Return a tuple derived from ``f = lhs - rhs`` that is one of
    the following: ``(0, 1)``, ``(0, 0)``, ``(symbol, solution)``, ``(n, d)``.

    Explanation
    ===========

    ``(0, 1)`` meaning that ``f`` is independent of the symbols in *symbols*
    that are not in *exclude*.

    ``(0, 0)`` meaning that there is no solution to the equation amongst the
    symbols given. If the first element of the tuple is not zero, then the
    function is guaranteed to be dependent on a symbol in *symbols*.

    ``(symbol, solution)`` where symbol appears linearly in the numerator of
    ``f``, is in *symbols* (if given), and is not in *exclude* (if given). No
    simplification is done to ``f`` other than a ``mul=True`` expansion, so the
    solution will correspond strictly to a unique solution.

    ``(n, d)`` where ``n`` and ``d`` are the numerator and denominator of ``f``
    when the numerator was not linear in any symbol of interest; ``n`` will
    never be a symbol unless a solution for that symbol was found (in which case
    the second element is the solution, not the denominator).

    Examples
    ========

    >>> from sympy import cancel, Pow

    ``f`` is independent of the symbols in *symbols* that are not in
    *exclude*:

    >>> from sympy import cos, sin, solve_linear
    >>> from sympy.abc import x, y, z
    >>> eq = y*cos(x)**2 + y*sin(x)**2 - y  # = y*(1 - 1) = 0
    >>> solve_linear(eq)
    (0, 1)
    >>> eq = cos(x)**2 + sin(x)**2  # = 1
    >>> solve_linear(eq)
    (0, 1)
    >>> solve_linear(x, exclude=[x])
    (0, 1)

    The variable ``x`` appears as a linear variable in each of the
    following:

    >>> solve_linear(x + y**2)
    (x, -y**2)
    >>> solve_linear(1/x - y**2)
    (x, y**(-2))

    When not linear in ``x`` or ``y`` then the numerator and denominator are
    returned:

    >>> solve_linear(x**2/y**2 - 3)
    (x**2 - 3*y**2, y**2)

    If the numerator of the expression is a symbol, then ``(0, 0)`` is
    returned if the solution for that symbol would have set any
    denominator to 0:

    >>> eq = 1/(1/x - 2)
    >>> eq.as_numer_denom()
    (x, 1 - 2*x)
    >>> solve_linear(eq)
    (0, 0)

    But automatic rewriting may cause a symbol in the denominator to
    appear in the numerator so a solution will be returned:

    >>> (1/x)**-1
    x
    >>> solve_linear((1/x)**-1)
    (x, 0)

    Use an unevaluated expression to avoid this:

    >>> solve_linear(Pow(1/x, -1, evaluate=False))
    (0, 0)

    If ``x`` is allowed to cancel in the following expression, then it
    appears to be linear in ``x``, but this sort of cancellation is not
    done by ``solve_linear`` so the solution will always satisfy the
    original expression without causing a division by zero error.

    >>> eq = x**2*(1/x - z**2/x)
    >>> solve_linear(cancel(eq))
    (x, 0)
    >>> solve_linear(eq)
    (x**2*(1 - z**2), x)

    A list of symbols for which a solution is desired may be given:

    >>> solve_linear(x + y + z, symbols=[y])
    (y, -x - z)

    A list of symbols to ignore may also be given:

    >>> solve_linear(x + y + z, exclude=[x])
    (y, -x - z)

    (A solution for ``y`` is obtained because it is the first variable
    from the canonically sorted list of symbols that had a linear
    solution.)

    z<
            If lhs is an Equality, rhs must be 0 but was %sNc                ó    — g | ]}|j         °	|‘ŒS rq   ©rc  r  s     ru   r}   z solve_linear.<locals>.<listcomp>j  s   € Ð5Ð5Ð5�Q¨¬Ð5ˆqÐ5Ð5Ð5rw   rn   r   zsolve(rR  ú)z, *z8
                solve_linear only handles symbols, not z=. To isolate
                non-symbols use solve, e.g. >>> z# <<<.
                             TrW  c                ó8   — i | ]}||                      ¦   «         “ŒS rq   )Údoit)rr   Úders     ru   rv   z solve_linear.<locals>.<dictcomp>ˆ  s"   € Ð@Ð@Ð@¨c˜#˜sŸxšx™zœzÐ@Ð@Ð@rw   c              3  óB   •K  — | ]}‰                      |¦  «        V — Œd S r’   )Údiff)rr   r‡   Ú	dnewn_dxis     €ru   r¢   zsolve_linear.<locals>.<genexpr>Ž  s/   øè è € Ð)JÐ)JÀ¨)¯.ª.¸Ñ*;Ô*;Ð)JÐ)JÐ)JÐ)JÐ)JÐ)Jrw   Fr¼   c              3  óD   •K  — | ]}t          |‰‰id ¬¦  «        d u V — ŒdS )Tr9  Nr²   )rr   ÚdiÚvirÍ  s     €€ru   r¢   zsolve_linear.<locals>.<genexpr>–  sO   øè è € ð *ð *Ø õ $ B¨¨R¨¸$Ð?Ñ?Ô?À4ÐGð *ð *ð *ð *ð *ð *rw   c                óR   — g | ]$}|j         j        ¯||                     ¦   «         f‘Œ%S rq   )ÚfunctionrÈ   rn  r8  s     ru   r}   z solve_linear.<locals>.<listcomp>™  s=   € ð 2ð 2ð 2¨aØœJÔ0ð2˜Q §¢¡¤˜Mð 2ð 2ð 2rw   )r€   r   r~   r\   rÊ   rÐ   r×   r   ri  r¦   r¡   r©   r   r¸  Ú
differencerj   rº   r   r‚   r5  r"   ro   rq  r¤   rá  rœ   r<   r   rc  )rÐ   rÊ   r…   rý   rš   rª   rÝ   r›   r^  ÚbadÚegÚderivsro  Úcsymr   Úall_zeroÚnewnÚireprr  ru  rÍ  s                     @@@ru   rÛ  rÛ  ï  sà  øøø€ õV �#•rÑÔð Øð 	GÝ�Zð )?ØADñ)Eñ Fô Fñ Gô Gð GàŒgˆØŒgˆØ€DØ	ˆs‰€BØ×ÒÑÔ�D€A€qØð ÝŒv•q”uˆ}ÐàŒ>€DØð -Øˆˆà5Ð5˜'Ð5Ñ5Ô5ˆØð 
	/Ý�3‰xŒx˜1Š}ˆ}Ø˜!”f�Ý�7‰|Œ|˜qÒ Ð Ð Ø(*¨¨¨G°A¬J¨J¨JÐ7��ð !ð *,¨¨­T°'©]¬]¨]¨]Ð;�Ý�Z˜Zð %( C C¨¨¨ð)-ñ .ô .ñ /ô /ð /ð ×#Ò# GÑ,Ô,ˆØ× Ò  Ñ)Ô)€GØð ÝŒv•q”uˆ}Ðõ
 �ÑÔ€FØ�wŠw•zÑ"Ô"ð "ð "ˆØÔ 'Ñ)ˆØð 	"ð 	"ˆAØ�1ŒI×Ò˜SÑ!Ô!Ð!Ð!ð	"ð €HÝ�WÕ"2Ð3Ñ3Ô3ð "ñ "ˆå�f˜R”j¥$Ñ'Ô'ð 	AØ@Ð@°V¸B´ZÐ@Ñ@Ô@ˆF�2‰JØ�vŠv�f˜R”jÑ!Ô!ˆØ—I’I˜b‘M”Mˆ	ð Ô%ˆØð 	"˜dð 	"¥cÐ)JÐ)JÐ)JÐ)JÀTÐ)JÑ)JÔ)JÑ&JÔ&Jð 	"ÈdÐV]ÊoÈoØˆHØ�AœEÐ!Ð!Ø�Ø˜Ô/Ð/Ð/Ø˜	‘\ 4§9¢9¨R°Ñ#3Ô#3Ñ4�Ø�<Ý'¨¨GÑ4Ô4�DÝð *ð *ð *ð *ð *Ø$(ð*ñ *ô *ñ *ô *ð "ð2ð 2°2·8²8½HÑ3EÔ3Eð 2ñ 2ô 2�Dõ $ B§G¢G¨D¡M¤MÑ2Ô2�BØ˜r˜6�M�M�MùØð ÝŒv•q”uˆ}ÐØ„{ð ÝŒv•q”vˆ~ÐØˆaˆ4€Krw   c           	     ó8  ‡ ‡‡‡— |                      dd¦  «        }t          ‰ g‰¢R i |¤Ž}|r+t          d„ |                     ¦   «         D ¦   «         ¦  «        r|S |�rt          ‰ g‰¢R Ž }d„ }i } |||¦  «         |rùt	          d„ |                     ¦   «         D ¦   «         d„ ¬¦  «        }|j        }	t          t          t          t          |	¦  «        ¦  «        ¦  «        ¦  «        Št          |	¦  «        dk    rt          j        |‰<   n]t          |‰d¬	¦  «        d
         Š‰s>t          ˆˆfd„|                     ¦   «         D ¦   «         ¦  «        st          j        |‰<   n‰|‰<    |||¦  «         |°ù|S t          ‰¦  «        }
t!          ‰ g‰¢R ddiŽ}t          d„ |                     ¦   «         D ¦   «         ¦  «        }t#          |dz
  dd¦  «        D �]B}t%          d|¦  «         d}t'          t#          |
¦  «        |¦  «        D �]}t)          ˆ fd„|D ¦   «         ‰                      d¦  «        j        gz   ¦  «        j        }t          |gˆfd„|D ¦   «         ¢R Ž }|r®t          d„ |                     ¦   «         D ¦   «         ¦  «        sƒˆfd„|D ¦   «         }|                     ¦   «         D ]\  }}|                     |¦  «        ||<   Œ‰D ]<}||vr6‰                     |¦  «        |v rt          j        ||<   Œ-t          j        ||<   Œ=|} n�Œ
|€ n|}�ŒD|S )a!  
    Find a particular solution to a linear system.

    Explanation
    ===========

    In particular, try to find a solution with the minimal possible number
    of non-zero variables using a naive algorithm with exponential complexity.
    If ``quick=True``, a heuristic is used.

    rò   Fc              3  ó"   K  — | ]
}|d k    V — ŒdS ©r   Nrq   ©rr   rt   s     ru   r¢   z)minsolve_linear_system.<locals>.<genexpr>´  s&   è è € Ð1Ð1 �Q˜!’VÐ1Ð1Ð1Ð1Ð1Ð1rw   c                óØ   — g }|                      ¦   «         D ]J\  }}|                     | ¦  «        ||<   ||         j        s |                     |¦  «         ||         | |<   ŒK|D ]}||= Œd S r’   )rƒ   ro   r¡   r‚   )Ú
determinedr�  Údeleters   rt   s        ru   r§   z&minsolve_linear_system.<locals>.updateº  sŠ   € ØˆFØ ŸšÑ(Ô(ð 0ð 0‘��1ØŸfšf ZÑ0Ô0�˜‘Ø ”{Ô/ð 0Ø—M’M !Ñ$Ô$Ð$Ø$,¨Q¤K�J˜q‘MøØð  ð  �Ø˜Q�K�Kð ð  rw   c              3  ó   K  — | ]}|V — Œd S r’   rq   )rr   rs   s     ru   r¢   z)minsolve_linear_system.<locals>.<genexpr>Ç  s"   è è € Ð+Ð+˜1�QÐ+Ð+Ð+Ð+Ð+Ð+rw   c                óH   — t          | j        ¦  «        t          | ¦  «        fS r’   )r©   r¡   r"   r/  s    ru   r  z(minsolve_linear_system.<locals>.<lambda>È  s   € ¥3 q¤~Ñ#6Ô#6Õ8HÈÑ8KÔ8KÐ"L€ rw   rW  rn   )rM  r   c              3  óD   •K  — | ]}|                      ‰‰¦  «        V — Œd S r’   r   )rr   rt   rä   r0  s     €€ru   r¢   z)minsolve_linear_system.<locals>.<genexpr>Ï  s/   øè è € Ð&JÐ&J¸! q§v¢v¨a°¡~¤~Ð&JÐ&JÐ&JÐ&JÐ&JÐ&Jrw   Tc                ó   — g | ]
}|d k    ¯|‘ŒS r7  rq   )rr   r0  s     ru   r}   z*minsolve_linear_system.<locals>.<listcomp>ß  s   € Ð8Ð8Ð8˜°°a²°�!°°°rw   r¼   zminsolve: %sNc                óD   •— g | ]}‰                      |¦  «        j        ‘ŒS rq   )ÚcolÚT)rr   r{   Úsystems     €ru   r}   z*minsolve_linear_system.<locals>.<listcomp>ä  s%   ø€ ÐAÐAÐA°1˜vŸzšz¨!™}œ}œÐAÐAÐArw   c                ó    •— g | ]
}‰|         ‘ŒS rq   rq   r4  s     €ru   r}   z*minsolve_linear_system.<locals>.<listcomp>å  s   ø€ Ð/MÐ/MÐ/M¸q°¸´
Ð/MÐ/MÐ/Mrw   c              3  ó"   K  — | ]
}|d k    V — ŒdS r‚  rq   rƒ  s     ru   r¢   z)minsolve_linear_system.<locals>.<genexpr>æ  s&   è è € Ð <Ð <¨A  a¢Ð <Ð <Ð <Ð <Ð <Ð <rw   c                ó8   •— g | ]}‰|         t           j        f‘ŒS rq   )r   r¦   )rr   rt   r…   s     €ru   r}   z*minsolve_linear_system.<locals>.<listcomp>ç  s$   ø€ ÐBÐBÐB°A˜W QœZ­¬Ð/ÐBÐBÐBrw   )rz   rG  rj  rå  Úmaxr¡   ÚnextrÍ   r   r!   r©   r   ri  rß  r¤   r¦   rF  Úranger]   rk   rP   rŒ  r�  rƒ   ro   rE  )rŽ  r…   rµ   rò   Ús0r‡   r§   r…  rs   ÚkfreeÚNÚbestsolÚn0rÝ   ÚthissolÚnonzerosÚsubmro   rt   r  rä   r0  s   ``                  @@ru   rF  rF  ¥  s¨  øøøø€ ð �IŠI�g˜uÑ%Ô%€Eå	˜VÐ	7 gÐ	7Ð	7Ð	7°Ð	7Ð	7€BØð •Ð1Ð1 R§Y¢Y¡[¤[Ð1Ñ1Ô1Ñ1Ô1ð Øˆ	Øñ ?õ   Ð1¨Ð1Ð1Ð1ˆð	 ð 	 ð 	 ð ˆ
Øˆˆz˜1ÑÔÐØð 	"åÐ+Ð+ §¢¡
¤
Ð+Ñ+Ô+ØLÐLðNñ Nô NˆAà”NˆEÝ•X�d¥7¨5¡>¤>Ñ2Ô2Ñ3Ô3Ñ4Ô4ˆAÝ�5‰zŒz˜QŠˆÝ !¤�
˜1‘�å˜a ¨%Ð0Ñ0Ô0°Ô3�Øð (¥3Ð&JÐ&JÐ&JÐ&JÐ&J¸q¿xºx¹z¼zÐ&JÑ&JÔ&JÑ#JÔ#Jð (Ý$%¤E�J˜q‘M�Mà$'�J˜q‘MØˆF�:˜qÑ!Ô!Ð!ð ð 	"ð Ðõ �‰LŒLˆÝ(¨ÐF°'ÐFÐFÐFÀÐFÐFˆÝÐ8Ð8˜WŸ^š^Ñ-Ô-Ð8Ñ8Ô8Ñ9Ô9ˆÝ�r˜A‘v˜q "Ñ%Ô%ð 	ñ 	ˆAÝ�> 1Ñ%Ô%Ð%ØˆGÝ(­¨q©¬°1Ñ5Ô5ð ñ �ÝÐAÐAÐAÐA¸ÐAÑAÔAÀVÇZÂZÐPRÁ^Ä^ÔEUÐDVÑVÑWÔWÔY�Ý'¨ÐNÐ/MÐ/MÐ/MÐ/MÀHÐ/MÑ/MÔ/MÐNÐNÐN�Øð �SÐ <Ð <°·²±´Ð <Ñ <Ô <Ñ<Ô<ð ØBÐBÐBÐB¸ÐBÑBÔB�DØ !§¢¡	¤	ð ,ð ,™˜˜1Ø Ÿvšv d™|œ|˜˜!™˜Ø&ð 0ð 0˜Ø a˜<˜<Ø&Ÿ}š}¨SÑ1Ô1°XÐ=Ð=Ý)*¬  #¡ å)*¬  #¡øØ�GØ�EùØˆØ�ØˆG‰GØˆrw   c                ó  — | j         d         t          |¦  «        dz   k    sJ ‚t          | t          |dz   ¦  «        z  ¦  «        }t	          ||¦  «        \  }}t          ||d¬¦  «        }|�d„ |                     ¦   «         D ¦   «         }|S )a9  
    Solve system of $N$ linear equations with $M$ variables, which means
    both under- and overdetermined systems are supported.

    Explanation
    ===========

    The possible number of solutions is zero, one, or infinite. Respectively,
    this procedure will return None or a dictionary with solutions. In the
    case of underdetermined systems, all arbitrary parameters are skipped.
    This may cause a situation in which an empty dictionary is returned.
    In that case, all symbols can be assigned arbitrary values.

    Input to this function is a $N\times M + 1$ matrix, which means it has
    to be in augmented form. If you prefer to enter $N$ equations and $M$
    unknowns then use ``solve(Neqs, *Msymbols)`` instead. Note: a local
    copy of the matrix is made by this routine so the matrix that is
    passed will not be modified.

    The algorithm used here is fraction-free Gaussian elimination,
    which results, after elimination, in an upper-triangular matrix.
    Then solutions are found using back-substitution. This approach
    is more efficient and compact than the Gauss-Jordan method.

    Examples
    ========

    >>> from sympy import Matrix, solve_linear_system
    >>> from sympy.abc import x, y

    Solve the following system::

           x + 4 y ==  2
        -2 x +   y == 14

    >>> system = Matrix(( (1, 4, 2), (-2, 1, 14)))
    >>> solve_linear_system(system, x, y)
    {x: -6, y: 2}

    A degenerate system returns an empty dictionary:

    >>> system = Matrix(( (0,0,0), (0,0,0) ))
    >>> solve_linear_system(system, x, y)
    {}

    rn   )r¼   F)Ú_rawNc                ó&   — i | ]\  }}||k    ¯||“ŒS rq   rq   )rr   r  rä   s      ru   rv   z'solve_linear_system.<locals>.<dictcomp>.	  s#   € ÐAÐAÐA™8˜3 °c¸S²j°jˆs�3°j°j°jrw   )Úshaper©   r   rP   rV   rW   rƒ   )rŽ  r…   rµ   r„   Úringr¶   s         ru   rG  rG  ø  s“   € ð^ Œ<˜Œ?�c '™lœl¨QÑ.Ò.Ð.Ð.Ð.õ ˆv�˜w¨™Ñ/Ô/Ñ/Ñ
0Ô
0€CÝ! # wÑ/Ô/�I€CˆÝ
˜˜T¨Ð
.Ñ
.Ô
.€CØ
€ØAÐA s§y¢y¡{¤{ÐAÑAÔAˆØ€Jrw   c                óú  ‡— |rt          d„ |D ¦   «         ¦  «        st          d¦  «        ‚t          | t          ¦  «        r| j        | j        z
  }n| }t          |¦  «        }t          |                     ¦   «         d         d¬¦  «        }|j	        }|t          |¦  «        z  }|s|                     dd¦  «        rg i fng S |sG |j        |ddiŽ\  }}	|	j	        }
|
|j	        z  }|s|
t          |¦  «        z
  }|st          ¦   «         g}nOt          |¦  «        d	k    rt          |d         ¦  «        r|d         }t!          |g|¦  «        \  }}}|d         }|}t           |j        |Ž                      ¦   «         ¦  «        d	hz
  }t          |¦  «        Št'          ˆfd
„|D ¦   «         ¦  «        rdS t!          |gt)          |¦  «        ¦  «        \  }}}|d         }t)          t+          ||d¬¦  «                             ¦   «         ¦  «        }t/          ||fi |¤Ž}|                     dd¦  «        p|                     dd¦  «        }t1          |¦  «        t2          u s|st          |¦  «        d	k    r|S |d         S )az	  
    Solve a system of equations in $k$ parameters that is formed by
    matching coefficients in variables ``coeffs`` that are on
    factors dependent on the remaining variables (or those given
    explicitly by ``syms``.

    Explanation
    ===========

    The result of this function is a dictionary with symbolic values of those
    parameters with respect to coefficients in $q$ -- empty if there
    is no solution or coefficients do not appear in the equation -- else
    None (if the system was not recognized). If there is more than one
    solution, the solutions are passed as a list. The output can be modified using
    the same semantics as for `solve` since the flags that are passed are sent
    directly to `solve` so, for example the flag ``dict=True`` will always return a list
    of solutions as dictionaries.

    This function accepts both Equality and Expr class instances.
    The solving process is most efficient when symbols are specified
    in addition to parameters to be determined,  but an attempt to
    determine them (if absent) will be made. If an expected solution is not
    obtained (and symbols were not specified) try specifying them.

    Examples
    ========

    >>> from sympy import Eq, solve_undetermined_coeffs
    >>> from sympy.abc import a, b, c, h, p, k, x, y

    >>> solve_undetermined_coeffs(Eq(a*x + a + b, x/2), [a, b], x)
    {a: 1/2, b: -1/2}
    >>> solve_undetermined_coeffs(a - 2, [a])
    {a: 2}

    The equation can be nonlinear in the symbols:

    >>> X, Y, Z = y, x**y, y*x**y
    >>> eq = a*X + b*Y + c*Z - X - 2*Y - 3*Z
    >>> coeffs = a, b, c
    >>> syms = x, y
    >>> solve_undetermined_coeffs(eq, coeffs, syms)
    {a: 1, b: 2, c: 3}

    And the system can be nonlinear in coefficients, too, but if
    there is only a single solution, it will be returned as a
    dictionary:

    >>> eq = a*x**2 + b*x + c - ((x - h)**2 + 4*p*k)/4/p
    >>> solve_undetermined_coeffs(eq, (h, p, k), x)
    {h: -b/(2*a), k: (4*a*c - b**2)/(4*a), p: 1/(4*a)}

    Multiple solutions are always returned in a list:

    >>> solve_undetermined_coeffs(a**2*x + b - x, [a, b], x)
    [{a: -1, b: 0}, {a: 1, b: 0}]

    Using flag ``dict=True`` (in keeping with semantics in :func:`~.solve`)
    will force the result to always be a list with any solutions
    as elements in that list.

    >>> solve_undetermined_coeffs(a*x - 2*x, [a], dict=True)
    [{a: 2}]
    c              3  ó$   K  — | ]}|j         V — Œd S r’   rk  r8  s     ru   r¢   z,solve_undetermined_coeffs.<locals>.<genexpr>s	  s$   è è € Ð7Ð7¨1˜1œ;Ð7Ð7Ð7Ð7Ð7Ð7rw   zmust provide symbols for coeffsr   Tr¾   r“   NÚas_Addrn   c              3  óB   •K  — | ]}|                      ‰¦  «        V — Œd S r’   )Ú	has_xfree)rr   r—  Úcsets     €ru   r¢   z,solve_undetermined_coeffs.<locals>.<genexpr>ž	  s/   øè è € Ð
+Ð
+ ˆ1�;Š;�tÑÔÐ
+Ð
+Ð
+Ð
+Ð
+Ð
+rw   Fr·   rÇ   )rj  r~   r€   r   rÐ   rÊ   rS   r   r×   r¡   r“   rz   rÓ   r   r©   ra   r‹   Úas_coefficients_dictrÕ   r¤   r   r?   rå  r”  r  rÇ   )ÚequÚcoeffsr_  rµ   rª   ÚceqÚxeqr^  r‹  rŒ  Údfreer�   r‡   rå   râ  rŽ  rÃ  Úsettingsr§  s                     @ru   r–  r–  2	  s­  ø€ ðB ð <•sÐ7Ð7°Ð7Ñ7Ô7Ñ7Ô7ð <ÝÐ:Ñ;Ô;Ð;å�#•rÑÔð ØŒW�s”wÑˆˆàˆå
�‰*Œ*€CÝ
�3×%Ò%Ñ'Ô'¨Ô*°dÐ
;Ñ
;Ô
;€CàÔ€DØ•C˜‘K”KÑ€FØð :Ø Ÿ9š9 U¨DÑ1Ô1Ð9��Bˆxˆx°rÐ9àð ð &�3Ô% vÐ;°dÐ;Ð;‰ˆˆSØÔ ˆØ�sÔ'Ñ'ˆØð 	'ð �3˜v™;œ;Ñ&ˆDØð 	Ý‘G”G�9ˆDøåˆt‰9Œ9˜Š>ˆ>�h t¨A¤wÑ/Ô/ˆ>Ø˜”7ˆDÝ# S E¨4Ñ0Ô0‰ˆˆ1ˆaØ�ŒdˆØˆõ Ð'ˆsÔ'¨Ð.×3Ò3Ñ5Ô5Ñ6Ô6¸!¸Ñ<€DÝˆv‰;Œ;€DÝ
Ð
+Ð
+Ð
+Ð
+ dÐ
+Ñ
+Ô
+Ñ+Ô+ð Øˆõ # C 5­$¨t©*¬*Ñ5Ô5�J€A€tˆQØ
ˆAŒ$€Cõ •'˜#˜t¨eÐ4Ñ4Ô4×;Ò;Ñ=Ô=Ñ>Ô>€Fõ �˜Ð)Ð) 5Ð)Ð)€Dð �yŠy˜ Ñ&Ô&Ð@¨%¯)ª)°E¸4Ñ*@Ô*@€HÝˆD�z„z•TÐÐ˜XÐ­¨T©¬°aª¨ØˆØ�Œ7€Nrw   c                ó(  — | j         | j        dz
  k    rt          d¦  «        ‚| d| j         …d| j         …f         }| dd…| j        dz
  d…f         }|                     |¦  «        }i }t	          |j         ¦  «        D ]}||df         |||         <   Œ|S )a  
    Solves the augmented matrix system using ``LUsolve`` and returns a
    dictionary in which solutions are keyed to the symbols of *syms* as ordered.

    Explanation
    ===========

    The matrix must be invertible.

    Examples
    ========

    >>> from sympy import Matrix, solve_linear_system_LU
    >>> from sympy.abc import x, y, z

    >>> solve_linear_system_LU(Matrix([
    ... [1, 2, 0, 1],
    ... [3, 2, 2, 1],
    ... [2, 0, 0, 1]]), [x, y, z])
    {x: 1/2, y: 1/4, z: -1/2}

    See Also
    ========

    LUsolve

    rn   z#Rows should be equal to columns - 1Nr   )ÚrowsÚcolsr~   ÚLUsolver”  )r[  r_  ÚAr¯  rÃ  r  r{   s          ru   Úsolve_linear_system_LUr´  ¶	  s¬   € ð8 „{�f”k A‘oÒ%Ð%ÝÐ>Ñ?Ô?Ð?Øˆ|�”ˆ|˜\˜fœk˜\Ð)Ô*€AØˆqˆqˆq�&”+ ‘/Ð"Ð"Ð"Ô#€AØ�9Š9�Q‰<Œ<€DØ€IÝ�4”9ÑÔð (ð (ˆØ! ! Q $œZˆ	�$�q”'ÑÐØÐrw   c                ó  — g }d}| j         }|                      ¦   «         }t          |¦  «        D ]T}g }d}|D ]%}|                     |||z            ¦  «         ||z  }Œ&t	          |Ž }	|                     |r|	n|	 ¦  «         | }ŒUt          |Ž S )a|  
    Return the determinant of *M* by using permutations to select factors.

    Explanation
    ===========

    For sizes larger than 8 the number of permutations becomes prohibitively
    large, or if there are no symbols in the matrix, it is better to use the
    standard determinant routines (e.g., ``M.det()``.)

    See Also
    ========

    det_minor
    det_quick

    Tr   )r°  Úflatr_   r‚   r	   r   )
ÚMrÎ   r‡   rÝ   Úlist_ÚpermÚfacÚidxrZ  Úterms
             ru   Údet_permr½  Ý	  s°   € ð$ €DØ€AØ	Œ€AØ�FŠF‰HŒH€EÝ˜aÑ Ô ð ð ˆØˆØˆØð 	ð 	ˆAØ�JŠJ�u˜S 1™W”~Ñ&Ô&Ð&Ø�1‰HˆCˆCÝ�CˆyˆØ�Š˜AÐ(�D�D D 5Ñ)Ô)Ð)ØˆEˆˆÝ�ˆ:Ðrw   c                ó´   ‡ — ‰ j         }|dk    r#‰ d         ‰ d         z  ‰ d         ‰ d         z  z
  S t          ˆ fd„t          |¦  «        D ¦   «         ¦  «        S )z�
    Return the ``det(M)`` computed from minors without
    introducing new nesting in products.

    See Also
    ========

    det_perm
    det_quick

    rÀ   )r   r   )rn   rn   )rn   r   )r   rn   c              3  óð   •‡K  — | ]oŠ‰d ‰f         rUd‰dz           t          ˆˆfd„t          j        t          ‰                     d ‰¦  «        ¦  «        ¦  «        D ¦   «         Ž z  nt          j        V — ŒpdS )r   )rn   r¼   rÀ   c                ó*   •— g | ]}‰d ‰f         |z  ‘ŒS r7  rq   )rr   r›   r·  r{   s     €€ru   r}   z'det_minor.<locals>.<genexpr>.<listcomp>
  s1   ø€ ð (?ð (?ð (?°a¨¨!¨Q¨$¬°©	ð (?ð (?ð (?rw   N)r   r¨   Ú	det_minorÚminor_submatrixr   ri  )rr   r{   r·  s    @€ru   r¢   zdet_minor.<locals>.<genexpr>
  s²   øøè è € ð 6ð 6à'(ˆq��A�Œwð#�7˜1˜q™5”>¥#ð (?ð (?ð (?ð (?ð (?ÝŒM�) A×$5Ò$5°a¸Ñ$;Ô$;Ñ<Ô<Ñ=Ô=ð(?ñ (?ô (?ð #@ñ @ð @åœFð6ð 6ð 6ð 6ð 6ð 6rw   )r°  rä  r”  )r·  rÝ   s   ` ru   rÁ  rÁ  ÿ	  sv   ø€ ð 	
Œ€AØˆA‚v€vØ�Œw�q˜”w‰  4¤¨¨4¬¡Ñ0Ð0åð 6ð 6ð 6ð 6å,1°!©H¬Hð6ñ 6ô 6ñ 6ô 6ð 	6rw   c                ó  — t          d„ | D ¦   «         ¦  «        rB| j        dk     r(t          d„ | D ¦   «         ¦  «        rt          | ¦  «        S t	          | ¦  «        S |r|                      |¬¦  «        n|                      ¦   «         S )a  
    Return ``det(M)`` assuming that either
    there are lots of zeros or the size of the matrix
    is small. If this assumption is not met, then the normal
    Matrix.det function will be used with method = ``method``.

    See Also
    ========

    det_minor
    det_perm

    c              3  óJ   K  — | ]}|                      t          ¦  «        V — Œd S r’   ©rÚ   r   r8  s     ru   r¢   zdet_quick.<locals>.<genexpr>"
  s,   è è € Ð
$Ð
$˜Qˆ1�5Š5•‰=Œ=Ð
$Ð
$Ð
$Ð
$Ð
$Ð
$rw   é   c              3  óJ   K  — | ]}|                      t          ¦  «        V — Œd S r’   rÅ  r8  s     ru   r¢   zdet_quick.<locals>.<genexpr>#
  s,   è è € Ð7Ð7°˜aŸeše¥F™mœmÐ7Ð7Ð7Ð7Ð7Ð7rw   )Úmethod)r¤   r°  rj  r½  rÁ  Údet)r·  rÈ  s     ru   Ú	det_quickrÊ  
  s‡   € õ Ð
$Ð
$ !Ð
$Ñ
$Ô
$Ñ$Ô$ð ;ØŒ6�AŠ:ˆ:�#Ð7Ð7°QÐ7Ñ7Ô7Ñ7Ô7ˆ:Ý˜A‘;”;ÐÝ˜‰|Œ|Ðà'-Ð:ˆq�uŠu˜FˆuÑ#Ô#Ð#°1·5²5±7´7Ð:rw   c                óÖ  — t          d„ | D ¦   «         ¦  «        s!t          d„ | D ¦   «         ¦  «        sd„ }nd„ }n|                      ¦   «         S | j        } || ¦  «        }|t          j        k    rt          d¦  «        ‚t          |¦  «        }d}t          |¦  «        D ]H}| x}}t          |¦  «        D ]1} ||  	                    ||¦  «        ¦  «        }	||	z  |z  |||f<   | }Œ2ŒI|S )zzReturn the inverse of ``M``, assuming that either
    there are lots of zeros or the size of the matrix
    is small.
    c              3  ó$   K  — | ]}|j         V — Œd S r’   ©r•   r8  s     ru   r¢   zinv_quick.<locals>.<genexpr>/
  s$   è è € Ð&Ð&˜qˆqŒ{Ð&Ð&Ð&Ð&Ð&Ð&rw   c              3  ó$   K  — | ]}|j         V — Œd S r’   rÍ  r8  s     ru   r¢   zinv_quick.<locals>.<genexpr>0
  s$   è è € Ð*Ð* 1�1”;Ð*Ð*Ð*Ð*Ð*Ð*rw   c                ó    — t          | ¦  «        S r’   )r½  ©rå   s    ru   r  zinv_quick.<locals>.<lambda>1
  s   € �H Q™KœK€ rw   c                ó    — t          | ¦  «        S r’   )rÁ  rÐ  s    ru   r  zinv_quick.<locals>.<lambda>3
  s   € �I a™LœL€ rw   zMatrix det == 0; not invertibler¼   )
rj  r¤   rÎ  r°  r   ri  rO   rQ   r”  rÂ  )
r·  rÉ  rÝ   r›   ÚretÚs1r{   r‡   rZ  rt  s
             ru   Ú	inv_quickrÔ  *
  s  € õ
 Ð&Ð& AÐ&Ñ&Ô&Ñ&Ô&ð ÝÐ*Ð*¨Ð*Ñ*Ô*Ñ*Ô*ð 	)Ø'Ð'ˆCˆCà(Ð(ˆCˆCà�uŠu‰wŒwˆØ	Œ€AØˆˆA‰Œ€AØ�AŒF‚{€{Ý&Ð'HÑIÔIÐIÝ
�‰(Œ(€CØ	€BÝ�1‰XŒXð ð ˆØ�ˆˆˆBÝ�q‘”ð 	ð 	ˆAØ��Q×&Ò& q¨!Ñ,Ô,Ñ-Ô-ˆBØ˜"™˜Q™ˆC��1�‰IØ�ˆAˆAð	ð €Jrw   c                óX   — t          | ¦  «        t          j        t          | ¦  «        z
  fS r’   )r/   r   ÚPir/  s    ru   r  r  G
  s   € •D˜‘G”G�QœT¥D¨¡G¤G™^Ð,€ rw   c                ó^   — t          | ¦  «        dt          j        z  t          | ¦  «        z
  fS ©NrÀ   )r.   r   rÖ  r/  s    ru   r  r  H
  s"   € •D˜‘G”G˜Q�qœt™V¥d¨1¡g¤gÑ-Ð.€ rw   c                ó8   ‡— ˆfd„t          | ‰fi |¤ŽD ¦   «         S )z?return list of scalar values for the solution of e for symbol sc                ó    •— g | ]
}|‰         ‘ŒS rq   rq   )rr   r{   r‡   s     €ru   r}   z_vsolve.<locals>.<listcomp>N
  s   ø€ Ð0Ð0Ð0�QˆAˆaŒDÐ0Ð0Ð0rw   )rs  )r�   r‡   rµ   s    ` ru   rß  rß  L
  s/   ø€ à0Ð0Ð0Ð0�&  AÐ/Ð/¨Ð/Ð/Ð0Ñ0Ô0Ð0rw   c                ó^  ‡‡&‡'‡(‡)‡*‡+— d|vrg |d<   | |d         v rdS |d                               | ¦  «         t          | ‰¦  «        \  }Š(‰(‰k    r|gS 	 ‰(j        rât          t	          ‰(|z
  ¦  «        ¦  «        }|j        rt          |‰fi |¤ŽS |rªt          ‰(|                     dd¦  «        ¬¦  «        }| 	                    t          ¦  «        ‰( 	                    t          ¦  «        k    rOt          |t          ¦  «        r)t          |j        d         t          |¦  «        z
  ‰fi |¤ŽS t          ||z
  ‰fi |¤ŽS �n¿‰(j        �rÜ‰(j        j        r‰(|z
  | k    rt          ‰(|z
  ‰fi |¤ŽS ‰‰(j        j        vr!t          ‰(j        |d‰(j        z  z  z
  ‰fi |¤ŽS t'          d„ |j        D ¦   «         ¦  «        rt(          ‚|s"t          ‰(j        ‰fi |¤Ž}ˆ(ˆfd	„|D ¦   «         S ‰(j                             ‰¦  «        �sÅ‰(j        dk    r|dk    rt          ‰(j        ‰fi |¤Žng S ‰(j        |                     ¦   «         d         k    r/t          ‰(j        |                     ¦   «         d         z
  ‰fi |¤ŽŠ*nTt          t          ‰(j        ¦  «        ‰(j        z  ¦  «        t          t          |¦  «        ¦  «        z
  }t          |‰fi |¤ŽŠ*d
„ Š't/          t          t1          |¦  «        ¦  «        t          t1          ‰(j        ¦  «        ¦  «        z  ¦  «        Š&t3          t5          ‰&¦  «        d         ¦  «        Š&t7          ‰&¦  «        \  }}t9          ‰(j        |z  ||z  z
  ¦  «        dk    r:ˆ&ˆ'ˆ(ˆfd„‰*D ¦   «         Š*‰*                     t          ‰(j        ‰&z
  ‰fi |¤Ž¦  «         t=          t?          ‰*¦  «        ¦  «        S g Š*‰(j        t          ‰(j        ¦  «        z  t          |¦  «        z
  }|‰(|z
  k    r3	 ‰*                     t          |‰fi |¤Ž¦  «         n# t(          $ r Y nw xY wg }	|dk    rz|	                     t          ‰(j        ‰fi |¤Ž¦  «         |	                     t          ‰(j        dz
  ‰fi |¤Ž¦  «         |	                     t          ‰(j        dz   ‰fi |¤Ž¦  «         �nþ|j         �rd„ tC          t1          |j"        ¦  «        ¦  «        D ¦   «         D ]Ú}tG          |j"        |¦  «        \  }
}|sŒtC          t1          |j$        ¦  «        ¦  «        D ]›}||
z  |j$        k    r‹tK          ||¦  «        }|	                     t          ‰(j        |z
  ‰fi |¤Ž¦  «         |	                     t          ‰(j        |z   ‰fi |¤Ž¦  «         |	                     t          ‰(j        |
z
  ‰fi |¤Ž¦  «         ŒœŒÛnï|j&        rè‰(j                             ¦   «         \  }}|‰(j        z   '                    ¦   «         \  }}tQ          |¦  «                             ¦   «         \  }}
d„ t          ‰(j        |z
  ‰fi |¤ŽD ¦   «         }	|	                     d„ t          ‰(j        |
z
  ‰fi |¤ŽD ¦   «         ¦  «         ||z  dk    r-|	                     t          ||z  |||z  z  z
  ‰fi |¤Ž¦  «         |	D ]U}tS          | ‰|¦  «        }|€)|  *                    ‰|¦  «         +                    d¦  «        }|r‰*                      |¦  «         ŒVt=          t?          ‰*¦  «        ¦  «        S ‰(j,        rÔt[          ‰(j        ¦  «        dk    r¼‰(j.        t^          v rrg }t_          ta          ‰(¦  «                 |¦  «        D ]1}|                     t          ‰(j        d         |z
  ‰fi |¤Ž¦  «         Œ2t=          t?          |¦  «        ¦  «        S ‰(j.        tb          k    r,t          ‰(j        d         |t          |¦  «        z  z
  ‰fi |¤ŽS ‰( 2                    t          ¦  «        }tg          |¦  «        }|‰(k    rt          ||z
  ‰fi |¤ŽS n# t(          $ r Y nw xY w| 4                    dd¦  «        �rŸ|  5                    t          ¦  «        }tm          ˆfd„|D ¦   «         pdh¦  «        }|dk    ro‰|z  }to          d¦  «        Š+|  *                    |‰+¦  «        }| 8                    ‰¦  «        s0t          |‰+fi |¤ŽŠ*t          |‰+z
  ‰¦  «        }ˆ*ˆ+fd„|D ¦   «         S ts          |  :                    ¦   «         ‰¦  «        }t?          ¦   «         }|D ]�}t          |t          t          f¦  «        s|j        r+|j        tv          j<        k    r| =                    |¦  «         ŒP|j        rFt	          t}          |¦  «        ¦  «        }|j        r#‰|j        j        v r| =                    |¦  «         Œžt          t}          | ¦  «        ¦  «         *                    t�          t=          tƒ          |dgt[          |¦  «        z  ¦  «        ¦  «        ¦  «        ¦  «        }t}          t          |d¬¦  «        | |z
  z   ¦  «        } t          | ‰¦  «        \  }Š(‰(                     ‰¦  «        �rm	 ‰( :                    ¦   «         }ts          |‰¦  «        }‰(|z
  } t…          | ‰|¦  «        }!t‡          |!¦  «        D ]‡\  }}t/          |¦  «        }"|"|k    rm|" D                    ¦   «         | D                    ¦   «         k    rCtS          | ‰|"¦  «        }|€)|  *                    ‰|"¦  «         +                    d¦  «        }|r|"|!|<   Œˆ|!S # t(          $ rŒ t[          |¦  «        dk    ru	 t‹          ‰(|z
  g|¢R Ž }#|#€t(          ‚|#\  }}Š+d|d<   t          |‰+z
  ‰fi |¤Ž}$|$r,t          |‰+fi |¤ŽŠ*t=          ˆ*ˆ+fd„|$D ¦   «         ¦  «        cY S n# t(          $ r Y nw xY w	 Y nw xY w| 4                    dd¦  «        r“d|d<   t5          ‰(|z
  ¦  «        \  }%Š)|tv          jF        k    rg S ‰) G                    ¦   «         D ]\  Š+}|‰k    r nŒ‰Š+|%                     ‰+¦  «        r-	 t          |%‰+fi |¤Ž}ˆ)fd„|D ¦   «         S # t(          $ r Y nw xY w	 dS )a…  
    Helper for ``_solve`` that solves a transcendental equation with respect
    to the given symbol. Various equations containing powers and logarithms,
    can be solved.

    There is currently no guarantee that all solutions will be returned or
    that a real solution will be favored over a complex one.

    Either a list of potential solutions will be returned or None will be
    returned (in the case that no method was known to get a solution
    for the equation). All other errors (like the inability to cast an
    expression as a Poly) are unhandled.

    Examples
    ========

    >>> from sympy import log, ordered
    >>> from sympy.solvers.solvers import _tsolve as tsolve
    >>> from sympy.abc import x

    >>> list(ordered(tsolve(3**(2*x + 5) - 4, x)))
    [-5/2 + log(2)/log(3), (-5*log(3)/2 + log(2) + I*pi)/log(3)]

    >>> tsolve(log(x) + 2*x, x)
    [LambertW(2)/2]

    Ú
tsolve_sawNrÁ   T)rÁ   r   rn   c              3  ó$   K  — | ]}|j         V — Œd S r’   )Úis_Dummy)rr   r+  s     ru   r¢   z_tsolve.<locals>.<genexpr>�
  s$   è è € Ð8Ð8 !�1”:Ð8Ð8Ð8Ð8Ð8Ð8rw   c                óR   •— g | ]#}‰j                              ‰|¦  «        d k    ¯!|‘Œ$S r7  ©r)   ro   )rr   r‡   rÐ   r  s     €€ru   r}   z_tsolve.<locals>.<listcomp>—
  s3   ø€ ÐIÐIÐI˜a¨s¬w¯|ª|¸CÀÑ/CÔ/CÀqÒ/HÐ/H˜Ð/HÐ/HÐ/Hrw   c                ó¼   — t          ¦   «         }t          | |z
  ||¦  «        }|€7t          | ¦  «        t          |¦  «        k    rdS |                      |¦  «        }|S )NF)r   r³   rC   Úequals)Úexpr1Úexpr2rå   rª   s       ru   Úequalz_tsolve.<locals>.equal©
  s]   € Ý™œ�AÝ! %¨!¡)¨Q°Ñ6Ô6�BØ�zÝ$ UÑ+Ô+­y¸Ñ/?Ô/?Ò?Ð?Ø#( 5ð #Ÿ\š\¨%Ñ0Ô0˜Ø�Irw   c                ó^   •— g | ])} ‰‰j                              ‰|¦  «        ‰¦  «        °'|‘Œ*S rq   rà  )rr   r‡   Úe_ratrå  rÐ   r  s     €€€€ru   r}   z_tsolve.<locals>.<listcomp>¹
  s:   ø€ ÐTÐTÐT °°°s´w·|²|ÀCÈÑ7KÔ7KÈUÑ1SÔ1SÐT˜1ÐTÐTÐTrw   c              3  ó&   K  — | ]}|d k    ¯|V — ŒdS r´  rq   r8  s     ru   r¢   z_tsolve.<locals>.<genexpr>Ð
  s&   è è € ÐHÐH AÀÀaÂÀ˜aÀÀÀÀÐHÐHrw   c                ó,   — g | ]}t          |¦  «        ‘ŒS rq   ©rF   r8  s     ru   r}   z_tsolve.<locals>.<listcomp>Þ
  s   € ÐZÐZÐZ¨q�Z¨™]œ]ÐZÐZÐZrw   c                ó,   — g | ]}t          |¦  «        ‘ŒS rq   rê  r8  s     ru   r}   z_tsolve.<locals>.<listcomp>ß
  s   € Ð!^Ð!^Ð!^°A¥*¨Q¡-¤-Ð!^Ð!^Ð!^rw   Ú	bivariatec                ón   •— h | ]1}|                      t          ¦  «        D ]}|j        ‰k    ¯|j        ’ŒŒ2S rq   )rº   r   r—   r)   )rr   rZ  r{   r  s      €ru   r¥   z_tsolve.<locals>.<setcomp>  sG   ø€ ð ð ð �q¨!¯'ª'µ#©,¬,ð ð  QØ”˜#’�ð ŒUØ���rw   zbivariate-covc                óF   •— g | ]}‰D ]}|                      ‰|¦  «        ‘ŒŒS rq   r   ©rr   r{   r‡   r¶   r  s      €€ru   r}   z_tsolve.<locals>.<listcomp>  s2   ø€ Ð?Ð?Ð?¨¸3Ð?Ð?°a˜Ÿš˜q !™œÐ?Ð?Ð?Ð?rw   )ÚdeeprÀ   Fc                óF   •— h | ]}‰D ]}|                      ‰|¦  «        ’ŒŒS rq   r   rï  s      €€ru   r¥   z_tsolve.<locals>.<setcomp>9  sR   ø€ ð )Að )Að )AØ$%¸Cð)Að )AØ78ð *+¯ª°°1©¬ð )Að )Að )Að )Arw   c                ó:   •— g | ]}|                      ‰¦  «        ‘ŒS rq   r   )rr   r‡   ræ   s     €ru   r}   z_tsolve.<locals>.<listcomp>M  s#   ø€ Ð3Ð3Ð3¨˜Ÿš˜t™œÐ3Ð3Ð3rw   )Hr‚   rC  r.  rT   rB   ro  rß  rE   rz   Úcountr(   r€   rÎ   r)   ré  r�   rØ   r¡   r—   r¤   rd  rÚ   r¬  rC   rÜ   r>   rA   rG   r   rh  r   r“   rÛ   r=   r¬   r   r­  r   Úis_irrationalr×   rF   r³   ro   râ  rÙ   r©   rp  Úmulti_inversesr  r*   r  rN   ra  rº   rH  r   r
  Ú_filtered_gensr0  r   ÚExp1r˜   r   r   rÇ   rq  Ú_solve_lambertrb  Ú	count_opsÚbivariate_typerÝ  rƒ   ),rª   r  rµ   rÊ   r™   Úsol_baserÝ   r›   ÚlogformrM  r�   r+  r‡   r§  Úb_lÚe_lr¯  r‡  rÃ  r{   r  ÚlogsÚspowr¬   ÚueqrÎ  r—  Ú	up_or_logÚgiÚgisimpÚeq_downrø  Ú_eqrV  ÚnsÚgpuÚ	inversionÚposrç  rå  rÐ   ræ   r¶   r  s,    `                                    @@@@@@ru   ré  ré  Q
  s  øøøøøøø€ ð8 ˜5Ð Ð Ø ˆˆlÑØ	ˆU�<Ô Ð Ð ØˆtàˆlÔ×"Ò" 2Ñ&Ô&Ð&å�r˜3ÑÔ�H€Cˆà
ˆc‚z€zØˆuˆðAØŒ:ð y	Iõ •y  s¡Ñ+Ô+Ñ,Ô,ˆAØŒxð 0Ý˜q #Ð/Ð/¨Ð/Ð/Ð/Øð :Ý˜s¨%¯)ª)°G¸TÑ*BÔ*BÐCÑCÔC�Ø—7’7�3‘<”< 3§9¢9­S¡>¤>Ò1Ð1Ý! !¥SÑ)Ô)ð KÝ& q¤v¨a¤yµ3°s±8´8Ñ';¸SÐJÐJÀEÐJÐJÐJÝ" 1 s¡7¨CÐ9Ð9°5Ð9Ð9Ð9ùàŒZñ l	IØŒwÔ!ð <Ø˜‘9 ’?�?Ý" 3¨¡9¨cÐ;Ð;°UÐ;Ð;Ð;à˜#œ'Ô.Ð.Ð.Ý˜sœx¨#°°#´'±	Ñ*:Ñ:¸CÐIÐIÀ5ÐIÐIÐIõ Ð8Ð8 sÔ'7Ð8Ñ8Ô8Ñ8Ô8ð *Ý)Ð)ð ð Jõ # 3¤8¨SÐ:Ð:°EÐ:Ð:�ØIÐIÐIÐIÐI 8ÐIÑIÔIÐIð ”8—<’< Ñ$Ô$ñ N&Ø”8˜q’=�=Ø=@ÀAºX¸X�7 3¤7¨CÐ9Ð9°5Ð9Ð9Ð9È2ÐMð ”8˜sŸšÑ0Ô0°Ô3Ò3Ð3å! #¤'¨C¯OªOÑ,=Ô,=¸aÔ,@Ñ"@À#ÐOÐOÈÐOÐO�C�Cõ �C ¤™MœM¨#¬'Ñ1Ñ2Ô2µS½¸S¹¼±]´]ÑB�AÝ! ! SÐ2Ð2¨EÐ2Ð2�Cð	ð 	ð 	õ "¥#¥c¨#¡h¤h¡-¤-µµC¸¼±M´MÑ0BÔ0BÑ"BÑCÔC�Ý ¥¨¡¤¨qÔ!1Ñ2Ô2�Ý ‘”‘��1Ý˜#œ( A™+¨¨Q©Ñ.Ñ/Ô/°1Ò4Ð4ØTÐTÐTÐTÐTÐTÐT cÐTÑTÔT�CØ—J’J�w s¤w°¡¸ÐEÐE¸uÐEÐEÑFÔFÐFå�C ™HœH‘~”~Ð%ð �Øœ'¥# c¤h¡-¤-Ñ/µ#°c±(´(Ñ:�Ø˜c C™iÒ'Ð'ðØŸ
š
¥7¨7°CÐ#AÐ#A¸5Ð#AÐ#AÑBÔBÐBÐBøÝ.ð ð ð Ø˜ðøøøð �Ø˜!’8�8à—L’L¥¨¬°#Ð!?Ð!?¸Ð!?Ð!?Ñ@Ô@Ð@Ø—L’L¥¨¬°A©°sÐ!DÐ!D¸eÐ!DÐ!DÑEÔEÐEØ—L’L¥¨¬°A©°sÐ!DÐ!D¸eÐ!DÐ!DÑEÔEÐEÑEØ”_ñ SØHÐH­µ#°c´e±*´*Ñ)=Ô)=ÐHÑHÔHð 	Qð 	Q˜Ý*¨3¬5°!Ñ4Ô4™˜˜1Ø ð %Ø$Ý!)­#¨c¬e©*¬*Ñ!5Ô!5ð Qð Q˜AØ  !™t c¤eš|˜|Ý$,¨Q°¡N¤N Ø %§¢­W°S´XÀ±\À3Ð-PÐ-PÈ%Ð-PÐ-PÑ QÔ QÐ QØ %§¢­W°S´XÀ±\À3Ð-PÐ-PÈ%Ð-PÐ-PÑ QÔ QÐ QØ %§¢­W°S´W¸q±[À#Ð-OÐ-OÈÐ-OÐ-OÑ PÔ PÐ PøðQð		Qð Ô&ð SØ"œx×3Ò3Ñ5Ô5‘H�C˜Ø ¤™K×7Ò7Ñ9Ô9‘D�A�qÝ% c™?œ?×6Ò6Ñ8Ô8‘D�A�qØZÐZµW¸S¼XÈ¹\È3Ð5XÐ5XÐRWÐ5XÐ5XÐZÑZÔZ�EØ—L’LÐ!^Ð!^½'À#Ä'ÈAÁ+ÈsÐ:\Ð:\ÐV[Ð:\Ð:\Ð!^Ñ!^Ô!^Ñ_Ô_Ð_Ø˜1‘u ’z�zØŸš¥W¨S°!©V°c¸CÀ¹E±lÑ-BÀCÐ%QÐ%QÈ5Ð%QÐ%QÑRÔRÐRØð &ð &�AÝ! " c¨1Ñ-Ô-�BØ�zØŸWšW S¨!™_œ_×3Ò3°AÑ6Ô6˜Øð &ØŸ
š
 1™œ˜øÝ�C ™HœH‘~”~Ð%àŒ_ð 	I¥ S¤X¡¤°!Ò!3Ð!3ØŒx�>Ð)Ð)à�Ý'­¨S©	¬	Ô2°3Ñ7Ô7ð Hð H�AØ—K’K¥¨¬°¬°a©¸Ð FÐ FÀÐ FÐ FÑGÔGÐGÐGÝ�C ™IœI‘”Ð&Ø”�XÒ%Ð%Ý˜sœx¨œ{¨Sµ°S±´©\Ñ9¸3ÐHÐHÀ%ÐHÐHÐHà—+’+�cÑ"Ô"ˆÝ˜'Ñ"Ô"ˆØ�cŠ>ˆ>Ý˜7 S™=¨#Ð7Ð7°Ð7Ð7Ð7ð øåð ð ð Øˆðøøøð ‡y‚y�˜dÑ#Ô#ñ Bð �xŠx�‰}Œ}ˆÝðð ð ð ˜Dð ñ ô ð &Ø#$ #ñ'ô 'ˆð �1Š9ˆ9Ø�T‘	ˆAÝ�oÑ&Ô&ˆAØ—'’'˜!˜Q‘-”-ˆCØ—<’< Ñ$Ô$ð @Ý˜c 1Ð.Ð.¨Ð.Ð.�Ý˜a !™e SÑ)Ô)�Ø?Ð?Ð?Ð?Ð?¨cÐ?Ñ?Ô?Ð?å˜2Ÿ:š:™<œ<¨Ñ-Ô-ˆÝ‘E”Eˆ	Øð 	&ð 	&ˆBÝ˜"�s¥C˜jÑ)Ô)ð &¨b¬ið &¸B¼GÅqÄvÒ<MÐ<MØ—’˜bÑ!Ô!Ð!Ð!Ø”ð &Ý"Õ#3°BÑ#7Ô#7Ñ8Ô8�Ø”=ð & S¨F¬JÔ,CÐ%CÐ%CØ—M’M "Ñ%Ô%Ð%øÝÕ-¨bÑ1Ô1Ñ2Ô2×7Ò7Ý••c˜) a S­¨Y©¬Ñ%7Ñ8Ô8Ñ9Ô9Ñ:Ô:ñ<ô <ˆå�f W°4Ð8Ñ8Ô8¸BÀ¹LÑIÑJÔJˆÝ˜2˜sÑ#Ô#‰ˆˆSØ�7Š7�3‰<Œ<ñ "	ð!Ø—{’{‘}”}�Ý" 4¨Ñ-Ô-�Ø˜C‘i�Ý% c¨3°Ñ2Ô2�õ & d™OœOð )ð )‘D�A�qÝ" 1™œ�BØ˜Q’w�w 2§<¢<¡>¤>°Q·[²[±]´]Ò#BÐ#BÝ% c¨3°Ñ3Ô3˜Ø˜:Ø!$§¢¨#¨rÑ!2Ô!2×!9Ò!9¸!Ñ!<Ô!<˜BØð )Ø&(˜D ™GøØ�øÝ&ð ð ð å�q‘6”6˜Q’;�;ðÝ,¨S°3©YÐ;¸Ð;Ð;Ð;˜Ø˜;Ý"5Ð5Ø"%™˜˜1˜aØ-2˜˜kÑ*Ý$+¨A°©E°3Ð$@Ð$@¸%Ð$@Ð$@˜	Ø$ð BÝ")¨!¨QÐ"8Ð"8°%Ð"8Ð"8˜CÝ#'ð )Að )Að )Að )Að )AØ)2ð)Añ )Aô )Añ $Bô $Bð Bð Bð BðBøõ /ð ð ð Ø˜ðøøøð øøð#øøøð& ‡y‚y�˜$ÑÔð Øˆˆg‰Ý˜3 ™9Ñ%Ô%‰	ˆˆTØ•!Ô#Ò#Ð#ØˆIØ—J’J‘L”Lð 	ð 	‰DˆAˆqØ�CŠxˆxØ�ð ð ˆAØ�7Š7�1‰:Œ:ð 	ðÝ˜s AÐ/Ð/¨Ð/Ð/�Ø3Ð3Ð3Ð3¨dÐ3Ñ3Ô3Ð3øÝ&ð ð ð Ø�ðøøøð à
€FsÎ   Á:`> ÂB`> Ä+`> Ä</`> Å,.`> ÆA`> Ç$A `> È%F`> Ï7`> Ï<!P Ð`> Ð
P+Ð(`> Ð*P+Ð+K6`> Ü"B`> ß;`> ß=?`> à>
aá
aêCm+ í+pî	A o-ï)pï,pï-
o:ï7pï9o:ï:pð pò r ò
r)ò(r)F©rÇ   c                ó8  — d|v rt          t          d¦  «        ¦  «        ‚d|v r#ddl}|                     d¦  «        |j        _        | }ddlm}  t          |¦  «        dk    r…|d         }|d         }|d	         }t          |¦  «        r]t          |¦  «        rNt          |¦  «        t          |¦  «        k    r.t          d
t          |¦  «        t          |¦  «        fz  ¦  «        ‚n•t          |¦  «        d	k    r1|d         }d}|d         }t          |¦  «        rt          d¦  «        ‚nQt          |¦  «        d	k     rt          dt          |¦  «        z  ¦  «        ‚t          dt          |¦  «        z  ¦  «        ‚|                     ddg¦  «        }t          |¦  «        r_t          |¦  «        }t          |¦  «        D ],\  }	}
t          |
t          ¦  «        r|
j        |
j        z
  ||	<   Œ-t%          |¦  «        j        }t          |¦  «        rt          |¦  «        }t          |t$          ¦  «        sÜt          |t          ¦  «        r|j        |j        z
  }n|j        rt          d¦  «        ‚|j        }|€&|                     ¦   «                              ¦   «         }t          |¦  «        dk    r||v s&|d         |v st          t          d¦  «        ¦  «        ‚t/          |||¦  «        }t1          t3          ||fi |¤Ž¦  «        }|r||igS |S t          |¦  «        |j        k    rt7          t          d¦  «        ¦  «        ‚|                     dd¦  «        }|rt9          d¦  «         t9          |¦  «         |                     |¦  «        }|rt9          d¦  «         t9          |¦  «         t/          ||j        |¦  «        }t/          |||¦  «        }t3          ||fd|i|¤Ž}|r$ | t=          |d„ |D ¦   «         ¦  «        ¦  «        gS t%          |¦  «        S )a  
    Solve a nonlinear equation system numerically: ``nsolve(f, [args,] x0,
    modules=['mpmath'], **kwargs)``.

    Explanation
    ===========

    ``f`` is a vector function of symbolic expressions representing the system.
    *args* are the variables. If there is only one variable, this argument can
    be omitted. ``x0`` is a starting vector close to a solution.

    Use the modules keyword to specify which modules should be used to
    evaluate the function and the Jacobian matrix. Make sure to use a module
    that supports matrices. For more information on the syntax, please see the
    docstring of ``lambdify``.

    If the keyword arguments contain ``dict=True`` (default is False) ``nsolve``
    will return a list (perhaps empty) of solution mappings. This might be
    especially useful if you want to use ``nsolve`` as a fallback to solve since
    using the dict argument for both methods produces return values of
    consistent type structure. Please note: to keep this consistent with
    ``solve``, the solution will be returned in a list even though ``nsolve``
    (currently at least) only finds one solution at a time.

    Overdetermined systems are supported.

    Examples
    ========

    >>> from sympy import Symbol, nsolve
    >>> import mpmath
    >>> mpmath.mp.dps = 15
    >>> x1 = Symbol('x1')
    >>> x2 = Symbol('x2')
    >>> f1 = 3 * x1**2 - 2 * x2**2 - 1
    >>> f2 = x1**2 - 2 * x1 + x2**2 + 2 * x2 - 8
    >>> print(nsolve((f1, f2), (x1, x2), (-1, 1)))
    Matrix([[-1.19287309935246], [1.27844411169911]])

    For one-dimensional functions the syntax is simplified:

    >>> from sympy import sin, nsolve
    >>> from sympy.abc import x
    >>> nsolve(sin(x), x, 2)
    3.14159265358979
    >>> nsolve(sin(x), 2)
    3.14159265358979

    To solve with higher precision than the default, use the prec argument:

    >>> from sympy import cos
    >>> nsolve(cos(x) - x, 1)
    0.739085133215161
    >>> nsolve(cos(x) - x, 1, prec=50)
    0.73908513321516064165531208767387340401341175890076
    >>> cos(_)
    0.73908513321516064165531208767387340401341175890076

    To solve for complex roots of real functions, a nonreal initial point
    must be specified:

    >>> from sympy import I
    >>> nsolve(x**2 + 2, I)
    1.4142135623731*I

    ``mpmath.findroot`` is used and you can find their more extensive
    documentation, especially concerning keyword parameters and
    available solvers. Note, however, that functions which are very
    steep near the root, the verification of the solution may fail. In
    this case you should use the flag ``verify=False`` and
    independently verify the solution.

    >>> from sympy import cos, cosh
    >>> f = cos(x)*cosh(x) - 1
    >>> nsolve(f, 3.14*100)
    Traceback (most recent call last):
    ...
    ValueError: Could not find root within given tolerance. (1.39267e+230 > 2.1684e-19)
    >>> ans = nsolve(f, 3.14*100, verify=False); ans
    312.588469032184
    >>> f.subs(x, ans).n(2)
    2.1e+121
    >>> (f/f.diff(x)).subs(x, ans).n(2)
    7.4e-15

    One might safely skip the verification if bounds of the root are known
    and a bisection method is used:

    >>> bounds = lambda i: (3.14*i, 3.14*(i + 1))
    >>> nsolve(f, bounds(100), solver='bisect', verify=False)
    315.730061685774

    Alternatively, a function may be better behaved when the
    denominator is ignored. Since this is not always the case, however,
    the decision of what function to use is left to the discretion of
    the user.

    >>> eq = x**2/(1 - x)/(1 - 2*x)**2 - 100
    >>> nsolve(eq, 0.46)
    Traceback (most recent call last):
    ...
    ValueError: Could not find root within given tolerance. (10000 > 2.1684e-19)
    Try another starting point or tweak arguments.
    >>> nsolve(eq.as_numer_denom()[0], 0.46)
    0.46792545969349058

    rÈ  zò
            Keyword "method" should not be used in this context.  When using
            some mpmath solvers directly, the keyword "method" is
            used, but when using nsolve (and findroot) the keyword to use is
            "solver".Úprecr   Nr  é   rn   rÀ   z0nsolve expected exactly %i guess vectors, got %iz"nsolve expected 3 arguments, got 2z,nsolve expected at least 2 arguments, got %iz+nsolve expected at most 3 arguments, got %iÚmodulesÚmpmathz!nsolve cannot accept inequalitieszB
                expected a one-dimensional and numerical functionz9
            need at least as many equations as variablesÚverboseFzf(x):zJ(x):ÚJc                ó,   — g | ]}t          |¦  «        ‘ŒS rq   )r#   )rr   rÍ  s     ru   r}   znsolve.<locals>.<listcomp>  s   € Ð 9Ð 9Ð 9°¥¨¡¤Ð 9Ð 9Ð 9rw   )r~   r\   r  ra  ÚmpÚdpsÚbuiltinsrÇ   r©   ra   rà  rz   r   rb  r€   r   rÐ   rÊ   rP   r�  rÒ   r¡   rI  r[   r#   rg   r±  rd  ÚprintÚjacobianrq  )rÇ   rÎ   Úkwargsr  r�  r™   ÚfargsÚx0r  r{   r´   r_  r0  r  r  s                  ru   Únsolver  X  sV  € ð^ �6ÐÐÝ�ð %ñ ô ñ ô ð 	ð �ÐÐØˆˆˆØŸ
š
 6Ñ*Ô*ˆŒ	Œð €GØÐÐÐÐÐõ ˆ4�y„y�A‚~€~Ø�ŒGˆØ�Q”ˆØ�!ŒWˆÝ�E‰?Œ?ð 	9�x¨™|œ|ð 	9Ý�2‰wŒw�#˜e™*œ*Ò$Ð$ÝÐ RÝ#& u¡:¤:­s°2©w¬wÐ"7ñ!8ñ 9ô 9ð 9øå	ˆT‰Œ�aŠˆØ�ŒGˆØˆØ�!ŒWˆÝ�A‰;Œ;ð 	BÝÐ@ÑAÔAÐAð	Bå	ˆT‰Œ�QŠˆÝÐFÝ˜d™)œ)ñ$ñ %ô %ð 	%õ ÐEÝ˜d™)œ)ñ$ñ %ô %ð 	%à�jŠj˜ X JÑ/Ô/€GÝ��{„{ð Ý�‰GŒGˆÝ˜q‘\”\ð 	'ð 	'‰EˆAˆrÝ˜"�bÑ!Ô!ð 'Ø”v ¤‘��!‘øÝ�1‰IŒIŒKˆÝ��|„|ð Ý�"‰XŒXˆÝ�a�Ñ Ô ð å�a�ÑÔð 	AØ”˜œ‘ˆAˆAØŒ_ð 	AÝÐ?Ñ@Ô@Ð@ØŒ~ˆØˆ=Ø—I’I‘K”K—O’OÑ%Ô%ˆEÝ�D‘	”	˜Q’� E¨T M M°U¸1´XÀÐ5EÐ5EÝ�Zð )Eñ Fô Fñ Gô Gð Gõ �U˜A˜wÑ'Ô'ˆÝ•H˜Q Ð-Ð- fÐ-Ð-Ñ.Ô.ˆØð 	 Ø˜A�J�<ÐØˆå
ˆ5�z„z�A”FÒÐÝ!¥*ð .<ñ #=ô #=ñ >ô >ð 	>à�jŠj˜ EÑ*Ô*€GØð Ýˆg‰ŒˆÝˆa‰Œˆà	�
Š
�5ÑÔ€AØð Ýˆg‰ŒˆÝˆa‰Œˆå�˜œ˜WÑ%Ô%€AÝ�˜˜7Ñ#Ô#€Aå��BÐ&Ð&˜!Ð&˜vÐ&Ð&€AØð =Ø�•S˜Ð 9Ð 9°qÐ 9Ñ 9Ô 9Ñ:Ô:Ñ;Ô;Ð<Ð<Ý�!‰9Œ9Ðrw   c           	     óª  — t          | ¦  «        } | j        r | j        | j        Ž } | j        }|s|}|t	          |¦  «        z  s| t
          j        fS t          |                     dd¦  «        ¦  «        }| }t
          j        }	 |}	  |j	        |Ž \  }}	|j
        r|j        rn|	}||z  }n|t
          j        u rn|	}||z  }Œ;|j
        rãi }
|j        D ]8} |j	        |Ž \  }}|
                     |g ¦  «                             |¦  «         Œ9t          d„ |
                     ¦   «         D ¦   «         ¦  «        rvg }|
                     ¦   «         D ]V\  }}t%          |¦  «        dk    r |                     t'          |Ž |z  ¦  «         Œ8|                     |d         |z  ¦  «         ŒWt'          |Ž }|j
        �rÑ|�sÎt%          |j        ¦  «        dk    �rµ |j        |Ž �sªt+          |j        ¦  «        \  }} |j	        |Ž \  }} |j	        |Ž \  }}t          d„ ||fD ¦   «         ¦  «        r™|                     ¦   «         \  }}|                     ¦   «         \  }}||k    r>|                     |¦  «        €)t1          t3          ||z  ¦  «        ¦  «        }|}| |z  }�n-||z  }t1          ||z  ¦  «        }||k    r|}| |z  }�n|| k    r½t5          |t6          ¦  «        r¨|j        |j        k    r˜t%          |j        ¦  «        t%          |j        ¦  «        cxk    rdk    rn n|j        d         |j        d         z
  }nŠt%          |j        ¦  «        t%          |j        ¦  «        k    rt9          d
¦  «        ‚t;          d¦  «        ‚nA|j        r:t          d„ |j        D ¦   «         ¦  «        rt1          t3          |¦  «        ¦  «        }|j        �r\tA          |d¦  «        rW| !                    ¦   «         �Ct%          |j        ¦  «        dk    r+ | !                    ¦   «         |¦  «        }|j        d         }nõt5          |tD          ¦  «        r9|j        \  }}dtG          |tI          |dz  |dz  z   ¦  «        |z   z  ¦  «        z  }n§|j        |j        k    r—t%          |j        ¦  «        t%          |j        ¦  «        cxk    rdk    rn n|j        d         }|j        d         }nHt%          |j        ¦  «        t%          |j        ¦  «        k    rt9          d
¦  «        ‚t;          d¦  «        ‚|r(|j%        r!|j&        j'        r|j&        dk     r
d|z  }d|z  }|j%        rn|j&        j'        r|sL|j&        j'        sTt%          |¦  «        dk    rAt%          |j(        j        t	          |¦  «        z  ¦  «        dk    r|d|j&        z  z  }|j(        }||k    rn�ŒN||fS )aY  
    Return tuple (i, d) where ``i`` is independent of *symbols* and ``d``
    contains symbols.

    Explanation
    ===========

    ``i`` and ``d`` are obtained after recursively using algebraic inversion
    until an uninvertible ``d`` remains. If there are no free symbols then
    ``d`` will be zero. Some (but not necessarily all) solutions to the
    expression ``i - d`` will be related to the solutions of the original
    expression.

    Examples
    ========

    >>> from sympy.solvers.solvers import _invert as invert
    >>> from sympy import sqrt, cos
    >>> from sympy.abc import x, y
    >>> invert(x - 3)
    (3, x)
    >>> invert(3)
    (3, 0)
    >>> invert(2*cos(x) - 1)
    (1/2, cos(x))
    >>> invert(sqrt(x) - 3)
    (3, sqrt(x))
    >>> invert(sqrt(x) + y, x)
    (-y, sqrt(x))
    >>> invert(sqrt(x) + y, y)
    (-sqrt(x), y)
    >>> invert(sqrt(x) + y, x, y)
    (0, sqrt(x) + y)

    If there is more than one symbol in a power's base and the exponent
    is not an Integer, then the principal root will be used for the
    inversion:

    >>> invert(sqrt(x + y) - 2)
    (4, x + y)
    >>> invert(sqrt(x + y) + 2)  # note +2 instead of -2
    (4, x + y)

    If the exponent is an Integer, setting ``integer_power`` to True
    will force the principal root to be selected:

    >>> invert(x**2 - 4, integer_power=True)
    (2, x)

    Úinteger_powerFTc              3  ó<   K  — | ]}t          |¦  «        d k    V — ŒdS r´  r»  rƒ  s     ru   r¢   z_invert.<locals>.<genexpr>€  s,   è è € Ð6Ð6 !•3�q‘6”6˜A’:Ð6Ð6Ð6Ð6Ð6Ð6rw   rn   r   rÀ   c              3  ó4   K  — | ]}t          |¦  «        V — Œd S r’   ©r�   r8  s     ru   r¢   z_invert.<locals>.<genexpr>�  s(   è è € Ð/Ð/ •6˜!‘9”9Ð/Ð/Ð/Ð/Ð/Ð/rw   Nz(equal function with more than 1 argumentz'function with different numbers of argsc              3  ó4   K  — | ]}t          |¦  «        V — Œd S r’   r!  r  s     ru   r¢   z_invert.<locals>.<genexpr>­  s(   è è € Ð<Ð<¨a¥ q¡	¤	Ð<Ð<Ð<Ð<Ð<Ð<rw   Úinverse))r#   rÎ   rp  r¡   r“   r   ri  rÑ   rz   rÓ   r.  r–   r¦   r^  r‚   r¤   rå  rƒ   r©   r   Úis_polynomialr!   r¬  Úextract_additivelyr@   rB   r€   r   rd  r~   ro  rÙ   Úhasattrr#  r6   r0   r5   r�   r)   rØ   r—   )rª   r…   r  r^  ÚdointpowrÐ   rÊ   r‚  ÚindeprŒ  rD  r  r{   r›   rÎ   r¯  ÚaiÚadÚbiÚbdÚa_baseÚa_expÚb_baseÚb_expÚratÚ_lhsÚyr0  s                               ru   rC  rC  "  sS  € õf 
�‰Œ€BØ	„wð àˆRŒW�b”gÐˆØŒ?€DØð ØˆØ•#�g‘,”,Ñð Ø•1”6ˆzÐå�F—J’J˜°Ñ6Ô6Ñ7Ô7€Hà
€CÝ
Œ&€Cð|Øˆð	Ø+˜Ô+¨WÐ5‰JˆE�3ð Œzð à”=ð Øà�Ø�u‘��ð
 �AœE�>�>Øà�Ø�u‘�ð'	ð, Œ:ð 	!ØˆEØ”Xð 2ð 2�Ø'�qÔ'¨Ð1‘��1Ø× Ò   BÑ'Ô'×.Ò.¨qÑ1Ô1Ð1Ð1ÝÐ6Ð6 u§|¢|¡~¤~Ð6Ñ6Ô6Ñ6Ô6ð !Ø�Ø!ŸKšK™MœMð ,ð ,‘D�A�qÝ˜1‘v”v ’z�zØŸš¥C¨ G¨A¡IÑ.Ô.Ð.Ð.àŸš A a¤D¨¡FÑ+Ô+Ð+Ð+Ý˜4�j�ð Œ:ñ #	*˜cñ #	*¥c¨#¬(¡m¤m°qÒ&8Ñ&8Ø%�CÔ% wÐ/ñ '9å˜3œ8Ñ$Ô$‰DˆAˆqØ%�QÔ% wÐ/‰FˆB�Ø%�QÔ% wÐ/‰FˆB�ÝÐ/Ð/ r¨2 hÐ/Ñ/Ô/Ñ/Ô/ð GØ "§¢Ñ 0Ô 0‘�˜Ø "§¢Ñ 0Ô 0‘�˜Ø˜VÒ#Ð#¨×(@Ò(@ÀÑ(GÔ(GÐ(Oõ "¥)¨B¨r©EÑ"2Ô"2Ñ3Ô3�CØ�CØ˜#˜b™&�C‘Cà˜R™%�CÝ" 2 b¡5™>œ>�DØ˜s’{�{Ø"˜Ø!˜c "™f˜ùØ˜�s’�Ý˜b¥(Ñ+Ô+ð 
G°´¸2¼7Ò0BÐ0BÝ˜2œ7‘|”|¥s¨2¬7¡|¤|Ð8Ð8Ò8Ð8°qÒ8Ð8Ð8Ð8Ð8Ø œg aœj¨2¬7°1¬:Ñ5˜˜Ý˜RœW™œ­¨R¬W©¬Ò5Ð5õ 2ØFñHô Hð Hõ )ØEñGô Gð Gøð ŒZð 	*�CÐ<Ð<°3´8Ð<Ñ<Ô<Ñ<Ô<ð 	*Ý�) C™.œ.Ñ)Ô)ˆCàŒ?ñ 	CÝ�s˜IÑ&Ô&ð C¨3¯;ª;©=¬=Ð+DÍÈSÌXÉÌÐZ[ÒI[ÐI[ð $�c—k’k‘m”m CÑ(Ô(�Ø”h˜q”k��Ý˜C¥Ñ'Ô'ð CØ”x‘��1Ø�˜Q¥ Q¨¡T¨A¨q©D¡[Ñ 1Ô 1°AÑ 5Ñ6Ñ7Ô7Ñ7��Ø”˜SœXÒ%Ð%Ý�s”x‘=”=¥C¨¬¡M¤MÐ6Ð6Ò6Ð6°QÒ6Ð6Ð6Ð6Ð6Øœ( 1œ+�CØœ( 1œ+�C�CÝ˜œ‘]”]¥c¨#¬(¡m¤mÒ3Ð3õ .ØBñDô Dð Dõ %ØAñCô Cð Cð ð 	�3”:ð 	 #¤'Ô"4ð 	¸¼À1º¸Ø�C‘%ˆCØ�C‘%ˆCð Œ:ð 	ØŒGÔð	Ø#+ð	Ø36´7Ô3Eð	å�G‘”˜qÒ Ð ¥S¨¬Ô)>ÅÀWÁÄÑ)MÑ%NÔ%NÐQRÒ%RÐ%RØ˜˜#œ'™	Ñ"ˆCØ”(ˆCà�#Š:ˆ:Øñy|ðz �ˆ8€Orw   c                óˆ  ‡‡‡?‡@‡A‡B‡C‡D‡E‡F‡G‡H— dddœŠHˆDˆHfd„}d„ }d„ ŠAˆAˆfd„ŠC‰                      d‰C¦  «        ŠCt          | t          ¦  «        r| j        | j        z
  } nt          | t
          ¦  «        sdS ˆfd	„t          g dd
dœ                     ¦   «         ¦  «        D ¦   «         \  ŠD}}t          t          | dd¬¦  «        ¦  «        } |  
                    ¦   «         d
         } t          | d¬¦  «        } | j        rdS t          ‰¦  «        p| j        Š|                      ¦   «         }ˆCfd„|j        D ¦   «         }|sdS  | j        |Ž }|€dS t#          ˆfd„|D ¦   «         ¦  «        rdS ˆAfd„ŠB ‰B|¦  «        \  }	}
}t%          dd¬¦  «        }t          ¦   «         }|	D ]}|                     ‰|j        z  ¦  «         Œ |‰k    r|Št)          t+          |	t-          t/          |	¦  «        ¦  «        ¦  «        ¦  «        ŠEdg iŠGt1          j        |                     ¦   «         ¦  «        }|D ]š} ‰C|¦  «        rbt          |                     ¦   «         j        ¦  «                             |	¦  «        }t9          t          ˆEfd„|D ¦   «         ¦  «        ¦  «        }nd}‰G                      |g ¦  «                             |¦  «         Œ›t1          ‰G                     d¦  «        Ž }ˆGfd„‰G                     ¦   «         D ¦   «         ŠGtA          tC          tA          tE          ‰G¦  «        ¦  «        ¦  «        ¦  «        ŠGd}tG          | ¦  «        }t/          ‰G¦  «        dk    r)‰Gd
         j$        r|dk    s‰Gd
         |z  | |z  z
  } d}�	n$t/          ‰G¦  «        dk    r'‰Gd
         j$        rtA          ‰Gd
         j%        ¦  «        ŠGt/          |
¦  «        dk    rä|
                     ¦   «         }t/          ‰¦  «        dk    r|j        }n‰}tA          tE          |¦  «        ¦  «        d
         }	 tM          ||z  |z
  |fi ‰H¤Ž}|stN          ‚|                     ¦   «          (                    |||z  ¦  «         (                    ||d
         ¦  «        }  ||||z  |z
  ¦  «          || ‰D¦  «        S # tN          $ r Y nw xY wt/          ‰G¦  «        dk    �r®|s‰Gd
         |z  ‰Gd          |z  z
  } d}�nètS          |d¦  «        j*        �sx‰G\  }}‰ +                    dd¦  «        r||}} ‰B|                     ¦   «         ¦  «        x}\  }}} ‰B|                     ¦   «         ¦  «        x}\  } }!}"t-          d¦  «        D �]}#|#r||}}||}}|\  } }$}"tY          | Ž } | |"z  }%||"z  |%z
  }&‰D ]Ò}	 tM          |&|fi ‰H¤Ž}'|'stN          ‚| (                    ||'d
         ¦  «        ||z  | z  z   |z   }(t[          |(|¦  «        })|)rL|)\  } }*|*r8|*\  }+}, ||+|& (                    |tM          |,|fi ‰H¤Žd
         ¦  «        ¦  «         n |||&¦  «         n|(}  |||&¦  «         d} n!# tN          $ r |#rtO          d¦  «        ‚Y ŒÏw xY w|r n�Œ�nXt/          ‰G¦  «        dk    �rDˆBfd„‰GD ¦   «         ŠFd
Š@dŠ?d}-‰Fd
         |-         dk    rQ‰F                     ‰F                     d
¦  «        ¦  «         ‰G                     ‰G                     d
¦  «        ¦  «         nb‰Fd         |-         dk    rP‰F                     ‰F                     d¦  «        ¦  «         ‰G                     ‰G                     d¦  «        ¦  «         ‰Fd
         |-         ‰Fd         |-         cxk    rdk    �rEn �nA‰Fd         ‰?         ‰Fd         ‰?         k    r.‰Fd         ‰Fd
         c‰Fd
<   ‰Fd<   ‰Gd         ‰Gd
         c‰Gd
<   ‰Gd<   ‰Fd         ‰?         ‰Fd         ‰?         k    r'‰Gd
         dz  ‰Gd         ‰Gd         z   |z   dz  z   } d}�n°‰Fd         |-         dk     �r�d„ dD ¦   «         \  }.}}&}/}0}1|&|/z
  |0dz  |.d z  z  d|0dz  z  |1z  |.d!z  z  |dz  z  z   d|0dz  z  |.d!z  z  |&dz  z  z
  d |0dz  z  |.d!z  z  |&dz  z  |/z  z   d |0dz  z  |.d!z  z  |&z  |/dz  z  z
  d|0dz  z  |.d!z  z  |/dz  z  z   d|0z  |1dz  z  |.dz  z  |d!z  z  z   d"|0z  |1z  |.dz  z  |dz  z  |&dz  z  z   d#|0z  |1z  |.dz  z  |dz  z  |&dz  z  |/z  z
  d#|0z  |1z  |.dz  z  |dz  z  |&z  |/dz  z  z   d"|0z  |1z  |.dz  z  |dz  z  |/dz  z  z
  d|0z  |.dz  z  |&d!z  z  z   d$|0z  |.dz  z  |&dz  z  |/z  z
  d%|0z  |.dz  z  |&d&z  z  |/dz  z  z   d'|0z  |.dz  z  |&dz  z  |/dz  z  z
  d%|0z  |.dz  z  |&dz  z  |/d&z  z  z   d$|0z  |.dz  z  |&z  |/dz  z  z
  d|0z  |.dz  z  |/d!z  z  z   |1dz  |d z  z  z   d|1dz  z  |d!z  z  |&dz  z  z
  d |1dz  z  |d!z  z  |&dz  z  |/z  z   d |1dz  z  |d!z  z  |&z  |/dz  z  z
  d|1dz  z  |d!z  z  |/dz  z  z   d|1z  |dz  z  |&d!z  z  z   d$|1z  |dz  z  |&dz  z  |/z  z
  d%|1z  |dz  z  |&d&z  z  |/dz  z  z   d'|1z  |dz  z  |&dz  z  |/dz  z  z
  d%|1z  |dz  z  |&dz  z  |/d&z  z  z   d$|1z  |dz  z  |&z  |/dz  z  z
  d|1z  |dz  z  |/d!z  z  z   |&d z  z
  d |&d(z  z  |/z  z   d)|&d*z  z  |/dz  z  z
  d+|&d!z  z  |/dz  z  z   d,|&dz  z  |/d&z  z  z
  d,|&d&z  z  |/dz  z  z   d+|&dz  z  |/d!z  z  z
  d)|&dz  z  |/d*z  z  z   d |&z  |/d(z  z  z
  |/d z  z   z  }2ˆ?ˆ@ˆFˆGfd-„}3 |3d
¦  «        \  }4}5 |3d¦  «        \  }6}7‰Gd          }8|}9|2 .                    t)          t+          |.|0||1|&|/f|4|5|6|7|8|9f¦  «        ¦  «        ¦  «        } d}|s×tS          |d¦  «        j*        rÂ|st/          ‰G¦  «        d&k    st/          ‰G¦  «        d&k     ršd.„ }:t/          ‰G¦  «        d&k    r#‰G\  }}};}< |:||¦  «         |:|;|<¦  «        z
  } d}nat/          ‰G¦  «        dk    r"‰G\  }}}; |:||;¦  «         |:||¦  «        z
  } d}n,t/          ‰G¦  «        dk    r‰G\  }}|dz   |:||¦  «        z
  } d}|rtG          | ¦  «        n|}=|dz  }|r#|�0t/          ‰G¦  «        |k    r|=�|=|k    r|dk    rtO          d/¦  «        ‚‰                     ‰Dt/          ‰G¦  «        |dœ¦  «         t[          | g‰¢R i ‰¤Ž}>|>r|>\  } ŠD || ‰D¦  «        \  } ŠD| ‰DfS )0a½	  
    Remove radicals with symbolic arguments and return (eq, cov),
    None, or raise an error.

    Explanation
    ===========

    None is returned if there are no radicals to remove.

    NotImplementedError is raised if there are radicals and they cannot be
    removed or if the relationship between the original symbols and the
    change of variable needed to rewrite the system as a polynomial cannot
    be solved.

    Otherwise the tuple, ``(eq, cov)``, is returned where:

    *eq*, ``cov``
        *eq* is an equation without radicals (in the symbol(s) of
        interest) whose solutions are a superset of the solutions to the
        original expression. *eq* might be rewritten in terms of a new
        variable; the relationship to the original variables is given by
        ``cov`` which is a list containing ``v`` and ``v**p - b`` where
        ``p`` is the power needed to clear the radical and ``b`` is the
        radical now expressed as a polynomial in the symbols of interest.
        For example, for sqrt(2 - x) the tuple would be
        ``(c, c**2 - 2 + x)``. The solutions of *eq* will contain
        solutions to the original equation (if there are any).

    *syms*
        An iterable of symbols which, if provided, will limit the focus of
        radical removal: only radicals with one or more of the symbols of
        interest will be cleared. All free symbols are used if *syms* is not
        set.

    *flags* are used internally for communication during recursive calls.
    Two options are also recognized:

        ``take``, when defined, is interpreted as a single-argument function
        that returns True if a given Pow should be handled.

    Radicals can be removed from an expression if:

        *   All bases of the radicals are the same; a change of variables is
            done in this case.
        *   If all radicals appear in one term of the expression.
        *   There are only four terms with sqrt() factors or there are less than
            four terms having sqrt() factors.
        *   There are only two terms with radicals.

    Examples
    ========

    >>> from sympy.solvers.solvers import unrad
    >>> from sympy.abc import x
    >>> from sympy import sqrt, Rational, root

    >>> unrad(sqrt(x)*x**Rational(1, 3) + 2)
    (x**5 - 64, [])
    >>> unrad(sqrt(x) + root(x + 1, 3))
    (-x**3 + x**2 + 2*x + 1, [])
    >>> eq = sqrt(x) + root(x, 3) - 2
    >>> unrad(eq)
    (_p**3 + _p**2 - 2, [_p, _p**6 - x])

    F)rM  r>   c           	     óâ   •— ‰rb‰\  }}t          || ¦  «                             | ¦  «        dv r1| |                     |t          || fi ‰¤Žd         ¦  «        g‰d d …<   d S t          ‚| |g‰d d …<   d S )N)rn   rÀ   r   )rU   rã  ro   rß  rd  )r¬   r�   ÚoldpÚolder  Úuflagss       €€ru   Ú_covzunrad.<locals>._cov(  s‹   ø€ Øð 	à‰JˆD�$Ý�A�q‰zŒz× Ò  Ñ#Ô# vÐ-Ð-Ø˜TŸYšY t­W°Q¸Ð-DÐ-D¸VÐ-DÐ-DÀQÔ-GÑHÔHÐI��A�A�A‘��å)Ð)à˜�VˆC���‰FˆFˆFrw   c                ó¬  — |rZ|\  }}|t          |j        ¦  «        i}|                      |¦  «        } |                     |¦  «        |                     |¦  «        g}t          t	          |                      ¦   «         d         d¬¦  «        d¬¦  «        } | j        rTg }| j        D ]A}|j        rŒ
|j	        r| 
                    |j        ¦  «         Œ,| 
                    |¦  «         ŒBt          |Ž } t          t          j        | ¦  «        ¦  «        }d}t          |¦  «        D ]!\  }	}
|
                     ¦   «         r|
 ||	<   d}Œ"|rt          |ddiŽ} | |fS )Nr   Tr¾   )ÚclearFr¸   )r   Únamer  r   r   r×   ro  rÎ   rÈ   r�   r‚   r—   r	   r   r¨   rb  Úcould_extract_minus_sign)rª   r  r¬   r�   ÚreprÎ   r™   ÚmargsÚchangedr{   rñ  s              ru   Ú
_canonicalzunrad.<locals>._canonical3  sp  € Øð 	5à‰DˆAˆqØ•e˜AœF‘m”mÐ$ˆCØ—’˜SÑ!Ô!ˆBØ—:’:˜c‘?”? A§J¢J¨s¡O¤OÐ4ˆCõ �( 2×#4Ò#4Ñ#6Ô#6°qÔ#9ÀTÐJÑJÔJÐRVÐWÑWÔWˆØŒ9ð 		ØˆDØ”Wð #ð #�Ø”;ð ØØ”8ð #Ø—K’K ¤Ñ'Ô'Ð'Ð'à—K’K ‘N”N�N�NÝ�d�ˆBõ •S”] 2Ñ&Ô&Ñ'Ô'ˆØˆÝ˜eÑ$Ô$ð 	ð 	‰DˆAˆqØ×)Ò)Ñ+Ô+ð Ø˜2��a‘Ø�øØð 	-Ý�eÐ, eÐ,Ð,ˆBà�3ˆwˆrw   c                óš   — |                       ¦   «         d                              ¦   «         d         }|j        st          j        S |j        S )Nrn   r   )r¬  r®  rÛ   r   r¦   r­  )Úpowr   s     ru   Ú_Qzunrad.<locals>._QU  s?   € à�OŠOÑÔ˜aÔ ×-Ò-Ñ/Ô/°Ô2ˆØŒ}ð 	Ý”5ˆLØŒsˆ
rw   c                ó€   •— t          j        | ¦  «        D ]'}|j        sŒ
 ‰|¦  «        dk    rŒ|j        ‰z  r dS Œ(dS )Nrn   TF)r	   r¨   r�   r¡   )r›   rC  rD  r_  s     €€ru   Ú_takezunrad.<locals>._take]  s^   ø€ å”= Ñ#Ô#ð 	ð 	ˆCØ”:ð ØØˆr�#‰wŒw˜!Š|ˆ|ØØÔ $Ñ&ð Ø�t�tðàˆurw   rF  Nc                óB   •— g | ]\  }}‰                      ||¦  «        ‘ŒS rq   )r^  )rr   rs   rt   rµ   s      €ru   r}   zunrad.<locals>.<listcomp>n  s9   ø€ ð :ð :ð :±°°A�e×&Ò& q¨!Ñ,Ô,ð :ð :ð :rw   r   )r  rÝ   ÚrptT)Úradicalr;  r¾   c                ó*   •— g | ]} ‰|¦  «        ¯|‘ŒS rq   rq   )rr   r—  rF  s     €ru   r}   zunrad.<locals>.<listcomp>{  s&   ø€ Ð-Ð-Ð-�! E E¨!¡H¤HÐ-ˆAÐ-Ð-Ð-rw   c              3  ó6   •K  — | ]} |j         j        ‰Ž V — Œd S r’   )r)   rÚ   )rr   r—  r_  s     €ru   r¢   zunrad.<locals>.<genexpr>‡  s.   øè è € Ð
*Ð
* ˆ9ˆ1Œ5Œ9�dÐÐ
*Ð
*Ð
*Ð
*Ð
*Ð
*rw   c                óþ   •— d}t          ¦   «         }t          ¦   «         }| j        D ]R} ‰|¦  «        }|dk    r?|                     |¦  «         t          ||¦  «        }|                     |j        ¦  «         ŒS|||fS r£  )r“   râ  r˜   r   r—   )rø  ÚlcmÚradsrü  r—  r­  rD  s         €ru   Ú_rads_bases_lcmzunrad.<locals>._rads_bases_lcmŠ  s�   ø€ ð ˆÝ‰uŒuˆÝ‘”ˆØ”ð 	"ð 	"ˆAØ��1‘”ˆAØ�AŠvˆvØ—’˜‘”�Ý˜3 ‘l”l�Ø—	’	˜!œ&Ñ!Ô!Ð!øØ�U˜CÐÐrw   r¬   )Únonnegativerq   c                ó    •— g | ]
}‰|         ‘ŒS rq   rq   )rr   r{   Údrads     €ru   r}   zunrad.<locals>.<listcomp>ª  s   ø€ Ð8Ð8Ð8¨A  Q¤Ð8Ð8Ð8rw   c                ó.   •— g | ]}t          ‰|         Ž ‘ŒS rq   )r   )rr   rs   Úrtermss     €ru   r}   zunrad.<locals>.<listcomp>¯  s!   ø€ Ð5Ð5Ð5 !�c�6˜!”9ˆoÐ5Ð5Ð5rw   rn   rÀ   Ú_reversez&no successful change of variable foundr  c                óJ   •— g | ]} ‰|                      ¦   «         ¦  «        ‘Œ S rq   )r0  )rr   r{   rO  s     €ru   r}   zunrad.<locals>.<listcomp>  s+   ø€ ÐAÐAÐA°Q�O�O A§I¢I¡K¤KÑ0Ô0ÐAÐAÐArw   é   c                ó,   — g | ]}t          |¦  «        ‘ŒS rq   r  r8  s     ru   r}   zunrad.<locals>.<listcomp>  s   € Ð'CÐ'CÐ'C°Q­¨a©¬Ð'CÐ'CÐ'Crw   ÚabcdABé	   é   é   é?   rÂ   é-   é   é<   rÆ  é$   é   éT   é~   c                óˆ   •— t          ‰|          ‰         Ž }t          ‰|          |z  ¦  «        t          ‰|          ‰         Ž fS r’   )r	   rS   )r{   r¯  ÚBASESÚRADÚinforT  s     €€€€ru   Ú_tzunrad.<locals>._t&  s=   ø€ Ý  a¤¨¤Ð.˜Ý% f¨Q¤i°¡kÑ2Ô2µC¸¸a¼À¼Ð4HÐHÐHrw   c                ó*   — | dz  |dz  z   d| z  |z  z   S rØ  rq   )r  r¯  s     ru   Ú_norm2zunrad.<locals>._norm25  s!   € Ø˜a™4 ! Q¡$™;¨¨1©¨Q©Ñ.Ð.rw   zCannot remove all radicals)/r^  r€   r   rÐ   rÊ   r   r5  rƒ   rB   r   r×   r   rÈ   r“   r¡   r0  râ  r¤   r   r§   rÇ   rq  r”  r©   r   r¨   rÉ   r¸  r?  r‚   ra  rÕ   r   rÍ   r!   rI   r.  rÎ   rß  rd  ro   r(   rØ   rz   r	   rè  r  )Irª   r_  rµ   r9  rA  ÚnwasrH  rø  râ  rN  rü  rM  ÚcovsymÚnewsymsr§  rÎ   r+  ÚcommonrX  Úothersr‡  Údepthr¯  r0  rÎ  Úr0r&  Úi0Ú_rads0Ú_bases0Úlcm0Úi1Ú_rads1Ú_bases1Úlcm1Úreverserå   Út1r   r¶   ÚneweqÚtmpÚnewcovÚnewpÚnewcÚLCMr  r›   r³  rá   Úzzri  ÚaaÚAAÚbbÚBBÚccÚddrk  Úr2Úr3Ú	new_depthÚneqrf  rg  rD  rO  rF  r  rR  rh  rT  r8  sI    ``                                                            @@@@@@@@@@ru   rè  rè  ã  s–  øøøøøøøøøøøø€ ðF ¨%Ð0Ð0€Fð	ð 	ð 	ð 	ð 	ð 	ð ð  ð  ðDð ð ð	ð 	ð 	ð 	ð 	ð 	ð ×Ò˜W eÑ,Ô,€Eå�"•bÑÔð ØŒV�b”f‰_ˆˆÝ˜�DÑ!Ô!ð Øˆð:ð :ð :ð :Ý�r ¨QÐ/Ð/×5Ò5Ñ7Ô7Ñ8Ô8ð:ñ :ô :�N€Cˆˆsõ 
•< ¨D¸Ð=Ñ=Ô=Ñ	>Ô	>€BØ	×	Ò	Ñ	Ô	˜QÔ	€BÝ	�" Ð	%Ñ	%Ô	%€BØ	„|ð Øˆõ ˆt‰9Œ9Ð'˜œ€DØ�:Š:‰<Œ<€DØ-Ð-Ð-Ð-�t”yÐ-Ñ-Ô-€DØð Øˆð ˆ2Œ:�tÐ€Dð €|Øˆõ Ð
*Ð
*Ð
*Ð
* TÐ
*Ñ
*Ô
*Ñ*Ô*ð Øˆð ð  ð  ð  ð  ð '� tÑ,Ô,Ñ€Dˆ%�å�3 DÐ)Ñ)Ô)€Fõ ‰eŒe€GØð .ð .ˆØ�Š�t˜aœnÑ,Ñ-Ô-Ð-Ð-Ø�$‚€Øˆå•�D�%¥ D¡	¤	Ñ*Ô*Ñ+Ô+Ñ,Ô,€DØ�"ˆX€FÝŒ=˜Ÿš™œÑ(Ô(€DØð -ð -ˆØˆ5�‰8Œ8ð 	Ý˜Ÿš™œÔ)Ñ*Ô*×7Ò7¸Ñ=Ô=ˆFÝ�Ð8Ð8Ð8Ð8°Ð8Ñ8Ô8Ñ9Ô9Ñ:Ô:ˆCˆCàˆCØ×Ò˜#˜rÑ"Ô"×)Ò)¨!Ñ,Ô,Ð,Ð,Ý�&—*’*˜R‘.”.Ð!€FØ5Ð5Ð5Ð5 v§{¢{¡}¤}Ð5Ñ5Ô5€Fõ •(�4¥¨¡¤Ñ0Ô0Ñ1Ô1Ñ2Ô2€Fà	€BÝ�r‰NŒN€Eå
ˆ6�{„{�aÒÐ ¨¤Ô!1Ð°c¸A²g°gØ�AŒY˜‰^  ¨#™~Ñ.ˆØˆ‰åˆv‰;Œ;˜!ÒÐ  q¤	Ô 0ÐÝ˜& œ)œ.Ñ)Ô)ˆFÝˆu‰:Œ:˜Š?ˆ?Ø—	’	‘”ˆAÝ�4‰yŒy˜1Š}ˆ}Ø”N��à�Ý•W˜Q‘Z”ZÑ Ô  Ô#ˆAðÝ˜f c™k¨A™o¨qÐ;Ð;°FÐ;Ð;�Øð .Ý-Ð-Ø—\’\‘^”^×(Ò(¨¨F°C©KÑ8Ô8×=Ò=¸aÀÀQÄÑHÔH�Ø��V˜V S™[¨1™_Ñ-Ô-Ð-Ø!�z " cÑ*Ô*Ð*øÝ&ð ð ð Ø�ðøøøõ ˆv‰;Œ;˜!ÒÑØð .Ø˜A”Y ‘^¨¨q¬	 z°CÑ&7Ñ7�Ø�‘Ý˜˜a‘[”[Ô+ñ +à‘��BØ—9’9˜Z¨Ñ/Ô/ð $Ø ˜�BØ-<¨_¸R¿ZºZ¹\¼\Ñ-JÔ-JÐJ�Ñ*�V˜W dØ-<¨_¸R¿ZºZ¹\¼\Ñ-JÔ-JÐJ�Ñ*�V˜W dÝ$ Q™xœxð $ñ $�GØð (Ø!# R˜B˜Ø!# R˜B˜Ø&(‘O�F˜A˜tÝ  &˜\�FØ ™�BØ ™ rÑ)�AØ!ð %ð %˜ð%Ý")¨!¨QÐ"9Ð"9°&Ð"9Ð"9˜CØ#&ð :Ý&9Ð 9Ø$&§G¢G¨A¨s°1¬vÑ$6Ô$6¸À¹À6Ñ9IÑ$IØ &ñ%'˜Eå"'¨¨vÑ"6Ô"6˜CØ"ð 
0Ø-0¡
  FØ#)ð !4Ø17¡J D¨$Ø$( D¨¨q¯vªv°fÝ(/°°fÐ(GÐ(GÀÐ(GÐ(GÈÔ(Jñ0Lô 0Lñ %Mô %Mð %Mð %Mð %) D¨°¡O¤O O Oà%* Ø $  V¨Q¡¤ Ø!%˜BØ!˜EøÝ2ð %ð %ð %Ø&ð %Ý&9Ø$Lñ'Nô 'Nð !Nð !% ð%øøøð ð Ø˜ñùå�‰[Œ[˜AÒÑð BÐAÐAÐA¸&ÐAÑAÔAˆDØˆCØˆEØˆCØ�AŒw�sŒ|˜qÒ Ð Ø—’˜DŸHšH Q™KœKÑ(Ô(Ð(Ø—’˜fŸjšj¨™mœmÑ,Ô,Ð,Ð,Ø�a”˜” Ò"Ð"Ø—’˜DŸHšH Q™KœKÑ(Ô(Ð(Ø—’˜fŸjšj¨™mœmÑ,Ô,Ð,Ø�AŒw�sŒ|˜t Aœw sœ|Ð0Ð0Ò0Ð0¨qÒ0Ñ0Ð0Ð0Ñ0Ø˜”7˜5”> T¨!¤W¨U¤^Ò3Ð3Ø'+¨A¤w°°Q´Ð$�D˜‘G˜T !™WØ+1°!¬9°f¸Q´iÐ(�F˜1‘I˜v a™yØ˜”7˜5”> T¨!¤W¨U¤^Ò3Ð3Ø œ A™¨°¬°V¸A´YÑ)>ÀÑ)GÈ!Ñ(KÑK�BØ�B‘BØ˜!”W˜S”\ AÒ%Ñ%à'CÐ'C¸(Ð'CÑ'CÔ'CÑ$�A�q˜!˜Q  1ð ˜a™% ! Q¡$ q¨!¡t¡)¨a°°1±©f°Q©h°q¸!±t©m¸A¸q¹DÑ.@Ñ"@Ø˜!˜Q™$™˜q !™t™ A q¡DÑ(ñ#)Ø+,¨Q°©T©6°!°Q±$©;°q¸!±tÑ+;¸AÑ+=ñ#>Ø@AÀ!ÀQÁ$ÁÀqÈ!ÁtÁÈAÁÈaÐQRÉdÑ@Rñ#Sà˜!˜Q™$™˜q !™t™ A q¡DÑ(ñ#)à+,¨Q©3¨q°!©t©8°A°q±D©=¸¸A¹Ñ+=ñ#>à@BÀ1ÁÀQÁÀqÈ!ÁtÁÈAÈqÉDÑ@PÐQRÐTUÑQUÑ@Uñ#Vð ˜1™˜Q™˜q !™t™ A q¡DÑ(¨¨A©Ñ-¨aÑ/ñ#0ð 35°Q±$°q±&¸¸A¹±+¸aÀ¹dÑ2BÀ1Ñ2DÀQÈÁTÑ2Iñ#Jð ˜1™˜Q™˜q !™t™ A q¡DÑ(¨¨A©Ñ-ñ	#.ð 12°!±°A°q±D±¸¸A¹±ñ	#>ð ACÀ1ÁÀQÈÁTÁ	È!ÈQÉ$ÁÈqÑ@Pñ	#Qð
 ˜1™˜Q ™T™	 ! Q¡$™ q¨!¡tÑ+ñ#,ð
 /1°©d°1°a±4©i¸¸1¹©n¸QÀ¹TÑ.Añ#Bð
 EGÀqÁDÈÈAÉÁIÈaÐQRÉdÁNÐSTÐVWÑSWÑDWñ#Xð ˜1™˜Q ™T™	 !™ A q¡DÑ(ñ#)ð ,-¨Q©3¨q°!©t©8°A°q±D©=ñ#9ð <=¸a¹4ÀÀ1Á¹9ñ#Eð HIÈÈAÉÁvÈaÐQRÉdÁ{ÐSTÐVWÑSWÑGWñ#Xð ˜!˜Q™$™˜q !™t™ A q¡DÑ(¨Ñ*ñ#+ð ./¨q°!©t©V°A°q±D©[¸©]¸1¸a¹4Ñ-?ñ#@ð CDÀAÀqÁDÁ&ÈÈAÉÁ+ÈaÐQRÉdÑBRñ#Sð ˜!™˜A˜q™D™  A¡™ñ#&ð )+¨1©¨Q°©T©	°!°Q±$©°qÑ(8ñ#9ð <>¸a¹4ÀÀ1Á¹9ÀQÈÁT¹>È!ÈQÉ$Ñ;Nñ#Oð ˜1™˜Q ™T™	 ! Q¡$™ q¨!¡tÑ+ñ	#,ð /1°©d°1°a±4©i¸¸1¹©n¸QÀ¹TÑ.Añ	#Bð EGÀqÁDÈÈAÉÁIÈaÁKÐPQÐSTÑPTÑDTñ	#Uð ˜!™˜A˜q™D™  A¡™ñ
#&ð )*¨1©ñ
#-ð 01°°A±©v°a©xñ
#8ð ;=¸QÀ¹T¹'À!ÀQÁ$¹,ñ
#Gð JLÈAÈqÉDÉÐQRÐTUÑQUÉñ
#Vð ˜A˜q™D™  A¡™ñ#&ð ),¨A¨q©D©°°A±©ñ#6ð 9;¸1¸a¹4¹ÀÀ1Á¹ñ#Eð HJÈ!ÈQÉ$ÁwÈqÐRSÉtÁ|ñ#Tð ˜!™˜A˜q™D™ñ#!ð $% a¡4ñ#(ñ )�BðIð Ið Ið Ið Ið Ið Ið Ið  ˜R ™UœU‘F�B˜Ø˜R ™UœU‘F�B˜Ø  œ)˜�BØ�BØŸš¥T­#Ø˜A˜q ! Q¨Ð*Ø˜R  R¨¨RÐ0ñ+2ô +2ñ &3ô &3ñ 4ô 4�Bð �Bàð 	Ý�3˜‰{Œ{Ô%ð ¨vð Ý˜‘K”K 1Ò$Ð$­¨F©¬°aª¨ð/ð /ð /õ �v‘;”; !Ò#Ð#à%+‘N�B˜˜B Ø˜  B™œ¨&¨&°°R©.¬.Ñ8�BØ�B�BÝ˜‘[”[ AÒ%Ð%à!'‘J�B˜˜BØ˜  B™œ¨&¨&°°VÑ*<Ô*<Ñ<�BØ�B�BÝ˜‘[”[ AÒ%Ð%à#‘F�B˜Ø˜Q™  ¨¨FÑ!3Ô!3Ñ3�BØ�Bà"$Ð/•
˜2‘”�¨%€IØˆ1�H€CØð @ØÐ ¥S¨¡[¤[°DÒ%8Ð%8ØÐ%¨)°uÒ*<Ð*<Ø�a’�Ý!Ð">Ñ?Ô?Ð?à	‡L‚L˜¥3 v¡;¤;°sÐ;Ð;Ñ<Ô<Ð<Ý
�Ð
#�TÐ
#Ð
#Ð
#˜UÐ
#Ð
#€CØ
ð Ø‰ˆˆCØˆj˜˜SÑ!Ô!�G€BˆØˆsˆ7€Ns&   Ð%A?R% Ò%
R2Ò1R2ÖB-YÙY,Ù+Y,)rú  rø  rö  r’   )r  r  r  r  )±Ú__doc__Ú
__future__r   Ú
sympy.corer   r   r   r   r   r	   Úsympy.core.assumptionsr
   Úsympy.core.exprtoolsr   Úsympy.core.functionr   r   r   r   r   r   r   r   r   r   r   Úsympy.core.logicr   r   Úsympy.core.numbersr   r   r   Úsympy.core.intfuncr   r   Úsympy.core.powerr   Úsympy.core.relationalr   r    Úsympy.core.sortingr!   r"   Úsympy.core.sympifyr#   r$   Úsympy.core.traversalr%   Úsympy.logic.boolalgr&   r'   Úsympy.functionsr(   r)   r*   r+   r,   r-   r.   r/   r0   r1   r2   r3   r4   r5   r6   Ú(sympy.functions.combinatorial.factorialsr7   Ú%sympy.functions.elementary.hyperbolicr8   Ú$sympy.functions.elementary.piecewiser9   r:   Ú(sympy.functions.elementary.trigonometricr;   Úsympy.integrals.integralsr<   Úsympy.ntheory.factor_r=   Úsympy.simplifyr>   r?   r@   rA   rB   rC   rD   rE   rF   rG   rH   Úsympy.simplify.sqrtdenestrI   Úsympy.simplify.furJ   rK   rL   rM   Úsympy.strategies.rlrN   Úsympy.matrices.exceptionsrO   Úsympy.matricesrP   rQ   Úsympy.polysrR   rS   rT   rU   Úsympy.polys.solversrV   rW   Úsympy.polys.polyerrorsrX   rY   Úsympy.polys.polytoolsrZ   Úsympy.utilities.lambdifyr[   Úsympy.utilities.miscr\   r]   Úsympy.utilities.iterablesr^   r_   r`   ra   rb   rc   rd   re   Úsympy.utilities.decoratorrf   r  rg   Úsympy.solvers.polysysrh   Útypesri   Úcollectionsrj   Ú	itertoolsrk   rl   rÞ   r‹   r�   rœ   r”   r³   r”  rr  rs  ru  rt  rÛ  rF  rG  r–  r´  r½  rÁ  rÊ  rÔ  rõ  rß  ré  r  rC  rè  Úsympy.solvers.bivariaterú  rø  rö  rq   rw   ru   ú<module>r·     sš  ððð ð #Ð "Ð "Ð "Ð "Ð "à 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø 4Ð 4Ð 4Ð 4Ð 4Ð 4Ø -Ð -Ð -Ð -Ð -Ð -ð.ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð .ð 2Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ð 1Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø  Ð  Ð  Ð  Ð  Ð  Ø (Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ø 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ð 8Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0Ð 0ð<ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <ð <à =Ð =Ð =Ð =Ð =Ð =Ø DÐ DÐ DÐ DÐ DÐ DØ JÐ JÐ JÐ JÐ JÐ JÐ JÐ JØ JÐ JÐ JÐ JÐ JÐ JØ .Ð .Ð .Ð .Ð .Ð .Ø *Ð *Ð *Ð *Ð *Ð *ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð 1Ð 0Ð 0Ð 0Ð 0Ð 0Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø 'Ð 'Ð 'Ð 'Ð 'Ð 'Ø >Ð >Ð >Ð >Ð >Ð >Ø (Ð (Ð (Ð (Ð (Ð (Ð (Ð (Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø @Ð @Ð @Ð @Ð @Ð @Ð @Ð @Ø DÐ DÐ DÐ DÐ DÐ DÐ DÐ DØ %Ð %Ð %Ð %Ð %Ð %Ø -Ð -Ð -Ð -Ð -Ð -Ø 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3Ð 3ðHð Hð Hð Hð Hð Hð Hð Hð Hð Hð Hð Hð Hð Hð Hð Hð Hð Hð Hð Hà 9Ð 9Ð 9Ð 9Ð 9Ð 9à Ð Ð Ð Ð Ð à 3Ð 3Ð 3Ð 3Ð 3Ð 3à Ð Ð Ð Ð Ð Ø #Ð #Ð #Ð #Ð #Ð #Ø +Ð +Ð +Ð +Ð +Ð +Ð +Ð +à €€€ð*>ð *>ð *>ðZDð Dð Dð
ð ð ð0Jð 0Jð 0JðfkJð kJð kJð kJð``Eð `Eð `EðFð ð ð tð tð tðnð ð ð ðIð Ið IðX  R°ð sð sð sð sðlPð Pð Pðf7ð 7ð 7ðtAð Að AðH$ð $ð $ðNð ð ðD6ð 6ð 6ð*;ð ;ð ;ð ;ð,ð ð ð: Ð	,Ð	,ØÐ	.Ð	.ð€ð1ð 1ð 1ð
Bð Bð BðN Øð Fð Fð Fð Fñ ÔðFðR~ð ~ð ~ðBrð rð rðl4ð 4ð 4ð 4ð 4ð 4ð 4ð 4ð 4ð 4ð 4ð 4rw   