(48S) Polynomial tools
|
03-03-2015, 11:49 PM
(This post was last modified: 03-03-2015 11:51 PM by f16falcona46.)
Post: #1
|
|||
|
|||
(48S) Polynomial tools
I like PROOT and its associated programs, but the HP 48S doesn't have them. I wrote some replacements, except I just realized there's an assembly version of PROOT that also works with the 48S. Darn.
But here they are, in all their unoptimized...er...glory? Given a polynomial a_n x^n + a_n-1 x^n-1 + ... + a_0 Write it as a vector [a+n a_n-1 ... a_0], inserting zeroes where the coefficient of that power is zero. This is what I have called a "polynomial vector", although I'm not sure if there's a better term. PVAL: Evaluates a polynomial specified by the vector in level 2 at the x-value in level 1. PCOF: Generates a vector describing a polynomial with the roots given in a vector in level 1. This polynomial will always have leading coefficient 1. TOL: Describes the difference that the result can be from the true root, or the difference that the polynomial's x-value can be from zero. Whichever one it is is not assured. This value must be positive, and values can be stored in it. LAGUERRE: Executes Laguerre's method on the polynomial given in the vector on level 1, replacing it with a solution vector. Complex solutions can also be found. SYNTHDIV: Executes synthetic division on the polynomial vector in level 2 by the factor (x-Level 1). The last number in the solution vector is the remainder. DERIV: Returns a polynomial vector which is the derivative of the polynomial vector in level 1. QD: Uses the quadratic formula to find the solutions of the quadratic polynomial vector in level 1. RDCE: Same as SYNTHDIV, but throws the remainder away, since it is assumed to be 0. NRMLZE: Divides a polynomial vector by its leading coefficient. FROOT: Given a solution vector in level 2, and a polynomial vector in level 1, will append all solutions of the polynomial to the solution vector. JOINVEC: Used by FROOT to join two vectors together. (not sure if I'm posting in the right place) I might get around to making these faster if I have time from schoolwork, but I don't think I will write these in System RPL, since I want these to be immediately portable between the various RPL calculators. EDIT: Just realized "DERIV" means people using HP49 will have to modify this. Sorry... PTOOL.txt (Size: 2.11 KB / Downloads: 23) |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)