From: jhmeyers@miu.edu (John H Meyers)
Newsgroups: comp.sys.hp48
Subject: PFCTR - Factor simple polynomials
Date: 30 Dec 1997 09:53:01 GMT
Message-ID: <68agav$o8a$1@news.iastate.edu>
Organization: MIU Computer Services,  Fairfield, IA 52557.  Not Approved.
Distribution: world
Reply-To: jhmeyers@miu.edu
NNTP-Posting-Host: vax1.mum.edu
Xref: republic.btigate.com comp.sys.hp48:5249

Algebra students have often asked for an HP48 program like this:

%%HP: T(3); @ PFCTR - Factor simple polynomials (G/GX)
\<< -3 CF DUP 1 GET SWAP PROOT OBJ\-> EVAL \->LIST
  1 \<< 'X' SWAP - * \>> DOLIST \>>

The input must be a vector (or array) of the polynomial coefficients,
e.g. for 'X^2-5*X+6' enter [ 1 -5 6 ] and get the result '(X-2)*(X-3)'

For  '2*X^2-7*X+6' enter [ 2 -7 6 ] and get a result '2*(X-1.5)*(X-2)'
which is equivalent to '(2*X-3)*(X-2)'

For 'X^3+X' enter [ 1 0 1 0 ] and get a result 'X*(X-(0,1))*(X-(0,-1))'
which means 'X*(X-i)*(X+i)' and is equivalent to 'X*(X^2+1)'

This is not quite as good as the FCTR command of ALG48, but it is
slightly smaller, faster, and easier to enter the arguments :)

-----------------------------------------------------------
With best wishes from:   John H Meyers   <jhmeyers@mum.edu>
