Skip to content

Commit e8058dd

Browse files
committed
fix maxima tests for version 5.46.0
1 parent 8f689c5 commit e8058dd

File tree

5 files changed

+35
-18
lines changed

5 files changed

+35
-18
lines changed

src/sage/calculus/calculus.py

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,8 +1187,18 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
11871187
e
11881188
sage: f.limit(x=5)
11891189
7776/3125
1190-
sage: f.limit(x=1.2)
1190+
1191+
Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
1192+
1193+
sage: maxima_calculus.eval("domain:real")
1194+
...
1195+
sage: f.limit(x=1.2).n()
11911196
2.06961575467...
1197+
sage: maxima_calculus.eval("domain:complex");
1198+
...
1199+
1200+
Otherwise, it works ::
1201+
11921202
sage: f.limit(x=I, taylor=True)
11931203
(-I + 1)^I
11941204
sage: f(x=1.2)
@@ -1204,7 +1214,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
12041214
12051215
sage: var('a')
12061216
a
1207-
sage: limit(x^a,x=0)
1217+
sage: limit(x^a,x=0) # random - maxima 5.46.0 does not need extra assumption
12081218
Traceback (most recent call last):
12091219
...
12101220
ValueError: Computation failed since Maxima requested additional
@@ -1216,7 +1226,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
12161226
With this example, Maxima is looking for a LOT of information::
12171227
12181228
sage: assume(a>0)
1219-
sage: limit(x^a,x=0)
1229+
sage: limit(x^a,x=0) # random - maxima 5.46.0 does not need extra assumption
12201230
Traceback (most recent call last):
12211231
...
12221232
ValueError: Computation failed since Maxima requested additional
@@ -1225,7 +1235,7 @@ def limit(ex, dir=None, taylor=False, algorithm='maxima', **argv):
12251235
more details)
12261236
Is a an integer?
12271237
sage: assume(a,'integer')
1228-
sage: limit(x^a, x=0)
1238+
sage: limit(x^a, x=0) # random - maxima 5.46.0 does not need extra assumption
12291239
Traceback (most recent call last):
12301240
...
12311241
ValueError: Computation failed since Maxima requested additional
@@ -2252,10 +2262,10 @@ def symbolic_expression_from_maxima_string(x, equals_sub=False, maxima=maxima):
22522262
True
22532263
sage: sefms("x # 3") == SR(x != 3)
22542264
True
2255-
sage: solve([x != 5], x)
2256-
[[x - 5 != 0]]
2265+
sage: solve([x != 5], x) in [[[x - 5 != 0]], [[x < 5], [5 < x]]]
2266+
True
22572267
sage: solve([2*x==3, x != 5], x)
2258-
[[x == (3/2), (-7/2) != 0]]
2268+
[[x == (3/2)...
22592269
22602270
Make sure that we don't accidentally pick up variables in the maxima namespace (:trac:`8734`)::
22612271

src/sage/functions/exp_integral.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,8 +601,8 @@ class Function_log_integral_offset(BuiltinFunction):
601601
1/log(x)
602602
sage: f.integrate(x)
603603
-x*log_integral(2) + x*log_integral(x) - Ei(2*log(x))
604-
sage: Li(x).integrate(x,2.0,4.5)
605-
-2.5*log_integral(2) + 5.799321147411334
604+
sage: Li(x).integrate(x,2.0,4.5).n()
605+
3.18641169711760
606606
sage: N(f.integrate(x,2.0,3.0)) # abs tol 1e-15
607607
0.601621785860587
608608

src/sage/interfaces/maxima_lib.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -934,8 +934,15 @@ def sr_limit(self, expr, v, a, dir=None):
934934
e
935935
sage: limit(f,x = 5)
936936
7776/3125
937-
sage: limit(f,x = 1.2)
937+
938+
Domain to real, a regression in 5.46.0, see https://sf.net/p/maxima/bugs/4138 ::
939+
940+
sage: maxima_calculus.eval("domain:real")
941+
...
942+
sage: limit(f,x = 1.2).n()
938943
2.06961575467...
944+
sage: maxima_calculus.eval("domain:complex");
945+
...
939946
sage: var('a')
940947
a
941948
sage: limit(x^a,x=0)
@@ -947,7 +954,7 @@ def sr_limit(self, expr, v, a, dir=None):
947954
for more details)
948955
Is a positive, negative or zero?
949956
sage: assume(a>0)
950-
sage: limit(x^a,x=0)
957+
sage: limit(x^a,x=0) # random - not needed for maxima 5.46.0
951958
Traceback (most recent call last):
952959
...
953960
ValueError: Computation failed ...

src/sage/symbolic/integration/integral.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -741,14 +741,14 @@ def integrate(expression, v=None, a=None, b=None, algorithm=None, hold=False):
741741
742742
sage: _ = var('x,y')
743743
sage: f = log(x^2+y^2)
744-
sage: res = integral(f,x,0.0001414, 1.); res
744+
sage: res = integral(f,x,1414/10^7, 1); res
745745
Traceback (most recent call last):
746746
...
747-
ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(50015104*y^2-50015103>0)', see `assume?` for more details)
748-
Is 50015104*y^2-50015103 positive, negative or zero?
747+
ValueError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help ...
748+
Is ... positive, negative or zero?
749749
sage: assume(y>1)
750-
sage: res = integral(f,x,0.0001414, 1.); res
751-
2*y*arctan(1.0/y) - 2*y*arctan(0.0001414/y) + 1.0*log(1.0*y^2 + 1.0) - 0.0001414*log(1.0*y^2 + 1.9993959999999997e-08) - 1.9997172
750+
sage: res = integral(f,x,1414/10^7, 1); res
751+
-2*y*arctan(707/5000000/y) + 2*y*arctan(1/y) + log(y^2 + 1) - 707/5000000*log(y^2 + 499849/25000000000000) - 4999293/2500000
752752
sage: nres = numerical_integral(f.subs(y=2), 0.0001414, 1.); nres
753753
(1.4638323264144..., 1.6251803529759...e-14)
754754
sage: res.subs(y=2).n()

src/sage/symbolic/relation.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,8 +1787,8 @@ def solve_ineq_fourier(ineq, vars=None):
17871787
sage: y = var('y')
17881788
sage: solve_ineq_fourier([x+y<9,x-y>4],[x,y])
17891789
[[y + 4 < x, x < -y + 9, y < (5/2)]]
1790-
sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])
1791-
[[y < min(x - 4, -x + 9)]]
1790+
sage: solve_ineq_fourier([x+y<9,x-y>4],[y,x])[0][0](x=42)
1791+
y < -33
17921792
17931793
sage: solve_ineq_fourier([x^2>=0])
17941794
[[x < +Infinity]]

0 commit comments

Comments
 (0)