The Museum of HP Calculators

HP Forum Archive 20

[ Return to Index | Top of Index ]

CORDIC in Degrees vs. Radians
Message #1 Posted by Mike Fikes on 23 July 2011, 12:27 p.m.

On a Voyager (15C) in degrees mode, cos 60 = 0.5. The same is true for a Pioneer (20S).

If, instead, this is performed in radians mode, first converting 60 degrees to radians using ->RAD, this results in

15C: 0.5000000002
20S: 0.499999999997

My question: How do these machines produce exactly the right answer when in degrees mode?

Is CORDIC internally performed always either degrees or radians (with the necessary conversions of input being done first)? Or is it internally performed using the mode that the calculator is set to?

      
Re: CORDIC in Degrees vs. Radians
Message #2 Posted by Gerson W. Barbosa on 23 July 2011, 1:36 p.m.,
in response to message #1 by Mike Fikes

HP calculators round the answer to the number of digits of the display. Thus, on the 32SII 60 -> RAD returns 1.04719755120, a worst approximation to pi/3 than 1.04719755119660 which would be used internally when in DEG mode. In RAD mode the internal results are

   cos(1.04719755120 rad) = 0.499999999997054
cos(1.04719755119660 rad) = 0.499999999999998
or
0.499999999997
0.500000000000
respectively, when rounded to 12 digits.

Gerson.

            
Re: CORDIC in Degrees vs. Radians
Message #3 Posted by Mike Fikes on 23 July 2011, 2:06 p.m.,
in response to message #2 by Gerson W. Barbosa

Is the following accurate?

When in degrees mode, the 15C internally converts the input to a radians representation that employs guard digits (in other words, a representation with more than 10 digits), which is then passed to the CORDIC routine. The (greater than 10-digit) output of CORDIC is then rounded to the 10 digits of the display.

                  
Re: CORDIC in Degrees vs. Radians
Message #4 Posted by Gerson W. Barbosa on 23 July 2011, 2:35 p.m.,
in response to message #3 by Mike Fikes

Yes, I think things occur like that. These past threads might be of interest to you:

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv016.cgi?read=103151

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv016.cgi?read=103356

http://www.hpmuseum.org/cgi-sys/cgiwrap/hpmuseum/archv014.cgi?read=62301

Edited: 23 July 2011, 2:37 p.m.

                        
Re: CORDIC in Degrees vs. Radians
Message #5 Posted by Mike Fikes on 23 July 2011, 4:31 p.m.,
in response to message #4 by Gerson W. Barbosa

Yep, post #16 in the first thread you referenced indicated the following with respect to trig in degree mode on the 15C:

Quote:
For example, the HP41, HP15, etc., are known to do internal arithmetic with 13 digits although final results are only 10 digits. That is, a 13 digit approximation to PI/180 is used to convert the argument from degrees to radians.

Thanks :)

      
Re: CORDIC in Degrees vs. Radians
Message #6 Posted by Eric Smith on 24 July 2011, 4:49 a.m.,
in response to message #1 by Mike Fikes

It is possible to do CORDIC operations in degrees, grads, or other angular units, but generally HP calculators don't do that. They internally convert to radians. As Gerson has noted, they use extra digits in internal calculations to get a more accurate result than if you did the conversion from the keyboard.

I say "generally" because I have no idea how models like the 6s, 8s, 9s, 9g, and 30s work internally.


[ Return to Index | Top of Index ]

Go back to the main exhibit hall