#566 poly_discriminant with ratfac == true / FIX

closed
nobody
5
2012-12-04
2004-04-29
No

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

Discussion

  • Robert Dodier

    Robert Dodier - 2006-07-29
    • labels: --> 460522
     
  • Robert Dodier

    Robert Dodier - 2006-07-29

    Logged In: YES
    user_id=501686

    Observed in 5.9.3cvs.

     
  • Robert Dodier

    Robert Dodier - 2006-09-09
    • labels: 460522 --> Lisp Core - Polynomials
     
  • Robert Dodier

    Robert Dodier - 2006-09-09
    • milestone: --> Includes_proposed_fix
     
  • Barton Willis

    Barton Willis - 2007-01-26

    Logged In: YES
    user_id=895922
    Originator: YES

    Fixed by CVS r 1.7. Closing bug.

     
  • Barton Willis

    Barton Willis - 2007-01-26
    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks