
    \hr                       S SK Jr  S SKJr  S SKJr  S SKJr  S SKJ	r	  S SK
JrJrJrJrJrJrJrJr  S SKJrJrJr  S SKJr  S S	KJrJrJrJr  S S
KJr  S SK J!r!  S SK"J#r#  S SK$J%r%J&r&  S SK'J(r(  S SK)J*r*  S SK+J,r,J-r-J.r.J/r/J0r0  S SK1J2r2  S SK3J4r4J5r5  S SK6J7r7   " S S\5      r8 " S S\85      r9 " S S\5      r: " S S\8\:S9r;S r< " S S\5      r= " S  S!\5      r>\S" 5       r?g#)$    )annotations)product)Add)cacheit)Expr)DefinedFunctionArgumentIndexError
expand_log
expand_mulFunctionClass	PoleErrorexpand_multinomialexpand_complex)	fuzzy_and	fuzzy_notfuzzy_or)Mul)IntegerRationalpiI)global_parameters)Pow)S)WildDummy)sympify)	factorial)arg
unpolarifyimreAbs)sqrt)multiplicityperfect_power)	factorintc                      \ rS rSrSr\R                  4r\S 5       r	SS jr
S r\S 5       rS rS rS	 rS
 rS rS rS rS rS rSrg)ExpBase#   Tc                .    U R                   R                  $ N)expkindselfs    ^/var/www/auris/envauris/lib/python3.13/site-packages/sympy/functions/elementary/exponential.pyr.   ExpBase.kind(   s    xx}}    c                    [         $ )z-
Returns the inverse function of ``exp(x)``.
logr0   argindexs     r1   inverseExpBase.inverse,   	     
r3   c                @   U R                   (       d  U [        R                  4$ U R                  nUR                  nU(       d"  U* R                  (       d  UR                  5       nU(       a"  [        R                  U R                  U* 5      4$ U [        R                  4$ )z
Returns this with a positive exponent as a 2-tuple (a fraction).

Examples
========

>>> from sympy import exp
>>> from sympy.abc import x
>>> exp(-x).as_numer_denom()
(1, exp(x))
>>> exp(x).as_numer_denom()
(exp(x), 1)
)is_commutativer   Oner-   is_negativecould_extract_minus_signfunc)r0   r-   neg_exps      r1   as_numer_denomExpBase.as_numer_denom2   sr      "";hh//11224G55$))SD/))QUU{r3   c                     U R                   S   $ )z'
Returns the exponent of the function.
r   )argsr/   s    r1   r-   ExpBase.expL   s    
 yy|r3   c                H    U R                  S5      [        U R                  6 4$ )z'
Returns the 2-tuple (base, exponent).
   )rA   r   rF   r/   s    r1   as_base_expExpBase.as_base_expS   s     yy|S$))_,,r3   c                T    U R                  U R                  R                  5       5      $ r,   )rA   r-   adjointr/   s    r1   _eval_adjointExpBase._eval_adjointY   s    yy))+,,r3   c                T    U R                  U R                  R                  5       5      $ r,   )rA   r-   	conjugater/   s    r1   _eval_conjugateExpBase._eval_conjugate\       yy++-..r3   c                T    U R                  U R                  R                  5       5      $ r,   )rA   r-   	transposer/   s    r1   _eval_transposeExpBase._eval_transpose_   rT   r3   c                    U R                   nUR                  (       a$  UR                  (       a  gUR                  (       a  gUR                  (       a  gg NTF)r-   is_infiniteis_extended_negativeis_extended_positive	is_finiter0   r   s     r1   _eval_is_finiteExpBase._eval_is_finiteb   s9    hh??''''== r3   c                   U R                   " U R                  6 nUR                   U R                   :X  aL  UR                  R                  nU(       a  gUR                  R                  (       a  [        U5      (       a  gg g UR                  $ rZ   )rA   rF   r-   is_zerois_rationalr   )r0   szs      r1   _eval_is_rationalExpBase._eval_is_rationall   sc    IItyy!66TYYA""y|| (4" == r3   c                :    U R                   [        R                  L $ r,   )r-   r   NegativeInfinityr/   s    r1   _eval_is_zeroExpBase._eval_is_zerow   s    xx1----r3   c                d    U R                  5       u  p#[        R                  " [        X#SS9U5      $ )z;exp(arg)**e -> exp(arg*e) if assumptions allow it.
        Fevaluate)rJ   r   _eval_power)r0   otherbes       r1   rp   ExpBase._eval_powerz   s,     !s1%8%@@r3   c                  ^  SSK Jn  SSKJn  T R                  S   nUR
                  (       a;  UR                  (       a*  [        R                  " U 4S jUR                   5       5      $ [        XC5      (       a=  UR                  (       a,  U" T R                  UR                  5      /UR                  Q76 $ T R                  U5      $ )Nr   )Product)Sumc              3  F   >#    U  H  nTR                  U5      v   M     g 7fr,   )rA   ).0xr0   s     r1   	<genexpr>1ExpBase._eval_expand_power_exp.<locals>.<genexpr>   s     ?h		!hs   !)sympy.concrete.productsrv   sympy.concrete.summationsrw   rF   is_Addr=   r   fromiter
isinstancerA   functionlimits)r0   hintsrv   rw   r   s   `    r1   _eval_expand_power_expExpBase._eval_expand_power_exp   s    31iil::#,,<<?chh???!!c&8&8499S\\2@SZZ@@yy~r3    NrI   )__name__
__module____qualname____firstlineno__
unbranchedr   ComplexInfinity_singularitiespropertyr.   r9   rC   r-   rJ   rN   rR   rW   r`   rg   rk   rp   r   __static_attributes__r   r3   r1   r)   r)   #   ss    J'')N 4  --//	!.Ar3   r)   c                  >    \ rS rSrSrSrSrS rS rS r	S r
S	 rS
rg)	exp_polar   a  
Represent a *polar number* (see g-function Sphinx documentation).

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

``exp_polar`` represents the function
`Exp: \mathbb{C} \rightarrow \mathcal{S}`, sending the complex number
`z = a + bi` to the polar number `r = exp(a), \theta = b`. It is one of
the main functions to construct polar numbers.

Examples
========

>>> from sympy import exp_polar, pi, I, exp

The main difference is that polar numbers do not "wrap around" at `2 \pi`:

>>> exp(2*pi*I)
1
>>> exp_polar(2*pi*I)
exp_polar(2*I*pi)

apart from that they behave mostly like classical complex numbers:

>>> exp_polar(2)*exp_polar(3)
exp_polar(5)

See Also
========

sympy.simplify.powsimp.powsimp
polar_lift
periodic_argument
principal_branch
TFc                D    [        [        U R                  S   5      5      $ Nr   )r-   r"   rF   r/   s    r1   	_eval_Absexp_polar._eval_Abs   s    2diil#$$r3   c                0   [        U R                  S   5      n U[        * :*  =(       d	    U[        :  nU(       a  U $ [	        U R                  S   5      R                  U5      nUS:  a  [        U5      S:  a  [        U5      $ U$ ! [         a    Sn N`f = f)z-Careful! any evalf of polar numbers is flaky r   T)r!   rF   r   	TypeErrorr-   _eval_evalfr"   )r0   precibadress        r1   r   exp_polar._eval_evalf   s    tyy|	8%q2vC K$))A,++D1q5RWq[c7N
  	C	s   B BBc                D    U R                  U R                  S   U-  5      $ r   )rA   rF   )r0   rq   s     r1   rp   exp_polar._eval_power   s    yy1e+,,r3   c                B    U R                   S   R                  (       a  gg )Nr   T)rF   is_extended_realr/   s    r1   _eval_is_extended_real exp_polar._eval_is_extended_real   s    99Q<(( )r3   c                v    U R                   S   S:X  a  U [        R                  4$ [        R	                  U 5      $ r   )rF   r   r>   r)   rJ   r/   s    r1   rJ   exp_polar.as_base_exp   s1    99Q<1;""4((r3   r   N)r   r   r   r   __doc__is_polaris_comparabler   r   rp   r   rJ   r   r   r3   r1   r   r      s-    #J HM%-)r3   r   c                      \ rS rSrS rSrg)ExpMeta   c                    [         UR                  R                  ;   a  g[        U[        5      =(       a    UR
                  [        R                  L $ )NT)r-   	__class____mro__r   r   baser   Exp1)clsinstances     r1   __instancecheck__ExpMeta.__instancecheck__   s8    ($$,,,(C(DX]]aff-DDr3   r   N)r   r   r   r   r   r   r   r3   r1   r   r      s    Er3   r   c                     ^  \ rS rSrSrSS jrS r\S 5       r\	S 5       r
\\S 5       5       rSS jrU 4S	 jrS
 rS rS rS rSS jrS rS rS rS rS rS rS rSrU =r$ )r-      z
The exponential function, :math:`e^x`.

Examples
========

>>> from sympy import exp, I, pi
>>> from sympy.abc import x
>>> exp(x)
exp(x)
>>> exp(x).diff(x)
exp(x)
>>> exp(I*pi)
-1

Parameters
==========

arg : Expr

See Also
========

log
c                (    US:X  a  U $ [        X5      e)z0
Returns the first derivative of this function.
rI   )r	   r7   s     r1   fdiff	exp.fdiff   s     q=K$T44r3   c                   SSK JnJn  U R                  S   nUR                  (       Ga4  [
        [        R                  -  nXEU* 4;   a  [        R                  $ UR                  " [        [
        -  5      nU(       a  U" UR                  SU-  5      5      (       a  U" UR                  U5      5      (       a  [        R                  $ U" UR                  U5      5      (       a  [        R                  $ U" UR                  U[        R                   -   5      5      (       a  [
        * $ U" UR                  U[        R                   -   5      5      (       a  [
        $ g g g g )Nr   )askQ   )sympy.assumptionsr   r   rF   is_Mulr   r   InfinityNaNas_coefficientr   integerevenr>   oddNegativeOneHalf)r0   assumptionsr   r   r   Ioocoeffs          r1   _eval_refineexp._eval_refine   s    ,iil:::AJJ,CSDk!uu&&r!t,Eqyy5)**166%=)) uuQUU5\** }},QVVEAFFN344 !r	QUU5166>233  4 +  r3   c                   SSK Jn  SSKJn  SSKJn  SSKJn  [        X5      (       a  UR                  " 5       $ [        R                  (       a  [        [        R                  U5      $ UR                  (       a  U[        R                   L a  [        R                   $ UR"                  (       a  [        R$                  $ U[        R$                  L a  [        R                  $ U[        R&                  L a  [        R&                  $ U[        R(                  L a  [        R*                  $ GO@U[        R,                  L a  [        R                   $ [        U[.        5      (       a  UR0                  S   $ [        X5      (       a/  U" [        UR2                  5      [        UR4                  5      5      $ [        X5      (       a  UR6                  " U 5      $ UR8                  (       Ga  UR:                  " [<        [>        -  5      nU(       a  SU-  R@                  (       a  URB                  (       a  [        R$                  $ URD                  (       a  [        RF                  $ U[        RH                  -   RB                  (       a  [>        * $ U[        RH                  -   RD                  (       a  [>        $ O<URJ                  (       a+  US-  nUS:  a  US-  nXv:w  a  U " U[<        -  [>        -  5      $ URL                  " 5       u  phU[        R(                  [        R&                  4;   a  URN                  (       a  U[        R(                  L a  U* n[Q        U5      R"                  (       a#  U[        R*                  La  [        R                   $ [Q        U5      RR                  (       a,  [U        U5      [        R*                  La  [        R,                  $ [Q        U5      RV                  (       a  [        R*                  $ g U/S p[X        RZ                  " U5       HZ  nU" U5      n[        U[.        5      (       a  U
c  UR0                  S   n
M4    g UR\                  (       a  U	R_                  U5        MZ    g    U
(       a  U
[Y        U	6 -  $ S $ UR`                  (       a  / n/ nSnUR0                   H  nU[        R$                  L a  UR_                  U5        M)  U " U5      n[        UU 5      (       aH  UR0                  S   U:w  a"  UR_                  UR0                  S   5        S	nMw  UR_                  U5        M  UR_                  U5        M     U(       d  U(       a  [Y        U6 U " [c        U6 SS
9-  $ UR"                  (       a  [        R$                  $ g )Nr   AccumBounds)
MatrixBaseSetExpr
logcombiner   rI   FTrn   )2sympy.calculusr   sympy.matrices.matrixbaser   sympy.sets.setexprr   sympy.simplify.simplifyr   r   r-   r   
exp_is_powr   r   r   	is_Numberr   rc   r>   r   rj   Zeror   r6   rF   minmax
_eval_funcr   r   r   r   
is_integeris_evenis_oddr   r   is_Rationalas_coeff_Mul	is_numberr"   is_positiver!   r?   r   	make_argsr   appendr   r   )r   r   r   r   r   r   r   ncoefftermscoeffslog_termtermterm_outadd
argchangedanewas                     r1   evalexp.eval  s   .8.6c&&779))qvvs##]]aee|uuuuvv

"zz!***vv +A%%%55LS!!88A;))s377|S\::%%>>#&&ZZZ&&r!t,EeG''}} uu }},!&&.11 !r	!&&.00  1&&"QYFz!"6"9Q;// ++-LE ++QZZ88?? 2 22!&%y((U!&&-@ uu%y,,E!&&1H 000%y,, vv %wHe,"4(eS))'#(::a=#''MM$' - .68S&\)?4?ZZCCJXX:JJqM1vdC((yy|q(

499Q<0%)


1JJt$  jCyS#Y!???;;55L r3   c                "    [         R                  $ )z/
Returns the base of the exponential function.
)r   r   r/   s    r1   r   exp.base}  s    
 vvr3   c                    U S:  a  [         R                  $ U S:X  a  [         R                  $ [        U5      nU(       a  US   nUb  X1-  U -  $ X-  [	        U 5      -  $ )z:
Calculates the next term in the Taylor series expansion.
r   )r   r   r>   r   r   )nrz   previous_termsps       r1   taylor_termexp.taylor_term  s\     q566M655LAJr"A}uqy tIaL  r3   c                    SSK JnJn  U R                  S   R	                  5       u  pVU(       a&  UR
                  " U40 UD6nUR
                  " U40 UD6nU" U5      U" U5      pC[        U5      U-  [        U5      U-  4$ )a  
Returns this function as a 2-tuple representing a complex number.

Examples
========

>>> from sympy import exp, I
>>> from sympy.abc import x
>>> exp(x).as_real_imag()
(exp(re(x))*cos(im(x)), exp(re(x))*sin(im(x)))
>>> exp(1).as_real_imag()
(E, 0)
>>> exp(I).as_real_imag()
(cos(1), sin(1))
>>> exp(1+I).as_real_imag()
(E*cos(1), E*sin(1))

See Also
========

sympy.functions.elementary.complexes.re
sympy.functions.elementary.complexes.im
r   )cossin)(sympy.functions.elementary.trigonometricr  r  rF   as_real_imagexpandr-   )r0   deepr   r  r  r"   r!   s          r1   r  exp.as_real_imag  ss    0 	F1**,4)5)B4)5)Br7CGSBSWS[))r3   c                  > UR                   (       a,  [        UR                  [        UR                  5      -  5      nO*U[        R
                  L a  UR                  (       a  [        n[        U[        5      (       d  U[        R
                  L a'  S n[        R                  " U" U 5      U" U5      U5      $ U[        L a.  UR                  (       d  X R                  R                  X5      -  $ [        TU ]%  X5      $ )Nc                    U R                   (       d  [        U [        5      (       a  [        U R	                  5       SS06$ U $ )Nro   F)is_Powr   r-   r   rJ   )r   s    r1   <lambda> exp._eval_subs.<locals>.<lambda>  s7    Jq#.. q}}?? 7567r3   )r  r-   r6   r   r   r   is_Functionr   r   
_eval_subs_subssuper)r0   oldnewfr   s       r1   r  exp._eval_subs  s    ::cggc#((m+,CAFF]sCc33!&&=7A>>!D'1S6377#:coos000w!#++r3   c                    U R                   S   R                  (       a  gU R                   S   R                  (       a6  [        S5      * [        -  U R                   S   -  [
        -  nUR                  $ g )Nr   Tr   )rF   r   is_imaginaryr   r   r   r   r0   arg2s     r1   r   exp._eval_is_extended_real  sW    99Q<((YYq\&&aD519tyy|+b0D<< 'r3   c                D    S n[        U" U R                  S   5      5      $ )Nc              3  D   #    U R                   v   U R                  v   g 7fr,   )
is_complexr\   )r   s    r1   complex_extended_negative7exp._eval_is_complex.<locals>.complex_extended_negative  s     .. ***s    r   )r   rF   )r0   r  s     r1   _eval_is_complexexp._eval_is_complex  s"    	+ 1$))A,?@@r3   c                    U R                   [        -  [        -  R                  (       a  g[	        U R                   R
                  5      (       a@  U R                   R                  (       a  gU R                   [        -  R                  (       a  gg g rZ   )r-   r   r   rd   r   rc   is_algebraicr/   s    r1   _eval_is_algebraicexp._eval_is_algebraic  s^    HHrMA**TXX%%&&xx$$((R-,, - 'r3   c                   U R                   R                  (       a  U R                  S   [        R                  L$ U R                   R
                  (       a*  [        * U R                  S   -  [        -  nUR                  $ g r   )	r-   r   rF   r   rj   r  r   r   r   r  s     r1   _eval_is_extended_positiveexp._eval_is_extended_positive  s]    88$$99Q<q'9'999XX""2		!$r)D<< #r3   c                  ^ SSK Jm  SSKJn  SSKJn  SSKJn  SSKJ	n  U R                  n	U	R                  " XUS9n
U
R                  (       a  SU
-   $ U" U
R                  5       US5      nU[        R                  L a  U" X-  U5      $ U[        R                   L a  U $ UR"                  (       a  [%        S	U -  5      e['        U4S
 jUR(                   5       5      (       a  U $ [+        S5      nUn U" U	R,                  " XS9U5      R/                  5       nU(       a  US:  a
  U" X.-  5      n[        U5      R3                  X5      n[        U5      UR5                  XU-
  5      -  nUb  U[7        U5      0O0 nUR5                  U5      U :X  a  U$ U(       a#  US:  a  UU" X-
  U-  U5      XS-
  U-  -  -  -  nOUU" X-
  U-  U5      -  nUR9                  5       nU" USSS9nS n[;        SU/S9nUR=                  [        R>                  U-  [A        [        R>                  U-  5      5      nU$ ! [0        [$        4 a    Sn GN/f = f)Nr   )signceiling)limitOrderpowsimpr   logxrI   Cannot expand %s around 0c              3  <   >#    U  H  n[        UT5      v   M     g 7fr,   )r   )ry   r   r*  s     r1   r{   $exp._eval_nseries.<locals>.<genexpr>  s     :	z#t$$	s   tr3  Tr-   r  combinec                F    U R                   =(       a    U R                  S;   $ )N)         )r   q)rz   s    r1   r  #exp._eval_nseries.<locals>.<lambda>  s    amm@y0@@r3   w)
properties)!$sympy.functions.elementary.complexesr*  #sympy.functions.elementary.integersr,  sympy.series.limitsr-  sympy.series.orderr/  sympy.simplify.powsimpr1  r-   _eval_nseriesis_OrderremoveOr   rj   r   r[   r   anyrF   r   as_leading_termgetnNotImplementedError_taylorsubsr6   r  r   replacer   r   )r0   rz   r   r3  cdirr,  r-  r/  r1  r   
arg_seriesarg0r7  ntermscf
exp_seriesrrep	simpleratrA  r*  s                       @r1   rH  exp._eval_nseries  s    	>?-,2hh&&qD9
z>!Z'')1a01%%%q>!1::K74@AA:		:::K#J	s**18!<AACB "q&QT]FV^^A.
Ijooad):;; $ 0tSVnb66#;$H"q&
)A-q1!!tQh-??A
)A-q11AHHJAD%0@	)-IIammQ&q}}a7G(HI' $Y/ 	B	s   1%H0 0IIc                    / nS n[        U5       HP  nU R                  XPR                  S   U5      nUR                  XS9nUR	                  UR                  5       5        MR     [        U6 $ )Nr   )r   )ranger   rF   nseriesr   rJ  r   )r0   rz   r   lgr   s         r1   rO  exp._taylor  sa    qA  IIaL!4A		!	!AHHQYY[!  Awr3   c                   SSK Jn  U R                  S   R                  5       R	                  XS9nUR
                  " US5      nU[        R                  L a  [        R                  $ [        Xd5      (       a4  [        U5      [        R                  :  a  [        U* 5      $ [        U5      $ U[        R                  L a  UR                  " US5      nUR                  SL a  [        U5      $ [        SU -  5      e)Nr   r   r8  Fr4  )sympy.calculus.utilr   rF   cancelrL  rP  r   r   r   r"   r   r-   r-  r[   r   )r0   rz   r3  rR  r   r   rT  s          r1   _eval_as_leading_termexp._eval_as_leading_term  s    3iil!!#33A3Axx1~!%%<55Ld(( $x!&& D5z!t9155=99Q?Du$t93t<==r3   c                n    SSK Jn  U" [        U-  [        S-  -   5      [        U" [        U-  5      -  -
  $ )Nr   )r  r   )r  r  r   r   )r0   r   kwargsr  s       r1   _eval_rewrite_as_sinexp._eval_rewrite_as_sin.  s-    @1S52a4< 1S3Z<//r3   c                n    SSK Jn  U" [        U-  5      [        U" [        U-  [        S-  -   5      -  -   $ )Nr   )r  r   )r  r  r   r   )r0   r   rh  r  s       r1   _eval_rewrite_as_cosexp._eval_rewrite_as_cos2  s.    @1S5zAc!C%"Q$,////r3   c                H    SSK Jn  SU" US-  5      -   SU" US-  5      -
  -  $ )Nr   )tanhrI   r   )%sympy.functions.elementary.hyperbolicro  )r0   r   rh  ro  s       r1   _eval_rewrite_as_tanhexp._eval_rewrite_as_tanh6  s(    >DQK!d3q5k/22r3   c                :   SSK JnJn  UR                  (       a  UR                  " [
        [        -  5      nU(       a]  UR                  (       aK  U" [
        U-  5      U" [
        U-  5      pv[        Xd5      (       d  [        Xs5      (       d  U[        U-  -   $ g g g g g )Nr   )r  r  )	r  r  r  r   r   r   r   r   r   )r0   r   rh  r  r  r   cosinesines           r1   _eval_rewrite_as_sqrtexp._eval_rewrite_as_sqrt:  su    E::IIbdOE"2e8}c"U(m!&..z47M7M!AdF?* 8N. )u r3   c                :   UR                   (       a  UR                   Vs/ s H7  n[        U[        5      (       d  M  [	        UR                  5      S:X  d  M5  UPM9     nnU(       a/  [        US   R                  S   UR                  " US   5      5      $ g g s  snf NrI   r   )r   rF   r   r6   lenr   r   )r0   r   rh  r   logss        r1   _eval_rewrite_as_Powexp._eval_rewrite_as_PowC  sr    ::"xxSx!:a+=A#aff+QRBRAxDS47<<?CIId1g,>??  Ss   BBBr   r   Tr   )r   r   r   r   r   r   r   classmethodr   r   r   staticmethodr   r   r  r  r   r   r$  r'  rH  rO  re  ri  rl  rq  rv  r|  r   __classcell__r   s   @r1   r-   r-      s    45!( g gR   !  !*@, A -^>*003+@ @r3   r-   )	metaclassc                    U R                  [        SS9u  pUS:X  a  UR                  (       a  X4$ UR                  [        5      nU(       a%  UR                  (       a  UR                  (       a  X4$ g)a  
Try to match expr with $a + Ib$ for real $a$ and $b$.

``match_real_imag`` returns a tuple containing the real and imaginary
parts of expr or ``(None, None)`` if direct matching is not possible. Contrary
to :func:`~.re`, :func:`~.im``, and ``as_real_imag()``, this helper will not force things
by returning expressions themselves containing ``re()`` or ``im()`` and it
does not expand its argument either.

Tas_Addr   )NN)as_independentr   is_realr   )exprr_i_s      r1   match_real_imagr  J  sX       4 0FB	Qw2::x			1	B	bjjRZZxr3   c                      \ rS rSr% SrS\S'   \R                  \R                  4r	SS jr
SS jr\SS j5       r\\S	 5       5       rSS
 jrS rSS jrS rS rS rS rS rS rS rS rSS jrS rSrg)r6   i_  ah  
The natural logarithm function `\ln(x)` or `\log(x)`.

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

Logarithms are taken with the natural base, `e`. To get
a logarithm of a different base ``b``, use ``log(x, b)``,
which is essentially short-hand for ``log(x)/log(b)``.

``log`` represents the principal branch of the natural
logarithm. As such it has a branch cut along the negative
real axis and returns values having a complex argument in
`(-\pi, \pi]`.

Examples
========

>>> from sympy import log, sqrt, S, I
>>> log(8, 2)
3
>>> log(S(8)/3, 2)
-log(3)/log(2) + 3
>>> log(-1 + I*sqrt(3))
log(2) + 2*I*pi/3

See Also
========

exp

ztuple[Expr]rF   c                H    US:X  a  SU R                   S   -  $ [        X5      e)z/
Returns the first derivative of the function.
rI   r   )rF   r	   r7   s     r1   r   	log.fdiff  s(     q=TYYq\>!$T44r3   c                    [         $ )z3
Returns `e^x`, the inverse function of `\log(x)`.
)r-   r7   s     r1   r9   log.inverse  r;   r3   Nc                V   SSK Jn  SSKJn  [	        U5      nUb  [	        U5      nUS:X  a&  US:X  a  [
        R                  $ [
        R                  $  [        X!5      nU(       a  U[        XU-  -  5      [        U5      -  -   $ [        U5      [        U5      -  $ UR                  (       a  UR                  (       a  [
        R                  $ U[
        R                  L a  [
        R                  $ U[
        R                   L a  [
        R                   $ U[
        R"                  L a  [
        R                   $ U[
        R                  L a  [
        R                  $ UR$                  (       a#  UR&                  S:X  a  U " UR(                  5      * $ UR*                  (       aD  UR,                  [
        R                  L a'  UR.                  R0                  (       a  UR.                  $ [3        U[.        5      (       a'  UR.                  R0                  (       a  UR.                  $ [3        U[.        5      (       a  UR.                  R4                  (       af  [7        UR.                  5      u  pgU(       aG  UR8                  (       a6  US[:        -  -  nU[:        :  a  US[:        -  -  nU[=        U[>        -  SS9-   $ O[3        U[@        5      (       a  [C        UR.                  5      $ [3        X5      (       a  URD                  RF                  (       a/  U" [        URD                  5      [        URH                  5      5      $ URD                  R                  (       a*  U" [
        R"                  [        URH                  5      5      $ [
        R                  $ [3        X5      (       a  URJ                  " U 5      $ UR4                  (       an  URL                  (       a  [:        [>        -  U " U* 5      -   $ U[
        R                  L a  [
        R                  $ U[
        R                  L a  [
        R                  $ UR                  (       a  [
        R                  $ URN                  (       d  URP                  " [>        5      nUb  U[
        R                   L a  [
        R                   $ U[
        R"                  L a  [
        R                   $ UR$                  (       aa  URR                  (       a'  [:        [>        -  [
        RT                  -  U " U5      -   $ [:        * [>        -  [
        RT                  -  U " U* 5      -   $ UR4                  (       Ga+  URV                  (       Ga  URX                  " [>        SS9u  pURL                  (       a
  US	-  nU	S	-  n	[=        U	SS9n	U	RY                  [>        S
S9u  pgURQ                  [>        5      nURZ                  (       Ga  U(       Ga  URZ                  (       Ga  URZ                  (       Gao  UR                  (       aw  URF                  (       a)  [:        [>        -  [
        RT                  -  U " X-  5      -   $ URL                  (       a+  [:        * [>        -  [
        RT                  -  U " X* -  5      -   $ g SSK.J/n
  Xv-  Ra                  5       nU* Ra                  5       n[c        5       nX;   aT  U
" U[e        U	5      -  5      nURF                  (       a  U " U5      [>        X   -  -   $ U " U5      [>        X   [:        -
  -  -   $ X;   aU  U
" U[e        U	5      -  5      nURF                  (       a  U " U5      [>        X   * -  -   $ U " U5      [>        [:        X   -
  -  -   $ g g g g g g g ! [         a     Of = fU[
        R                  La  U " U5      U " U5      -  $ U " U5      $ )Nr   r   r   rI   r   Fr  r  r   T)ratsimp)3r   r   r   r   r   r   r   r   r%   r6   
ValueErrorr   r   rc   r>   r   r   rj   r   r   r?  r  r   r-   r   r   r   r  r   r   r   r   r   r    r   r   r   r   r?   r   r   is_nonnegativer   r#  r  r  sympy.simplifyr  rd  _log_atan_tabler#   )r   r   r   r   r   r   r  r  r   arg_r  r7  t1
atan_tablemoduluss                  r1   r   log.eval  sx   ..cl4=Dqy!855L,,,	 !+s3q=1CI===s8CI-- =={{(((vv

"zz!***zz!uuSUUaZCEE
{"::#((aff,1I1I77Nc3CGG$<$<77NS!!cgg&7&7$SWW-FBb&&ad
7!B$JBJrAvE:::Y''cgg&&))ww"""3sww<SWW>>"1#5#5s377|DDuu%%>>#&&==AvSD	)))))(((uu;;$$$ zz&&q)E AJJ&::%a000::%&&++!AvU;; "sQw/#uf+=====S---,,Qu=KE  
d/D((4(8FB""1%B}}}


rzzz::~~!AvUZ@@ "sQw/#eck2BBB ( 7(A"B!0!2J")%#d)*;"<>>#&w<!jm2C#CC#&w<!z}r7I2J#JJ)")%#d)*;"<>>#&w<!
2G#GG#&w<!rJN7J2K#KK *% 8B
} .=M  166!3xD	))3xs   0]/ ]/ /
]<;]<c                    SSK Jn  U S:  a  [        R                  $ [	        U5      nU S:X  a  U$ U(       a  US   nUb  U" U * U-  U-  U S-   -  SSS9$ SSU S-  -  -
  XS-   -  -  U S-   -  $ )	zF
Returns the next term in the Taylor series expansion of `\log(1+x)`.
r   r0  r   rI   Tr-   r9  r   )rG  r1  r   r   r   )r   rz   r   r1  r   s        r1   r   log.taylor_term  s     	3q566MAJ6Hr"A}ax!|q1u5D%PPAq1uIU+QU33r3   c                
   SSK JnJn  UR                  SS5      nUR                  SS5      n[	        U R
                  5      S:X  a!  [        U R                  " U R
                  6 XS9$ U R
                  S   nUR                  (       aw  [        U5      nS n	Sn
USLa  Uu  pzU R                  U5      n	U(       a>  [        U5      nXxR                  5       ;  a   [        S	 UR                  5        5       5      n	U	b  X-  $ GOUR                  (       a+  [        UR                   5      [        UR"                  5      -
  $ UR$                  (       Ga+  / n/ nUR
                   H  nU(       d"  UR&                  (       d  UR(                  (       ak  U R                  U5      n[+        U[        5      (       a2  UR-                  U R                  U5      R.                  " S
0 UD65        M  UR-                  U5        M  UR0                  (       aD  U R                  U* 5      nUR-                  U5        UR-                  [2        R4                  5        M  UR-                  U5        M     [7        U6 [        [9        U6 5      -   $ UR:                  (       d  [+        U[<        5      (       a  U(       d  UR<                  R>                  (       aW  UR@                  R&                  (       dW  UR<                  S-   R&                  (       a  UR<                  S-
  RB                  (       d  UR@                  R(                  (       aj  UR@                  nUR<                  nU R                  U5      n[+        U[        5      (       a  [E        U5      UR.                  " S
0 UD6-  $ [E        U5      U-  $ OX[+        Xt5      (       aH  U(       d  URF                  R&                  (       a&  U" [        URF                  5      /URH                  Q76 $ U R                  U5      $ )Nr   )rw   rv   forceFfactorr   )r  r  rI   c              3  B   #    U  H  u  pU[        U5      -  v   M     g 7fr,   r5   )ry   valr   s      r1   r{   'log._eval_expand_log.<locals>.<genexpr>7  s      D)3s8)s   r   )%sympy.concreterw   rv   getrz  rF   r
   rA   
is_Integerr&   r'   keyssumitemsr   r6   r   r?  r   r   r   r   r   _eval_expand_logr?   r   r   r   r   r  r-   r   r   is_nonpositiver    r   r   )r0   r  r   rw   rv   r  r  r   r   logargr   r  nonposrz   r   rr   rs   s                    r1   r  log._eval_expand_log$  s   /		'5)8U+		Nadii3$LLiil>>c"AFE~
3cNffh&  D!'') DDF!|# "__suu:CEE
**ZZZDFXXAMMQZZ		!A!!S))DIIaL$A$A$JE$JKA]]		1"AKKNMM!--0MM!$  :CL 111ZZ:c3//11sxx7K7KQTQXQXYZQZQ"%''!)!;!;#((BSBSHHGGIIaLa%%%a=1+=+=+F+FFF%a=1,, CT %%003s||,:szz::yy~r3   c                    SSK JnJnJn  [	        U R
                  5      S:X  a   U" U R                  " U R
                  6 40 UD6$ U R                  U" U R
                  S   40 UD65      nUS   (       a  U" U5      nU" USS9n[        XP/US   S9$ )	Nr   )r
   simplifyinversecombiner   r9   Tr  measure)key)r   r
   r  r  rz  rF   rA   r   )r0   rh  r
   r  r  r  s         r1   _eval_simplifylog._eval_simplify]  s    PPtyy>QDIItyy1<V<<yy$))A,9&9:)!$'D$T*D<VI%677r3   c                V   U R                   S   nU(       a   U R                   S   R                  " U40 UD6n[        U5      nXC:X  a  U [        R                  4$ [        U5      nUR                  SS5      (       a#  SUS'   [        U5      R                  " U40 UD6U4$ [        U5      U4$ )a9  
Returns this function as a complex coordinate.

Examples
========

>>> from sympy import I, log
>>> from sympy.abc import x
>>> log(x).as_real_imag()
(log(Abs(x)), arg(x))
>>> log(I).as_real_imag()
(0, pi/2)
>>> log(1 + I).as_real_imag()
(log(sqrt(2)), pi/4)
>>> log(I*x).as_real_imag()
(log(Abs(x)), arg(I*x))

r   r6   Fcomplex)rF   r  r#   r   r   r   r  r6   )r0   r  r   sargsarg_abssarg_args         r1   r  log.as_real_imagh  s    & yy|99Q<&&t5u5Dt9<t999UE""$E)M((77BBx=(**r3   c                Z   U R                   " U R                  6 nUR                   U R                   :X  am  U R                  S   S-
  R                  (       a  gUR                  S   R                  (       a,  [	        U R                  S   S-
  R                  5      (       a  gg g UR                  $ Nr   rI   TF)rA   rF   rc   rd   r   r0   re   s     r1   rg   log._eval_is_rational  s    IItyy!66TYY		!q ))vvay$$DIIaL14D3M3M)N)N *O$ == r3   c                Z   U R                   " U R                  6 nUR                   U R                   :X  am  U R                  S   S-
  R                  (       a  g[        U R                  S   S-
  R                  5      (       a   U R                  S   R                  (       a  gg g UR                  $ r  )rA   rF   rc   r   r#  r  s     r1   r$  log._eval_is_algebraic  s    IItyy!66TYY		!q ))DIIaL1,556699Q<,,  - 7 >>!r3   c                4    U R                   S   R                  $ r   rF   r]   r/   s    r1   r   log._eval_is_extended_real  s    yy|000r3   c                t    U R                   S   n[        UR                  [        UR                  5      /5      $ r   )rF   r   r  r   rc   )r0   rf   s     r1   r   log._eval_is_complex  s,    IIaL!,,	!))(<=>>r3   c                \    U R                   S   nUR                  (       a  gUR                  $ Nr   F)rF   rc   r^   r_   s     r1   r`   log._eval_is_finite  s#    iil;;}}r3   c                :    U R                   S   S-
  R                  $ Nr   rI   r  r/   s    r1   r'  log._eval_is_extended_positive  s    		!q 666r3   c                :    U R                   S   S-
  R                  $ r  )rF   rc   r/   s    r1   rk   log._eval_is_zero  s    		!q )))r3   c                :    U R                   S   S-
  R                  $ r  )rF   is_extended_nonnegativer/   s    r1   _eval_is_extended_nonnegative!log._eval_is_extended_nonnegative  s    		!q 999r3   c           
     
  ^ SSK Jn  SSKJn  SSKJn  U R                  S   U:X  a  Uc  [        U5      $ U$ U R                  S   nU" SSS9n	US:X  a  SnUR                  " XU	-  5      n
[        S	5      [        S
5      pU
R                  XU-  -  5      nUbm  X   X   pUS:w  a`  UR                  U	5      (       dJ  UR                  U	5      (       d4  Uc  U[        U5      -  OX-  nU[        U5      U[        U5      -  -
  -  nU$ S n U
R                  XSS9u  nnXU	U-  -  -  S-
  R-                  5       R!                  U	TUSS9nUR                  [.        5      (       a  U" U5      n[1        UU5      (       a  UR3                  5       mU" UU	5      u  nnUc  [        U5      OUnUR4                  (       d  [        U5      U[        U5      -  -
  UU-  -   nUnSSSSSSSSSS.	nU R6                  " S0 UD6nUR9                  5       (       dC  UR9                  5       (       a.  UR                  U* [        U5      * 5      R6                  " S0 UD6nO+UR                  U[        U5      5      R6                  " S0 UD6nUU:X  a  U$ UU" UT-  U5      -   $ U4S jn0 n[:        R<                  " UR%                  5       5       H5  nU" UU	5      u  nnUR?                  U[(        R*                  5      U-   UU'   M7     [(        R@                  n0 nUnUU-  T:  as  [(        RB                  U-  * U-  n U H/  n!UR?                  U![(        R*                  5      U UU!   -  -   UU!'   M1     U" UU5      nU[(        R@                  -  nUU-  T:  a  Ms  [        U5      U[        U5      -  -
  UU-  -   nU H  n!UUU!   R-                  5       U	U!-  -  -  nM!     URD                  (       a  [G        U
5      S:w  a  SSK$J%n"  [M        U
RO                  U	5      5       H  u  n#nURP                  (       a  U#S:X  d  M    O   W#S:  a;  WRS                  U	5      u  n nUS[T        -  [V        -  U"" [G        U 5      * S5      -  -  nUR                  XU-  5      nUU" UT-  U5      -   $ ! [        [        [        4 a    U
R!                  U	TUSS9nUR"                  (       a*  TS-  mU
R!                  U	TUSS9nUR"                  (       a  M*   UR%                  5       R                  U	SS9u  nn GN! [         a3    UR%                  5       R'                  U	SS9[(        R*                  nn  GN9f = ff = f)Nr   r.  r   )r   r7  TpositiverI   kr_  c                V   [         R                  [         R                  p2[        R                  " U 5       HJ  nUR                  U5      (       a-  UR                  5       u  pSXQ:w  a   U R                  U5      s  $ MF  X$-  nML     X#4$ ! [         a    U [         R                  4s s  $ f = fr,   )	r   r>   r   r   r   hasrJ   leadtermr  )r   rz   r   r-   r  r   s         r1   	coeff_exp$log._eval_nseries.<locals>.coeff_exp  s    3---::a== & 2 2 4IDy0#'==#33 ! OE . :	  * 0#'</0s   'BB('B(r3  rR  )r   r3  rR  )rR  F)	r  r6   mul	power_exp
power_basemultinomialbasicr  r  c                   > 0 n[        X5       H=  u  p4X4-   nUT:  d  M  UR                  U[        R                  5      X   X   -  -   X%'   M?     U$ r,   )r   r  r   r   )d1d2r   e1e2exr   s         r1   r  log._eval_nseries.<locals>.mul  sP    C!"/W6!ggb!&&1BF26MACG * Jr3   	Heaviside   r   ),rF  r/  r   r   sympy.core.symbolr   rF   r6   rP  r   matchr  r  r  rN  r   rH  rI  rJ  rL  r   r   rd  r-   r   rM  r   r  r@   r   r   r  r>   r   r?   r!   'sympy.functions.special.delta_functionsr  	enumeratelseriesr  as_coeff_exponentr   r   )$r0   rz   r   r3  rR  r/  r   r   r   r7  rf   r  r_  rX  r  r   rr   re   r   _dr   _reslogflagsr  r  ptermsr   co1r  r   pkr   r  r  r   s$     `                                 r1   rH  log._eval_nseries  s    	-6+99Q<1!\3q63t3iil#%19DHHQQCy$s)1GGAdFO=4qAvaeeAhhquuQxx $Ac!fH!&SVaD	k))	
	F::a:3DAq !Q$Z!^##%33AA3N55::1AaAA1s1v4}}a&1SY;&4/CD $T%e#EETX!H ;;**D..00--//yy$Q077C(Cyys1v.55AAt|
q!tQ''	 MM!))+.Da(GCB/#5F2J / EEcAg]]A%%a'E!IIb!&&1E"R&L@b	 RBJA cAg !fqT{"QtV+B59##%a"g--C  ==RUaZI$QYYq\24||qAv 3 1u11!4qr!tBwy"U)Q777hhqD&!U1a4^##S /; 	FQT:A**QOOAAO> ***Fyy{++AA+61 Fyy{22112=qvv11F	Fs+   	R A U5!T8UUUUc                   U R                   S   R                  5       n[        SSS9nUS:X  a  SnUR                  XU-  5      n UR	                  XRSS9u  pxUR                  U5      (       a3  UR                  XQU-  5      nUS:w  a  [        SU -  5      e[        U5      $ U[        R                  :X  a4  U[        R                  :X  a   U[        R                  -
  R                  XS9$ [        U5      U[        U5      -  -
  n
Uc  [        U5      OUnXU-  -  n
UR                  (       a  [        U5      S:w  a  SS	KJn  [#        UR%                  U5      5       H  u  pUR&                  (       a  US
:X  d  M    O   WS
:  a:  WR)                  U5      u  pU
S[*        -  [,        -  U" [        U5      * S5      -  -  n
U
$ ! [
         a    UR                  XUS9n	[        U	5      s $ f = f)Nr   r7  Tr  rI   r  r4  r8  r  r  r  )rF   togetherr   rP  r  r  rL  r6   r  r   r   r>   r   r?   r!   r  r  r  r  r  r  r   r   )r0   rz   r3  rR  rT  r7  rf   crs   r   r   r  r   r   r   r  s                   r1   re  log._eval_as_leading_term'  s    yy|$$& #%19DIIaa 	::a:3DA 5588qD&!AAv ;t DEEq6M :!qvv+155L11!1?? !fqT{"s1v4v ==RUaZI$QYYq\2||qAv 3 1u11!4r!tBwy"U)Q777
7  	&&q$&?Cs8O	s   F= =%G%$G%r   r   r,   r~  r  )r   r   r   r   r   __annotations__r   r   r   r   r   r9   r  r   r  r   r   r  r  r  rg   r$  r   r   r`   r'  rk   r  rH  re  r   r   r3   r1   r6   r6   _  s    B ffa//0N5 {L {Lz 4  4 7r	8+@!	"1?7*:r$h*r3   r6   c                     ^  \ rS rSrSr\" \R                  SSS9* \R                  4r	\
SS j5       rSS jrS rS	 rS
 rS rSU 4S jjrS rSrU =r$ )LambertWiT  a  
The Lambert W function $W(z)$ is defined as the inverse
function of $w \exp(w)$ [1]_.

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

In other words, the value of $W(z)$ is such that $z = W(z) \exp(W(z))$
for any complex number $z$.  The Lambert W function is a multivalued
function with infinitely many branches $W_k(z)$, indexed by
$k \in \mathbb{Z}$.  Each branch gives a different solution $w$
of the equation $z = w \exp(w)$.

The Lambert W function has two partially real branches: the
principal branch ($k = 0$) is real for real $z > -1/e$, and the
$k = -1$ branch is real for $-1/e < z < 0$. All branches except
$k = 0$ have a logarithmic singularity at $z = 0$.

Examples
========

>>> from sympy import LambertW
>>> LambertW(1.2)
0.635564016364870
>>> LambertW(1.2, -1).n()
-1.34747534407696 - 4.41624341514535*I
>>> LambertW(-1).is_real
False

References
==========

.. [1] https://en.wikipedia.org/wiki/Lambert_W_function
r   Frn   c                   U[         R                  :X  a  U " U5      $ Uc  [         R                  nUR                  (       Ga  UR                  (       a  [         R                  $ U[         R                  L a  [         R                  $ US[         R                  -  :X  a  [         R
                  $ U[        S5      * S-  :X  a  [        S5      * $ US[        S5      -  :X  a  [        S5      $ U[        * S-  :X  a  [        [        -  S-  $ U[        S[         R                  -   5      :X  a  [         R                  $ U[         R                  L a  [         R                  $ [        UR                  5      (       a!  UR                  (       a  [         R                  $ U[         R
                  L ae  U[        * S-  :X  a  [        * [        -  S-  $ US[         R                  -  :X  a  [         R
                  $ US[        S5      -  :X  a  [        S5      * $ g g )Nr   r   rI   r  )r   r   rc   r   r>   r   r6   r   r   r-   r   r   rj   r   )r   rz   r  s      r1   r   LambertW.evaly  sr   ;q6MYA999yyvvAFF{uuBqvvI~}}$SVGAI~AwAc!fH}1vRCEztAvCAFF
O#vvAJJzz!QYYyy)))RCEzr"uQwbi}}$bRj
{" ! r3   c                   U R                   S   n[        U R                   5      S:X  a$  US:X  a  [        U5      US[        U5      -   -  -  $ O2U R                   S   nUS:X  a  [        X#5      US[        X#5      -   -  -  $ [        X5      e)z/
Return the first derivative of this function.
r   rI   )rF   rz  r  r	   )r0   r8   rz   r  s       r1   r   LambertW.fdiff  s     IIaLtyy>Q1}{Aq8A;$788  		!A1}~q!hqn*<'=>> 00r3   c                   U R                   S   n[        U R                   5      S:X  a  [        R                  nOU R                   S   nUR                  (       aM  US[        R
                  -  -   R                  (       a  gUS[        R
                  -  -   R                  (       a  gg US-   R                  (       ao  UR                  (       a&  US[        R
                  -  -   R                  (       a  gUR                  (       d%  US[        R
                  -  -   R                  (       a  gg [        UR                  5      (       a1  [        US-   R                  5      (       a  UR                  (       a  gg g g r  )rF   rz  r   r   rc   r   r   r  r?   r  r   r   )r0   rz   r  s      r1   r   LambertW._eval_is_extended_real  s    IIaLtyy>QA		!A99AaffH))ah,.. /!e__}}!ah,!;!;!!a!AFF(l%B%B &Cqyy!!iQ&@&@!! " 'A!r3   c                4    U R                   S   R                  $ r   )rF   r^   r/   s    r1   r`   LambertW._eval_is_finite  s    yy|%%%r3   c                   U R                   " U R                  6 nUR                   U R                   :X  aH  [        U R                  S   R                  5      (       a   U R                  S   R                  (       a  gg g UR                  $ r  )rA   rF   r   rc   r#  r  s     r1   r$  LambertW._eval_is_algebraic  se    IItyy!66TYY1--..499Q<3L3L 4M. >>!r3   c                    [        U R                  5      S:X  ad  U R                  S   nUR                  " US5      R                  5       nUR                  (       d  U R                  U5      $ UR                  " U5      $ g ry  )rz  rF   rP  rd  rc   rA   rL  )r0   rz   r3  rR  r   rT  s         r1   re  LambertW._eval_as_leading_term  sb    tyy>Q))A,C88Aq>((*D<<yy&&&q)) r3   c           
     J  > [        U R                  5      S:X  a  SSKJn  SSKJn  U R                  S   R                  XUS9nUR                  " XS9nSn	UR                  (       a  UR                  n	U" X)-  5      S:  ar  [        [        SU" X)-  5      5       V
s/ s H@  n
[        R                  * U
S-
  -  [        U
5      U
S-
  -  -  [        U
S-
  5      -  Xz-  -  PMB     sn
6 n[!        U5      nO[        R"                  nX" X-  U5      -   $ [$        TU ]M  XU5      $ s  sn
f )NrI   r   r+  r.  r2  r8  r   )rz  rF   rD  r,  rF  r/  r^  rL  r  r-   r   r]  r   r>   r   r   r   r   r  rH  )r0   rz   r   r3  rR  r,  r/  r   ltlter  re   r   s               r1   rH  LambertW._eval_nseries  s   tyy>QC0))A,&&qD&9C$$Q2BCyyffqu~";@GAEN;SU;Sa EE6QU+GAJQ,??#AE*++.62;SU V&q)FFuQT1~%%w$Q400Us   AD c                    U R                   S   n[        U R                   5      S:X  a  UR                  $ [        UR                  U R                   S   R                  /5      $ r  )rF   rz  rc   r   )r0   rz   s     r1   rk   LambertW._eval_is_zero  sK    IIaLtyy>Q99aii1)=)=>??r3   r   r,   r   r  )r   r   r   r   r   r   r   r   r   r   r  r   r   r   r`   r$  re  rH  rk   r   r  r  s   @r1   r  r  T  sh    !D 1662668I8IJN!# !#F1 (&"*1&@ @r3   r  c            	        0 [        S5      [        S-  _S[        S-  _[        SS[        S5      -  -
  5      [        S-  _[        S5      [        S[        S5      -
  5      -  S[        S5      -   -  [        S-  _[        SS[        S5      -  -   5      [        [        SS5      -  _[        S5      [        [        S5      S-   5      -  S[        S5      -   -  [        [        SS5      -  _[        S5      S-  [        S-  _[        S5      S-
  [        S-  _[        S[        S5      -
  5      [        [        S5      S-   5      -  [        S-  _[        S5      S-   [        [        SS5      -  _[        [        S5      S-   5      [        S[        S5      -
  5      -  [        [        SS5      -  _[        SS[        S5      -  S-  -
  5      [        S	-  _[        S5      * [        S	5      -   S[        [        S5      S-   5      -  -  [        S	-  _[        SS[        S5      -  S-  -   5      [        [        SS	5      -  _[        S5      [        S	5      -   S[        S[        S5      -
  5      -  -  [        [        SS	5      -  _S[        S5      -
  [        S
-  _S[        S5      -   S[        S5      -   -  [        S
-  _S[        S5      -   [        [        SS
5      -  S[        S5      -   S[        S5      -   -  [        [        SS
5      -  0E$ )Nr<  rI   r=  r  r   r   r>     
      )r$   r   r   r   r3   r1   r  r    s   Qa 	
26 	QT!W_rAv	
 	Q$q47{##q47{3R!V 	QT!W_rHQN2 	Q$tAw{##rDG|4b8Aq>6I 	Q!R!V 	Q!R!V 	Qa[Da1--rAv 	Q!R(1a.( 	T!Wq[DT!W--rHQN/B 	QT!Wq !27 q'DH	T$q'A+%6!67b 	QT!Wq !2B#7  
a48	DT!W$5 56Xa_8L!" 	
DGR"W#$ 
d1g!d1g+&R%& 	
DGR(1b/)	
T!Wd1g&Xa_(<) r3   N)@
__future__r   	itertoolsr   sympy.core.addr   sympy.core.cacher   sympy.core.exprr   sympy.core.functionr   r	   r
   r   r   r   r   r   sympy.core.logicr   r   r   sympy.core.mulr   sympy.core.numbersr   r   r   r   sympy.core.parametersr   sympy.core.powerr   sympy.core.singletonr   r  r   r   sympy.core.sympifyr   (sympy.functions.combinatorial.factorialsr   rC  r   r    r!   r"   r#   (sympy.functions.elementary.miscellaneousr$   sympy.ntheoryr%   r&   sympy.ntheory.factor_r'   r)   r   r   r-   r  r6   r  r  r   r3   r1   <module>r,     s    "   $  N N N ; ;  7 7 3   " ) & > M M 9 5 +eo ePF) F)REm El@'W l@^*r/ rjX@ X@v 	 	r3   