
    \h
p                     z   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
JrJr  S SKJrJrJr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  S SKJr   " S S\5      r\" \\5      S 5       r \" \\5      S 5       r \" \\5      S 5       r!\" \\5      S 5       r!\" \\5      S 5       r!\" \\5      S 5       r!\r"g)    )AddMulPowS)Basic)Expr)
_sympifyitoozoo)is_leis_ltis_geis_gt)_sympify)MinMax)And)dispatch)Order)	FiniteSetc                      \ rS rSrSrSrSrS\4S jrSr	S r
\S	 5       r\S
 5       r\S 5       r\S 5       r\" S\5      S 5       r\" S\5      S 5       r\rS r\" S\5      S 5       r\" S\5      S 5       r\" S\5      S 5       r\r\" S\5      S 5       r\" S\5      S 5       r\" S\5      S 5       r\" S\5      S 5       rS rS rS r S r!Sr"g)AccumulationBounds   aC  An accumulation bounds.

# Note AccumulationBounds has an alias: AccumBounds

AccumulationBounds represent an interval `[a, b]`, which is always closed
at the ends. Here `a` and `b` can be any value from extended real numbers.

The intended meaning of AccummulationBounds is to give an approximate
location of the accumulation points of a real function at a limit point.

Let `a` and `b` be reals such that `a \le b`.

`\left\langle a, b\right\rangle = \{x \in \mathbb{R} \mid a \le x \le b\}`

`\left\langle -\infty, b\right\rangle = \{x \in \mathbb{R} \mid x \le b\} \cup \{-\infty, \infty\}`

`\left\langle a, \infty \right\rangle = \{x \in \mathbb{R} \mid a \le x\} \cup \{-\infty, \infty\}`

`\left\langle -\infty, \infty \right\rangle = \mathbb{R} \cup \{-\infty, \infty\}`

``oo`` and ``-oo`` are added to the second and third definition respectively,
since if either ``-oo`` or ``oo`` is an argument, then the other one should
be included (though not as an end point). This is forced, since we have,
for example, ``1/AccumBounds(0, 1) = AccumBounds(1, oo)``, and the limit at
`0` is not one-sided. As `x` tends to `0-`, then `1/x \rightarrow -\infty`, so `-\infty`
should be interpreted as belonging to ``AccumBounds(1, oo)`` though it need
not appear explicitly.

In many cases it suffices to know that the limit set is bounded.
However, in some other cases more exact information could be useful.
For example, all accumulation values of `\cos(x) + 1` are non-negative.
(``AccumBounds(-1, 1) + 1 = AccumBounds(0, 2)``)

A AccumulationBounds object is defined to be real AccumulationBounds,
if its end points are finite reals.

Let `X`, `Y` be real AccumulationBounds, then their sum, difference,
product are defined to be the following sets:

`X + Y = \{ x+y \mid x \in X \cap y \in Y\}`

`X - Y = \{ x-y \mid x \in X \cap y \in Y\}`

`X \times Y = \{ x \times y \mid x \in X \cap y \in Y\}`

When an AccumBounds is raised to a negative power, if 0 is contained
between the bounds then an infinite range is returned, otherwise if an
endpoint is 0 then a semi-infinite range with consistent sign will be returned.

AccumBounds in expressions behave a lot like Intervals but the
semantics are not necessarily the same. Division (or exponentiation
to a negative integer power) could be handled with *intervals* by
returning a union of the results obtained after splitting the
bounds between negatives and positives, but that is not done with
AccumBounds. In addition, bounds are assumed to be independent of
each other; if the same bound is used in more than one place in an
expression, the result may not be the supremum or infimum of the
expression (see below). Finally, when a boundary is ``1``,
exponentiation to the power of ``oo`` yields ``oo``, neither
``1`` nor ``nan``.

Examples
========

>>> from sympy import AccumBounds, sin, exp, log, pi, E, S, oo
>>> from sympy.abc import x

>>> AccumBounds(0, 1) + AccumBounds(1, 2)
AccumBounds(1, 3)

>>> AccumBounds(0, 1) - AccumBounds(0, 2)
AccumBounds(-2, 1)

>>> AccumBounds(-2, 3)*AccumBounds(-1, 1)
AccumBounds(-3, 3)

>>> AccumBounds(1, 2)*AccumBounds(3, 5)
AccumBounds(3, 10)

The exponentiation of AccumulationBounds is defined
as follows:

If 0 does not belong to `X` or `n > 0` then

`X^n = \{ x^n \mid x \in X\}`

>>> AccumBounds(1, 4)**(S(1)/2)
AccumBounds(1, 2)

otherwise, an infinite or semi-infinite result is obtained:

>>> 1/AccumBounds(-1, 1)
AccumBounds(-oo, oo)
>>> 1/AccumBounds(0, 2)
AccumBounds(1/2, oo)
>>> 1/AccumBounds(-oo, 0)
AccumBounds(-oo, 0)

A boundary of 1 will always generate all nonnegatives:

>>> AccumBounds(1, 2)**oo
AccumBounds(0, oo)
>>> AccumBounds(0, 1)**oo
AccumBounds(0, oo)

If the exponent is itself an AccumulationBounds or is not an
integer then unevaluated results will be returned unless the base
values are positive:

>>> AccumBounds(2, 3)**AccumBounds(-1, 2)
AccumBounds(1/3, 9)
>>> AccumBounds(-2, 3)**AccumBounds(-1, 2)
AccumBounds(-2, 3)**AccumBounds(-1, 2)

>>> AccumBounds(-2, -1)**(S(1)/2)
sqrt(AccumBounds(-2, -1))

Note: `\left\langle a, b\right\rangle^2` is not same as `\left\langle a, b\right\rangle \times \left\langle a, b\right\rangle`

>>> AccumBounds(-1, 1)**2
AccumBounds(0, 1)

>>> AccumBounds(1, 3) < 4
True

>>> AccumBounds(1, 3) < -1
False

Some elementary functions can also take AccumulationBounds as input.
A function `f` evaluated for some real AccumulationBounds `\left\langle a, b \right\rangle`
is defined as `f(\left\langle a, b\right\rangle) = \{ f(x) \mid a \le x \le b \}`

>>> sin(AccumBounds(pi/6, pi/3))
AccumBounds(1/2, sqrt(3)/2)

>>> exp(AccumBounds(0, 1))
AccumBounds(1, E)

>>> log(AccumBounds(1, E))
AccumBounds(0, 1)

Some symbol in an expression can be substituted for a AccumulationBounds
object. But it does not necessarily evaluate the AccumulationBounds for
that expression.

The same expression can be evaluated to different values depending upon
the form it is used for substitution since each instance of an
AccumulationBounds is considered independent. For example:

>>> (x**2 + 2*x + 1).subs(x, AccumBounds(-1, 1))
AccumBounds(-1, 4)

>>> ((x + 1)**2).subs(x, AccumBounds(-1, 1))
AccumBounds(0, 4)

References
==========

.. [1] https://en.wikipedia.org/wiki/Interval_arithmetic

.. [2] https://fab.cba.mit.edu/classes/S62.12/docs/Hickey_interval.pdf

Notes
=====

Do not use ``AccumulationBounds`` for floating point interval arithmetic
calculations, use ``mpmath.iv`` instead.
TFreturnc                    [        U5      n[        U5      nUR                  (       a  UR                  (       d  [        S5      eX!:X  a  U$ UR                  (       a<  UR                  (       a+  UR                  =(       a    UR                  =(       a    X!:  nOX!-
  R
                  nU(       a  [        S5      e[        R                  " XU5      $ )Nz*Only real AccumulationBounds are supportedz.Lower limit should be smaller than upper limit)r   is_extended_real
ValueError	is_numberis_comparableis_extended_negativer   __new__)clsminmaxbads       Y/var/www/auris/envauris/lib/python3.13/site-packages/sympy/calculus/accumulationbounds.pyr!   AccumulationBounds.__new__   s    smsm ##3+?+?IJJ:J ==S]]##G(9(9GciC922C@B B }}Ss++    g      &@c                 t    U R                   R                  (       a  U R                  R                  (       a  gg g )NT)r#   is_realr$   selfs    r&   _eval_is_real AccumulationBounds._eval_is_real   s&    88 0 0 !1r(   c                      U R                   S   $ )z
Returns the minimum possible value attained by AccumulationBounds
object.

Examples
========

>>> from sympy import AccumBounds
>>> AccumBounds(1, 3).min
1

r   argsr+   s    r&   r#   AccumulationBounds.min        yy|r(   c                      U R                   S   $ )z
Returns the maximum possible value attained by AccumulationBounds
object.

Examples
========

>>> from sympy import AccumBounds
>>> AccumBounds(1, 3).max
3

   r0   r+   s    r&   r$   AccumulationBounds.max   r3   r(   c                 4    U R                   U R                  -
  $ )z
Returns the difference of maximum possible value attained by
AccumulationBounds object and minimum possible value attained
by AccumulationBounds object.

Examples
========

>>> from sympy import AccumBounds
>>> AccumBounds(1, 3).delta
2

)r$   r#   r+   s    r&   deltaAccumulationBounds.delta   s     xx$((""r(   c                 :    U R                   U R                  -   S-  $ )z
Returns the mean of maximum possible value attained by
AccumulationBounds object and minimum possible value
attained by AccumulationBounds object.

Examples
========

>>> from sympy import AccumBounds
>>> AccumBounds(1, 3).mid
2

   )r#   r$   r+   s    r&   midAccumulationBounds.mid
  s     488#q((r(   otherc                 $    U R                  U5      $ N)__pow__r,   r>   s     r&   _eval_powerAccumulationBounds._eval_power  s    ||E""r(   c                    [        U[        5      (       Ga  [        U[        5      (       aH  [        [        U R                  UR                  5      [        U R
                  UR
                  5      5      $ U[        R                  L a  U R                  [        R                  L d0  U[        R                  L a2  U R
                  [        R                  L a  [        [        * [        5      $ UR                  (       a  U R                  [        R                  L a2  U R
                  [        R                  L a  [        [        * [        5      $ U R                  [        R                  L a  [        [        * U R
                  U-   5      $ U R
                  [        R                  L a  [        U R                  U-   [        5      $ [        [        U R                  U5      [        U R
                  U5      5      $ [        XSS9$ [        $ NFevaluate)
isinstancer   AccumBoundsr   r#   r$   r   InfinityNegativeInfinityr
   r   NotImplementedrB   s     r&   __add__AccumulationBounds.__add__  sW   eT""%--"%)),%)),. . 

"txx13E3E'EQ///DHH

4J"B3++''88q111dhh!**6L&sB//XX!3!33&sDHHu,<==XX+&txx%'7<<&s488U';S5=QRRtU33r(   c                 F    [        U R                  * U R                  * 5      $ r@   )rJ   r$   r#   r+   s    r&   __neg__AccumulationBounds.__neg__7  s    DHH9txxi00r(   c                    [        U[        5      (       Ga  [        U[        5      (       aJ  [        [        U R                  UR
                  * 5      [        U R
                  UR                  * 5      5      $ U[        R                  L a  U R                  [        R                  L d0  U[        R                  L a2  U R
                  [        R                  L a  [        [        * [        5      $ UR                  (       a  U R                  [        R                  L a2  U R
                  [        R                  L a  [        [        * [        5      $ U R                  [        R                  L a  [        [        * U R
                  U-
  5      $ U R
                  [        R                  L a  [        U R                  U-
  [        5      $ [        [        U R                  U* 5      [        U R
                  U* 5      5      $ [        X* SS9$ [        $ rF   )rI   r   rJ   r   r#   r$   r   rL   rK   r
   r   rM   rB   s     r&   __sub__AccumulationBounds.__sub__:  si   eT""%--"599*-599*-/ / ***txx1;M;M/MQZZ'DHH

,B"B3++''88q111dhh!**6L&sB//XX!3!33&sDHHu,<==XX+&txx%'7<<&DHHuf-DHHuf-/ / tVe44r(   c                 (    U R                  5       U-   $ r@   )rQ   rB   s     r&   __rsub__AccumulationBounds.__rsub__R  s    ||~%%r(   c                    U R                   [        * [        4:X  a  U $ [        U[        5      (       Ga  [        U[        5      (       a{  UR                   [        * [        4:X  a  U$ [        5       nU R                    H,  nX-  nUR                  UR                   =(       d    U45        M.     [	        [        U6 [        U6 5      $ U[        R                  L aW  U R                  R                  (       a  [	        S[        5      $ U R                  R                  (       a  [	        [        * S5      $ U[        R                  L aW  U R                  R                  (       a  [	        [        * S5      $ U R                  R                  (       a  [	        S[        5      $ UR                  (       Ga  UR                  (       ak  U R                  [        R                  L a  [	        S[        5      $ U R                  [        R                  L a  [	        [        * S5      $ [        R                   $ UR"                  (       a4  [	        [%        U R                  U5      [%        U R                  U5      5      $ UR&                  (       a4  [	        [%        U R                  U5      [%        U R                  U5      5      $ [        U[(        5      (       a  U$ [%        XSS9$ [*        $ )Nr   FrG   )r1   r
   rI   r   rJ   setupdater   r   r   rK   r#   is_zeror$   rL   r   Zerois_extended_positiver   r    r   rM   )r,   r>   vavis        r&   __mul__AccumulationBounds.__mul__V  s   99"b	!KeT""%--::2#r* LEABHHRWW-. # #37CG44

"88##&q"--88##&sA..***88##&sA..88##&q"--%%%==xx1::-*1b11xx1#5#55*B32266M--&DHHe,DHHe,. . //&DHHe,DHHe,. . %''tU33r(   c                 ^
   [        U[        5      (       Ga  [        U[        5      (       Ga{  UR                  R                  (       d  UR
                  R                  (       a)  U [        SUR
                  -  SUR                  -  5      -  $ U R                  R                  (       a  U R
                  R                  (       a  UR                  R                  (       a  UR
                  R                  (       a  U R                  R                  (       a+  UR                  R                  (       a  [        S[        5      $ U R
                  R                  (       a,  UR                  R                  (       a  [        [        * S5      $ [        [        * [        5      $ U R
                  R                  (       a  UR                  R                  (       ar  UR
                  R                  (       a'  [        U R
                  UR                  -  [        5      $ UR
                  R                  (       a  [        [        * [        5      $ UR                  R                  (       aC  UR
                  R                  (       a(  [        [        * U R
                  UR
                  -  5      $ U R                  R                  (       a  UR                  R                  (       as  UR
                  R                  (       a(  [        [        * U R                  UR                  -  5      $ UR
                  R                  (       a  [        [        * [        5      $ UR                  R                  (       aB  UR
                  R                  (       a'  [        U R                  UR
                  -  [        5      $ GONUR                  (       Ga<  U[        R                  [        R                   4;   a  U [        [        * [        5      :X  a  [        [        * [        5      $ U R
                  [        R                  L a   [        [#        SU5      [%        SU5      5      $ U R                  [        R                   L a"  [        [#        SU* 5      [%        SU* 5      5      $ UR                  (       a&  [        U R                  U-  U R
                  U-  5      $ UR                  (       a&  [        U R
                  U-  U R                  U-  5      $ SU-  [        R&                  L a  [)        U SU-  SS9$ [)        U SU-  5      $ [*        $ )Nr5   r   FrG   )rI   r   rJ   r#   is_positiver$   is_negativeis_extended_nonpositiveis_extended_nonnegativer\   r
   r    r^   r   r   rK   rL   r   r   ComplexInfinityr   rM   rB   s     r&   __truediv__AccumulationBounds.__truediv__  s6   eT""%--99((EII,A,A+a		k1UYY;"GGGHH449Y9YII55%)):[:[xx''EII,=,=*1b11xx''EII,=,=*B322&sB//8800yy55 99,,#.txx%))/CR#HH 9999 $/sB#77yy((UYY-K-K*B35990DEE8800yy55 99,,#.sDHHuyy4H#II 9999 $/sB#77yy((UYY-K-K*488eii+?DD'''QZZ););<<{B333*B333xx1::-*3q%=#a-HHxx1#5#55*3q5&>3q5&>JJ--&txx%'7E9IJJ//&txx%'7E9IJJE	a///4UU;;4U++r(   c                 &   [        U[        5      (       Ga  UR                  (       Ga  UR                  (       a  [        R
                  $ U R                  R                  (       GaI  U R                  R                  (       Ga-  U R                  R                  (       aq  UR                  (       a'  [        [        USU R                  -  5      [        5      $ UR                  (       a(  [        [        * [        USU R                  -  5      5      $ U R                  R                  (       aq  UR                  (       a(  [        [        * [        USU R                  -  5      5      $ UR                  (       a'  [        [        USU R                  -  5      [        5      $ [        [        * [        5      $ [        [        XR                  -  XR                  -  5      [!        XR                  -  XR                  -  5      5      $ [        USU -  SS9$ ["        $ )Nr5   FrG   )rI   r   r   r\   r   r]   r#   rg   r$   rh   r^   rJ   r   r
   r    r   r   rM   rB   s     r&   __rtruediv__AccumulationBounds.__rtruediv__  sb   eT""%%%==66MHH4449Y9Y9Yxx'' 55#.s5!dhh,/G#LL 55#.sCq488|4L#MMxx'' 55#.sCq488|4L#MM 55#.s5!dhh,/G#LL&sB//&s588+;UXX=M'N'*588+;UXX=M'NP Pua$h77!!r(   c                    [        U[        5      (       GaN  U[        R                  L Ga!  U R                  R
                  (       aP  U R                  S:  a  [        R                  $ U R                  S:  a  [        R                  $ [        S[        5      $ U R                  R                  (       aF  U R                  S:  a  [        R                  $ U R                  S:  a  [        $ [        R                  $ U R                  S:  a0  U R                  S:  a  [        R                  $ [        S[        5      $ [        [        * [        5      $ U[        R                  L a  SU -  [        -  $ U R                  U R                  -
  R                  (       aX  U R                  R                  (       a=  UR                  (       a,  U R                  U R                  U-  U R                  U-  5      $ UR                   (       a  [        R"                  $ UR$                  (       d  UR&                  (       Gai  U R                  R(                  (       aT  [        [+        U R                  U-  U R                  U-  5      [-        U R                  U-  U R                  U-  5      5      $ U R                  R                  (       aT  [        [+        U R                  U-  U R                  U-  5      [-        U R                  U-  U R                  U-  5      5      $ US-  S:X  a  UR                  (       ay  U R                  R                   (       a  [        U R                  U-  [        5      $ U R                  R                   (       a  [        U R                  U-  [        5      $ SU -  U* -  $ [        [        R                  [-        U R                  U-  U R                  U-  5      5      $ US-  S:X  a  UR                  (       az  U R                  R                   (       a  [        U R                  U-  [        5      $ U R                  R                   (       a  [        [        * U R                  U-  5      $ SU -  U* -  $ [        U R                  U-  U R                  U-  5      $ UR.                  (       d  UR0                  (       a  U R                  R
                  (       d,  UR
                  (       a  U R                  R
                  (       aj  UR3                  5       u  p#U[        R"                  L a(  [        U R4                   Vs/ s H
  oDSU-  -  PM     sn6 $ U[        R"                  La
  X-  SU-  -  $ [        U[        5      (       a  U R                  R(                  (       d6  U R                  R
                  (       a  UR                  R
                  (       a  UR4                   Vs/ s H  o@U-  PM	     nn[7        S U 5       5      (       dU  U VVs/ s H!  oDR4                  =(       d    U4  H  ofPM     M#     nnn U R                  [	        U5      [        U5      5      $ [;        XSS9$ [<        $ s  snf s  snf s  snnf ! [8         a     N,f = f)Nr5   r   r;   c              3   8   #    U  H  oR                   v   M     g 7fr@   )is_Pow).0is     r&   	<genexpr>-AccumulationBounds.__pow__.<locals>.<genexpr>,  s     3Axxs   FrG   )rI   r   r   rK   r#   rh   r$   r]   rJ   r
   r    r   NaNrL   is_nonnegativefuncr\   One
is_Integer
is_integerr^   r   r   r   is_rationalas_numer_denomr1   any	TypeErrorr   rM   )r,   r>   numdenrt   pjr`   s           r&   rA   AccumulationBounds.__pow__  s   eT""

"8833xx!| vvxx!| zz)&q"--XX22xx"} vvxx"}"
55Lxx"}88a<#$66M*1b11&sB//***$|# 488#3388**++#yy5$((E/JJ}}uu5#3#3#38800&DHHeOTXXu_=DHHeOTXXu_=? ? XX22&DHHeOTXXu_=DHHeOTXXu_=? ? 19>1188++#.txx#CC88++#.txx#CC !$5&11&DHHeOTXXu_ EG GQY!^1188++#.txx#CC88++#.sDHHeO#DD !$5&11&txx%HH 5#4#4HH4411HH44 //1!%%<&TYY(GYQsUY(GHH% I3//%--HH1188		99*/**5*Qq*A53333()B166>aT>aQ>QB!#'99SVSV#<< tU33' )H 6B  ) ! !s$   9Y+Y0(Y57#Y; ;
ZZc                 x   UR                   (       Ga  UR                  (       Ga  U R                  U R                  -
  R                  (       a  U[
        R                  L a  [
        R                  $ UR                  (       aC  U R                   Vs/ s H  o!U-  PM	     snu  p4[        X45      U:w  a  XCpCU R                  X45      $ UR                  (       aX  U R                  R                  (       a  U R                  SS5      $ U R                  R                  (       a  [
        R                  $ [        XSS9$ s  snf )Nr   r5   FrG   )r*   rh   r$   r#   r^   r   rz   r1   ry   r\   r]   r   )r,   r>   rt   r`   bs        r&   __rpow__AccumulationBounds.__rpow__7  s    ===U:::488#%9%9@:~uu))*.))4)Qq)4q9>qyy&}}88##99Q?*880066M5// 5s   D7c                    U R                   R                  (       a  U R                  5       $ U R                  R                  (       aA  [	        [
        R                  [        [        U R                  5      U R                   5      5      $ U $ r@   )	r$   r    rQ   r#   rJ   r   r]   r   absr+   s    r&   __abs__AccumulationBounds.__abs__J  sQ    88((<<>!XX**qvvs3txx=$(('CDDKr(   c                 J   [        U5      nU[        R                  [        R                  4;   a<  U R                  [        R                  L d  U R
                  [        R                  L a  gg[        U R                  U:*  U R
                  U:  5      nUS;  a  [        S5      eU$ )ay  
Returns ``True`` if other is contained in self, where other
belongs to extended real numbers, ``False`` if not contained,
otherwise TypeError is raised.

Examples
========

>>> from sympy import AccumBounds, oo
>>> 1 in AccumBounds(-1, 3)
True

-oo and oo go together as limits (in AccumulationBounds).

>>> -oo in AccumBounds(1, oo)
True

>>> oo in AccumBounds(-oo, 0)
True

TF)TFzinput failed to evaluate)r   r   rK   rL   r#   r$   r   r   )r,   r>   rvs      r&   __contains__AccumulationBounds.__contains__S  s    , QZZ!3!344xx1---QZZ1GU"DHH$56]"677	r(   c                 $   [        U[        [        45      (       d  [        S5      e[        U[        5      (       a0  [        R
                  nU H  nX0;   d  M
  U[        U5      -   nM     U$ U R                  UR                  :  d  U R                  UR                  :  a  [        R
                  $ U R                  UR                  ::  aV  U R                  UR                  ::  a   [        UR                  U R                  5      $ U R                  UR                  :  a  U$ UR                  U R                  ::  aW  UR                  U R                  :  a   [        U R                  UR                  5      $ UR                  U R                  :  a  U $ gg)ah  
Returns the intersection of 'self' and 'other'.
Here other can be an instance of :py:class:`~.FiniteSet` or AccumulationBounds.

Parameters
==========

other : AccumulationBounds
    Another AccumulationBounds object with which the intersection
    has to be computed.

Returns
=======

AccumulationBounds
    Intersection of ``self`` and ``other``.

Examples
========

>>> from sympy import AccumBounds, FiniteSet
>>> AccumBounds(1, 3).intersection(AccumBounds(2, 4))
AccumBounds(2, 3)

>>> AccumBounds(1, 3).intersection(AccumBounds(4, 6))
EmptySet

>>> AccumBounds(1, 4).intersection(FiniteSet(1, 2, 5))
{1, 2}

4Input must be AccumulationBounds or FiniteSet objectN)rI   rJ   r   r   r   EmptySetr$   r#   )r,   r>   fin_setrt   s       r&   intersectionAccumulationBounds.intersectionu  s,   @ %+y!9::FH H eY''jjG9%	!4G  N88eii488eii#7::88uyy xx599$"599dhh77xx%))#99 yy488#"488UYY77yy488# $ !r(   c                    [        U[        5      (       d  [        S5      eU R                  UR                  ::  aN  U R                  UR                  :  a4  [        U R                  [        U R                  UR                  5      5      $ UR                  U R                  ::  aO  UR                  U R                  :  a4  [        UR                  [        U R                  UR                  5      5      $ g g )Nr   )rI   rJ   r   r#   r$   r   rB   s     r&   unionAccumulationBounds.union  s     %--FH H 88uyy TXX%:txxTXXuyy)ABB99 UYY$((%:uyy#dhh		*BCC &; r(    N)#__name__
__module____qualname____firstlineno____doc__r   r   r   r!   _op_priorityr-   propertyr#   r$   r8   r<   r	   rM   rC   rN   __radd__rQ   rT   rW   rb   __rmul__rj   rm   rA   r   r   r   r   r   __static_attributes__r   r(   r&   r   r      s   gR I,$ ,0 L     # #  ) )  (# )# ( )* H1 ( ). (& )& (( )(T H(9 )9v (" )"0 (\ )\| (0 )0$ D8tDr(   r   c                     [        U R                  UR                  5      (       a  g[        U R                  UR                  5      (       a  gg NTF)r   r$   r#   r   lhsrhss     r&   _eval_is_ler     7    SWWcggSWWcgg r(   c                     UR                   (       d  [        S[        U5      < SU< 35      eUR                  (       a9  [	        U R
                  U5      (       a  g[        U R                  U5      (       a  ggg)a*  
Returns ``True `` if range of values attained by ``lhs`` AccumulationBounds
object is greater than the range of values attained by ``rhs``,
where ``rhs`` may be any value of type AccumulationBounds object or
extended real number value, ``False`` if ``rhs`` satisfies
the same property, else an unevaluated :py:class:`~.Relational`.

Examples
========

>>> from sympy import AccumBounds, oo
>>> AccumBounds(1, 3) > AccumBounds(4, oo)
False
>>> AccumBounds(1, 4) > AccumBounds(3, 4)
AccumBounds(1, 4) > AccumBounds(3, 4)
>>> AccumBounds(1, oo) > -1
True

Invalid comparison of  TFNr   r   typer   r   r$   r   r#   r   s     r&   r   r     se    , cC!" " 
		##  
r(   c                     [        U R                  UR                  5      (       a  g[        U R                  UR                  5      (       a  gg r   r   r#   r$   r   r   s     r&   _eval_is_ger     r   r(   c                     UR                   (       d  [        S[        U5      < SU< 35      eUR                  (       a9  [	        U R
                  U5      (       a  g[        U R                  U5      (       a  ggg)a&  
Returns ``True`` if range of values attained by ``lhs`` AccumulationBounds
object is less that the range of values attained by ``rhs``, where
other may be any value of type AccumulationBounds object or extended
real number value, ``False`` if ``rhs`` satisfies the same
property, else an unevaluated :py:class:`~.Relational`.

Examples
========

>>> from sympy import AccumBounds, oo
>>> AccumBounds(1, 3) >= AccumBounds(4, oo)
False
>>> AccumBounds(1, 4) >= AccumBounds(3, 4)
AccumBounds(1, 4) >= AccumBounds(3, 4)
>>> AccumBounds(1, oo) >= 1
True
r   r   TFN)r   r   r   r   r   r#   r   r$   r   s     r&   r   r     se    * #Y 	 
		##  
r(   c                     U R                   (       d  [        S[        U 5      < SU < 35      eU R                  (       a9  [	        UR
                  U 5      (       a  g[        UR                  U 5      (       a  gg g )Nr   r   TFr   r   s     r&   r   r     sc    #Y 	 
		##  
r(   c                     [        U R                  UR                  5      (       a  g[        U R                  UR                  5      (       a  gg r   r   r   s     r&   r   r     r   r(   N)#
sympy.corer   r   r   r   sympy.core.basicr   sympy.core.exprr   sympy.core.numbersr	   r
   r   sympy.core.relationalr   r   r   r   sympy.core.sympifyr   (sympy.functions.elementary.miscellaneousr   r   sympy.logic.boolalgr   sympy.multipledispatchr   sympy.series.orderr   sympy.sets.setsr   r   r   r   rJ   r   r(   r&   <module>r      s    ' ' "   2 2 < < ' = # + $ %m
D m
D` 

01 2 

e$ %@ 

01 2 

d# $> 
$"#	 $	 

01 2 !r(   