(11C) CUBIC EQUATION
|
06-10-2018, 09:35 PM
(This post was last modified: 06-11-2018 07:55 AM by Dieter.)
Post: #15
|
|||
|
|||
RE: (11C) CUBIC EQUATION
(06-10-2018 02:36 PM)Gamo Wrote: Somehow the program I listed seem to work. Gamo, I now have looked a bit closer at all this. And it looks a bit clearer now. 1. I had an error in the program I entered into the 15C emulator. One of the test command was wrong. Sorry, my bad. So I corrected this. 2. After the correction the program still required a substantial time even on the emulator. On a real 15C this would mean several minutes before a result is returned. If at all. It turned out that this depends on the initial value of R4. Which confirms my idea that it cannot be right that R4 is not initialized in the program: Depending on the initial R4 value the program runs fine, or may take a very long time. R4 seems to hold some kind of initial guess for the first root. Now if R4 happens to hold a value like 10^9 and the root is near 1... I just stopped such an iteration which seemed to run endlessly. So R4 should be initialized. There are two options now: 3a: The program as listed has an error and there actually is some code that initializes R4, but it is missing in the listing. That's why I asked you to carefully compare the code with the original listing. 3b: The original 29C program indeed has no initializsation code for R4. That's bad programming, but of course it's not your fault. In this case one could start with R4=0 (instead of what happens to be stored in R4 on program start). This can be done with a simple STO 4 after the final CLX at the end of the LBL A routine. I modified the program this way and for the cases I tested it seems to run fine. At least there were no cases where the program required an exceptionally long execution time. Dieter |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)