Repository: sympy/sympy

Issue:
subs into inequality involving RootOf raises GeneratorsNeeded
If x is real then the following generates and error

```python
>>> from sympy import *
>>> var('x', real=True)
x
>>> eq=RootOf(x**3 - 17*x**2 + 81*x - 118, 0)
>>> (x<eq).subs(x,eq)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sympy\core\basic.py", line 895, in subs
    rv = rv._subs(old, new, **kwargs)
  File "sympy\core\cache.py", line 93, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 880, in wrapper
    result = user_function(*args, **kwds)
  File "sympy\core\basic.py", line 1009, in _subs
    rv = fallback(self, old, new)
  File "sympy\core\basic.py", line 981, in fallback
    arg = arg._subs(old, new, **hints)
  File "sympy\core\cache.py", line 93, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 880, in wrapper
    result = user_function(*args, **kwds)
  File "sympy\core\basic.py", line 1009, in _subs
    rv = fallback(self, old, new)
  File "sympy\core\basic.py", line 986, in fallback
    rv = self.func(*args)
  File "sympy\polys\rootoftools.py", line 68, in __new__
    poly = PurePoly(f, x, greedy=False, expand=expand)
  File "sympy\polys\polytools.py", line 89, in __new__
    return cls._from_expr(rep, opt)
  File "sympy\polys\polytools.py", line 199, in _from_expr
    rep, opt = _dict_from_expr(rep, opt)
  File "sympy\polys\polyutils.py", line 366, in _dict_from_expr
    rep, gens = _dict_from_expr_no_gens(expr, opt)
  File "sympy\polys\polyutils.py", line 311, in _dict_from_expr_no_gens
    (poly,), gens = _parallel_dict_from_expr_no_gens((expr,), opt)
  File "sympy\polys\polyutils.py", line 272, in _parallel_dict_from_expr_no_gens

    raise GeneratorsNeeded("specify generators to give %s a meaning" % arg)
sympy.polys.polyerrors.GeneratorsNeeded: specify generators to give -17*RootOf(x
**3 - 17*x**2 + 81*x - 118, 0)**2 - 118 + RootOf(x**3 - 17*x**2 + 81*x - 118, 0)
**3 + 81*RootOf(x**3 - 17*x**2 + 81*x - 118, 0) a meaning
```

But a vanilla x does not raise:

```
>>> var('x')
x
>>> eq=RootOf(x**3 - 17*x**2 + 81*x - 118, 0)
>>> (x<eq).subs(x,eq)
False
```

Discussion:

Patch:
diff --git a/README.rst b/README.rst
index 13e71d11fa..23342c4eac 100644
--- a/README.rst
+++ b/README.rst
@@ -184,7 +184,7 @@ from Google Summer of Code students.
 In 2011, Ondřej Čertík stepped down as lead developer, with Aaron Meurer, who
 also started as a Google Summer of Code student, taking his place. Ondřej
 Čertík is still active in the community, but is too busy with work and family
-to play a lead development role.
+to play a lead development role
 
 Since then, a lot more people have joined the development and some people have
 also left. You can see the full list in doc/src/aboutus.rst, or online at:
diff --git a/doc/src/aboutus.rst b/doc/src/aboutus.rst
index 8b262bc5bb..ee954a9c14 100644
--- a/doc/src/aboutus.rst
+++ b/doc/src/aboutus.rst
@@ -236,7 +236,7 @@ want to be mentioned here, so see our repository history for a full list).
 #. Marek Šuppa: Improvements to symbols, tests
 #. Prasoon Shukla: Bug fixes
 #. Stefen Yin: Fixes to the mechanics module
-#. Thomas Hisch: Spherical Hankel functions, Improvements to the printing module, Improvements to the doctesting system
+#. Thomas Hisch: Improvements to the printing module
 #. Matthew Hoff: Addition to quantum module
 #. Madeleine Ball: Bug fix
 #. Case Van Horsen: Fixes to gmpy support
diff --git a/sympy/functions/__init__.py b/sympy/functions/__init__.py
index ce1a4e0c36..9c71f40365 100644
--- a/sympy/functions/__init__.py
+++ b/sympy/functions/__init__.py
@@ -34,7 +34,7 @@
 from sympy.functions.special.delta_functions import DiracDelta, Heaviside
 from sympy.functions.special.bsplines import bspline_basis, bspline_basis_set
 from sympy.functions.special.bessel import (besselj, bessely, besseli, besselk,
-        hankel1, hankel2, jn, yn, jn_zeros, hn1, hn2, airyai, airybi, airyaiprime, airybiprime)
+        hankel1, hankel2, jn, yn, jn_zeros, airyai, airybi, airyaiprime, airybiprime)
 from sympy.functions.special.hyper import hyper, meijerg
 from sympy.functions.special.polynomials import (legendre, assoc_legendre,
         hermite, chebyshevt, chebyshevu, chebyshevu_root, chebyshevt_root,
diff --git a/sympy/functions/special/bessel.py b/sympy/functions/special/bessel.py
index f087730969..1789a6e84e 100644
--- a/sympy/functions/special/bessel.py
+++ b/sympy/functions/special/bessel.py
@@ -1,11 +1,8 @@
 from __future__ import print_function, division
 
-from functools import wraps
-
 from sympy import S, pi, I, Rational, Wild, cacheit, sympify
 from sympy.core.function import Function, ArgumentIndexError
 from sympy.core.power import Pow
-from sympy.core.compatibility import range
 from sympy.functions.combinatorial.factorials import factorial
 from sympy.functions.elementary.trigonometric import sin, cos, csc, cot
 from sympy.functions.elementary.complexes import Abs
@@ -13,8 +10,7 @@
 from sympy.functions.elementary.complexes import re, im
 from sympy.functions.special.gamma_functions import gamma
 from sympy.functions.special.hyper import hyper
-from sympy.polys.orthopolys import spherical_bessel_fn as fn
-
+from sympy.core.compatibility import range
 
 # TODO
 # o Scorer functions G1 and G2
@@ -559,13 +555,7 @@ def _eval_conjugate(self):
         if (z.is_real and z.is_negative) is False:
             return hankel1(self.order.conjugate(), z.conjugate())
 
-
-def assume_integer_order(fn):
-    @wraps(fn)
-    def g(self, nu, z):
-        if nu.is_integer:
-            return fn(self, nu, z)
-    return g
+from sympy.polys.orthopolys import spherical_bessel_fn as fn
 
 
 class SphericalBesselBase(BesselBase):
@@ -590,11 +580,11 @@ def _rewrite(self):
     def _eval_expand_func(self, **hints):
         if self.order.is_Integer:
             return self._expand(**hints)
-        return self
+        else:
+            return self
 
     def _eval_evalf(self, prec):
-        if self.order.is_Integer:
-            return self._rewrite()._eval_evalf(prec)
+        return self._rewrite()._eval_evalf(prec)
 
     def fdiff(self, argindex=2):
         if argindex != 2:
@@ -603,15 +593,6 @@ def fdiff(self, argindex=2):
             self * (self.order + 1)/self.argument
 
 
-def _jn(n, z):
-    return fn(n, z)*sin(z) + (-1)**(n + 1)*fn(-n - 1, z)*cos(z)
-
-
-def _yn(n, z):
-    # (-1)**(n + 1) * _jn(-n - 1, z)
-    return (-1)**(n + 1) * fn(-n - 1, z)*sin(z) - fn(n, z)*cos(z)
-
-
 class jn(SphericalBesselBase):
     r"""
     Spherical Bessel function of the first kind.
@@ -629,62 +610,43 @@ class jn(SphericalBesselBase):
 
     where :math:`J_\nu(z)` is the Bessel function of the first kind.
 
-    The spherical Bessel functions of integral order are
-    calculated using the formula:
-
-    .. math:: j_n(z) = f_n(z) \sin{z} + (-1)^{n+1} f_{-n-1}(z) \cos{z},
-
-    where the coefficients :math:`f_n(z)` are available as
-    :func:`polys.orthopolys.spherical_bessel_fn`.
-
     Examples
     ========
 
-    >>> from sympy import Symbol, jn, sin, cos, expand_func, besselj, bessely
-    >>> from sympy import simplify
+    >>> from sympy import Symbol, jn, sin, cos, expand_func
     >>> z = Symbol("z")
-    >>> nu = Symbol("nu", integer=True)
-    >>> print(expand_func(jn(0, z)))
+    >>> print(jn(0, z).expand(func=True))
     sin(z)/z
-    >>> expand_func(jn(1, z)) == sin(z)/z**2 - cos(z)/z
+    >>> jn(1, z).expand(func=True) == sin(z)/z**2 - cos(z)/z
     True
     >>> expand_func(jn(3, z))
     (-6/z**2 + 15/z**4)*sin(z) + (1/z - 15/z**3)*cos(z)
-    >>> jn(nu, z).rewrite(besselj)
-    sqrt(2)*sqrt(pi)*sqrt(1/z)*besselj(nu + 1/2, z)/2
-    >>> jn(nu, z).rewrite(bessely)
-    (-1)**nu*sqrt(2)*sqrt(pi)*sqrt(1/z)*bessely(-nu - 1/2, z)/2
-    >>> jn(2, 5.2+0.3j).evalf(20)
-    0.099419756723640344491 - 0.054525080242173562897*I
+
+    The spherical Bessel functions of integral order
+    are calculated using the formula:
+
+    .. math:: j_n(z) = f_n(z) \sin{z} + (-1)^{n+1} f_{-n-1}(z) \cos{z},
+
+    where the coefficients :math:`f_n(z)` are available as
+    :func:`polys.orthopolys.spherical_bessel_fn`.
 
     See Also
     ========
 
     besselj, bessely, besselk, yn
 
-    References
-    ==========
-
-    .. [1] http://dlmf.nist.gov/10.47
-
     """
 
     def _rewrite(self):
         return self._eval_rewrite_as_besselj(self.order, self.argument)
 
-    @assume_integer_order
     def _eval_rewrite_as_besselj(self, nu, z):
-        return sqrt(pi/(2*z)) * besselj(nu + S.Half, z)
-
-    @assume_integer_order
-    def _eval_rewrite_as_bessely(self, nu, z):
-        return (-1)**nu * sqrt(pi/(2*z)) * bessely(-nu - S.Half, z)
-
-    def _eval_rewrite_as_yn(self, nu, z):
-        return (-1)**(nu) * yn(-nu - 1, z)
+        return sqrt(pi/(2*z)) * besselj(nu + S('1/2'), z)
 
     def _expand(self, **hints):
-        return _jn(self.order, self.argument)
+        n = self.order
+        z = self.argument
+        return fn(n, z) * sin(z) + (-1)**(n + 1) * fn(-n - 1, z) * cos(z)
 
 
 class yn(SphericalBesselBase):
@@ -695,221 +657,42 @@ class yn(SphericalBesselBase):
     linearly independent from :math:`j_n`. It can be defined as
 
     .. math ::
-        y_\nu(z) = \sqrt{\frac{\pi}{2z}} Y_{\nu + \frac{1}{2}}(z),
+        j_\nu(z) = \sqrt{\frac{\pi}{2z}} Y_{\nu + \frac{1}{2}}(z),
 
     where :math:`Y_\nu(z)` is the Bessel function of the second kind.
 
-    For integral orders :math:`n`, :math:`y_n` is calculated using the formula:
-
-    .. math:: y_n(z) = (-1)^{n+1} j_{-n-1}(z)
-
     Examples
     ========
 
-    >>> from sympy import Symbol, yn, sin, cos, expand_func, besselj, bessely
+    >>> from sympy import Symbol, yn, sin, cos, expand_func
     >>> z = Symbol("z")
-    >>> nu = Symbol("nu", integer=True)
     >>> print(expand_func(yn(0, z)))
     -cos(z)/z
     >>> expand_func(yn(1, z)) == -cos(z)/z**2-sin(z)/z
     True
-    >>> yn(nu, z).rewrite(besselj)
-    (-1)**(nu + 1)*sqrt(2)*sqrt(pi)*sqrt(1/z)*besselj(-nu - 1/2, z)/2
-    >>> yn(nu, z).rewrite(bessely)
-    sqrt(2)*sqrt(pi)*sqrt(1/z)*bessely(nu + 1/2, z)/2
-    >>> yn(2, 5.2+0.3j).evalf(20)
-    0.18525034196069722536 + 0.014895573969924817587*I
+
+    For integral orders :math:`n`, :math:`y_n` is calculated using the formula:
+
+    .. math:: y_n(z) = (-1)^{n+1} j_{-n-1}(z)
 
     See Also
     ========
 
     besselj, bessely, besselk, jn
 
-    References
-    ==========
-
-    .. [1] http://dlmf.nist.gov/10.47
-
     """
 
     def _rewrite(self):
         return self._eval_rewrite_as_bessely(self.order, self.argument)
 
-    @assume_integer_order
-    def _eval_rewrite_as_besselj(self, nu, z):
-        return (-1)**(nu+1) * sqrt(pi/(2*z)) * besselj(-nu - S.Half, z)
-
-    @assume_integer_order
-    def _eval_rewrite_as_bessely(self, nu, z):
-        return sqrt(pi/(2*z)) * bessely(nu + S.Half, z)
-
-    def _eval_rewrite_as_jn(self, nu, z):
-        return (-1)**(nu + 1) * jn(-nu - 1, z)
-
-    def _expand(self, **hints):
-        return _yn(self.order, self.argument)
-
-
-class SphericalHankelBase(SphericalBesselBase):
-
-    def _rewrite(self):
-        return self._eval_rewrite_as_besselj(self.order, self.argument)
-
-    @assume_integer_order
-    def _eval_rewrite_as_besselj(self, nu, z):
-        # jn +- I*yn
-        # jn as beeselj: sqrt(pi/(2*z)) * besselj(nu + S.Half, z)
-        # yn as besselj: (-1)**(nu+1) * sqrt(pi/(2*z)) * besselj(-nu - S.Half, z)
-        hks = self._hankel_kind_sign
-        return sqrt(pi/(2*z))*(besselj(nu + S.Half, z) +
-                               hks*I*(-1)**(nu+1)*besselj(-nu - S.Half, z))
-
-    @assume_integer_order
     def _eval_rewrite_as_bessely(self, nu, z):
-        # jn +- I*yn
-        # jn as bessely: (-1)**nu * sqrt(pi/(2*z)) * bessely(-nu - S.Half, z)
-        # yn as bessely: sqrt(pi/(2*z)) * bessely(nu + S.Half, z)
-        hks = self._hankel_kind_sign
-        return sqrt(pi/(2*z))*((-1)**nu*bessely(-nu - S.Half, z) +
-                               hks*I*bessely(nu + S.Half, z))
-
-    def _eval_rewrite_as_yn(self, nu, z):
-        hks = self._hankel_kind_sign
-        return jn(nu, z).rewrite(yn) + hks*I*yn(nu, z)
-
-    def _eval_rewrite_as_jn(self, nu, z):
-        hks = self._hankel_kind_sign
-        return jn(nu, z) + hks*I*yn(nu, z).rewrite(jn)
-
-    def _eval_expand_func(self, **hints):
-        if self.order.is_Integer:
-            return self._expand(**hints)
-        else:
-            nu = self.order
-            z = self.argument
-            hks = self._hankel_kind_sign
-            return jn(nu, z) + hks*I*yn(nu, z)
+        return sqrt(pi/(2*z)) * bessely(nu + S('1/2'), z)
 
     def _expand(self, **hints):
         n = self.order
         z = self.argument
-        hks = self._hankel_kind_sign
-
-        # fully expanded version
-        # return ((fn(n, z) * sin(z) +
-        #          (-1)**(n + 1) * fn(-n - 1, z) * cos(z)) +  # jn
-        #         (hks * I * (-1)**(n + 1) *
-        #          (fn(-n - 1, z) * hk * I * sin(z) +
-        #           (-1)**(-n) * fn(n, z) * I * cos(z)))  # +-I*yn
-        #         )
-
-        return (_jn(n, z) + hks*I*_yn(n, z)).expand()
-
-
-class hn1(SphericalHankelBase):
-    r"""
-    Spherical Hankel function of the first kind.
-
-    This function is defined as
-
-    .. math:: h_\nu^(1)(z) = j_\nu(z) + i y_\nu(z),
-
-    where :math:`j_\nu(z)` and :math:`y_\nu(z)` are the spherical
-    Bessel function of the first and second kinds.
-
-    For integral orders :math:`n`, :math:`h_n^(1)` is calculated using the formula:
-
-    .. math:: h_n^(1)(z) = j_{n}(z) + i (-1)^{n+1} j_{-n-1}(z)
-
-    Examples
-    ========
-
-    >>> from sympy import Symbol, hn1, hankel1, expand_func, yn, jn
-    >>> z = Symbol("z")
-    >>> nu = Symbol("nu", integer=True)
-    >>> print(expand_func(hn1(nu, z)))
-    jn(nu, z) + I*yn(nu, z)
-    >>> print(expand_func(hn1(0, z)))
-    sin(z)/z - I*cos(z)/z
-    >>> print(expand_func(hn1(1, z)))
-    -I*sin(z)/z - cos(z)/z + sin(z)/z**2 - I*cos(z)/z**2
-    >>> hn1(nu, z).rewrite(jn)
-    (-1)**(nu + 1)*I*jn(-nu - 1, z) + jn(nu, z)
-    >>> hn1(nu, z).rewrite(yn)
-    (-1)**nu*yn(-nu - 1, z) + I*yn(nu, z)
-    >>> hn1(nu, z).rewrite(hankel1)
-    sqrt(2)*sqrt(pi)*sqrt(1/z)*hankel1(nu, z)/2
-
-    See Also
-    ========
-
-    hn2, jn, yn, hankel1, hankel2
-
-    References
-    ==========
-
-    .. [1] http://dlmf.nist.gov/10.47
-
-    """
-
-    _hankel_kind_sign = S.One
-
-    @assume_integer_order
-    def _eval_rewrite_as_hankel1(self, nu, z):
-        return sqrt(pi/(2*z))*hankel1(nu, z)
-
-
-class hn2(SphericalHankelBase):
-    r"""
-    Spherical Hankel function of the second kind.
-
-    This function is defined as
-
-    .. math:: h_\nu^(2)(z) = j_\nu(z) - i y_\nu(z),
-
-    where :math:`j_\nu(z)` and :math:`y_\nu(z)` are the spherical
-    Bessel function of the first and second kinds.
-
-    For integral orders :math:`n`, :math:`h_n^(2)` is calculated using the formula:
-
-    .. math:: h_n^(2)(z) = j_{n} - i (-1)^{n+1} j_{-n-1}(z)
-
-    Examples
-    ========
-
-    >>> from sympy import Symbol, hn2, hankel2, expand_func, jn, yn
-    >>> z = Symbol("z")
-    >>> nu = Symbol("nu", integer=True)
-    >>> print(expand_func(hn2(nu, z)))
-    jn(nu, z) - I*yn(nu, z)
-    >>> print(expand_func(hn2(0, z)))
-    sin(z)/z + I*cos(z)/z
-    >>> print(expand_func(hn2(1, z)))
-    I*sin(z)/z - cos(z)/z + sin(z)/z**2 + I*cos(z)/z**2
-    >>> hn2(nu, z).rewrite(hankel2)
-    sqrt(2)*sqrt(pi)*sqrt(1/z)*hankel2(nu, z)/2
-    >>> hn2(nu, z).rewrite(jn)
-    -(-1)**(nu + 1)*I*jn(-nu - 1, z) + jn(nu, z)
-    >>> hn2(nu, z).rewrite(yn)
-    (-1)**nu*yn(-nu - 1, z) - I*yn(nu, z)
-
-    See Also
-    ========
-
-    hn1, jn, yn, hankel1, hankel2
-
-    References
-    ==========
-
-    .. [1] http://dlmf.nist.gov/10.47
-
-    """
-
-    _hankel_kind_sign = -S.One
-
-    @assume_integer_order
-    def _eval_rewrite_as_hankel2(self, nu, z):
-        return sqrt(pi/(2*z))*hankel2(nu, z)
+        return (-1)**(n + 1) * \
+               (fn(-n - 1, z) * sin(z) + (-1)**(-n) * fn(n, z) * cos(z))
 
 
 def jn_zeros(n, k, method="sympy", dps=15):
diff --git a/sympy/geometry/point.py b/sympy/geometry/point.py
index b17f652a4f..0fe89dfea8 100644
--- a/sympy/geometry/point.py
+++ b/sympy/geometry/point.py
@@ -269,39 +269,6 @@ def distance(self, p):
         p = Point(p)
         return sqrt(sum([(a - b)**2 for a, b in zip(self.args, p.args)]))
 
-    def taxicab_distance(self, p):
-        """The Taxicab Distance from self to point p.
-
-        Returns the sum of the horizontal and vertical distances to point p.
-
-        Parameters
-        ==========
-
-        p : Point
-
-        Returns
-        =======
-
-        taxicab_distance : The sum of the horizontal
-        and vertical distances to point p.
-
-        See Also
-        ========
-
-        sympy.geometry.Point.distance
-
-        Examples
-        ========
-
-        >>> from sympy.geometry import Point
-        >>> p1, p2 = Point(1, 1), Point(4, 5)
-        >>> p1.taxicab_distance(p2)
-        7
-
-        """
-        p = Point(p)
-        return sum(abs(a - b) for a, b in zip(self.args, p.args))
-
     def midpoint(self, p):
         """The midpoint between self and point p.
 
diff --git a/sympy/polys/rootoftools.py b/sympy/polys/rootoftools.py
index 3a891d9d9b..6de12d9ec9 100644
--- a/sympy/polys/rootoftools.py
+++ b/sympy/polys/rootoftools.py
@@ -530,6 +530,10 @@ def _set_interval(self, interval):
             reals_count = len(_reals_cache[self.poly])
             _complexes_cache[self.poly][self.index - reals_count] = interval
 
+    def _eval_subs(self, old, new):
+        # don't allow subs to change anything
+        return self
+
     def _eval_evalf(self, prec):
         """Evaluate this complex root to the given precision. """
         with workprec(prec):
diff --git a/sympy/printing/latex.py b/sympy/printing/latex.py
index add4e9535a..0210a53e7f 100644
--- a/sympy/printing/latex.py
+++ b/sympy/printing/latex.py
@@ -1054,12 +1054,6 @@ def _print_hankel1(self, expr, exp=None):
     def _print_hankel2(self, expr, exp=None):
         return self._hprint_BesselBase(expr, exp, 'H^{(2)}')
 
-    def _print_hn1(self, expr, exp=None):
-        return self._hprint_BesselBase(expr, exp, 'h^{(1)}')
-
-    def _print_hn2(self, expr, exp=None):
-        return self._hprint_BesselBase(expr, exp, 'h^{(2)}')
-
     def _hprint_airy(self, expr, exp=None, notation=""):
         tex = r"\left(%s\right)" % self._print(expr.args[0])
 
diff --git a/sympy/sets/sets.py b/sympy/sets/sets.py
index 3b4a237995..424b63febe 100644
--- a/sympy/sets/sets.py
+++ b/sympy/sets/sets.py
@@ -280,6 +280,8 @@ def contains(self, other):
         other = sympify(other, strict=True)
         ret = sympify(self._contains(other))
         if ret is None:
+            if all(Eq(i, other) == False for i in self):
+                return false
             ret = Contains(other, self, evaluate=False)
         return ret
 
diff --git a/sympy/simplify/simplify.py b/sympy/simplify/simplify.py
index 3de708981e..fe33bd8ed2 100644
--- a/sympy/simplify/simplify.py
+++ b/sympy/simplify/simplify.py
@@ -204,9 +204,8 @@ def _is_sum_surds(p):
 
 
 def posify(eq):
-    """Return eq (with generic symbols made positive) and a
-    dictionary containing the mapping between the old and new
-    symbols.
+    """Return eq (with generic symbols made positive) and a restore
+    dictionary.
 
     Any symbol that has positive=None will be replaced with a positive dummy
     symbol having the same name. This replacement will allow more symbolic
@@ -216,30 +215,21 @@ def posify(eq):
     A dictionary that can be sent to subs to restore eq to its original
     symbols is also returned.
 
-    >>> from sympy import posify, Symbol, log, solve
+    >>> from sympy import posify, Symbol, log
     >>> from sympy.abc import x
     >>> posify(x + Symbol('p', positive=True) + Symbol('n', negative=True))
     (_x + n + p, {_x: x})
 
-    >>> eq = 1/x
-    >>> log(eq).expand()
+    >> log(1/x).expand() # should be log(1/x) but it comes back as -log(x)
     log(1/x)
-    >>> log(posify(eq)[0]).expand()
+
+    >>> log(posify(1/x)[0]).expand() # take [0] and ignore replacements
     -log(_x)
-    >>> p, rep = posify(eq)
-    >>> log(p).expand().subs(rep)
+    >>> eq, rep = posify(1/x)
+    >>> log(eq).expand().subs(rep)
     -log(x)
-
-    It is possible to apply the same transformations to an iterable
-    of expressions:
-
-    >>> eq = x**2 - 4
-    >>> solve(eq, x)
-    [-2, 2]
-    >>> eq_x, reps = posify([eq, x]); eq_x
-    [_x**2 - 4, _x]
-    >>> solve(*eq_x)
-    [2]
+    >>> posify([x, 1 + x])
+    ([_x, _x + 1], {_x: x})
     """
     eq = sympify(eq)
     if iterable(eq):


Test patch:
diff --git a/sympy/core/tests/test_args.py b/sympy/core/tests/test_args.py
index 7c733fc9a8..37ddc2923e 100644
--- a/sympy/core/tests/test_args.py
+++ b/sympy/core/tests/test_args.py
@@ -1351,11 +1351,6 @@ def test_sympy__functions__special__bessel__SphericalBesselBase():
     pass
 
 
-@SKIP("abstract class")
-def test_sympy__functions__special__bessel__SphericalHankelBase():
-    pass
-
-
 def test_sympy__functions__special__bessel__besseli():
     from sympy.functions.special.bessel import besseli
     assert _test_args(besseli(x, 1))
@@ -1396,16 +1391,6 @@ def test_sympy__functions__special__bessel__yn():
     assert _test_args(yn(0, x))
 
 
-def test_sympy__functions__special__bessel__hn1():
-    from sympy.functions.special.bessel import hn1
-    assert _test_args(hn1(0, x))
-
-
-def test_sympy__functions__special__bessel__hn2():
-    from sympy.functions.special.bessel import hn2
-    assert _test_args(hn2(0, x))
-
-
 def test_sympy__functions__special__bessel__AiryBase():
     pass
 
diff --git a/sympy/core/tests/test_subs.py b/sympy/core/tests/test_subs.py
index 5d3f987e1d..2972947e2e 100644
--- a/sympy/core/tests/test_subs.py
+++ b/sympy/core/tests/test_subs.py
@@ -2,7 +2,7 @@
 from sympy import (Symbol, Wild, sin, cos, exp, sqrt, pi, Function, Derivative,
         abc, Integer, Eq, symbols, Add, I, Float, log, Rational, Lambda, atan2,
         cse, cot, tan, S, Tuple, Basic, Dict, Piecewise, oo, Mul,
-        factor, nsimplify, zoo, Subs)
+        factor, nsimplify, zoo, Subs, RootOf)
 from sympy.core.basic import _aresame
 from sympy.utilities.pytest import XFAIL
 from sympy.abc import x, y, z
@@ -657,3 +657,10 @@ def test_pow_eval_subs_no_cache():
     # It incorrectly returned 1/sqrt(x**2) before this pull request.
     result = s.subs(sqrt(x**2), y)
     assert result == 1/y
+
+
+def test_RootOf_issue_10092():
+    x = Symbol('x', real=True)
+    eq = x**3 - 17*x**2 + 81*x - 118
+    r = RootOf(eq, 0)
+    assert (x < r).subs(x, r) is S.false
diff --git a/sympy/functions/special/tests/test_bessel.py b/sympy/functions/special/tests/test_bessel.py
index f4d7827b09..74402bc869 100644
--- a/sympy/functions/special/tests/test_bessel.py
+++ b/sympy/functions/special/tests/test_bessel.py
@@ -1,9 +1,7 @@
-from itertools import product
-
 from sympy import (jn, yn, symbols, Symbol, sin, cos, pi, S, jn_zeros, besselj,
-                   bessely, besseli, besselk, hankel1, hankel2, hn1, hn2,
-                   expand_func, sqrt, sinh, cosh, diff, series, gamma, hyper,
-                   Abs, I, O, oo, conjugate)
+                   bessely, besseli, besselk, hankel1, hankel2, expand_func,
+                   sqrt, sinh, cosh, diff, series, gamma, hyper, Abs, I, O, oo,
+                   conjugate)
 from sympy.functions.special.bessel import fn
 from sympy.functions.special.bessel import (airyai, airybi,
                                             airyaiprime, airybiprime)
@@ -19,12 +17,9 @@
 
 
 def test_bessel_rand():
-    for f in [besselj, bessely, besseli, besselk, hankel1, hankel2]:
+    for f in [besselj, bessely, besseli, besselk, hankel1, hankel2, jn, yn]:
         assert td(f(randcplx(), z), z)
 
-    for f in [jn, yn, hn1, hn2]:
-        assert td(f(randint(-10, 10), z), z)
-
 
 def test_bessel_twoinputs():
     for f in [besselj, bessely, besseli, besselk, hankel1, hankel2, jn, yn]:
@@ -66,40 +61,6 @@ def test_rewrite():
     assert tn(besselk(nu, z), besselk(nu, z).rewrite(besseli), z)
     assert tn(besselk(nu, z), besselk(nu, z).rewrite(bessely), z)
 
-    # check that a rewrite was triggered, when the order is set to a generic
-    # symbol 'nu'
-    assert yn(nu, z) != yn(nu, z).rewrite(jn)
-    assert hn1(nu, z) != hn1(nu, z).rewrite(jn)
-    assert hn2(nu, z) != hn2(nu, z).rewrite(jn)
-    assert jn(nu, z) != jn(nu, z).rewrite(yn)
-    assert hn1(nu, z) != hn1(nu, z).rewrite(yn)
-    assert hn2(nu, z) != hn2(nu, z).rewrite(yn)
-
-    # rewriting spherical bessel functions (SBFs) w.r.t. besselj, bessely is
-    # not allowed if a generic symbol 'nu' is used as the order of the SBFs
-    # to avoid inconsistencies (the order of bessel[jy] is allowed to be
-    # complex-valued, whereas SBFs are defined only for integer orders)
-    order = nu
-    for f in (besselj, bessely):
-        assert yn(order, z) == yn(order, z).rewrite(f)
-        assert jn(order, z) == jn(order, z).rewrite(f)
-        assert hn1(order, z) == hn1(order, z).rewrite(f)
-        assert hn2(order, z) == hn2(order, z).rewrite(f)
-
-    # for integral orders rewriting SBFs w.r.t bessel[jy] is allowed
-    N = Symbol('n', integer=True)
-    ri = randint(-11, 10)
-    for order in (ri, N):
-        for f in (besselj, bessely):
-            assert yn(order, z) != yn(order, z).rewrite(f)
-            assert jn(order, z) != jn(order, z).rewrite(f)
-            assert hn1(order, z) != hn1(order, z).rewrite(f)
-            assert hn2(order, z) != hn2(order, z).rewrite(f)
-
-    for func, refunc in product((yn, jn, hn1, hn2),
-                                (jn, yn, besselj, bessely)):
-        assert tn(func(ri, z), func(ri, z).rewrite(refunc), z)
-
 
 def test_expand():
     from sympy import besselsimp, Symbol, exp, exp_polar, I
@@ -232,12 +193,6 @@ def test_jn():
 
     assert expand_func(jn(n, z)) == jn(n, z)
 
-    # SBFs not defined for complex-valued orders
-    assert jn(2+3j, 5.2+0.3j).evalf() == jn(2+3j, 5.2+0.3j)
-
-    assert eq([jn(2, 5.2+0.3j).evalf(10)],
-              [0.09941975672 - 0.05452508024*I])
-
 
 def test_yn():
     z = symbols("z")
@@ -246,12 +201,6 @@ def test_yn():
     assert myn(2, z) == -((3/z**3 - 1/z)*cos(z) + (3/z**2)*sin(z))
     assert expand_func(yn(n, z)) == yn(n, z)
 
-    # SBFs not defined for complex-valued orders
-    assert yn(2+3j, 5.2+0.3j).evalf() == yn(2+3j, 5.2+0.3j)
-
-    assert eq([yn(2, 5.2+0.3j).evalf(10)],
-              [0.185250342 + 0.01489557397*I])
-
 
 def test_sympify_yn():
     assert S(15) in myn(3, pi).atoms()
@@ -340,14 +289,14 @@ def test_conjugate():
     n, z, x = Symbol('n'), Symbol('z', real=False), Symbol('x', real=True)
     y, t = Symbol('y', real=True, positive=True), Symbol('t', negative=True)
 
-    for f in [besseli, besselj, besselk, bessely, hankel1, hankel2]:
+    for f in [besseli, besselj, besselk, bessely, jn, yn, hankel1, hankel2]:
         assert f(n, -1).conjugate() != f(conjugate(n), -1)
         assert f(n, x).conjugate() != f(conjugate(n), x)
         assert f(n, t).conjugate() != f(conjugate(n), t)
 
     rz = randcplx(b=0.5)
 
-    for f in [besseli, besselj, besselk, bessely]:
+    for f in [besseli, besselj, besselk, bessely, jn, yn]:
         assert f(n, 1 + I).conjugate() == f(conjugate(n), 1 - I)
         assert f(n, 0).conjugate() == f(conjugate(n), 0)
         assert f(n, 1).conjugate() == f(conjugate(n), 1)
diff --git a/sympy/geometry/tests/test_point.py b/sympy/geometry/tests/test_point.py
index 248613f827..caca591956 100644
--- a/sympy/geometry/tests/test_point.py
+++ b/sympy/geometry/tests/test_point.py
@@ -60,8 +60,6 @@ def test_point():
     assert Point.distance(p1, p1) == 0
     assert Point.distance(p3, p2) == sqrt(p2.x**2 + p2.y**2)
 
-    assert Point.taxicab_distance(p4, p3) == 2
-
     p1_1 = Point(x1, x1)
     p1_2 = Point(y2, y2)
     p1_3 = Point(x1 + 1, x1)
diff --git a/sympy/printing/tests/test_latex.py b/sympy/printing/tests/test_latex.py
index f50b103c5e..884b2ac699 100644
--- a/sympy/printing/tests/test_latex.py
+++ b/sympy/printing/tests/test_latex.py
@@ -127,7 +127,6 @@ def test_latex_builtins():
     assert latex(true) == r"\mathrm{True}"
     assert latex(false) == r'\mathrm{False}'
 
-
 def test_latex_Float():
     assert latex(Float(1.0e100)) == r"1.0 \cdot 10^{100}"
     assert latex(Float(1.0e-100)) == r"1.0 \cdot 10^{-100}"
@@ -353,7 +352,6 @@ def test_latex_functions():
     # even when it is referred to without an argument
     assert latex(fjlkd) == r'\operatorname{fjlkd}'
 
-
 def test_hyper_printing():
     from sympy import pi
     from sympy.abc import x, z
@@ -373,7 +371,7 @@ def test_hyper_printing():
 
 def test_latex_bessel():
     from sympy.functions.special.bessel import (besselj, bessely, besseli,
-            besselk, hankel1, hankel2, jn, yn, hn1, hn2)
+            besselk, hankel1, hankel2, jn, yn)
     from sympy.abc import z
     assert latex(besselj(n, z**2)**k) == r'J^{k}_{n}\left(z^{2}\right)'
     assert latex(bessely(n, z)) == r'Y_{n}\left(z\right)'
@@ -384,8 +382,6 @@ def test_latex_bessel():
     assert latex(hankel2(n, z)) == r'H^{(2)}_{n}\left(z\right)'
     assert latex(jn(n, z)) == r'j_{n}\left(z\right)'
     assert latex(yn(n, z)) == r'y_{n}\left(z\right)'
-    assert latex(hn1(n, z)) == r'h^{(1)}_{n}\left(z\right)'
-    assert latex(hn2(n, z)) == r'h^{(2)}_{n}\left(z\right)'
 
 
 def test_latex_fresnel():
diff --git a/sympy/simplify/tests/test_simplify.py b/sympy/simplify/tests/test_simplify.py
index 79bf14c9f0..251a5690e2 100644
--- a/sympy/simplify/tests/test_simplify.py
+++ b/sympy/simplify/tests/test_simplify.py
@@ -420,6 +420,9 @@ def test_posify():
         Symbol('p', positive=True) +
         Symbol('n', negative=True))) == '(_x + n + p, {_x: x})'
 
+    # log(1/x).expand() should be log(1/x) but it comes back as -log(x)
+    # when it is corrected, posify will allow the change to be made. The
+    # force=True option can do so as well when it is implemented.
     eq, rep = posify(1/x)
     assert log(eq).expand().subs(rep) == -log(x)
     assert str(posify([x, 1 + x])) == '([_x, _x + 1], {_x: x})'
diff --git a/sympy/solvers/tests/test_inequalities.py b/sympy/solvers/tests/test_inequalities.py
index 13569bc9bc..2ec3865448 100644
--- a/sympy/solvers/tests/test_inequalities.py
+++ b/sympy/solvers/tests/test_inequalities.py
@@ -291,7 +291,6 @@ def test_issue_9954():
     assert isolve(x**2 < 0, x, relational=True) == S.EmptySet.as_relational(x)
 
 
-@slow
 def test_slow_general_univariate():
     r = RootOf(x**5 - x**2 + 1, 0)
     assert solve(sqrt(x) + 1/root(x, 3) > 1) == \
@@ -299,12 +298,11 @@ def test_slow_general_univariate():
 
 
 def test_issue_8545():
-    from sympy import refine
     eq = 1 - x - abs(1 - x)
     ans = And(Lt(1, x), Lt(x, oo))
     assert reduce_abs_inequality(eq, '<', x) == ans
     eq = 1 - x - sqrt((1 - x)**2)
-    assert reduce_inequalities(refine(eq) < 0) == ans
+    assert reduce_inequalities(eq < 0) == ans
 
 
 def test_issue_8974():
diff --git a/sympy/solvers/tests/test_solveset.py b/sympy/solvers/tests/test_solveset.py
index 2ccd876be9..db313f87ed 100644
--- a/sympy/solvers/tests/test_solveset.py
+++ b/sympy/solvers/tests/test_solveset.py
@@ -17,7 +17,7 @@
 
 from sympy.sets import (FiniteSet, ConditionSet)
 
-from sympy.utilities.pytest import XFAIL, raises, skip
+from sympy.utilities.pytest import XFAIL, raises, skip, slow
 from sympy.utilities.randtest import verify_numerically as tn
 from sympy.physics.units import cm
 
@@ -421,6 +421,7 @@ def test_solve_sqrt_fail():
     assert solveset_real(eq, x) == FiniteSet(S(1)/3)
 
 
+@slow
 def test_solve_sqrt_3():
     R = Symbol('R')
     eq = sqrt(2)*R*sqrt(1/(R + 1)) + (R + 1)*(sqrt(2)*sqrt(1/(R + 1)) - 1)
@@ -439,7 +440,10 @@ def test_solve_sqrt_3():
     eq = -sqrt((m - q)**2 + (-m/(2*q) + S(1)/2)**2) + sqrt((-m**2/2 - sqrt(
         4*m**4 - 4*m**2 + 8*m + 1)/4 - S(1)/4)**2 + (m**2/2 - m - sqrt(
             4*m**4 - 4*m**2 + 8*m + 1)/4 - S(1)/4)**2)
-    unsolved_object = ConditionSet(q, Eq((-2*sqrt(4*q**2*(m - q)**2 + (-m + q)**2) + sqrt((-2*m**2 - sqrt(4*m**4 - 4*m**2 + 8*m + 1) - 1)**2 + (2*m**2 - 4*m - sqrt(4*m**4 - 4*m**2 + 8*m + 1) - 1)**2)*Abs(q))/Abs(q), 0), S.Reals)
+    unsolved_object = ConditionSet(q, Eq((-2*sqrt(4*q**2*(m - q)**2 +
+        (-m + q)**2) + sqrt((-2*m**2 - sqrt(4*m**4 - 4*m**2 + 8*m + 1) -
+        1)**2 + (2*m**2 - 4*m - sqrt(4*m**4 - 4*m**2 + 8*m + 1) - 1)**2
+        )*Abs(q))/Abs(q), 0), S.Reals)
     assert solveset_real(eq, q) == unsolved_object