(Updated 7/1/12 - thanks everyone!)
Edited: 1 July 2012, 4:49 p.m. after one or more responses were posted
Cubic Formula: HP 71B
|
|
« Next Oldest | Next Newest »
|
▼
Post: #2
06-30-2012, 04:34 PM
(Updated 7/1/12 - thanks everyone!) Edited: 1 July 2012, 4:49 p.m. after one or more responses were posted ▼
Post: #3
07-01-2012, 12:22 PM
Hi Eddie, Thanks for sharing this interesting approach. Just for sake of precision, in your program listing, line 36 seems truncated and merged with line 38; and line 54 can be removed. Hope this helps. Best wishes. Diego. ▼
Post: #4
07-01-2012, 02:17 PM
Also, there's a typo in line 30. It should be 30 P = 2*B^3 - 9*A*B*C + 27*A^2*D.If line 36 is changed to 36 IF A1 < 0 THEN 48it will work for his first and last examples. Assuming line 36 is correct, there's still one typo left because of the byte count (547 bytes instead of 549). There is another typo in X1 in the second example (an extra zero between 4 and 6). This will be a nice program to convert to RPN when Eddie fixes the typos. Regards, Gerson.
▼
Post: #5
07-01-2012, 04:44 PM
Quote: Diego and Gerson: Thank you so much. I made the corrections. In addition to deleting line 54, I also deleted line 100. I also had to make corrections on one of the examples. The program is now 533 bytes. The link on the original post is updated. I appreciate that you pointed my errors to me. :) ▼
Post: #6
07-01-2012, 06:51 PM
Eddie, Would you please double-check the lines 48, 50 and 52? It still doesn't work when A1<0 (your second and fourth examples). Two bytes are still missing. X1 in the second example should be -3.46050487001, not -3.406050487001. Thank you, Gerson. ▼
Post: #7
07-02-2012, 08:03 AM
For Example 2 B = 4, C = 1, D = -3 I get:
A = 1 B = -2 C = -5 D = 6 I get: P = 56 Q = 19 A1 = -6075
Edited: 2 July 2012, 8:54 a.m.
Post: #8
07-02-2012, 09:07 AM
Quote: Line 52 should be 52 X1 = -B/(3*A) - 2/(3*A) * (P1^(1/3)*COS(P2/3)) On a separate note, I edited line 68 to: 68 IF K>=0 THEN 70 ELSE 90 This corrects the display for repeated roots (Example 5) I edited the blog too.
Edited: 2 July 2012, 9:40 a.m. ▼
Post: #9
07-02-2012, 12:57 PM
Hello Eddie, Thanks for the program! The algorithm will be perfect for calculators that don't have native complex numbers. Thanks also for your prompt fixing of the typos. All examples work fine now:
Have you considered using Jean-François Garnier's 68 IF K<0 THEN 90 Best regards, Gerson.
▼
Post: #10
07-03-2012, 11:14 PM
I like emulators, but for me, there is nothing like operating on the real thing. |