As he was going through the tome that represented the CISC instruction set of a VAX system (long before easy search engines), he found POLY ( https://www.ece.lsu.edu/ee4720/doc/vax.pdf page 9-118).
So, his program, instead of doing all the calculations was setting up a few registers, a large comment block that explained it, a call to POLY, and reading out the registers.
He claimed to have gotten full credit and within a handful of semesters later the course was switched from CISC architectures to RISC.
- some kind of root finding (note that methods like Newton–Raphson don’t work when zeros have multiplicity)
- dividing polynomials by (X - a) after finding one root to find the next root
float poly(int d, float x, float *c) {
c+=d;
float y = *c;
while(d--)
y = *c-- + y * x;
return y;
}
I also don’t see why you consider this to be the CISCiest instruction from an architecture that includes a substring-search instruction, a vaguely printf-like instruction with its own mini instruction set for the pattern strings it takes, and an instruction to do polynomial division in the ring of polynomials over F_2 (ok this is just CRC)I do recall that it was something to do with polynomials.
It was also something that was fun to port.
I got an A in that class both semesters, which was better than the B I often got in Math (and a C- once in AlgII) because I hated doing homework. But starting on the program as soon as I grasped the concept and usually blasting through the homework with it by the end of the period meant an A was easily in my grasp.
That teacher was the best damn math teacher ever. He would work hard to help every last student get it, he'd gladly spend his whole lunch helping a kid if they needed it.
PS. I did share some of my programs, mostly with one girl, but she's a successful nurse today so I guess I didn't ruin her future :D
Lol. So naïve. Half the point of programing and testing the software is so that you can then forget how to do the task yourself. I'd say that 90+% of the task-specific code I've written was for that I no longer remember how to do myself. Once upon a time I wrote a thing to calculate some of the specifics re water hammer effects in pipes. I still have the code but, for the life of me, I have totally forgotten the actual math.
I started using this username in...I think 2002? Well, actually, I started using just "Sohcahtoa" then. Then I tried signing up for some service a few years later and "Sohcahtoa" was already taken, so decided to just add my birth year to it, since that was a pretty common thing to do at the time, and now I'm Sohcahtoa82 everywhere except on EFnet, where nicks are limited to 9 letters. Still Sohcahtoa there.
I showed it to my teacher and asked it if it would be considered cheating to use it on the test, and she said that if I knew the material so well that I could write a program that didn't just solve it, but showed the work, then clearly I knew the material so well that I'd ace the test even without the program, so I could go ahead and use it, just as long as I didn't share the program with my friends.
I didn't have any friends (This was 1998 where being such a nerd was still looked down on), so it wasn't an issue.