rtoy / maxima

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

poly_discriminant with ratfac == true / FIX #3062

Closed rtoy closed 3 months ago

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 12:41:51 Created by willisbl on 2004-04-29 18:03:49 Original: https://sourceforge.net/p/maxima/bugs/566


When ratfac == true, poly_discriminant often incorrectly determines that the first argument is non-polynomial; for example

(C1) ratfac : true$ (C2) poly_discriminant((x-1)*(x-2),x); ARG. MUST BE A POLYNOMIAL IN VAR -- an error. Quitting. To debug this try DEBUGMODE (TRUE);)

Additionally,

(1) The error message is silly. (2) The function poly_discriminant isn't documented. (3) What other functions misbehave when ratfac == true?

A simple fix is

(DEFMFUN $POLY_DISCRIMINANT (POLY VAR) (LET* ((VARLIST (LIST VAR)) ($ratfac nil) (GENVAR ()) (RFORM (RFORM ($rat POLY var))) (RVAR (CAR (LAST GENVAR))) (N (PDEGREE (SETQ POLY (CAR RFORM)) RVAR)))
(COND ((= N 1) 1) ((OR (= N 0) (NOT (atom (CDR RFORM)))) (MERROR "The first argument must be a polynomial in ~:M" var)) (T (PDIS (PRESIGN (// (f* N (f1- N)) 2) (PQUOTIENT (RESULTANT POLY (PDERIVATIVE POLY RVAR)) (P-LC POLY))))))))

Barton

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 12:41:52 Created by robert_dodier on 2006-07-29 06:25:56 Original: https://sourceforge.net/p/maxima/bugs/566/#d928


Logged In: YES user_id=501686

Observed in 5.9.3cvs.

rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 12:41:56 Created by robert_dodier on 2006-07-29 06:25:56 Original: https://sourceforge.net/p/maxima/bugs/566/#6b9d


rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 12:41:59 Created by robert_dodier on 2006-09-09 05:30:11 Original: https://sourceforge.net/p/maxima/bugs/566/#60f4


rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 12:42:03 Created by robert_dodier on 2006-09-09 15:10:57 Original: https://sourceforge.net/p/maxima/bugs/566/#a09c


rtoy commented 3 months ago

Imported from SourceForge on 2024-07-07 12:42:06 Created by willisbl on 2007-01-26 04:46:43 Original: https://sourceforge.net/p/maxima/bugs/566/#9a62