Re: Polynomials solver for 42: WANTED Message #2 Posted by ExPPC member on 12 Feb 2003, 4:19 a.m., in response to message #1 by R Lion
The translated HP67 program you're trying to load and
run is far from optimal, or even efficient. Your best best
would be to get one from the former "HP41C User's Library",
or even better, to look for one in the old issues of the
PPC Journal, available in CDROM.
If you do have or can get an HP71B with a Math ROM,
this is the "program" that will do what you want,
particularized for a 100thdegree polynomial:
10 DIM P(101) @ COMPLEX R(100) @ MAT INPUT P @ MAT R=PROOT(P) @ MAT DISP R
I quoted "program" because you could easily execute that
from the command line, no need to enter a program. As
written, it does the following:
DIM P(101) dimensions a 101element vector to hold
the 101 coefficients
COMPLEX R(100) dimensions a 100element complex vector
to hold the 100 complex roots
MAT INPUT P prompts the user for each element. The
user can enter elements one by one or
several at a time, and can enter numbers
or expressions, even using variables
and functions
MAT R=PROOT(P) computes all 100 complex roots
MAT DISP R displays all roots
To make it general, just ask for the degree N, and then
use DIM P(N+1) and COMPLEX R(N) instead.
That's it. Amazingly simple and powerful !
