17bii+ solver workaround



#2

The solver in the 17bii+ is different than the solver in the original 17bii. It always solves equations using the iterative solver, never the direct solver. As a result, every equation is evaluated twice (at least). This causes problems if you change the value of an input variable using the L() function. For example, the equation A=L(B:B+1) returns A=1, as expected, but if you RCL B you see that it is 2.

For new equations, you can stay out of trouble if you initialize variables and never update an input variable with the L() function. Older equations, that worked on the original 17bii, may not work on the + if they don't abide by these rules.

The Technical Applications Manual for the 27S and 19B contains a solver equation to determine the prime factors of a number. As written, the equation does not work on the 17bii+, because it updates input variable N at the end of the equation. Experimentation with this equation revealed that it finds every other prime factor of a given number. For example, the prime factors of 510510 are 2, 3, 5, 7, 11, 13, 17. On the 17bii+, the equation finds every other factor: 2, 5, 11, and 17. So I needed to find a way to trick the solver into not evaluating the equation on even numbered iterations.

This was the solution I found that worked. At the beginning of the equation, add the following:

FACT=0xL(B$$:G(B$$)+1)+IF(MOD(G(B$$):2)=1:

at the very end of the equation, add :0)

This essentially only executes the bulk of the equation code during odd iterations, and the correct factors are derived. I used B$$ since it is unlikely to be used in other equations, and it is necessary for B$$ to be 0 or an even number for this workaround to work.


Possibly Related Threads...
Thread Author Replies Views Last Post
  hp-prime solver and variable name fabrice48 22 2,770 12-10-2013, 03:25 AM
Last Post: fabrice48
  Programming workaround for "prepend" HP PRIME Marek Russ 4 701 11-29-2013, 05:46 AM
Last Post: Marek Russ
  Solver issue with HP 17BII - different from 19BII Jeff Kearns 13 1,399 11-28-2013, 02:36 AM
Last Post: Don Shepherd
  HP Prime Triangle solver BruceH 29 2,799 11-28-2013, 12:03 AM
Last Post: Dale Reed
  17BII & 17BII+ Discounted Payback Period Revisited Tom Neudorfl 8 1,134 11-25-2013, 10:28 AM
Last Post: Don Shepherd
  Using units in Numeric Solver Harold A Climer 1 422 10-13-2013, 10:44 AM
Last Post: Tim Wessman
  Does Prime Have a Multiple Equation Solver? Norman Dziedzic 2 448 09-20-2013, 09:43 AM
Last Post: Norman Dziedzic
  A workaround for the inefficient SUBST command peacecalc 3 475 07-03-2013, 05:17 PM
Last Post: Gilles Carpentier
  Just a lazy solver algortihm PGILLET 1 432 06-28-2013, 11:47 PM
Last Post: Namir
  [43s] : How the solver will be implemented Miguel Toro 3 609 03-14-2013, 06:09 PM
Last Post: Walter B

Forum Jump: