summary refs log tree commit diff
path: root/pkgs/applications/science/math/sage/patches/pynac-0.7.22.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science/math/sage/patches/pynac-0.7.22.patch')
-rw-r--r--pkgs/applications/science/math/sage/patches/pynac-0.7.22.patch479
1 files changed, 479 insertions, 0 deletions
diff --git a/pkgs/applications/science/math/sage/patches/pynac-0.7.22.patch b/pkgs/applications/science/math/sage/patches/pynac-0.7.22.patch
new file mode 100644
index 00000000000..22f274d608d
--- /dev/null
+++ b/pkgs/applications/science/math/sage/patches/pynac-0.7.22.patch
@@ -0,0 +1,479 @@
+diff --git a/src/sage/calculus/calculus.py b/src/sage/calculus/calculus.py
+index 3a417d9d5c..fadaadbaf6 100644
+--- a/src/sage/calculus/calculus.py
++++ b/src/sage/calculus/calculus.py
+@@ -231,7 +231,7 @@ Another example::
+     sage: f(x=3)
+     arcsinh(1)
+     sage: f.derivative(x)
+-    1/3/sqrt(1/9*x^2 + 1)
++    1/sqrt(x^2 + 9)
+ 
+ We compute the length of the parabola from 0 to 2::
+ 
+@@ -1509,8 +1509,8 @@ def laplace(ex, t, s, algorithm='maxima'):
+     Testing SymPy::
+ 
+         sage: laplace(t^n, t, s, algorithm='sympy')
+-        (s^(-n)*gamma(n + 1)/s, 0, -re(n) < 1)
+-        
++        (gamma(n + 1)/(s*s^n), 0, -re(n) < 1)
++
+     Testing Maxima::
+ 
+         sage: laplace(t^n, t, s, algorithm='maxima')
+diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
+index 1fc2db5c94..f3e49b9cdb 100644
+--- a/src/sage/functions/hypergeometric.py
++++ b/src/sage/functions/hypergeometric.py
+@@ -34,7 +34,7 @@ Simplification (note that ``simplify_full`` does not yet call
+     sage: a.simplify_hypergeometric()
+     1/((-e^x + 1)^e^x)
+     sage: a.simplify_hypergeometric(algorithm='sage')
+-    (-e^x + 1)^(-e^x)
++    1/((-e^x + 1)^e^x)
+ 
+ Equality testing::
+ 
+@@ -145,7 +145,7 @@ Series expansions of confluent hypergeometric functions::
+ 
+     sage: hypergeometric_M(2, 2, x).series(x, 3)
+     1 + 1*x + 1/2*x^2 + Order(x^3)
+-    sage: hypergeometric_U(2, 2, x).series(x == 3, 100).subs(x=1).n()
++    sage: hypergeometric_U(2, 2, x).series(x == 3, 100).subs(x=1).n() # known bug (see :trac:`25688`)
+     0.403652637676806
+     sage: hypergeometric_U(2, 2, 1).n()
+     0.403652637676806
+@@ -773,7 +773,7 @@ def closed_form(hyp):
+         sage: closed_form(hypergeometric([], [], z))
+         e^z
+         sage: closed_form(hypergeometric([a], [], z))
+-        (-z + 1)^(-a)
++        1/((-z + 1)^a)
+         sage: closed_form(hypergeometric([1, 1, 2], [1, 1], z))
+         (z - 1)^(-2)
+         sage: closed_form(hypergeometric([2, 3], [1], x))
+@@ -1121,7 +1121,7 @@ class Hypergeometric_U(BuiltinFunction):
+                 sage: var('a b z')
+                 (a, b, z)
+                 sage: hypergeometric_U(a, b, z).generalized()
+-                z^(-a)*hypergeometric((a, a - b + 1), (), -1/z)
++                hypergeometric((a, a - b + 1), (), -1/z)/z^a
+                 sage: hypergeometric_U(1, 3, 1/2).generalized()
+                 2*hypergeometric((1, -1), (), -2)
+                 sage: hypergeometric_U(3, I, 2).generalized()
+diff --git a/src/sage/functions/log.py b/src/sage/functions/log.py
+index 75d1bf8060..61968582af 100644
+--- a/src/sage/functions/log.py
++++ b/src/sage/functions/log.py
+@@ -518,17 +518,17 @@ class Function_polylog(GinacFunction):
+ 
+             sage: BF = RealBallField(100)
+             sage: polylog(2, BF(1/3))
+-            [0.36621322997706348761674629766 +/- 4.51e-30]
++            [0.36621322997706348761674629766... +/- ...]
+             sage: polylog(2, BF(4/3))
+-            nan
++            [2.27001825336107090380391448586 +/- 5.64e-30] + [-0.90377988538400159956755721265 +/- 8.39e-30]*I
+             sage: parent(_)
+-            Real ball field with 100 bits of precision
++            Complex ball field with 100 bits of precision
+             sage: polylog(2, CBF(1/3))
+-            [0.366213229977063 +/- 5.85e-16]
++            [0.366213229977063 +/- ...]
+             sage: parent(_)
+             Complex ball field with 53 bits of precision
+             sage: polylog(2, CBF(1))
+-            [1.644934066848226 +/- 6.59e-16]
++            [1.644934066848226 +/- ...]
+             sage: parent(_)
+             Complex ball field with 53 bits of precision
+         """
+diff --git a/src/sage/functions/trig.py b/src/sage/functions/trig.py
+index e7e7a311cd..1f2926d6c9 100644
+--- a/src/sage/functions/trig.py
++++ b/src/sage/functions/trig.py
+@@ -529,13 +529,8 @@ class Function_arcsin(GinacFunction):
+             arcsin
+             sage: asin(complex(1,1))
+             (0.6662394324925152+1.0612750619050357j)
+-
+-        Check that :trac:`22823` is fixed::
+-
+-            sage: bool(asin(SR(2.1)) == NaN)
+-            True
+-            sage: asin(SR(2.1)).is_real()
+-            False
++            sage: asin(SR(2.1))
++            1.57079632679490 - 1.37285914424258*I
+         """
+         GinacFunction.__init__(self, 'arcsin', latex_name=r"\arcsin",
+                 conversions=dict(maxima='asin', sympy='asin', fricas="asin", giac="asin"))
+@@ -595,13 +590,8 @@ class Function_arccos(GinacFunction):
+             arccos
+             sage: acos(complex(1,1))
+             (0.9045568943023814-1.0612750619050357j)
+-
+-        Check that :trac:`22823` is fixed::
+-
+-            sage: bool(acos(SR(2.1)) == NaN)
+-            True
+-            sage: acos(SR(2.1)).is_real()
+-            False
++            sage: acos(SR(2.1))
++            1.37285914424258*I
+         """
+         GinacFunction.__init__(self, 'arccos', latex_name=r"\arccos",
+                 conversions=dict(maxima='acos', sympy='acos', fricas='acos', giac='acos'))
+@@ -807,7 +797,7 @@ class Function_arcsec(GinacFunction):
+             sage: arcsec(2).n(100)
+             1.0471975511965977461542144611
+             sage: arcsec(1/2).n(100)
+-            NaN
++            1.3169578969248167086250463473*I
+             sage: RDF(arcsec(2))  # abs tol 1e-15
+             1.0471975511965976
+             sage: arcsec(1 + I)
+@@ -958,7 +948,9 @@ class Function_arctan2(GinacFunction):
+             sage: atan2(0,0,hold=True)
+             arctan2(0, 0)
+             sage: atan2(0,0,hold=True).n()
+-            NaN
++            Traceback (most recent call last):
++            ...
++            RuntimeError: atan2(): division by zero
+ 
+         Check if :trac:`10062` is fixed, this was caused by
+         ``(I*I).is_positive()`` returning ``True``::
+diff --git a/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py b/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py
+index 3b5c8d1729..1c6b73a16c 100644
+--- a/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py
++++ b/src/sage/geometry/hyperbolic_space/hyperbolic_geodesic.py
+@@ -1422,8 +1422,10 @@ class HyperbolicGeodesicUHP(HyperbolicGeodesic):
+         expressions do not generate runtime errors. ::
+ 
+             sage: g=HyperbolicPlane().UHP().get_geodesic(-1+I,1+I)
+-            sage: g.midpoint()
+-            Point in UHP 1/2*(sqrt(2)*e^(1/2*arccosh(3)) - sqrt(2) + (I - 1)*e^(1/2*arccosh(3)) + I - 1)/((1/4*I - 1/4)*sqrt(2)*e^(1/2*arccosh(3)) - (1/4*I - 1/4)*sqrt(2) + 1/2*e^(1/2*arccosh(3)) + 1/2)
++            sage: point = g.midpoint(); point
++            Point in UHP -1/2*(sqrt(2)*...
++            sage: QQbar(point.coordinates()).radical_expression()
++            I*sqrt(2)
+ 
+         Check that floating points remain floating points
+         in :meth:`midpoint` ::
+diff --git a/src/sage/interfaces/fricas.py b/src/sage/interfaces/fricas.py
+index 82aae78e37..8501ea2a18 100644
+--- a/src/sage/interfaces/fricas.py
++++ b/src/sage/interfaces/fricas.py
+@@ -1084,14 +1084,14 @@ class FriCASElement(ExpectElement):
+              0.451026811796262,
+              0.732815101786507,
+              0.837981225008390,
+-             NaN,
+-             NaN,
++             1.57079632679490 - 0.467145308103262*I,
++             0.467145308103262*I,
+              1.11976951499863,
+              0.451026811796262,
+              0.732815101786507,
+              0.837981225008390,
+-             NaN,
+-             NaN]
++             1.57079632679490 - 0.467145308103262*I,
++             0.467145308103262*I]
+             sage: l = [tanh, sinh, cosh, coth, sech, csch, asinh, acosh, atanh, acoth, asech, acsch, arcsinh, arccosh, arctanh, arccoth, arcsech, arccsch]
+             sage: [f(x)._fricas_().sage().subs(x=0.9) for f in l]               # optional - fricas
+             [0.716297870199024,
+diff --git a/src/sage/libs/pynac/pynac.pyx b/src/sage/libs/pynac/pynac.pyx
+index 9e9d8f664b..e3406f007e 100644
+--- a/src/sage/libs/pynac/pynac.pyx
++++ b/src/sage/libs/pynac/pynac.pyx
+@@ -1824,7 +1824,7 @@ cdef py_atan2(x, y):
+         sage: atan2(CC(I), CC(I+1))
+         0.553574358897045 + 0.402359478108525*I
+         sage: atan2(CBF(I), CBF(I+1))
+-        [0.55357435889705 +/- 5.58e-15] + [0.402359478108525 +/- 7.11e-16]*I
++        [0.55357435889705 +/- ...] + [0.402359478108525 +/- ...]*I
+ 
+     Check that :trac:`23776` is fixed and RDF input gives real output::
+ 
+diff --git a/src/sage/matrix/matrix_symbolic_dense.pyx b/src/sage/matrix/matrix_symbolic_dense.pyx
+index 46a15e53eb..7a0beb437b 100644
+--- a/src/sage/matrix/matrix_symbolic_dense.pyx
++++ b/src/sage/matrix/matrix_symbolic_dense.pyx
+@@ -200,7 +200,7 @@ cdef class Matrix_symbolic_dense(Matrix_generic_dense):
+             sage: eval, [evec], mult = es[0]
+             sage: delta = eval*evec - evec*A
+             sage: abs(abs(delta)) < 1e-10
+-            sqrt(9/25*((2*sqrt(6) - 3)*(sqrt(6) - 2) + 7*sqrt(6) - 18)^2 + 9/25*((sqrt(6) - 2)*(sqrt(6) - 4) + 6*sqrt(6) - 14)^2) < (1.00000000000000e-10)
++            3/5*sqrt(((2*sqrt(6) - 3)*(sqrt(6) - 2) + 7*sqrt(6) - 18)^2 + ((sqrt(6) - 2)*(sqrt(6) - 4) + 6*sqrt(6) - 14)^2) < (1.00000000000000e-10)
+             sage: abs(abs(delta)).n() < 1e-10
+             True
+ 
+diff --git a/src/sage/modules/matrix_morphism.py b/src/sage/modules/matrix_morphism.py
+index 17a1d6e290..03892ceec0 100644
+--- a/src/sage/modules/matrix_morphism.py
++++ b/src/sage/modules/matrix_morphism.py
+@@ -214,9 +214,9 @@ class MatrixMorphism_abstract(sage.categories.morphism.Morphism):
+             sage: f((1, 0))
+             Traceback (most recent call last):
+             ...
+-            TypeError: Unable to coerce entries (=[1.00000000000000*I, 0.000000000000000]) to coefficients in Real Field with 53 bits of precision
++            TypeError: Unable to coerce entries (=[1.00000000000000*I, 0]) to coefficients in Real Field with 53 bits of precision
+             sage: f((1, 0), coerce=False)
+-            (1.00000000000000*I, 0.000000000000000)
++            (1.00000000000000*I, 0)
+ 
+         """
+         if self.domain().is_ambient():
+diff --git a/src/sage/plot/plot.py b/src/sage/plot/plot.py
+index 77cdeb8c46..e501e74036 100644
+--- a/src/sage/plot/plot.py
++++ b/src/sage/plot/plot.py
+@@ -2061,7 +2061,7 @@ def _plot(funcs, xrange, parametric=False,
+     plot properly (:trac:`13246`)::
+ 
+         sage: parametric_plot((x, arcsec(x)), (x, -2, 2))
+-        Graphics object consisting of 1 graphics primitive
++        Graphics object consisting of 2 graphics primitives
+ 
+     """
+     from sage.plot.colors import Color
+diff --git a/src/sage/repl/display/formatter.py b/src/sage/repl/display/formatter.py
+index 8ce2e839d7..948207c95e 100644
+--- a/src/sage/repl/display/formatter.py
++++ b/src/sage/repl/display/formatter.py
+@@ -25,11 +25,11 @@ generally, all sage expression as an ASCII art object::
+     sage: shell = get_test_shell()
+     sage: shell.run_cell('%display ascii_art')
+     sage: shell.run_cell('integral(x^2/pi^x, x)')
+-     / 2    2                      \  -x*log(pi)
+-    -\x *log (pi) + 2*x*log(pi) + 2/*e
+-    ---------------------------------------------
+-                         3
+-                      log (pi)
++       -x / 2    2                      \ 
++    -pi  *\x *log (pi) + 2*x*log(pi) + 2/ 
++    --------------------------------------
++                     3                   
++                   log (pi)               
+     sage: shell.run_cell("i = var('i')")
+     sage: shell.run_cell('sum(i*x^i, i, 0, 10)')
+         10      9      8      7      6      5      4      3      2
+diff --git a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
+index d8ebbf4f76..8c60f65e99 100644
+--- a/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
++++ b/src/sage/rings/asymptotic/asymptotics_multivariate_generating_functions.py
+@@ -151,8 +151,8 @@ A multiple point example (Example 6.5 of [RaWi2012]_)::
+      [(x + 2*y - 1, 1), (2*x + y - 1, 1)])
+     sage: F1 = decomp[1]
+     sage: F1.asymptotics(p, alpha, 2)
+-    (-3*((2*a^2 - 5*a*b + 2*b^2)*r^2 + (a + b)*r + 3)*((1/3)^(-a)*(1/3)^(-b))^r,
+-     (1/3)^(-a)*(1/3)^(-b), -3*(2*a^2 - 5*a*b + 2*b^2)*r^2 - 3*(a + b)*r - 9)
++    (-3*((2*a^2 - 5*a*b + 2*b^2)*r^2 + (a + b)*r + 3)*(1/((1/3)^a*(1/3)^b))^r,
++     1/((1/3)^a*(1/3)^b), -3*(2*a^2 - 5*a*b + 2*b^2)*r^2 - 3*(a + b)*r - 9)
+     sage: alpha = [4, 3]
+     sage: decomp =  F.asymptotic_decomposition(alpha)
+     sage: F1 = decomp[1]
+@@ -2159,7 +2159,7 @@ class FractionWithFactoredDenominator(RingElement):
+             sage: p = {x: 1/3, y: 1/3}
+             sage: alpha = (var('a'), var('b'))
+             sage: F.asymptotics_multiple(p, alpha, 2, var('r')) # long time
+-            (3*((1/3)^(-a)*(1/3)^(-b))^r*e^(2/3), (1/3)^(-a)*(1/3)^(-b), 3*e^(2/3))
++            (3*(1/((1/3)^a*(1/3)^b))^r*e^(2/3), 1/((1/3)^a*(1/3)^b), 3*e^(2/3))
+         """
+         from itertools import product
+         from sage.calculus.functions import jacobian
+diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
+index 16a268a02c..5fd244e93b 100644
+--- a/src/sage/stats/basic_stats.py
++++ b/src/sage/stats/basic_stats.py
+@@ -183,7 +183,7 @@ def std(v, bias=False):
+         sage: std([])
+         NaN
+         sage: std([I, sqrt(2), 3/5])
+-        sqrt(1/450*(10*sqrt(2) - 5*I - 3)^2 + 1/450*(5*sqrt(2) - 10*I + 3)^2 + 1/450*(5*sqrt(2) + 5*I - 6)^2)
++        1/15*sqrt(1/2)*sqrt((10*sqrt(2) - 5*I - 3)^2 + (5*sqrt(2) - 10*I + 3)^2 + (5*sqrt(2) + 5*I - 6)^2)
+         sage: std([RIF(1.0103, 1.0103), RIF(2)])
+         0.6998235813403261?
+         sage: import numpy
+diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
+index ab4c05de3a..60f0dc549a 100644
+--- a/src/sage/symbolic/expression.pyx
++++ b/src/sage/symbolic/expression.pyx
+@@ -622,7 +622,7 @@ cdef class Expression(CommutativeRingElement):
+             sage: x^(-5)
+             x^(-5)
+             sage: x^(-y)
+-            x^(-y)
++            1/(x^y)
+             sage: 2*x^(-1)
+             2/x
+             sage: i*x
+@@ -3621,14 +3621,14 @@ cdef class Expression(CommutativeRingElement):
+             sage: repl_dict = {b_0: b_0, b_3: b_1, b_2: b_3, b_1: b_2}
+             sage: P = precomp.substitute(repl_dict)
+             sage: P.expand()
+-            -2^(-b_0)*2^(-b_2)*2^b_3 - 2^b_0*2^(-b_2)*2^b_3 -
+-            2^(-b_0)*2^b_2*2^b_3 + 2^b_0*2^b_2*2^b_3 - 2*2^(-b_0)*2^(-b_2)
+-            - 2*2^b_0*2^(-b_2) - 2*2^(-b_0)*2^b_2 + 2*2^b_0*2^b_2 +
+-            2^(-b_0)*2^b_3 + 2^b_0*2^b_3 + 2^(-b_2)*2^b_3 + 2^b_2*2^b_3 +
+-            2*2^(-b_0) + 2*2^b_0 + 2*2^(-b_2) + 2*2^b_2 - 9*2^b_3 -
+-            2^(-b_0)*2^(-b_2)/2^b_3 - 2^b_0*2^(-b_2)/2^b_3 -
+-            2^(-b_0)*2^b_2/2^b_3 + 2^b_0*2^b_2/2^b_3 + 2^(-b_0)/2^b_3 +
+-            2^b_0/2^b_3 + 2^(-b_2)/2^b_3 + 2^b_2/2^b_3 - 9/2^b_3 - 18
++            2^b_0*2^b_2*2^b_3 + 2*2^b_0*2^b_2 + 2^b_0*2^b_3 + 2^b_2*2^b_3 +
++            2*2^b_0 + 2*2^b_2 - 9*2^b_3 + 2^b_0*2^b_2/2^b_3 -
++            2^b_0*2^b_3/2^b_2 - 2^b_2*2^b_3/2^b_0 - 2*2^b_0/2^b_2 -
++            2*2^b_2/2^b_0 + 2^b_0/2^b_3 + 2^b_2/2^b_3 + 2^b_3/2^b_0 +
++            2^b_3/2^b_2 + 2/2^b_0 + 2/2^b_2 - 2^b_0/(2^b_2*2^b_3) -
++            2^b_2/(2^b_0*2^b_3) - 9/2^b_3 - 2^b_3/(2^b_0*2^b_2) -
++            2/(2^b_0*2^b_2) + 1/(2^b_0*2^b_3) + 1/(2^b_2*2^b_3) -
++            1/(2^b_0*2^b_2*2^b_3) - 18
+ 
+             sage: _0,b_1,b_2=var('b_0,b_1,b_2')
+             sage: f = 1/27*b_2^2/(2^b_2)^2 + 1/27*b_1^2/(2^b_1)^2 + \
+@@ -3809,7 +3809,7 @@ cdef class Expression(CommutativeRingElement):
+ 
+             sage: x = SR.symbol('x', domain='real')
+             sage: (x^3)^(1/3)
+-            (x^3)^(1/3)
++            x
+             sage: (x^4)^(1/4)
+             abs(x)
+             sage: (x^8)^(1/4)
+@@ -3872,7 +3872,7 @@ cdef class Expression(CommutativeRingElement):
+             sage: 2^(x/log(2))
+             e^x
+             sage: 2^(-x^2/2/log(2))
+-            e^(-1/2*x^2)
++            1/e^(1/2*x^2)
+             sage: x^(x/log(x))
+             x^(x/log(x))
+             sage: assume(x > 0)
+@@ -4816,18 +4816,24 @@ cdef class Expression(CommutativeRingElement):
+             sage: ((x+y)^(x+y)).match(w0^w0)
+             {$0: x + y}
+             sage: t = ((a+b)*(a+c)).match((a+w0)*(a+w1))
+-            sage: t[w0], t[w1]
+-            (c, b)
++            sage: set([t[w0], t[w1]]) == set([b, c])
++            True
+             sage: ((a+b)*(a+c)).match((w0+b)*(w0+c))
+             {$0: a}
+             sage: t = ((a+b)*(a+c)).match((w0+w1)*(w0+w2))
+-            sage: t[w0], t[w1], t[w2]
+-            (a, c, b)
+-            sage: print(((a+b)*(a+c)).match((w0+w1)*(w1+w2)))
+-            None
++            sage: t[w0]
++            a
++            sage: set([t[w1], t[w2]]) == set([b, c])
++            True
++            sage: t = ((a+b)*(a+c)).match((w0+w1)*(w1+w2))
++            sage: t[w1]
++            a
++            sage: set([t[w0], t[w2]]) == set([b, c])
++            True
+             sage: t = (a*(x+y)+a*z+b).match(a*w0+w1)
+-            sage: t[w0], t[w1]
+-            (x + y, a*z + b)
++            sage: s = set([t[w0], t[w1]])
++            sage: s == set([x+y, a*z+b]) or s == set([z, a*(x+y)+b])
++            True
+             sage: print((a+b+c+d+f+g).match(c))
+             None
+             sage: (a+b+c+d+f+g).has(c)
+@@ -4836,7 +4842,7 @@ cdef class Expression(CommutativeRingElement):
+             {$0: a + b + d + f + g}
+             sage: (a+b+c+d+f+g).match(c+g+w0)
+             {$0: a + b + d + f}
+-            sage: (a+b).match(a+b+w0)
++            sage: (a+b).match(a+b+w0) # known bug
+             {$0: 0}
+             sage: print((a*b^2).match(a^w0*b^w1))
+             None
+@@ -5009,7 +5015,7 @@ cdef class Expression(CommutativeRingElement):
+             a^3 + b^3 + (x + y)^3
+ 
+             sage: t.subs(w0 == w0^2)
+-            (x^2 + y^2)^18 + a^16 + b^16
++            a^8 + b^8 + (x^2 + y^2)^6
+ 
+             sage: t.subs(a == b, b == c)
+             (x + y)^3 + b^2 + c^2
+@@ -8392,9 +8398,13 @@ cdef class Expression(CommutativeRingElement):
+             sage: SR(I).arctan2(1)
+             arctan2(I, 1)
+             sage: SR(CDF(0,1)).arctan2(1)
+-            NaN + +infinity*I
+-            sage: SR(1).arctan2(CDF(0,1))   # known bug
+-            0.7853981633974484 - 19.012501686914433*I
++            Traceback (most recent call last):
++            ...
++            ValueError: power::eval(): division by zero
++            sage: SR(1).arctan2(CDF(0,1))
++            Traceback (most recent call last):
++            ...
++            ValueError: power::eval(): division by zero
+ 
+             sage: arctan2(0,oo)
+             0
+@@ -8656,7 +8666,7 @@ cdef class Expression(CommutativeRingElement):
+             1/2*I*pi
+             sage: SR(1/2).arccosh()
+             arccosh(1/2)
+-            sage: SR(CDF(1/2)).arccosh()  # rel tol 1e-15
++            sage: SR(CDF(1/2)).arccosh() #  rel tol 1e-15
+             1.0471975511965976*I
+             sage: maxima('acosh(0.5)')
+             1.04719755119659...*%i
+@@ -11687,7 +11697,7 @@ cdef class Expression(CommutativeRingElement):
+             sage: a.solve(t)
+             []
+             sage: b = a.canonicalize_radical(); b
+-            -23040.0*(-2.0*e^(1800*t) + 25.0*e^(900*t) - 32.0)*e^(-2400*t)
++            (46080.0*e^(1800*t) - 576000.0*e^(900*t) + 737280.0)*e^(-2400*t)
+             sage: b.solve(t)
+             []
+             sage: b.solve(t, to_poly_solve=True)
+@@ -12163,14 +12173,14 @@ cdef class Expression(CommutativeRingElement):
+ 
+             sage: (n,k,j)=var('n,k,j')
+             sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
+-            -(-1)^(-j)*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
++            -(-1)^j*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
+             sage: assume(j>-1)
+             sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
+             1
+             sage: forget()
+             sage: assume(n>=j)
+             sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
+-            -(-1)^(-j)*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
++            -(-1)^j*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
+             sage: forget()
+             sage: assume(j==-1)
+             sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
+@@ -12178,7 +12188,7 @@ cdef class Expression(CommutativeRingElement):
+             sage: forget()
+             sage: assume(j<-1)
+             sage: sum(binomial(n,k)*binomial(k-1,j)*(-1)**(k-1-j),k,j+1,n)
+-            -(-1)^(-j)*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
++            -(-1)^j*sum((-1)^k*binomial(k - 1, j)*binomial(n, k), k, j + 1, n)
+             sage: forget()
+ 
+         Check that :trac:`16176` is fixed::
+diff --git a/src/sage/symbolic/relation.py b/src/sage/symbolic/relation.py
+index da6f0eef42..4bd65ef572 100644
+--- a/src/sage/symbolic/relation.py
++++ b/src/sage/symbolic/relation.py
+@@ -895,7 +895,7 @@ def solve(f, *args, **kwds):
+         sage: (r[0][x], r[0][y])
+         (2*lambert_w(1/2), 1)
+         sage: solve(-2*x**3 + 4*x**2 - 2*x + 6 > 0, x, algorithm='sympy')
+-        [x < (1/6*sqrt(77) + 79/54)^(1/3) + 1/9/(1/6*sqrt(77) + 79/54)^(1/3) + 2/3]
++        [x < 1/3*(1/2)^(1/3)*(9*sqrt(77) + 79)^(1/3) + 2/3*(1/2)^(2/3)/(9*sqrt(77) + 79)^(1/3) + 2/3]
+         sage: solve(sqrt(2*x^2 - 7) - (3 - x),x,algorithm='sympy')
+         [x == -8, x == 2]
+         sage: solve(sqrt(2*x + 9) - sqrt(x + 1) - sqrt(x + 4),x,algorithm='sympy')