The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

Some Vintage HP15Cs Faster than Others?
Message #1 Posted by Bruce Zastera on 25 Jan 2012, 11:10 p.m.

Someone mentioned that their HP15C circa 1985 took 30 seconds to compute 69 factorial. My vintage HP15C computes that almost instantaneously. I purchased mine in 1990, and going by the serial number, it was built in 1986 (first 2 digits are 26 which indicate the number of years since 1960). I'm considering purchasing one from 1983 or 1984, so if those are significantly slower, I'd really like to know that before I buy it.

I'd appreciate it if someone with an older model can tell me how fast their calculators perform the following 2 functions:

69 f x!

100 ENTER 50 g Cx,y

The second of those takes much longer than the first - about 10 seconds on mine.

Please post the first 4 digits of the serial number with any results. I'm only talking about the vintage models here. I understand that the new limited editions are much faster.

Thanks.

      
Re: Some Vintage HP15Cs Faster than Others?
Message #2 Posted by uhmgawa on 26 Jan 2012, 1:04 a.m.,
in response to message #1 by Bruce Zastera

Quote:
Someone mentioned that their HP15C circa 1985 took 30 seconds to compute 69 factorial.

They may have just been mistaken. The clock frequency hasn't seen a manufacturing change and I've never come across more that one version of hp released firmware for the 15c.

Quote:
I'd appreciate it if someone with an older model can tell me how fast their calculators perform the following 2 functions:

69 f x!

100 ENTER 50 g Cx,y

The second of those takes much longer than the first - about 10 seconds on mine.

Please post the first 4 digits of the serial number with any results. I'm only talking about the vintage models here. I understand that the new limited editions are much faster.


~10s for x! and 0.5s for Cx,y on a 24xx and 25xx 15c.

            
Re: Some Vintage HP15Cs Faster than Others?
Message #3 Posted by uhmgawa on 4 Feb 2012, 12:06 a.m.,
in response to message #2 by uhmgawa

Quote:
..I've never come across more that one version of hp released firmware for the 15c.

But I have come across an apparent oddity which may relate to a firmware version change.

I had loan of a 10c for the purpose of testing KEMU with that model's firmware. When the 10c was running I would get jibberish on the display but the system test would succeed and render all available segments. It took me a while to realize the display mapping was different than every other voyager I've encountered.

This was a 22xx serial number 10c which has the early satellite PCB containing the NUT and display controller. However I have 23xx voyagers with the same satellite PCB configuration, and firmware captured from them treats the display mapping identical to the later single PCB voyagers. So I'm unsure whether the display mapping difference here is a function of the 10c, s/n <= 22xx voyagers, or possibly both.

The sequence of segments enabled during the keypad test for both cases differs although the data written to the display registers is identical. This makes for a simple check to determine what units have this configuration, just by the first set of segments enabled when the keypad ON + <div> test is selected. The corresponding sequences are here although the first display rendered in the sequence is all which is needed. I've only ever encountered the "A" version up until the "B" version generated by this 10c.

Would someone with a 22xx serial number voyager other than a 10c mind telling me what sequence is followed? Also if someone has access to a 22xx < s/n 10c I'd be interested to know how that behaves as well.

Thanks!

                  
Re: Some Vintage HP15Cs Faster than Others?
Message #4 Posted by Katie Wasserman on 4 Feb 2012, 11:33 a.m.,
in response to message #3 by uhmgawa

Interesting find and nice display pattern map!

My collection verifies what you said:

10C 22xx --> b
10C 23xx --> b

11C 20xx --> a 11C 26xx --> a 12C 25xx --> a 12C 33xx --> a 15C 25xx --> a 16C 22xx --> a 16C 25xx --> a

Edited: 4 Feb 2012, 11:34 a.m.

                        
Re: Some Vintage HP15Cs Faster than Others?
Message #5 Posted by uhmgawa on 4 Feb 2012, 1:48 p.m.,
in response to message #4 by Katie Wasserman

Quote:
Interesting find and nice display pattern map!

My collection verifies what you said:

10C 22xx --> b
10C 23xx --> b

11C 20xx --> a


Hmm.. given the above this may be a quirk unique to the 10c.

I have a 2301A 16c and several 23xxA 12c units which all possess the 'a' behaviour. I suppose the only missing data point would be a 24xx 10c, but I wouldn't expect a surprise there. AFAIK that was the last production year for the 10c.

It looks to be a layout change for unknown reasons on the display flex pcb. It is possible the R2D2 in the 10c has a modified pinout which admittedly makes little sense. The ROM image is only 4K words vs. 6K for other voyager models but I haven't tried to drive the bus to determine whether it appears the upper 2K is unused or simply not present. Nothing above 4K is accessed when the image is executing in KEMU and the self test checksum only addresses that range. The device code is 1LF7-0301 which I've never encountered before, however I'd expect an actual silicon change outside of the rom mask to be unlikely.

Unknown at this point. If I ever manage to add a 10c to my own collection I'll trace out the display pcb when I run out of things to do. ;)

Thanks!

[edit: fix formatting botch]

Edited: 4 Feb 2012, 4:14 p.m.

      
Re: Some Vintage HP15Cs Faster than Others?
Message #6 Posted by Peter Murphy (Livermore) on 26 Jan 2012, 1:35 a.m.,
in response to message #1 by Bruce Zastera

69! is quick.

100C50 takes 11.3 s on my 24xxA and 11.6 s on my 27xxA.

      
Re: Some Vintage HP15Cs Faster than Others?
Message #7 Posted by Gerson W. Barbosa on 26 Jan 2012, 1:55 a.m.,
in response to message #1 by Bruce Zastera

Quote:
Please post the first 4 digits of the serial number with any results.

This is irrelevant. Any differences you may notice are due to modifications done by some users, they are not related to the serial numbers. Please take a look at the following past threads:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv015.cgi?read=77430

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv019.cgi?read=157905 (professionally done mod)

Regards,

Gerson.

-------------------

Since you've asked:

69 f x! -> about 0.8 seconds

100 ENTER 50 g Cx,y -> 11.4 seconds

69.5 CHS f x! -> 13.5 seconds.

(2343B75099, no mod)

Edited: 26 Jan 2012, 2:19 a.m.

      
Re: Some Vintage HP15Cs Faster than Others?
Message #8 Posted by Dieter on 26 Jan 2012, 7:18 a.m.,
in response to message #1 by Bruce Zastera

Bruce wrote:

Quote:
Someone mentioned that their HP15C circa 1985 took 30 seconds to compute 69 factorial.
I think we can safely assume that no 15C ever (and no other HP I can think of) would require half a minute to compute 69!. Even on my 34C (about the same speed, maybe a bit slower) this is done within a second. Half a minute might be okay for a user-written program. Maybe this is what the timing refers to.
Quote:
My vintage HP15C computes that almost instantaneously.
So should any other standard 15C.
Quote:
I'd appreciate it if someone with an older model can tell me how fast their calculators perform the following 2 functions:   69 f x!   100 ENTER 50 g Cx,y   The second of those takes much longer than the first - about 10 seconds on mine.
These are two typical results.

Anyway, I wonder why the 15C took that long for the Cx,y function which is essentially a loop with 50 multiplications and divisions. The current 35s does this within a second, and even a hand-written program in user code does it in just 5 seconds. Yes, the 35s is much faster faster than the 15C (ten, maybe twenty times), but shouldn't a 15C-routine in machine code run at least as fast as a 35s-program in user code?!

Dieter

Edited: 26 Jan 2012, 7:20 a.m.

            
Re: Some Vintage HP15Cs Faster than Others?
Message #9 Posted by Marcus von Cube, Germany on 26 Jan 2012, 8:52 a.m.,
in response to message #8 by Dieter

Dieter are you sure the 15C uses multiplications for Cxy? Another approach could be using lnGamma.

                  
Re: Some Vintage HP15Cs Faster than Others?
Message #10 Posted by Dieter on 26 Jan 2012, 3:36 p.m.,
in response to message #9 by Marcus von Cube, Germany

Of course I'm not sure of anything as far as the internal programming of the 15C is concerned. But I don't think that a lngamma approach is used here. First, because in this case that function probably would have been made available to the user. And second, simply think of the time three lngammas would require here... #-)

Dieter

                        
Re: Some Vintage HP15Cs Faster than Others?
Message #11 Posted by Bruce Zastera on 26 Jan 2012, 5:33 p.m.,
in response to message #10 by Dieter

Quote:
Of course I'm not sure of anything as far as the internal programming of the 15C is concerned. But I don't think that a lngamma approach is used here. First, because in this case that function probably would have been made available to the user.

The x! key appears to return gamma(x+1). For example, -0.5! returns gamma(0.5) = sqrt(pi).

                              
Re: Some Vintage HP15Cs Faster than Others?
Message #12 Posted by Dieter on 26 Jan 2012, 5:46 p.m.,
in response to message #11 by Bruce Zastera

Quote:
The x! key appears to return gamma(x+1). For example, -0.5! returns gamma(0.5) = sqrt(pi).
Yes, this is documented in the manual, and it was already available on the good old 34C from 1979.

However, obviously two different algorithms are used for the factorial and the gamma function. Try 10! and the result appears immediately, as with other non-negative integers. Then try 10.001! and the calculator has to switch to "gamma mode" where the result requires a few seconds of computation time.

Dieter

            
Re: Some Vintage HP15Cs Faster than Others?
Message #13 Posted by Bruce Zastera on 26 Jan 2012, 12:33 p.m.,
in response to message #8 by Dieter

Quote:
Anyway, I wonder why the 15C took that long for the Cx,y function which is essentially a loop with 50 multiplications and divisions. The current 35s does this within a second, and even a hand-written program in user code does it in just 5 seconds. Yes, the 35s is much faster faster than the 15C (ten, maybe twenty times), but shouldn't a 15C-routine in machine code run at least as fast as a 35s-program in user code?!

I'm guessing that it takes precautions against overflow such as adding logs. Something like that is required for larger combinatorics.

                  
Re: Some Vintage HP15Cs Faster than Others?
Message #14 Posted by Dieter on 26 Jan 2012, 3:34 p.m.,
in response to message #13 by Bruce Zastera

I don't think that the 15C uses logs for the C(y,x) function. The usual straightforward implementation of this function will not cause an overflow either - at long as the result doesn't overflow as well.

Example for C(400, 108) = 9,432 E+99:

C(400, 108)  =  400 / 108 * 399 / 107 * 398 / 106 * ... * 294 / 2 * 293 / 1
Before the last multiplication the value is less than the final result, which is then obtained by the multiplication with 293. In other words: there is no "intermediate overflow". As long as the result is within the limits, the algorithm will not cause an overflow either. At least that's what it looks to me. ;-)

Dieter

                        
Re: Some Vintage HP15Cs Faster than Others?
Message #15 Posted by Bruce Zastera on 26 Jan 2012, 4:56 p.m.,
in response to message #14 by Dieter

Quote:
I don't think that the 15C uses logs for the C(y,x) function. The usual straightforward implementation of this function will not cause an overflow either - at long as the result doesn't overflow as well.

Example for C(400, 108) = 9,432 E+99:

C(400, 108)  =  400 / 108 * 399 / 107 * 398 / 106 * ... * 294 / 2 * 293 / 1
Before the last multiplication the value is less than the final result, which is then obtained by the multiplication with 293. In other words: there is no "intermediate overflow". As long as the result is within the limits, the algorithm will not cause an overflow either. At least that's what it looks to me. ;-)

You're right, I was thinking of evaluating the binomial distribution, where the C(y,x) terms can overflow even though the binomial terms do not since the large C(y,x) terms get multiplied by very small values. Excel had a problem with this a few years ago, and they implemented an algorithm to fix it. That can also be fixed by summing logs. Of course the HP15C doesn't have a key for the binomial distribution.

                              
Re: Some Vintage HP15Cs Faster than Others?
Message #16 Posted by Dieter on 26 Jan 2012, 5:36 p.m.,
in response to message #15 by Bruce Zastera

Regarding statistical functions I don't think Excel has problems. For me it looks more like Excel is the problem. ;-)

Just as C(y,x), also the binomial pdf can be evaluated with minimal overflow risk. For instance this way (just the basic idea):

function binpdf(x, n, p)
  q = 1-p
  poverq = p/q
  pdf = q^n
  for k = 1 to x
      pdf = pdf * (n - k + 1) / k * poverq
  next k
  binpdf = pdf
end function
The major risk here is an underflow during the calculation of q^n. ;-)

Dieter

                                    
Re: Some Vintage HP15Cs Faster than Others?
Message #17 Posted by Bruce Zastera on 26 Jan 2012, 6:04 p.m.,
in response to message #16 by Dieter

Quote:
Regarding statistical functions I don't think Excel has problems. For me it looks more like Excel is the problem. ;-)

Just as C(y,x), also the binomial pdf can be evaluated with minimal overflow risk. For instance this way (just the basic idea):

function binpdf(x, n, p)
  q = 1-p
  poverq = p/q
  pdf = q^n
  for k = 1 to x
      pdf = pdf * (n - k + 1) / k * poverq
  next k
  binpdf = pdf
end function
The major risk here is an underflow during the calculation of q^n. ;-)

Here is a link about Microsoft's fix (near the bottom).


[ Return to Index | Top of Index ]

Go back to the main exhibit hall