rtoy / maxima

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

sign can't figure out sign of simple expression #1477

Open rtoy opened 4 months ago

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-04 17:01:43 Created by robert_dodier on 2015-07-02 15:17:14 Original: https://sourceforge.net/p/maxima/bugs/2989


sign can't figure out the sign of a simple expression which should be inferred from assume declarations.

assume (n > k, k > 0);
sign (n - k);
 => pos /* OK */
sign (n - k + 1);
 => pnz /* OOPS, SHOULD BE POS */

There are probably a lot of similar examples -- probably a good idea to collect them as test cases for the eventual reworking of sign & friends.

I seem to recall there are at least two paths through the code which compute sign of something -- sign follows one, but I forget the other one at the moment. Perhaps I'm mistaken.

rtoy commented 4 months ago

Imported from SourceForge on 2024-07-04 17:01:44 Created by fabriziocaruso on 2018-11-27 18:56:22 Original: https://sourceforge.net/p/maxima/bugs/2989/#552c


The current SARAG package covers the sign problem in many cases (polynomial expressions).

The univariate algorithms (in certificateOfPositivity.mac) covers fully the strict positive/negative cases over real intervals (and all the reals by taking a large enough interval such as the one provided by the Cauchy/Lagrange bounds).

The multivarate algorithms (in multivariateCertificateOfPositivity.mac) cover the strict positive/negative cases and some non-negative/non-positive cases for multivariate polynomial expressions over simplices.

I am trying to extend the univariate case to cover at least some non-negative/non-positive cases.