Page 1 of 1

Solver bug for secondary roots?

Posted: Wed Aug 29, 2018 2:44 am
by eulerfan
While waiting for my DM42 to arrive (it's a long way from Switzerland to Canada!) I've been refreshing my memory of the HP-42S by playing with the Free42 program on my Linux box.

I've tried using the Solver on the following program for (x - 7)(x - 11) = 0 :

Code: Select all

00 { 25-byte Prgm }
01 LBL "QUAD"
02 MVAR "X"
03 RCL "X"
04 ENTER
05 7
06 -
07 X<>Y
08 11
09 -
10 x
11 .END.
This should have roots 7 and 11. My problem is getting the second root x=11 by entering initial estimates of 9 and 20, using the procedure described in the HP-42S Owner's Manual, Chapter 12, section "Choosing Initial Guesses". I entered the following keys:

(Shift) (Solve) (Soft key for QUAD)

OK, now I'm in the solver for program QUAD. More keys:

(9) (Soft key for X)

which should store the low estimate for X. Now to store the high estimate:

(2) (0) (Soft key for X)

To solve for X:

(Soft key for X)

I get answer "X=9.0000" which is clearly not correct (should be 11). Did I do something wrong?

I'm using Free42 2.0.21 on Linux amd64 (Debian 9.4.0).

Re: Solver bug for secondary roots?

Posted: Wed Aug 29, 2018 6:57 am
by grsbanks
The "ENTER" in line 04 disables stack lift so the 7 that follows it REPLACES the new copy of X instead of pushing it up the stack.

Lose it and replace the "X<>Y" currently in line 07 with another RCL "X" and you should be OK.

Alternatively, replace the ENTER with RCL ST X and leave the X<>Y further down.

Re: Solver bug for secondary roots?

Posted: Wed Aug 29, 2018 12:29 pm
by eulerfan
Thanks for the quick answer.

You're right, ENTER does disable stack lift, even in a running program. My old, worn out HP-15C does this too. I never noticed it in all the years I've been using HP calculators. Strange.

If I do as you say (remove the ENTER and replace the X<>Y with RCL "X"), the Solver finds the second root x=11, which is correct.