If the HP15C has more memory... Message #8 Posted by Vieira, Luiz C. (Brazil) on 8 June 2003, 4:01 p.m., in response to message #7 by Patrick
... we'd be claiming for more! Human beings are not easy to satisfy as for their (our) needs...
About the HP15C memory: if we look at the 2 × 2n growing (64 = 23 × 23), than the next step would be a 16 × 16 maximum matrix, that would lead us to 256 registers and 1792 bytes of memory, what is equivalent to the HP41's Quad Memory Module. Cool!
Back to business: thanks for your comments. I try to keep low-profile, stack-mostly solutions, but there is always a limit. When you have fixed-partition memory (HP65, HP55, HP67/97, HP25, HP33... any others?), using registers is up to you, but when movable partition is the case (HP34, HP38, all Voyagers, Coconuts, HP42... others?) then using numbered registers mean at least nine extra bytes. Yes, nine: the seven bytes used by the register itself and both STO / RCL to access it's contents. A lot of people forget about that: what is a register good for if you do not store something there for later retrieval? The best case is when you manually store something in a register before running a program, so you'll use only one RCL, meaning eight bytes. I thought an article about Stack Manipulation × Storage Registers would be a good reading, but I didn't got through it so far.
In my first version, I considered any matrix descriptor in X-register, so I could not use the ÷
[f]LSTx trick: X- and Y-register contents might be different, and I mentioned I used column numbers as reference, remember? As it was not an orthodox maneuver, I thought considering a square-matrix in X-register should not be accomplished. In the second version, this is mandatory to reduce program steps. Also, I could use the remaining "1" in LASTx (step #7):
001 f LBL any
002 STO RESULT
003 STO I
004 0
005 ×
006 1
007 +
008 RCL DIM I
009 g LSTx
010 x<>y
011 f DIM I
012 +
013 x<>y
014 f DIM I
015 g R^
016 f MATRIX 4
017 Rv
018 ENTER
019 f DIM I
provided matrix in X-register is a square matrix. Anyway, final listing has the same number of steps (I did not check for bytes).
As you mentioned, let's wait for Valentin's final words. I'm curious a lot to see his version.
You know, I tell my students that the best thing in a math problem is the fact that each math problem, in most of the cases, accepts many, many solutions. There are rare math problems with only one solution and others with no solution. Then we can use a human solution that, in most cases, is a simple behavioral change so the original math problem no longer exists and the new one has a solution, now.
Best regards.
Luiz C. Vieira - Brazil
|