LBL A
RCL Z ST+ T * 4 *
RCL Y CHS STO Z X^2 X<>Y - SQRT
STO T X<>Y + LASTX R^ -
RCL Z ST/ Z /
END
Just a little exercise for the hot summer days ...
What is this HP-41 program doing?
|
07-26-2002, 02:50 AM
Just a little exercise for the hot summer days ...
07-26-2002, 04:12 AM
It is computing the real roots of a quadratic equation,
07-26-2002, 06:33 AM
Bravo! I used it in the school, some 17 years ago. In fact, I have used the following program which can handle complex solutions as well:
Real solutions: flag 0 cleared, X=x1, Y=x2 The size of this program is 41 bytes (not counting LBL A and END). I am aware this is not optimal and would like to make a proposal: Who can write a shorter program? Only stack registers and flag 00 can be used. Alpha register and data registers cannot be used. Synthetic instructions are welcome but alpha register should not be disturbed.
07-26-2002, 06:48 AM
This is a slightly modified version:
07-26-2002, 08:57 AM
Reminds me the integration with Simpson rule I've once done only on the stack. Was useful when you had a table of points with uniform steps in X. Ciao.....Mike
07-26-2002, 02:39 PM
Hi, HrastProgrammer; Hey, have a look here. If you cannot open it, tell me and I'll send the text. Cheers.
07-28-2002, 03:00 AM
Thanks Luiz ... |
« Next Oldest | Next Newest »
|