- labels: --> 460522
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
Logged In: YES
user_id=501686
Observed in 5.9.3cvs.
Logged In: YES
user_id=895922
Originator: YES
Fixed by CVS r 1.7. Closing bug.
Log in to post a comment.