
    wgo                     z   d dl 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 d dlmZmZmZmZ d dlmZ d dlmZmZ d dlmZ d d	lmZ d d
lmZ d dlmZ  G d de      Z eee      d        Z  eee      d        Z  eee      d        Z! eee      d        Z! eee      d        Z! eee      d        Z!eZ"y)    )AddMulPowS)Basic)Expr)
_sympifyitoozoo)is_leis_ltis_geis_gt)_sympify)MinMax)And)dispatch)Order)	FiniteSetc                      e Zd ZdZdZdZd ZdZd Ze	d        Z
e	d        Ze	d	        Ze	d
        Z ede      d        Z ede      d        ZeZd Z ede      d        Z ede      d        Z ede      d        ZeZ ede      d        Z ede      d        Z ede      d        Z ede      d        Zd Zd Zd Zd Zy)AccumulationBoundsa  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.
    TFc                 \   t        |      }t        |      }|j                  r|j                  st        d      ||k(  r|S |j                  r.|j                  r"|j                  xr |j                  xr ||k  }n||z
  j
                  }|rt        d      t        j                  | ||      S )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       f/home/mcse/projects/flask/flask-venv/lib/python3.12/site-packages/sympy/calculus/accumulationbounds.pyr   zAccumulationBounds.__new__   s    smsm ##3+?+?IJJ#:J ==S]]##G(9(9GcCiC922C@B B }}S#s++    g      &@c                 `    | j                   j                  r| j                  j                  ryy y )NT)r!   is_realr"   selfs    r$   _eval_is_realz AccumulationBounds._eval_is_real   s&    88 0 0 !1r%   c                      | j                   d   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!   zAccumulationBounds.min        yy|r%   c                      | j                   d   S )z
        Returns the maximum possible value attained by AccumulationBounds
        object.

        Examples
        ========

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

           r,   r(   s    r$   r"   zAccumulationBounds.max   r.   r%   c                 4    | j                   | j                  z
  S )a7  
        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$   deltazAccumulationBounds.delta   s     xx$((""r%   c                 :    | j                   | j                  z   dz  S )a/  
        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$   midzAccumulationBounds.mid
  s     488#q((r%   otherc                 $    | j                  |      S N)__pow__r)   r6   s     r$   _eval_powerzAccumulationBounds._eval_power  s    ||E""r%   c                    t        |t              rt        |t              rHt        t        | j                  |j                        t        | j
                  |j
                              S |t        j                  u r| j                  t        j                  u s.|t        j                  u r1| j
                  t        j                  u rt        t         t              S |j                  r| j                  t        j                  u r1| j
                  t        j                  u rt        t         t              S | j                  t        j                  u rt        t         | j
                  |z         S | j
                  t        j                  u rt        | j                  |z   t              S t        t        | j                  |      t        | j
                  |            S t        | |d      S t        S NFevaluate)
isinstancer   AccumBoundsr   r!   r"   r   InfinityNegativeInfinityr
   r   NotImplementedr:   s     r$   __add__zAccumulationBounds.__add__  sS   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tUU33r%   c                 F    t        | j                   | j                         S r8   )rA   r"   r!   r(   s    r$   __neg__zAccumulationBounds.__neg__7  s    DHH9txxi00r%   c                    t        |t              rt        |t              rJt        t        | j                  |j
                         t        | j
                  |j                               S |t        j                  u r| j                  t        j                  u s.|t        j                  u r1| j
                  t        j                  u rt        t         t              S |j                  r| j                  t        j                  u r1| j
                  t        j                  u rt        t         t              S | j                  t        j                  u rt        t         | j
                  |z
        S | j
                  t        j                  u rt        | j                  |z
  t              S t        t        | j                  |       t        | j
                  |             S t        | | d      S t        S r=   )r@   r   rA   r   r!   r"   r   rC   rB   r
   r   rD   r:   s     r$   __sub__zAccumulationBounds.__sub__:  se   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-/ / teVe44r%   c                 (    | j                         |z   S r8   )rG   r:   s     r$   __rsub__zAccumulationBounds.__rsub__R  s    ||~%%r%   c                 .   | j                   t         t        fk(  r| S t        |t              rct        |t              rt|j                   t         t        fk(  r|S t               }| j                   D ]'  }||z  }|j                  |j                   xs |f       ) t	        t        | t        |       S |t        j                  u rM| j                  j                  rt	        dt              S | j                  j                  rt	        t         d      S |t        j                  u rM| j                  j                  rt	        t         d      S | j                  j                  rt	        dt              S |j                  r|j                  ri| j                  t        j                  u rt	        dt              S | j                  t        j                  u rt	        t         d      S t        j                   S |j"                  r4t	        t%        | j                  |      t%        | j                  |            S |j&                  r4t	        t%        | j                  |      t%        | j                  |            S t        |t(              r|S t%        | |d      S t*        S )Nr   Fr>   )r-   r
   r@   r   rA   setupdater   r   r   rB   r!   is_zeror"   rC   r   Zerois_extended_positiver   r   r   rD   )r)   r6   vavis        r$   __mul__zAccumulationBounds.__mul__V  s   99"b	!KeT"%-::2#r* LE /Aq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,. . %'tUU33r%   c                 L	   t        |t              rt        |t              r|j                  j                  s|j
                  j                  r)| t        d|j
                  z  d|j                  z        z  S | j                  j                  r| j
                  j                  r|j                  j                  r|j
                  j                  r| j                  j                  r&|j                  j                  rt        dt              S | j
                  j                  r'|j                  j                  rt        t         d      S t        t         t              S | j
                  j                  r|j                  j                  rh|j
                  j                  r't        | j
                  |j                  z  t              S |j
                  j                  rt        t         t              S |j                  j                  r>|j
                  j                  r(t        t         | j
                  |j
                  z        S | j                  j                  r|j                  j                  ri|j
                  j                  r(t        t         | j                  |j                  z        S |j
                  j                  rt        t         t              S |j                  j                  rx|j
                  j                  rat        | j                  |j
                  z  t              S |j                  r-|t        j                  t        j                   fv r| t        t         t              k(  rt        t         t              S | j
                  t        j                  u r t        t#        d|      t%        d|            S | j                  t        j                   u r"t        t#        d|       t%        d|             S |j                  r&t        | j                  |z  | j
                  |z        S |j                  r&t        | j
                  |z  | j                  |z        S d|z  t        j&                  u rt)        | d|z  d      S t)        | d|z        S t*        S )Nr0   r   Fr>   )r@   r   rA   r!   is_positiver"   is_negativeis_extended_nonpositiveis_extended_nonnegativerO   r
   r   rQ   r   r   rB   rC   r   r   ComplexInfinityr   rD   r:   s     r$   __truediv__zAccumulationBounds.__truediv__  s,   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                    t        |t              r|j                  r|j                  rt        j
                  S | j                  j                  r&| j                  j                  r| j                  j                  rg|j                  r't        t        |d| j                  z        t              S |j                  r(t        t         t        |d| j                  z              S | j                  j                  rg|j                  r(t        t         t        |d| j                  z              S |j                  r't        t        |d| j                  z        t              S t        t         t              S t        t        || j                  z  || j                  z        t!        || j                  z  || j                  z              S t        |d| z  d      S t"        S )Nr0   Fr>   )r@   r   r   rO   r   rP   r!   rY   r"   rZ   rQ   rA   r   r
   r   r   r   rD   r:   s     r$   __rtruediv__zAccumulationBounds.__rtruediv__  s^   eT"%%==66MHH449Y9Y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//&s5488+;UTXX=M'N'*5488+;UTXX=M'NP Pua$h77!!r%   c                    t        |t              r|t        j                  u r| j                  j
                  rN| j                  dk  rt        j                  S | j                  dkD  rt        j                  S t        dt              S | j                  j                  rD| j                  dkD  rt        j                  S | j                  dk  rt        S t        j                  S | j                  dkD  r/| j                  dk  rt        j                  S t        dt              S t        t         t              S |t        j                  u rd| z  t        z  S | j                  | j                  z
  j                  rN| j                  j                  r8|j                  r,| j                  | j                  |z  | j                  |z        S |j                   rt        j"                  S |j$                  s|j&                  r?| j                  j(                  rTt        t+        | j                  |z  | j                  |z        t-        | j                  |z  | j                  |z              S | j                  j                  rTt        t+        | j                  |z  | j                  |z        t-        | j                  |z  | j                  |z              S |dz  dk(  r|j                  ro| j                  j                   rt        | j                  |z  t              S | j                  j                   rt        | j                  |z  t              S d| z  | z  S t        t        j                  t-        | j                  |z  | j                  |z              S |dz  dk(  r|j                  rp| j                  j                   rt        | j                  |z  t              S | j                  j                   rt        t         | j                  |z        S d| z  | z  S t        | j                  |z  | j                  |z        S |j.                  s|j0                  r| j                  j
                  s"|j
                  r~| j                  j
                  rh|j3                         \  }}|t        j"                  u r&t        | j4                  D cg c]
  }|d|z  z   c} S |t        j"                  ur| |z  d|z  z  S t        |t              r| j                  j(                  s,| j                  j
                  r|j                  j
                  rz|j4                  D cg c]  }| |z  	 }}t7        d |D              sL|D cg c]  }|j4                  xs |fD ]  }|  }}}	 | j                  t	        |      t        |            S t;        | |d      S t<        S c c}w c c}w c c}}w # t8        $ r Y /w xY w)Nr0   r   r4   c              3   4   K   | ]  }|j                     y wr8   )is_Pow).0is     r$   	<genexpr>z-AccumulationBounds.__pow__.<locals>.<genexpr>,  s     3Aqxx3s   Fr>   )r@   r   r   rB   r!   rZ   r"   rP   rA   r
   r   r   NaNrC   is_nonnegativefuncrO   One
is_Integer
is_integerrQ   r   r   r   is_rationalas_numer_denomr-   any	TypeErrorr   rD   )r)   r6   numdenrd   pjrS   s           r$   r9   z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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S!%%<&TYY(GQsU(GHH% #I3//%-HH1188		99*/**5Qq5A5333()B1166>aTBaQBQBB!#'99SVSV#<< tUU33' )H 6B  ) ! !s$   WW6W#W! !	W-,W-c                 8   |j                   r|j                  r| j                  | j                  z
  j                  r|t
        j                  u rt
        j                  S |j                  rE| j                  D cg c]  }||z  	 c}\  }}t        ||      |k7  r||}}| j                  ||      S |j                  rN| j                  j                  r| j                  dd      S | j                  j                  rt
        j                  S t        || d      S c c}w )Nr   r0   Fr>   )r'   rZ   r"   r!   rQ   r   ri   r-   rh   rO   rP   r   )r)   r6   rd   rS   bs        r$   __rpow__zAccumulationBounds.__rpow__7  s    ==U::488#%9%9@:~uu))*.))4Qq41q!9>aqAyyA&}}88##99Q?*880066M5$// 5s   8Dc                     | j                   j                  r| j                         S | j                  j                  rAt	        t
        j                  t        t        | j                        | j                               S | S r8   )	r"   r   rG   r!   rA   r   rP   r   absr(   s    r$   __abs__zAccumulationBounds.__abs__J  sQ    88((<<>!XX**qvvs3txx=$(('CDDKr%   c                 >   t        |      }|t        j                  t        j                  fv r:| j                  t        j                  u s| j
                  t        j                  u ryyt        | j                  |k  | j
                  |k\        }|dvrt        d      |S )a  
        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   rB   rC   r!   r"   r   ro   )r)   r6   rvs      r$   __contains__zAccumulationBounds.__contains__S  s    , QZZ!3!344xx1---QZZ1GU"DHH$56]"677	r%   c                    t        |t        t        f      st        d      t        |t              r,t        j
                  }|D ]  }|| v s|t        |      z   } |S | j                  |j                  k  s| j                  |j                  kD  rt        j
                  S | j                  |j                  k  rT| j                  |j                  k  r t        |j                  | j                        S | j                  |j                  kD  r|S |j                  | j                  k  rU|j                  | j                  k  r t        | j                  |j                        S |j                  | j                  kD  r| S yy)a  
        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)r@   rA   r   ro   r   EmptySetr"   r!   )r)   r6   fin_setrd   s       r$   intersectionzAccumulationBounds.intersectionu  s-   @ %+y!9:FH H eY'jjG 59%	!4G5 N88eii488eii#7::88uyy xx599$"599dhh77xx%))#99 yy488#"488UYY77yy488# $ !r%   c                    t        |t              st        d      | j                  |j                  k  rM| j                  |j                  k\  r4t        | j                  t        | j                  |j                              S |j                  | j                  k  rN|j                  | j                  k\  r4t        |j                  t        | j                  |j                              S y y )Nr~   )r@   rA   ro   r!   r"   r   r:   s     r$   unionz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____doc__r   r   r   _op_priorityr*   propertyr!   r"   r2   r5   r	   rD   r;   rE   __radd__rG   rI   rK   rU   __rmul__r\   r^   r9   rv   ry   r|   r   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                     t        | j                  |j                        ryt        | j                  |j                        ryy NTF)r   r"   r!   r   lhsrhss     r$   _eval_is_ler     1    SWWcggSWWcgg r%   c                     |j                   st        dt        |      d|      |j                  r/t	        | j
                  |      ryt        | j                  |      ryyy)af  
    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   ro   typer   r   r"   r   r!   r   s     r$   r   r     s_    , cC!" " 
		##  
r%   c                     t        | j                  |j                        ryt        | j                  |j                        ryy r   r   r!   r"   r   r   s     r$   _eval_is_ger     r   r%   c                     |j                   st        dt        |      d|      |j                  r/t	        | j
                  |      ryt        | j                  |      ryyy)ab  
    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   ro   r   r   r   r!   r   r"   r   s     r$   r   r     s_    * #Y 	 
		##  
r%   c                     | j                   st        dt        |       d|       | j                  r/t	        |j
                  |       ryt        |j                  |       ryy y )Nr   r   TFr   r   s     r$   r   r     s]    #Y 	 
		##  
r%   c                     t        | j                  |j                        ryt        | j                  |j                        ryy 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   rA   r   r%   r$   <module>r      s    ' ' "   2 2 < < ' = # + $ %m
D m
D` 

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

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

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

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

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