rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

solve: breakup option is ignored #325

Open rtoy opened 4 months ago

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-02 16:28:52 Created by macrakis on 2023-01-13 18:53:50 Original: https://sourceforge.net/p/maxima/bugs/4076


The breakup option to solve is documented as:

‘breakup’ if ‘false’ will cause ‘solve’ to express the solutions of cubic or quartic equations as single expressions rather than as made up of several common subexpressions which is the default.

As far as I can tell, it has no effect at all:

cu: x^3+6*x^2+x+2$
qu: x^4+x^3+6*x^2+x+2$
makelist(
     is( block([breakup:false],solve(eq,x)) = block([breakup:true],solve(eq,x))),
     eq,
     [  x^3+6*x^2+x+2
        x^4+x^3+6*x^2+x+2 ] )
        => [true,true]
rtoy commented 4 months ago

Imported from SourceForge on 2024-07-02 16:28:53 Created by rtoy on 2023-01-13 19:09:03 Original: https://sourceforge.net/p/maxima/bugs/4076/#4e12


From reading the code, it looks like you need to set programmode:false to get anything.  programmode defaults to true.

Example:

(%i10) solve(x^3+6*x^2+x+2,x);

                               sqrt(397)     1/3
(%t10)                        (--------- - 8)
                                  3/2
                                 3
solve: solution:

                                              sqrt(3) %i   - 1
                                          11 (---------- + ---)
                 - 1   sqrt(3) %i                 2         2
(%t11)      x = (--- - ----------) %t10 + --------------------- - 2
                  2        2                     3 %t10

                                              - 1   sqrt(3) %i
                                          11 (--- - ----------)
                 sqrt(3) %i   - 1              2        2
(%t12)      x = (---------- + ---) %t10 + --------------------- - 2
                     2         2                 3 %t10

                                          11
(%t13)                       x = %t10 + ------ - 2
                                        3 %t10
Evaluation took 0.0000 seconds (0.0000 elapsed) using 150.039 KB.
(%o13)                        [%t11, %t12, %t13]
rtoy commented 4 months ago

Imported from SourceForge on 2024-07-02 16:28:56 Created by macrakis on 2023-01-13 19:16:53 Original: https://sourceforge.net/p/maxima/bugs/4076/#d811


Makes sense. Sounds to me like the programmode and breakup options should be documented together, not several paragraphs apart. So I'll reclassify this as a documentation problem.

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-02 16:28:58 Created by macrakis on 2023-01-13 19:17:22 Original: https://sourceforge.net/p/maxima/bugs/4076/#cfc3


rtoy commented 4 months ago

Imported from SourceForge on 2024-07-02 16:29:00 Created by rtoy on 2023-01-16 00:36:17 Original: https://sourceforge.net/p/maxima/bugs/4076/#bc03


The docs for breakup specifically mention that it only has effect if programmode is false. Not sure what you want to add to that.

As usual the order of the entries is alphabetical, so we can't move them closer together without deciding on how to reorder/rewrite the section.

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-02 16:29:02 Created by macrakis on 2023-01-16 18:11:45 Original: https://sourceforge.net/p/maxima/bugs/4076/#4684


You're right, I'll close the bug.

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-02 16:29:04 Created by macrakis on 2023-01-16 18:12:05 Original: https://sourceforge.net/p/maxima/bugs/4076/#5c09