Post Reply 
Polynomial with real coefficients —> array w/ real coeff
11-22-2021, 05:12 PM
Post: #2
RE: Polynomial with real coefficients
Hi, Gil

This may be what you wanted.

(10-26-2020 04:25 PM)Albert Chan Wrote:  
(10-24-2020 02:03 PM)John Keith Wrote:  'X^5-19*X^4+79*X^3+146*X^2-1153*X+1222'

Is there a command to convert this symbolic polynomial form to an array

XCas has symy2poly, but I can't find one for HP50G

XCas> symb2poly((x+1)*(x+2)*(x+3))       → poly1[1, 6, 11, 6]

Code:
≪ 0 OVER DEGREE → D
   ≪ 3. DUP D + FOR k HORNER k ROLLD NEXT
      + + D 1 + →ARRY
   ≫

Save above to, say, PARRY

hp50g> '(X+1)*(X+2)*(X+3)'
hp50g> PARRY        → [1 6 11 6]
hp50g> PROOT       → [-1. -2. -3.]

hp50g> 'X^5-19*X^4+79*X^3+146*X^2-1153*X+1222'
hp50g> PARRY        → [1 -19 79 146 -1153 1222]
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Polynomial with real coefficients - Albert Chan - 11-22-2021 05:12 PM



User(s) browsing this thread: 1 Guest(s)