The Museum of HP Calculators

HP Forum Archive 15

[ Return to Index | Top of Index ]

Fast and Accurate Trigonometric Functions on the HP-12C
Message #1 Posted by GWB on 22 Apr 2005, 2:55 a.m.

Hello,

I've just written another program for trigs on the HP-12C, that's the third and the last one. It it kind of a "concept" program, which might be better used on the 12CP, for instance.

It gives results like these

degrees sin cos tan 60.0000 0.866025404 0.500000001 1.732050805

in 3.5s, and

arccos(0.5)=60.00000022 in less than 4.5 s.

Regards,

Gerson.

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/articles.cgi?read=487

Edited: 22 Apr 2005, 3:58 p.m.

      
Congrats! (and new HP12Cp serial# label?)
Message #2 Posted by Vieira, Luiz C. (Brazil) on 22 Apr 2005, 7:57 p.m.,
in response to message #1 by GWB

Gerson;

I had a look at the program and felt it somehow complex in terms of handling data. You used both [FV] and [n] registers, even the [g][12÷] function. That was interesting!

I didn't load it yet, but I surely will test it.

BTW, folks, I saw a NIB HP12Cp with a serial # printed in a small, thin silver label instead of having it 'carved' in the plastic case. I took a picture of it:

Anyone knows if HP is now doing this to all calculators?

Cheers.

Luiz (Brazil)

            
Re: Congrats! (and new HP12Cp serial# label?)
Message #3 Posted by John on 22 Apr 2005, 10:00 p.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Yes, I believe they are, starting with the 49g+ a few months ago.

            
Re: Congrats! (and new HP12Cp serial# label?)
Message #4 Posted by GWB on 22 Apr 2005, 10:20 p.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Hello Luiz,

I used [12÷] in line 03 instead of [3] [÷] to save one step. In the first instructions the input angle in degrees is converted to radians and then divided by three. Instead of dividing it by the factor 180/pi and then by 3 it is divide by 45/pi and then by 12, which is equivalent. At line 91 the output angle in radians had to be multiplied by 2 and then by 180/pi to convert it to degrees. As the conversion fact store in R0 is 45/pi, it is multiplied by 8 instead. At line 72, the coefficient of x^9 of the arctan approximation polynomial was 0.079638. I changed it to 0.08 and recalculated the three others coefficients. Doing this caused the maximum absolute error change from 1.09E-8 to 1.23E-8, nothing to worry about. But again I needed two more steps, so I changed .08 to [12÷], that is, .08333333, recalculated the coefficient and came up with an error of 3.38E-8, considered acceptable. Later I decided to use the financial register n to avoid a square root computation and increase speed by .2 or .3 seconds. This had the side effect to save two steps. As the approximation was acceptable, I included the test for zero at line 51 (a good idea! No, Luiz, I don't drink :-), thus avoiding the Error 0 message, at least for the atan routine. Both 12x and 12÷ instructions may be handy, but they don't cause an automatic stack lift, that is why is is at line 76 rather than 77. [n] and [FV] have been used just because I ran out of registers.

Thanks for the congratulation, but as I said, it is just a concept, something to be better implemented on the 12CP (I don't intend to buy one though).

Cheers,

Gerson.

Edited: 23 Apr 2005, 12:14 a.m.

            
Re: Congrats! (and new HP12Cp serial# label?)
Message #5 Posted by EL on 23 Apr 2005, 4:07 p.m.,
in response to message #2 by Vieira, Luiz C. (Brazil)

Luiz,

My first 49g+ had the engraved serial number. However, both replacements have had the sticker. In fact, it seems a bit sloppy. There were little slivers of excess sticker around the case, indicating that whoever was applying them had just cleaned their x-acto blade ;)

Eric

                  
Re: Congrats! (and new HP12Cp serial# label?)
Message #6 Posted by Vieira, Luiz C. (Brazil) on 23 Apr 2005, 5:05 p.m.,
in response to message #5 by EL

Hi, EL;

as you can see, the 'stick' glued to the one in the picture I added is not ligned up with the case. Sign of times? ;-)

Cheers.

Luiz (Brazil)

Edited: 23 Apr 2005, 5:22 p.m.

                        
Re: Congrats! (and new HP12Cp serial# label?)
Message #7 Posted by Arnaud Amiel on 24 Apr 2005, 3:18 a.m.,
in response to message #6 by Vieira, Luiz C. (Brazil)

Quote:
as you can see, the 'stick' glued to the one in the picture I added is not ligned up with the case. Sign of times? ;-)
Most of the classics serial numbers were not ligned up either...

Arnaud

                              
Re: Congrats! (and new HP12Cp serial# label?)
Message #8 Posted by Vieira, Luiz C. (Brazil) on 24 Apr 2005, 2:57 p.m.,
in response to message #7 by Arnaud Amiel

Hi, Arnaud;

you are right, I cannot help noticing the same fact. What bothers me is the fact that I (and maybe many others) expect development and new technology to enhance quality of final products, costs and profit being cut or enhanced as well. We all have seen that this is not true in some aspects, new pseudo-HP calculators are some examples. I mentioned the sticker not ligned up based on some expectations... of mine.

Best regards.

Luiz (Brazil)


[ Return to Index | Top of Index ]

Go back to the main exhibit hall