Solver bug for secondary roots?

Post here to share useful tips and tricks, to ask questions about using your DM42 or to report software-related problems
Post Reply
eulerfan
Posts: 6
Joined: Fri Aug 24, 2018 10:19 pm

Solver bug for secondary roots?

Post by eulerfan » Wed Aug 29, 2018 12:44 am

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).

grsbanks
Posts: 709
Joined: Tue Apr 25, 2017 9:23 am
Location: Preston, Lancs, UK

Re: Solver bug for secondary roots?

Post by grsbanks » Wed Aug 29, 2018 4:57 am

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.
Not SwissMicros staff, just an enthusiast.

eulerfan
Posts: 6
Joined: Fri Aug 24, 2018 10:19 pm

Re: Solver bug for secondary roots?

Post by eulerfan » Wed Aug 29, 2018 10:29 am

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.

Post Reply