Post Reply 
sine of an angle in degree mode
01-29-2018, 06:58 AM
Post: #21
RE: sine of an angle in degree mode
Hello,

Well, since you guys want "precise" info, I had a look at the source code.

grad are converted to deg if needed.

The calc has a flag (fix) which tells it if the result is a remarquable value (0° in all modes, n*30° or tan(45) in deg/grad).

This flag is also put on entry if 0 is detected.

The calc then does a modulo 45 or pi/2, depending, using 31 digits.
It then applies cordic, which yeild a x and y pair on the axis of the angle.
tan=y/x cos/sin are calculated from tan using 1/sqrt(1+tan()²).

Then, if the flag was set, the result is rounded.
and this is it.

Cheers,
Cyrille

Although I work for the HP calculator group, the views and opinions I post here are my own. I do not speak for HP.
Find all posts by this user
Quote this message in a reply
01-29-2018, 08:26 AM (This post was last modified: 01-29-2018 08:26 AM by rflesch.)
Post: #22
RE: sine of an angle in degree mode
(01-29-2018 06:58 AM)cyrille de brébisson Wrote:  Hello,

Well, since you guys want "precise" info, I had a look at the source code.

(...)

Then, if the flag was set, the result is rounded.
and this is it.

Cheers,
Cyrille

Tank you!!! From my point of view (I'm the OP) this is settled now.
Find all posts by this user
Quote this message in a reply
01-29-2018, 12:31 PM
Post: #23
RE: sine of an angle in degree mode
(01-26-2018 10:23 AM)Mike (Stgt) Wrote:  For the inquisitive here a compare of the HP-15C firware trace from DEG 360 SIN and 720 SIN.
Code:
  SUPERC - CMS FILE/LINE/WORD/BYTE/SFOR COMPARE UTILITY - V3.01  (11/22/95)    01/26/18    11.05    PAGE     1
NEW:  SIN      720      C                                    OLD:  SIN      360      C
 
                     LISTING OUTPUT SECTION (LINE COMPARE)
 
ID          NEW FILE LINES                                   ID           OLD FILE LINES                                N-LN# O-LN#
   ----+----1----+----2----+----3---                            ----+----1----+----2----+----3---
   0648: 1EE C=C+C  ALL                                    !    0648: 1EE C=C+C  ALL                                    00241 00241
   0649: 1EE C=C+C  ALL                                    !    0649: 1EE C=C+C  ALL                                    00242 00242
   064A: 3CE CSL    ALL                                    !    064A: 3CE CSL    ALL                                    00243 00243
   064B: 0EE B<>C   ALL                                    !    064B: 0EE B<>C   ALL                                    00244 00244
   064C: 2FA ?C#0   M                                      !    064C: 2FA ?C#0   M                                      00245 00245
   064D: 09F JC     +13 0660                               !    064D: 09F JC     +13 0660                               00246 00246
   064E: 18E A=A-B  ALL                                    !    064E: 18E A=A-B  ALL                                    00247 00247
   064F: 3FB JNC    -01 064E                               !    064F: 3FB JNC    -01 064E                               00248 00248
   064E: 18E A=A-B  ALL                                    !    064E: 18E A=A-B  ALL                                    00249 00249
   064F: 3FB JNC    -01 064E                               !    064F: 3FB JNC    -01 064E                               00250 00250
I -064E: 18E A=A-B  ALL                                    !                                                            00251
I -064F: 3FB JNC    -01 064E                               !                                                            00252
   0650: 12E A=A+B  ALL                                    !    0650: 12E A=A+B  ALL                                    00253 00251
   0651: 3EE ASL    ALL                                    !    0651: 3EE ASL    ALL                                    00254 00252
   0652: 266 C=C-1  X                                      !    0652: 266 C=C-1  X                                      00255 00253
   0653: 3DB JNC    -05 064E                               !    0653: 3DB JNC    -05 064E                               00256 00254
   0654: 04E C=0    ALL                                    !    0654: 04E C=0    ALL                                    00257 00255
   0655: 0EE B<>C   ALL                                    !    0655: 0EE B<>C   ALL                                    00258 00256
   0656: 198 C=M                                           !    0656: 198 C=M                                           00259 00257
   0657: 1EE C=C+C  ALL                                    !    0657: 1EE C=C+C  ALL                                    00260 00258
   0658: 04C ?FS    4                                      !    0658: 04C ?FS    4                                      00261 00259
   0659: 01B JNC    +03 065C                               !    0659: 01B JNC    +03 065C                               00262 00260
*** CHANGE SECTION CUTOFF ******************************
 
  SUPERC - CMS FILE/LINE/WORD/BYTE/SFOR COMPARE UTILITY - V3.01  (11/22/95)    01/26/18    11.05    PAGE     2
NEW:  SIN      720      C                                    OLD:  SIN      360      C
 
                       LINE COMPARE SUMMARY AND STATISTICS
 
    1874 NUMBER OF LINE MATCHES               2  TOTAL CHANGES (PAIRED+NONPAIRED CHNG)
       0 REFORMATTED LINES                    0  PAIRED CHANGES (REFM+PAIRED INS/DEL)
       2 NEW FILE LINE INSERTIONS             2  NON-PAIRED INSERTS
       0 OLD FILE LINE DELETIONS              0  NON-PAIRED DELETES
    1876 NEW FILE LINES PROCESSED
    1874 OLD FILE LINES PROCESSED
 
LISTING-TYPE = CHNG       COMPARE-COLUMNS =    1:33        LONGEST-LINE = 33
PROCESS OPTIONS USED: NARROW
From pushing SIN to display of the result (to be exact: to light sleep) it takes only two more firmware instructions to compute the result for 720 instead of 360.

Ciao.....Mike

Sorry for my ignorance but, what tools have you used to generate such firmware traces?

Thanks & regards.
Find all posts by this user
Quote this message in a reply
01-29-2018, 12:47 PM (This post was last modified: 01-29-2018 12:53 PM by Massimo Gnerucci.)
Post: #24
RE: sine of an angle in degree mode
(01-29-2018 12:31 PM)emece67 Wrote:  
(01-26-2018 10:23 AM)Mike (Stgt) Wrote:  For the inquisitive here a compare of the HP-15C firware trace from DEG 360 SIN and 720 SIN.
Code:
  SUPERC - CMS FILE/LINE/WORD/BYTE/SFOR COMPARE UTILITY - V3.01  (11/22/95)    01/26/18    11.05    PAGE     1

Sorry for my ignorance but, what tools have you used to generate such firmware traces?

Thanks & regards.

I bet it's running on an IBM mainframe running VM/CMS or z/VM. (or an emulation on Hercules...)
Those were the days...

Greetings,
    Massimo

-+×÷ ↔ left is right and right is wrong
Visit this user's website Find all posts by this user
Quote this message in a reply
01-29-2018, 04:23 PM
Post: #25
RE: sine of an angle in degree mode
(01-29-2018 02:41 PM)Mike (Stgt) Wrote:  Short answer: my own tools.
Long answer: do you have time for a looong tale? (negligibly, this question is a citation from Waterhole No. 3, when Foggers asks Cole "How come..?")

...

An interesting tale, & not so looong as expected ;-)

Thanks & regards.
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)