Repository: sympy/sympy

Issue:
TorqueActuator.at_pin_joint has counter intuitive directions
The current implementation of the experimental `at_pin_joint` class method seems counter intuitive to me, missed it when approving it earlier. As the names of a torque actuator imply, we have a target and a reaction body/frame. The target is to which the torque is applied positively and an opposite torque is applied on the reaction frame. In case of a pin joint, we have a parent and a child, where the child is orient with respect to the parent.

Now let's go through an example on what we would expect. Suppose we add a torque actuator to a pin joint. The most sensible is to think that the parent applies a torque to the child. This means that the child is the target. Assuming that this torque of our actuator is positive, then we should get a positive deflection (generalized coordinate of our pin joint gets higher).

If we now actually look at the implementation side of things, we will see that it is exactly opposite. The target is currently the parent and the child is the reaction body. This also mean that a positive torque results in a negative acceleration.

As this feature is still experimental I suppose to swap the parent and child argument in the `TorqueActuator.at_pin_joint` definition, while also adding some documentation on what the definition is.

Discussion:

Patch:
diff --git a/.mailmap b/.mailmap
index 892e93c3bc..1cd241ff49 100644
--- a/.mailmap
+++ b/.mailmap
@@ -790,6 +790,8 @@ Karthik Chintapalli <karthik.chintapalli@students.iiit.ac.in> <karthik.chintapal
 Kartik Sethi <kartiks31416@gmail.com> Kartik Sethi <37146279+ks147@users.noreply.github.com>
 Katja Sophie Hotz <katja.sophie.hotz@student.tuwien.ac.at>
 Kaushik Varanasi <kaushik.varanasi1@gmail.com>
+Kaustubh <90597818+kaustubh-765@users.noreply.github.com>
+Kaustubh <kaustubh.am765@gmail.com>
 Kaustubh Chaudhari <ckaustubhm06@gmail.com> Kaustubh <ckaustubhm06@gmail.com>
 Kaustubh Chaudhari <ckaustubhm06@gmail.com> kc611 <ckaustubhm06@gmail.com>
 KaustubhDamania <kaustubh.damania@gmail.com>
diff --git a/doc/src/modules/polys/reference.rst b/doc/src/modules/polys/reference.rst
index db6eb11cd7..d918c36c05 100644
--- a/doc/src/modules/polys/reference.rst
+++ b/doc/src/modules/polys/reference.rst
@@ -60,7 +60,6 @@ Basic polynomial manipulation functions
 .. autofunction:: intervals
 .. autofunction:: refine_root
 .. autofunction:: count_roots
-.. autofunction:: all_roots
 .. autofunction:: real_roots
 .. autofunction:: nroots
 .. autofunction:: ground_roots
diff --git a/sympy/__init__.py b/sympy/__init__.py
index 2a4af1d8a7..21033a6190 100644
--- a/sympy/__init__.py
+++ b/sympy/__init__.py
@@ -77,10 +77,10 @@ def __sympy_debug():
         subresultants, resultant, discriminant, cofactors, gcd_list, gcd,
         lcm_list, lcm, terms_gcd, trunc, monic, content, primitive, compose,
         decompose, sturm, gff_list, gff, sqf_norm, sqf_part, sqf_list, sqf,
-        factor_list, factor, intervals, refine_root, count_roots, all_roots,
-        real_roots, nroots, ground_roots, nth_power_roots_poly, cancel,
-        reduced, groebner, is_zero_dimensional, GroebnerBasis, poly,
-        symmetrize, horner, interpolate, rational_interpolate, viete, together,
+        factor_list, factor, intervals, refine_root, count_roots, real_roots,
+        nroots, ground_roots, nth_power_roots_poly, cancel, reduced, groebner,
+        is_zero_dimensional, GroebnerBasis, poly, symmetrize, horner,
+        interpolate, rational_interpolate, viete, together,
         BasePolynomialError, ExactQuotientFailed, PolynomialDivisionFailed,
         OperationNotSupported, HeuristicGCDFailed, HomomorphismFailed,
         IsomorphismFailed, ExtraneousFactors, EvaluationFailed,
@@ -295,10 +295,10 @@ def __sympy_debug():
     'gcd', 'lcm_list', 'lcm', 'terms_gcd', 'trunc', 'monic', 'content',
     'primitive', 'compose', 'decompose', 'sturm', 'gff_list', 'gff',
     'sqf_norm', 'sqf_part', 'sqf_list', 'sqf', 'factor_list', 'factor',
-    'intervals', 'refine_root', 'count_roots', 'all_roots', 'real_roots',
-    'nroots', 'ground_roots', 'nth_power_roots_poly', 'cancel', 'reduced',
-    'groebner', 'is_zero_dimensional', 'GroebnerBasis', 'poly', 'symmetrize',
-    'horner', 'interpolate', 'rational_interpolate', 'viete', 'together',
+    'intervals', 'refine_root', 'count_roots', 'real_roots', 'nroots',
+    'ground_roots', 'nth_power_roots_poly', 'cancel', 'reduced', 'groebner',
+    'is_zero_dimensional', 'GroebnerBasis', 'poly', 'symmetrize', 'horner',
+    'interpolate', 'rational_interpolate', 'viete', 'together',
     'BasePolynomialError', 'ExactQuotientFailed', 'PolynomialDivisionFailed',
     'OperationNotSupported', 'HeuristicGCDFailed', 'HomomorphismFailed',
     'IsomorphismFailed', 'ExtraneousFactors', 'EvaluationFailed',
diff --git a/sympy/physics/mechanics/_actuator.py b/sympy/physics/mechanics/_actuator.py
index 7525acea41..5fbffee090 100644
--- a/sympy/physics/mechanics/_actuator.py
+++ b/sympy/physics/mechanics/_actuator.py
@@ -605,10 +605,10 @@ class TorqueActuator(ActuatorBase):
     >>> axis = N.z
     >>> parent = RigidBody('parent', frame=N)
     >>> child = RigidBody('child', frame=A)
-    >>> bodies = (parent, child)
+    >>> bodies = (child, parent)
     >>> actuator = TorqueActuator(torque, axis, *bodies)
     >>> actuator
-    TorqueActuator(T, axis=N.z, target_frame=N, reaction_frame=A)
+    TorqueActuator(T, axis=N.z, target_frame=A, reaction_frame=N)
 
     Note that because torques actually act on frames, not bodies,
     ``TorqueActuator`` will extract the frame associated with a ``RigidBody``
@@ -699,11 +699,13 @@ def at_pin_joint(
         To create the torque actuator from the ``torque`` and ``pin_joint``
         variables previously instantiated, these can be passed to the alternate
         constructor class method ``at_pin_joint`` of the ``TorqueActuator``
-        class.
+        class. It should be noted that a positive torque will cause a positive
+        displacement of the joint coordinate or that the torque is applied on the
+        child body with a reaction torque on the parent.
 
         >>> actuator = TorqueActuator.at_pin_joint(torque, pin_joint)
         >>> actuator
-        TorqueActuator(T, axis=N.z, target_frame=N, reaction_frame=A)
+        TorqueActuator(T, axis=N.z, target_frame=A, reaction_frame=N)
 
         Parameters
         ==========
@@ -729,8 +731,8 @@ def at_pin_joint(
         return cls(
             torque,
             pin_joint.joint_axis,
-            pin_joint.parent_interframe,
             pin_joint.child_interframe,
+            pin_joint.parent_interframe,
         )
 
     @property
@@ -860,7 +862,7 @@ def to_loads(self) -> list[LoadBase]:
         ``to_loads`` method.
 
         >>> actuator.to_loads()
-        [(N, T*N.z), (A, - T*N.z)]
+        [(A, T*N.z), (N, - T*N.z)]
 
         Alternatively, if a torque actuator is created without a reaction frame
         then the loads returned by the ``to_loads`` method will contain just
diff --git a/sympy/polys/__init__.py b/sympy/polys/__init__.py
index 8055ed12d2..d74355b227 100644
--- a/sympy/polys/__init__.py
+++ b/sympy/polys/__init__.py
@@ -8,9 +8,9 @@
     'gcd', 'lcm_list', 'lcm', 'terms_gcd', 'trunc', 'monic', 'content',
     'primitive', 'compose', 'decompose', 'sturm', 'gff_list', 'gff',
     'sqf_norm', 'sqf_part', 'sqf_list', 'sqf', 'factor_list', 'factor',
-    'intervals', 'refine_root', 'count_roots', 'all_roots', 'real_roots',
-    'nroots', 'ground_roots', 'nth_power_roots_poly', 'cancel', 'reduced',
-    'groebner', 'is_zero_dimensional', 'GroebnerBasis', 'poly',
+    'intervals', 'refine_root', 'count_roots', 'real_roots', 'nroots',
+    'ground_roots', 'nth_power_roots_poly', 'cancel', 'reduced', 'groebner',
+    'is_zero_dimensional', 'GroebnerBasis', 'poly',
 
     'symmetrize', 'horner', 'interpolate', 'rational_interpolate', 'viete',
 
@@ -72,9 +72,8 @@
         gcd, lcm_list, lcm, terms_gcd, trunc, monic, content, primitive,
         compose, decompose, sturm, gff_list, gff, sqf_norm, sqf_part,
         sqf_list, sqf, factor_list, factor, intervals, refine_root,
-        count_roots, all_roots, real_roots, nroots, ground_roots,
-        nth_power_roots_poly, cancel, reduced, groebner, is_zero_dimensional,
-        GroebnerBasis, poly)
+        count_roots, real_roots, nroots, ground_roots, nth_power_roots_poly,
+        cancel, reduced, groebner, is_zero_dimensional, GroebnerBasis, poly)
 
 from .polyfuncs import (symmetrize, horner, interpolate,
         rational_interpolate, viete)
diff --git a/sympy/polys/polytools.py b/sympy/polys/polytools.py
index e6c4f0a917..48887be060 100644
--- a/sympy/polys/polytools.py
+++ b/sympy/polys/polytools.py
@@ -3594,8 +3594,6 @@ def real_roots(f, multiple=True, radicals=True):
         """
         Return a list of real roots with multiplicities.
 
-        See :func:`real_roots` for more explanation.
-
         Examples
         ========
 
@@ -3606,6 +3604,7 @@ def real_roots(f, multiple=True, radicals=True):
         [-1/2, 2, 2]
         >>> Poly(x**3 + x + 1).real_roots()
         [CRootOf(x**3 + x + 1, 0)]
+
         """
         reals = sympy.polys.rootoftools.CRootOf.real_roots(f, radicals=radicals)
 
@@ -3618,8 +3617,6 @@ def all_roots(f, multiple=True, radicals=True):
         """
         Return a list of real and complex roots with multiplicities.
 
-        See :func:`all_roots` for more explanation.
-
         Examples
         ========
 
@@ -6672,306 +6669,18 @@ def count_roots(f, inf=None, sup=None):
 
 
 @public
-def all_roots(f, multiple=True, radicals=True):
+def real_roots(f, multiple=True):
     """
-    Returns the real and complex roots of ``f`` with multiplicities.
-
-    Explanation
-    ===========
-
-    Finds all real and complex roots of a univariate polynomial with rational
-    coefficients of any degree exactly. The roots are represented in the form
-    given by :func:`~.rootof`. This is equivalent to using :func:`~.rootof` to
-    find each of the indexed roots.
-
-    Examples
-    ========
-
-    >>> from sympy import all_roots
-    >>> from sympy.abc import x, y
-
-    >>> print(all_roots(x**3 + 1))
-    [-1, 1/2 - sqrt(3)*I/2, 1/2 + sqrt(3)*I/2]
-
-    Simple radical formulae are used in some cases but the cubic and quartic
-    formulae are avoided. Instead most non-rational roots will be represented
-    as :class:`~.ComplexRootOf`:
-
-    >>> print(all_roots(x**3 + x + 1))
-    [CRootOf(x**3 + x + 1, 0), CRootOf(x**3 + x + 1, 1), CRootOf(x**3 + x + 1, 2)]
-
-    All roots of any polynomial with rational coefficients of any degree can be
-    represented using :py:class:`~.ComplexRootOf`. The use of
-    :py:class:`~.ComplexRootOf` bypasses limitations on the availability of
-    radical formulae for quintic and higher degree polynomials _[1]:
-
-    >>> p = x**5 - x - 1
-    >>> for r in all_roots(p): print(r)
-    CRootOf(x**5 - x - 1, 0)
-    CRootOf(x**5 - x - 1, 1)
-    CRootOf(x**5 - x - 1, 2)
-    CRootOf(x**5 - x - 1, 3)
-    CRootOf(x**5 - x - 1, 4)
-    >>> [r.evalf(3) for r in all_roots(p)]
-    [1.17, -0.765 - 0.352*I, -0.765 + 0.352*I, 0.181 - 1.08*I, 0.181 + 1.08*I]
-
-    Irrational algebraic or transcendental coefficients cannot currently be
-    handled by :func:`all_roots` (or :func:`~.rootof` more generally):
-
-    >>> from sympy import sqrt, expand
-    >>> p = expand((x - sqrt(2))*(x - sqrt(3)))
-    >>> print(p)
-    x**2 - sqrt(3)*x - sqrt(2)*x + sqrt(6)
-    >>> all_roots(p)
-    Traceback (most recent call last):
-    ...
-    NotImplementedError: sorted roots not supported over EX
-
-    In the case of algebraic or transcendental coefficients
-    :func:`~.ground_roots` might be able to find some roots by factorisation:
-
-    >>> from sympy import ground_roots
-    >>> ground_roots(p, x, extension=True)
-    {sqrt(2): 1, sqrt(3): 1}
-
-    If the coefficients are numeric then :func:`~.nroots` can be used to find
-    all roots approximately:
-
-    >>> from sympy import nroots
-    >>> nroots(p, 5)
-    [1.4142, 1.732]
-
-    If the coefficients are symbolic then :func:`sympy.polys.polyroots.roots`
-    or :func:`~.ground_roots` should be used instead:
-
-    >>> from sympy import roots, ground_roots
-    >>> p = x**2 - 3*x*y + 2*y**2
-    >>> roots(p, x)
-    {y: 1, 2*y: 1}
-    >>> ground_roots(p, x)
-    {y: 1, 2*y: 1}
-
-    Parameters
-    ==========
-
-    f : :class:`~.Expr` or :class:`~.Poly`
-        A univariate polynomial with rational (or ``Float``) coefficients.
-    multiple : ``bool`` (default ``True``).
-        Whether to return a ``list`` of roots or a list of root/multiplicity
-        pairs.
-    radicals : ``bool`` (default ``True``)
-        Use simple radical formulae rather than :py:class:`~.ComplexRootOf` for
-        some irrational roots.
-
-    Returns
-    =======
-
-    A list of :class:`~.Expr` (usually :class:`~.ComplexRootOf`) representing
-    the roots is returned with each root repeated according to its multiplicity
-    as a root of ``f``. The roots are always uniquely ordered with real roots
-    coming before complex roots. The real roots are in increasing order.
-    Complex roots are ordered by increasing real part and then increasing
-    imaginary part.
-
-    If ``multiple=False`` is passed then a list of root/multiplicity pairs is
-    returned instead.
-
-    If ``radicals=False`` is passed then all roots will be represented as
-    either rational numbers or :class:`~.ComplexRootOf`.
-
-    See also
-    ========
-
-    Poly.all_roots:
-        The underlying :class:`Poly` method used by :func:`~.all_roots`.
-    rootof:
-        Compute a single numbered root of a univariate polynomial.
-    real_roots:
-        Compute all the real roots using :func:`~.rootof`.
-    ground_roots:
-        Compute some roots in the ground domain by factorisation.
-    nroots:
-        Compute all roots using approximate numerical techniques.
-    sympy.polys.polyroots.roots:
-        Compute symbolic expressions for roots using radical formulae.
-
-    References
-    ==========
-
-    .. [1] https://en.wikipedia.org/wiki/Abel%E2%80%93Ruffini_theorem
-    """
-    try:
-        F = Poly(f, greedy=False)
-        if not isinstance(f, Poly) and not F.gen.is_Symbol:
-            # root of sin(x) + 1 is -1 but when someone
-            # passes an Expr instead of Poly they may not expect
-            # that the generator will be sin(x), not x
-            raise PolynomialError("generator must be a Symbol")
-    except GeneratorsNeeded:
-        raise PolynomialError(
-            "Cannot compute real roots of %s, not a polynomial" % f)
-
-    return F.all_roots(multiple=multiple, radicals=radicals)
-
-
-@public
-def real_roots(f, multiple=True, radicals=True):
-    """
-    Returns the real roots of ``f`` with multiplicities.
-
-    Explanation
-    ===========
-
-    Finds all real roots of a univariate polynomial with rational coefficients
-    of any degree exactly. The roots are represented in the form given by
-    :func:`~.rootof`. This is equivalent to using :func:`~.rootof` or
-    :func:`~.all_roots` and filtering out only the real roots. However if only
-    the real roots are needed then :func:`real_roots` is more efficient than
-    :func:`~.all_roots` because it computes only the real roots and avoids
-    costly complex root isolation routines.
+    Return a list of real roots with multiplicities of ``f``.
 
     Examples
     ========
 
     >>> from sympy import real_roots
-    >>> from sympy.abc import x, y
+    >>> from sympy.abc import x
 
     >>> real_roots(2*x**3 - 7*x**2 + 4*x + 4)
     [-1/2, 2, 2]
-    >>> real_roots(2*x**3 - 7*x**2 + 4*x + 4, multiple=False)
-    [(-1/2, 1), (2, 2)]
-
-    Real roots of any polynomial with rational coefficients of any degree can
-    be represented using :py:class:`~.ComplexRootOf`:
-
-    >>> p = x**9 + 2*x + 2
-    >>> print(real_roots(p))
-    [CRootOf(x**9 + 2*x + 2, 0)]
-    >>> [r.evalf(3) for r in real_roots(p)]
-    [-0.865]
-
-    All rational roots will be returned as rational numbers. Roots of some
-    simple factors will be expressed using radical or other formulae (unless
-    ``radicals=False`` is passed). All other roots will be expressed as
-    :class:`~.ComplexRootOf`.
-
-    >>> p = (x + 7)*(x**2 - 2)*(x**3 + x + 1)
-    >>> print(real_roots(p))
-    [-7, -sqrt(2), CRootOf(x**3 + x + 1, 0), sqrt(2)]
-    >>> print(real_roots(p, radicals=False))
-    [-7, CRootOf(x**2 - 2, 0), CRootOf(x**3 + x + 1, 0), CRootOf(x**2 - 2, 1)]
-
-    All returned root expressions will numerically evaluate to real numbers
-    with no imaginary part. This is in contrast to the expressions generated by
-    the cubic or quartic formulae as used by :func:`~.roots` which suffer from
-    casus irreducibilis [1]_:
-
-    >>> from sympy import roots
-    >>> p = 2*x**3 - 9*x**2 - 6*x + 3
-    >>> [r.evalf(5) for r in roots(p, multiple=True)]
-    [5.0365 - 0.e-11*I, 0.33984 + 0.e-13*I, -0.87636 + 0.e-10*I]
-    >>> [r.evalf(5) for r in real_roots(p, x)]
-    [-0.87636, 0.33984, 5.0365]
-    >>> [r.is_real for r in roots(p, multiple=True)]
-    [None, None, None]
-    >>> [r.is_real for r in real_roots(p)]
-    [True, True, True]
-
-    Using :func:`real_roots` is equivalent to using :func:`~.all_roots` (or
-    :func:`~.rootof`) and filtering out only the real roots:
-
-    >>> from sympy import all_roots
-    >>> r = [r for r in all_roots(p) if r.is_real]
-    >>> real_roots(p) == r
-    True
-
-    If only the real roots are wanted then using :func:`real_roots` is faster
-    than using :func:`~.all_roots`. Using :func:`real_roots` avoids complex root
-    isolation which can be a lot slower than real root isolation especially for
-    polynomials of high degree which typically have many more complex roots
-    than real roots.
-
-    Irrational algebraic or transcendental coefficients cannot be handled by
-    :func:`real_roots` (or :func:`~.rootof` more generally):
-
-    >>> from sympy import sqrt, expand
-    >>> p = expand((x - sqrt(2))*(x - sqrt(3)))
-    >>> print(p)
-    x**2 - sqrt(3)*x - sqrt(2)*x + sqrt(6)
-    >>> real_roots(p)
-    Traceback (most recent call last):
-    ...
-    NotImplementedError: sorted roots not supported over EX
-
-    In the case of algebraic or transcendental coefficients
-    :func:`~.ground_roots` might be able to find some roots by factorisation:
-
-    >>> from sympy import ground_roots
-    >>> ground_roots(p, x, extension=True)
-    {sqrt(2): 1, sqrt(3): 1}
-
-    If the coefficients are numeric then :func:`~.nroots` can be used to find
-    all roots approximately:
-
-    >>> from sympy import nroots
-    >>> nroots(p, 5)
-    [1.4142, 1.732]
-
-    If the coefficients are symbolic then :func:`sympy.polys.polyroots.roots`
-    or :func:`~.ground_roots` should be used instead.
-
-    >>> from sympy import roots, ground_roots
-    >>> p = x**2 - 3*x*y + 2*y**2
-    >>> roots(p, x)
-    {y: 1, 2*y: 1}
-    >>> ground_roots(p, x)
-    {y: 1, 2*y: 1}
-
-    Parameters
-    ==========
-
-    f : :class:`~.Expr` or :class:`~.Poly`
-        A univariate polynomial with rational (or ``Float``) coefficients.
-    multiple : ``bool`` (default ``True``).
-        Whether to return a ``list`` of roots or a list of root/multiplicity
-        pairs.
-    radicals : ``bool`` (default ``True``)
-        Use simple radical formulae rather than :py:class:`~.ComplexRootOf` for
-        some irrational roots.
-
-    Returns
-    =======
-
-    A list of :class:`~.Expr` (usually :class:`~.ComplexRootOf`) representing
-    the real roots is returned. The roots are arranged in increasing order and
-    are repeated according to their multiplicities as roots of ``f``.
-
-    If ``multiple=False`` is passed then a list of root/multiplicity pairs is
-    returned instead.
-
-    If ``radicals=False`` is passed then all roots will be represented as
-    either rational numbers or :class:`~.ComplexRootOf`.
-
-    See also
-    ========
-
-    Poly.real_roots:
-        The underlying :class:`Poly` method used by :func:`real_roots`.
-    rootof:
-        Compute a single numbered root of a univariate polynomial.
-    all_roots:
-        Compute all real and non-real roots using :func:`~.rootof`.
-    ground_roots:
-        Compute some roots in the ground domain by factorisation.
-    nroots:
-        Compute all roots using approximate numerical techniques.
-    sympy.polys.polyroots.roots:
-        Compute symbolic expressions for roots using radical formulae.
-
-    References
-    ==========
-
-    .. [1] https://en.wikipedia.org/wiki/Casus_irreducibilis
     """
     try:
         F = Poly(f, greedy=False)
@@ -6984,7 +6693,7 @@ def real_roots(f, multiple=True, radicals=True):
         raise PolynomialError(
             "Cannot compute real roots of %s, not a polynomial" % f)
 
-    return F.real_roots(multiple=multiple, radicals=radicals)
+    return F.real_roots(multiple=multiple)
 
 
 @public


Test patch:
diff --git a/sympy/physics/mechanics/tests/test_actuator.py b/sympy/physics/mechanics/tests/test_actuator.py
index 2c69bafb3d..6dfb630ce5 100644
--- a/sympy/physics/mechanics/tests/test_actuator.py
+++ b/sympy/physics/mechanics/tests/test_actuator.py
@@ -677,11 +677,11 @@ def test_at_pin_joint_constructor(self) -> None:
 
         assert hasattr(instance, 'target_frame')
         assert isinstance(instance.target_frame, ReferenceFrame)
-        assert instance.target_frame == self.N
+        assert instance.target_frame == self.A
 
         assert hasattr(instance, 'reaction_frame')
         assert isinstance(instance.reaction_frame, ReferenceFrame)
-        assert instance.reaction_frame == self.A
+        assert instance.reaction_frame == self.N
 
     def test_at_pin_joint_pin_joint_not_pin_joint_invalid(self) -> None:
         with pytest.raises(TypeError):
diff --git a/sympy/polys/tests/test_polytools.py b/sympy/polys/tests/test_polytools.py
index 17c59243ec..89e1f47c21 100644
--- a/sympy/polys/tests/test_polytools.py
+++ b/sympy/polys/tests/test_polytools.py
@@ -24,7 +24,7 @@
     sqf_norm, sqf_part, sqf_list, sqf,
     factor_list, factor,
     intervals, refine_root, count_roots,
-    all_roots, real_roots, nroots, ground_roots,
+    real_roots, nroots, ground_roots,
     nth_power_roots_poly,
     cancel, reduced, groebner,
     GroebnerBasis, is_zero_dimensional,
@@ -2856,7 +2856,6 @@ def test_Poly_root():
 
 
 def test_real_roots():
-
     assert real_roots(x) == [0]
     assert real_roots(x, multiple=False) == [(0, 1)]
 
@@ -2872,11 +2871,6 @@ def test_real_roots():
     assert real_roots(x**3*(x**3 + x + 3), multiple=False) == [(rootof(
         x**3 + x + 3, 0), 1), (0, 3)]
 
-    assert real_roots(x**2 - 2, radicals=False) == [
-            rootof(x**2 - 2, 0, radicals=False),
-            rootof(x**2 - 2, 1, radicals=False),
-        ]
-
     f = 2*x**3 - 7*x**2 + 4*x + 4
     g = x**3 + x + 1
 
@@ -2885,26 +2879,11 @@ def test_real_roots():
 
 
 def test_all_roots():
-
     f = 2*x**3 - 7*x**2 + 4*x + 4
-    froots = [Rational(-1, 2), 2, 2]
-    assert all_roots(f) == Poly(f).all_roots() == froots
-
     g = x**3 + x + 1
-    groots = [rootof(g, 0), rootof(g, 1), rootof(g, 2)]
-    assert all_roots(g) == Poly(g).all_roots() == groots
-
-    assert all_roots(x**2 - 2) == [-sqrt(2), sqrt(2)]
-    assert all_roots(x**2 - 2, multiple=False) == [(-sqrt(2), 1), (sqrt(2), 1)]
-    assert all_roots(x**2 - 2, radicals=False) == [
-        rootof(x**2 - 2, 0, radicals=False),
-        rootof(x**2 - 2, 1, radicals=False),
-    ]
 
-    p = x**5 - x - 1
-    assert all_roots(p) == [
-        rootof(p, 0), rootof(p, 1), rootof(p, 2), rootof(p, 3), rootof(p, 4)
-    ]
+    assert Poly(f).all_roots() == [Rational(-1, 2), 2, 2]
+    assert Poly(g).all_roots() == [rootof(g, 0), rootof(g, 1), rootof(g, 2)]
 
 
 def test_nroots():