Small Solver Program
02-17-2019, 09:06 AM
Post: #12
 Thomas Klemm Senior Member Posts: 1,851 Joined: Dec 2013
RE: Small Solver Program
(02-17-2019 02:57 AM)Gamo Wrote:  I just fine tune this solver program for HP-11C

Your program doesn't work for this simple example: $$x^2+x=x(x+1)=0$$
I've entered the following program:
Code:
LBL B 1 RCL 1 + LSTx × RTN

Example:

-2
ENTER
-0.5
A

9.999999 99

The reason is that the function value is divided by -0.5, making it larger and larger:
Code:
LBL 1  // Solver Routine RCL 0 ÷ CHS RCL 1 + RTN

Another thing is this in this loop:
Code:
LBL 0 GSB B GSB 1 STO 1 GSB B GSB 1 RCL 1 X=Y  // End if Root is found GTO 2 DSE  // Loop Limit Counter GTO 0

When you return to label 0, the same value in register 1 will be used as before.
This function evaluation can be avoided if you save the result of the previous evaluation.

You could move this block:
Code:
LBL 2 RCL 1  // Answer  RTN

Over here and avoid the jump GTO 2:
Code:
CLx FIX 9  // 0.000000000 indicate that Maximum Loops is use up. PSE PSE FIX 4  LBL 2 RCL 1  // Answer  RTN

Take a look at Csaba's solution for the HP-12C using the secant method.

Cheers
Thomas
 « Next Oldest | Next Newest »

 Messages In This Thread Small Solver Program - Gamo - 02-14-2019, 05:25 AM RE: Small Solver Program - Thomas Klemm - 02-14-2019, 07:06 AM RE: Small Solver Program - Albert Chan - 02-15-2019, 12:07 AM RE: Small Solver Program - Thomas Klemm - 02-15-2019, 06:26 PM RE: Small Solver Program - Albert Chan - 02-15-2019, 09:16 PM Addendum: Small Solver Program - Thomas Klemm - 02-14-2019, 07:15 AM RE: Small Solver Program - Thomas Klemm - 02-16-2019, 03:58 AM RE: Small Solver Program - Albert Chan - 11-03-2019, 03:14 PM RE: Small Solver Program - Albert Chan - 11-10-2019, 07:02 PM RE: Small Solver Program - Albert Chan - 12-01-2019, 12:13 AM RE: Small Solver Program - Csaba Tizedes - 02-16-2019, 12:24 PM RE: Small Solver Program - Thomas Klemm - 02-16-2019, 01:42 PM RE: Small Solver Program - Csaba Tizedes - 02-16-2019, 03:24 PM RE: Small Solver Program - Gamo - 02-17-2019, 02:57 AM RE: Small Solver Program - Thomas Klemm - 02-17-2019 09:06 AM RE: Small Solver Program - Gamo - 02-17-2019, 02:33 PM RE: Small Solver Program - Thomas Klemm - 02-17-2019, 04:57 PM RE: Small Solver Program - Gamo - 02-18-2019, 03:49 AM RE: Small Solver Program - Thomas Klemm - 02-18-2019, 05:20 AM RE: Small Solver Program - Dieter - 02-18-2019, 07:46 PM RE: Small Solver Program - Thomas Klemm - 02-18-2019, 10:22 PM RE: Small Solver Program - Albert Chan - 02-19-2019, 01:10 AM RE: Small Solver Program - Csaba Tizedes - 02-19-2019, 08:39 AM RE: Small Solver Program - Thomas Klemm - 02-20-2019, 05:31 AM RE: Small Solver Program - Csaba Tizedes - 02-25-2019, 08:39 PM RE: Small Solver Program - Thomas Klemm - 02-20-2019, 07:22 AM RE: Small Solver Program - Thomas Klemm - 02-24-2019, 09:21 AM RE: Small Solver Program - Thomas Klemm - 02-25-2019, 11:00 PM RE: Small Solver Program - Albert Chan - 01-04-2020, 07:49 PM

User(s) browsing this thread: 1 Guest(s)