hi,
I wonder for a simple, short program to get all complex roots from a number (real or complex), like the function which is in the Math 1 pack for HP41CX.
This is not exactly what you were looking for, but it is a complex root finder for real and complex numbers. I wrote this a few years ago for use on my HP 28S (different code) calculator. I did a quick and dirty adaptation for the DM42. Put the .raw file into the Programs file of your disk. Exit out to the main screen and XEQ cplxr. Go in to the Solver, Shift-7, and hit the CPLXR menu key. You should see the menu keys: Z N K.
Example: Put in -27 for Z. Put in 3 for N and then put 0 into K. Hit R/S. The 0th root of a negative number is complex. You should see a 0 in Y and the complex result in X. Now, put a 1 into K and hit R/S. You should see a 1 in Y and the real root in X (obviously, a -3). For the final root, put a 2 into K and hit R/S. You should see a 2 in Y and the other complex root in X. That's all the roots for the cube root of -27. You just need to remember that to calculate all of the roots of a real or complex number the K value should always start at zero and end with a number one less that the number of roots you are calculating.
I edited the cplxr.raw program to make it a little more convenient to use. First, download the "KPLXR.raw" to the USB disk of your calculator. Load the program. Go the the main screen of your calculator and hit the "XEQ" button. Select "KPLXR". Go to the "SOLVER", shift-7. Select "KPLXR". A menu should appear on your calculator screen...Z, N, K, Step. Now, find the first 3 roots of -8. Put -8 into Z. Put 3 into N. Put 2 into K (remember K=N-1).
Finally, put 1 into "Step" (or nothing, it will default to Step=1). Hit R/S...you should see X=1.0000 i1.7321. Hit R/S again...you should see X=-2.0000 i0.0000. Hit R/s again...you should see 1.0000 -i1.7321. That's the first 3 roots of -8. Now, if you hit R/S again, the program will loop back to the first answer. If you hit "Exit" everything will clear out of the stack.