Opened 7 years ago
Closed 6 years ago
#14306 closed defect (fixed)
regression in solve
Reported by:  zimmerma  Owned by:  burcin 

Priority:  major  Milestone:  sage6.3 
Component:  calculus  Keywords:  
Cc:  mmezzarobba  Merged in:  
Authors:  KarlDieter Crisman  Reviewers:  Peter Bruin 
Report Upstream:  Fixed upstream, in a later stable release.  Work issues:  
Branch:  0585302 (Commits)  Commit:  058530226b99dbb70136bec21225f0f3153f9dc0 
Dependencies:  Stopgaps: 
Description
the following example, which we use in our book (in french) about Sage, does not work any more with Sage 5.7:
With Sage 5.1:
sage: var('y z') sage: solve([x^2*y*z==18,x*y^3*z==24,x*y*z^4==6],x,y,z) [[x == 3, y == 2, z == 1], [x == (1.33721506733  2.68548987407*I), y == (1.70043427146 + 1.05286432575*I), z == (0.932472229404  0.361241666187*I)], [x == (1.33721506733 + 2.68548987407*I), y == (1.70043427146  1.05286432575*I), z == (0.932472229404 + 0.361241666187*I)], [x == (2.55065140719  1.57929648863*I), y == (0.547325980144 + 1.92365128635*I), z == (0.982973099684  0.183749517817*I)], [x == (2.55065140719 + 1.57929648863*I), y == (0.547325980144  1.92365128635*I), z == (0.982973099684 + 0.183749517817*I)], [x == (0.27680507839  2.98720252889*I), y == (1.47801783444  1.34739128729*I), z == (0.85021713573  0.526432162877*I)], [x == (0.27680507839 + 2.98720252889*I), y == (1.47801783444 + 1.34739128729*I), z == (0.85021713573 + 0.526432162877*I)], [x == (0.820988970216 + 2.88547692952*I), y == (1.20526927276  1.59603445456*I), z == (0.0922683594633  0.995734176295*I)], [x == (0.820988970216  2.88547692952*I), y == (1.20526927276 + 1.59603445456*I), z == (0.0922683594633 + 0.995734176295*I)], [x == (1.80790390914  2.39405168184*I), y == (0.891476711553  1.79032658271*I), z == (0.739008917221  0.673695643647*I)], [x == (1.80790390914 + 2.39405168184*I), y == (0.891476711553 + 1.79032658271*I), z == (0.739008917221 + 0.673695643647*I)], [x == (2.21702675166 + 2.02108693094*I), y == (1.86494445881 + 0.722483332374*I), z == (0.273662990072  0.961825643173*I)], [x == (2.21702675166  2.02108693094*I), y == (1.86494445881  0.722483332374*I), z == (0.273662990072 + 0.961825643173*I)], [x == (2.79741668821  1.08372499856*I), y == (1.96594619937 + 0.367499035633*I), z == (0.602634636379  0.79801722728*I)], [x == (2.79741668821 + 1.08372499856*I), y == (1.96594619937  0.367499035633*I), z == (0.602634636379 + 0.79801722728*I)], [x == (2.94891929905 + 0.55124855345*I), y == (0.184536718927 + 1.99146835259*I), z == (0.445738355777  0.895163291355*I)], [x == (2.94891929905  0.55124855345*I), y == (0.184536718927  1.99146835259*I), z == (0.445738355777 + 0.895163291355*I)]]
With Sage 5.7:
sage: var('y z') (y, z) sage: solve([x^2*y*z==18,x*y^3*z==24,x*y*z^4==6],x,y,z) [x^2*y*z == 18, x*y^3*z == 24, x*y*z^4 == 6]
Change History (20)
comment:1 Changed 7 years ago by
 Report Upstream changed from N/A to Reported upstream. No feedback yet.
comment:2 Changed 7 years ago by
 Report Upstream changed from Reported upstream. No feedback yet. to Fixed upstream, but not in a stable release.
comment:3 Changed 7 years ago by
see #13973
comment:4 Changed 7 years ago by
 Milestone changed from sage5.10 to sage5.11
 Report Upstream changed from Fixed upstream, but not in a stable release. to Fixed upstream, in a later stable release.
comment:5 Changed 6 years ago by
 Milestone changed from sage5.11 to sage5.12
comment:6 Changed 6 years ago by
 Milestone changed from sage6.1 to sage6.2
comment:7 Changed 6 years ago by
 Milestone changed from sage6.2 to sage6.3
comment:8 Changed 6 years ago by
Wait a minute. This is already almost a doctest in Sage.
Sage example in ./calculus.tex, line 583:: sage: x, y, z = var('x, y, z') sage: solve([x^2 * y * z == 18, x * y^3 * z == 24,\ ....: x * y * z^4 == 3], x, y, z) [[x == (2.76736473308  1.71347969911*I), y == (0.570103503963 + 2.00370597877*I), z == (0.801684337646  0.14986077496*I)], ...]
and it passes
$ ./sage t src/sage/tests/french_book/calculus_doctest.py Running doctests with ID 201405300856367a1afdf4. Doctesting 1 file. sage t src/sage/tests/french_book/calculus_doctest.py [246 tests, 7.59 s]  All tests passed!  Total time for all tests: 7.7 seconds cpu time: 5.6 seconds cumulative wall time: 7.6 seconds
But assuming we want to add this back: Paul, where should this appear  presumably in src/sage/tests/french_book/calculus_doctest.py ?
comment:9 Changed 6 years ago by
in our book we originally had the example in the description (at that time we were using Sage 5.1) but
we had to change the last equation from x*y*z^4==6
to x*y*z^4==3
to get Sage to really solve the system (the final version of the book is based on Sage 5.9).
With x*y*z^4==6
as last equation, Sage 6.2 is still unable to solve the system as Sage 5.1 did in the description, thus the problem is still open for me.
Paul
comment:10 Changed 6 years ago by
Ah, but with #13973 we have
sage: var('y,z') (y, z) sage: solve([x^2*y*z==18,x*y^3*z==24,x*y*z^4==6],x,y,z) [[x == 3, y == 2, z == 1], [x == (1.33721506733  2.68548987407*I), y == (1.70043427146 + 1.05286432575*I), z == (0.932472229404  0.361241666187*I)],
As you see, Maxima fixed it. So are you saying that you don't need this for your book? We can still add this as a doctest elsewhere, of course.
comment:11 Changed 6 years ago by
yes we don't need this (with x*y*z^4==6
) for the current version of our book.
But it would be good to add this as a doctest, to check the Maxima fix remains ok.
Paul
comment:12 Changed 6 years ago by
 Branch set to u/kcrisman/14306maxima_solve_doctest
 Commit set to 983492971662a0cfc337845a3e4bbe9b30b34cd1
 Status changed from new to needs_review
Last 10 new commits:
13d48c2  Trac 13973: fix doctests with changed floating point format/precision

a130eed  Trac 13973: realpart should be real_part

3d927bf  Merge remotetracking branch 'trac/u/pbruin/13973maxima_update' into ticket/13712

c715aab  Merge branch 'public/ticket/inf_sum_doctest13712' of git://trac.sagemath.org/sage into ticket/11894maxima_sum_zero_division

1dd0f05  Trac 11894: add doctest for error detection in Maxima sum

0ede45c  Merge branch 'u/pbruin/11894maxima_sum_zero_division' of trac.sagemath.org:sage into maxima_upgrade

b6657b9  Trac #15386  document that Maxima 5.33 fixes this limit

54d0609  Trac #14209  verify Maxima fix for doing improper integral twice

999e21f  Trac #14209  Forget assumptions from earlier doctest

9834929  Trac 14306  doctest Maxima bugfix in solve

comment:13 Changed 6 years ago by
Once again sorry for the looong branch  I'll do this better after the current Maxima upgrade things are done.
comment:14 followup: ↓ 16 Changed 6 years ago by
The last colon before the example should be a double colon.
comment:15 Changed 6 years ago by
 Commit changed from 983492971662a0cfc337845a3e4bbe9b30b34cd1 to 058530226b99dbb70136bec21225f0f3153f9dc0
Branch pushed to git repo; I updated commit sha1. New commits:
0585302  Add second colon for doctest

comment:16 in reply to: ↑ 14 ; followup: ↓ 17 Changed 6 years ago by
The last colon before the example should be a double colon.
Right you are! I've fixed this now.
<rant>I just want to point out that in Mercurial, I could always "roll back" the previous commit and fix such trivialities. Now it has to clutter up the log/tree/directed acyclic graph/whatever for a onecharacter fix.</rant>
New commits:
0585302  Add second colon for doctest

New commits:
0585302  Add second colon for doctest

comment:17 in reply to: ↑ 16 Changed 6 years ago by
Replying to kcrisman:
<rant>I just want to point out that in Mercurial, I could always "roll back" the previous commit and fix such trivialities. Now it has to clutter up the log/tree/directed acyclic graph/whatever for a onecharacter fix.</rant>
You still can. You'll just have to "force push" and deal with a grumpy Volker. It's a tradeoff: do you want a clean history or a (small) chance for more difficult merge issues later on, in case someone based some work on your now abandoned commit?
comment:18 Changed 6 years ago by
 Cc mmezzarobba added
comment:19 Changed 6 years ago by
 Reviewers set to Peter Bruin
 Status changed from needs_review to positive_review
comment:20 Changed 6 years ago by
 Branch changed from u/kcrisman/14306maxima_solve_doctest to 058530226b99dbb70136bec21225f0f3153f9dc0
 Resolution set to fixed
 Status changed from positive_review to closed
I've reported this at Maxima bug 2564.