different Woodstocks - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: different Woodstocks (/thread-98837.html) |
different Woodstocks - Bram - 09-01-2006 Once upon a time I noticed a very small error in a calculation, performed on my HP-21.
Re: different Woodstocks - Thomas Okken - 09-01-2006 There is an article The New Accuracy: Making 23=8 that discusses this. (It's in the November 1976 HP Journal, and reproduced on the HP Museum CD/DVD.) That HP Journal issue focuses on the HP-67, 97, and 91, and the aforementioned article explains that the improved accuracy of the power function was achieved by performing all three steps (ln, *, exp) at 13 digit precision, instead of rounding all intermediary results to 10 digits like their predecessors. The older calcs basically did the same as executing those steps on the keyboard; the reason for this was to conserve ROM space. With the increase in complexity of machines like the 67, 97, 91, and also the 19C/29C, HP needed to increase ROM space to a point where these precision/space tradeoffs no longer made sense. (Note that the simpler HP-25 still has the less-accurate implementation.)
- Thomas
Re: different Woodstocks - Valentin Albillo - 09-01-2006 Hi, Bram:
Bram posted:
2 ENTER ENTER ENTER * * * * * * * * * * * * * * * * * * * * * * * * * * * * *"
Your sequence is 33 keystrokes long. You can do much better like this: 2 ENTER *which promptly returns the exact answer, 1073741824, in just 14 keystrokes. That's a full 19 (58%) less keystrokes. If the HP-21 had an x2 function in a primary key, the savings would be truly dramatic. Best regards from V. Re: different Woodstocks - Frank Boehm (Germany) - 09-01-2006 I guess typing in the correct result does it in even less keystrokes :)
Re: different Woodstocks - Dave Shaffer (Arizona) - 09-01-2006 Well, not everybody knows 2^30, but I bet almost everybody here knows 2^10 = 1024. So, use 1024 enter enter * *
for a grand total of 8 keystrokes.
Re: different Woodstocks - Kiyoshi Akima - 09-02-2006 While we're counting keystrokes... It can be done in as few as five keystrokes on some machines. I don't think it takes more than seven on any HP RPN or RPL machine. On those which do the power right AND has the yx as a primary key, 2 ENTER 30 yx works, of course. On some machines a shift key makes it six keystrokes. On those which do not do the power right but has the x2 as a primary, it can be done in six: 32768 x2. A shift may make it seven. On any RPN machine except the 80, 32768 ENTER * does it in seven. On the 80, merely replace the ENTER with SAVE. And then there are the "cheats", of course. Under certain conditions, something like RCL 0 or GSB A may work. Or possibly even just a single keystroke, like x<>y. I'm not sure about the algebraics like the 10 and 01, but I think 32768 * = would work.
Can anyone find a better solution, or a machine that requires more than seven keystrokes?
Re: different Woodstocks - Bram - 09-02-2006 Quote:
Well, it depends ...
Very nice, but .. - Valentin Albillo - 09-02-2006 Very nice, but as I see the question, you've got to start with a 2, mandatorily, not 1024, or 32768, or 65536, or 33554432, or any other "magic number" that the oh-so-clever user happens to know beforehand it's an exact power of 2. That being so, see in how many keystrokes you can do the feat. Else, you're plainly cheating by injecting into the computation magic numbers taken out of thin air.
Best regards from V.
Re: Very nice, but .. - Kiyoshi Akima - 09-05-2006 From the previous responses, two out of three that discussed keystrokes didn't start with 2 (they both start with 1). That led me to think that the goal was to get the correct value of 2^30 into X. Whether it starts with 1, or 2, or pi, I took to be irrelevant. But I have been known to be wrong. As another post points out, ease of keystrokes is not always the same thing as the minimum number of keystrokes. There used to be a concept of the half-keystroke (hitting the same key twice is easier than hitting two different keys).
If I had to compute 2^30 ONCE on the HP21, I'd probably fill the stack with 2s and hit * 29 times. If I had to compute more than about three different powers, I'd probably switch to a 25 and write a short iterative program that simply did a series of doublings.
|