MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)     100  HISTORY	; Detailed Current Edit History

   (3)     100  DECLARATIONS	-	 Declarative Part of Module

   (4)     300  COEFFICIENT TABLES	-	Series Coefficients

   (10)    100  MTH$COS	-	Standard Single Precision osine

   (11)    100  MTH$COS_R4  -	Special cosine routine

   (11)    400  SIN/COSINE  - Calculate SIN/COS

   (23)    100  MTH$SIN	-	Standard Single Precision Sine

   (24)    100  MTH$SIN_R4  -	Special Sine JSB-Routine

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page   1

1-10                                                                                                                             (1)



                                     0000   100 	.TITLE	MTH$SINCOS 	; Floating Point Sine and Cosine Functions

                                     0000   200 	.IDENT /1-10/		; File:	MTHSINCOS.MAR

                                     0000   300 ;

                                     0000   400 ; Copyright (C) 1978

                                     0000   500 ; Digital Equipment Corporation, Maynard, Massachusetts 01754

                                     0000   600 ;

                                     0000   700 ; This software is furnished under a license for use only on a single

                                     0000   800 ; computer  system  and  may be copied only with the inclusion of the

                                     0000   900 ; above copyright notice. This software, or any other copies thereof,

                                     0000  1000 ; may not be provided or otherwise made available to any other person

                                     0000  1100 ; except for use on such system and to one who agree to these license 

                                     0000  1200 ; terms.  Title to  and  ownership of the software shall at all times 

                                     0000  1300 ; remain in DEC.

                                     0000  1400 ;

                                     0000  1500 ; The information in the software is subject to change without notice

                                     0000  1600 ; and should  not  be construed  as a commitment by Digital Equipment 

                                     0000  1700 ; Corporation.

                                     0000  1800 ;

                                     0000  1900 ; DEC assumes  no  responsibility  for the use or  reliability of its

                                     0000  2000 ; software on equipment which is not supplied by DEC.

                                     0000  2100 ;

                                     0000  2200 ;

                                     0000  2300 ; FACILITY:	MATH LIBRARY

                                     0000  2400 ;++

                                     0000  2500 ; ABSTRACT:

                                     0000  2600 ;

                                     0000  2700 ; MTH$SIN  and  MTH$COS are functions which return the floating point

                                     0000  2800 ; sine or cosine value of their single precision floating point argu-

                                     0000  2900 ; ment (radians). The call is standard call-by-reference.

                                     0000  3000 ; MTH$SIN_R4  and  MTH$COS_R4 are special routines which are the same

                                     0000  3100 ; as MTH$SIN  and  MTH$COS  except  a faster non-standard JSB call is

                                     0000  3200 ; used with the argument in R0 and no registers are saved.

                                     0000  3300 ;

                                     0000  3400 ;--

                                     0000  3500 ;

                                     0000  3600 ; VERSION:	1

                                     0000  3700 ;

                                     0000  3800 ; HISTORY:

                                     0000  3900 ; AUTHOR:

                                     0000  4000 ;	MARY PAYNE & JUD LEONARD, 25-MAY-78:	Version 0

                                     0000  4100 ;

                                     0000  4200 ; MODIFIED BY:

                                     0000  4300 ;

                                     0000  4400 ; 1-1	Tryggve Fossum, 28-May-78

                                     0000  4500 ;

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page   2

1-10            HISTORY ; Detailed Current Edit History                                                                          (2)



                                     0000   100 	.SBTTL	HISTORY	; Detailed Current Edit History

                                     0000   200 

                                     0000   300 

                                     0000   400 ; ALGORITHMIC DIFFERENCES FROM FP-11C ROUTINE:

                                     0000   500 ;	1. Uses POLYF, so more accuracy.

                                     0000   600 ;	2. Checks for 1-2**-14 before polynomial instead of checking for

                                     0000   700 ;		greater than 1.0 afterwards.

                                     0000   800 ;	3. Signals complete loss of significance.

                                     0000   900 ;

                                     0000  1000 ; Edit History for Version 1 of MTH$SINCOS 

                                     0000  1100 ;

                                     0000  1200 ;

                                     0000  1300 ; 1-2  Add JSB entry points, MTH$COS_R4 and MTH$SIN_R4. Tryggve, JUN-12-78

                                     0000  1400 ; 1-3  Change routines so as not to use R5 and R6. Tryggve, Jun-15-78

                                     0000  1500 ; 1-4  Use EMODD if |x| > 8.  Tryggve, June-26-78

                                     0000  1600 ; 1-5  Do CVTDF after EMODD.  TNH June-26-78

                                     0000  1700 ; 1-6  Check argument range after EMODF.  Tryggve June-27-78

                                     0000  1800 ; 1-7  Do CVTFD before EMODD at CBIG.  TNH 25-July-78

                                     0000  1900 ; 1-8  Fix overflow SIN(2**25*PI), too large answers SIN(2**I*PI)

                                     0000  2000 ;	I=21:24.  TNH 26-July-78

                                     0000  2100 ; 1-9  Same fix for negative arg as in 1-8.  TNH 26-July-78

                                     0000  2200 ; 1-10 Pickup arg with MOVF so reserved op check.  TNH 16-Aug-78

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page   3

1-10            DECLARATIONS -  Declarative Part of Module                                                                       (3)



                                     0000   100 	.SBTTL	DECLARATIONS	-	 Declarative Part of Module

                                     0000   200 

                                     0000   300 ;

                                     0000   400 ; INCLUDE FILES:	OTSPARAMS.MAR

                                     0000   500 ;

                                     0000   600 ; EXTERNAL SYMBOLS:	MTH$JACKET_HDLR

                                     0000   700 ;

                                     0000   800 ; EQUATED SYMBOLS:

                                     0000   900 

                                     0000  1000 ;

                                     0000  1100 ; MACROS:	none

                                     0000  1200 ;

                                     0000  1300 ; PSECT DECLARATIONS:

                                     0000  1400 

                                 00000000  1500 	.PSECT	MTH$CODE	PIC,SHR,LONG,EXE,NOWRT

                                     0000  1600 				; program section for math routines

                                     0000  1700 ;

                                     0000  1800 ; OWN STORAGE:	none

                                     0000  1900 ;

                                     0000  2000 ; CONSTANTS:

                           0000001C  0000  2100 	ACMASK = ^M<R2,R3,R4>

                                     0000  2200 

                           00000005  0000  2300 	BTLEN  = 5	; Length of BIGTAB

                           00000004  0000  2400 	SINLEN = 4	; Length of SNTB

                           00000004  0000  2500 	COSLEN = 4	; Length of CSTB and NGCSTB

                           00000003  0000  2600 	SINLN1 = 3	; Length of SNTB1 and NSNTB1

                           00000003  0000  2700 	COSLN1 = 3	; Length of CSTB1 and BNCSTB1

                           00000004  0000  2800 	SINLN2 = 4	; Length of SNTB

                           00000004  0000  2900 	COSLN2 = 4	; Length of CSTB and NGCSTB

                           F98340A2  0000  3000 	LF_4overPI	= ^XF98340A2

                           F983C0A2  0000  3100 	LF_N4overPI	= ^XF983C0A2

                           F98344A2  0000  3200 	LF_1024overPI	= ^XF98344A2

                           F983C4A2  0000  3300 	LF_N1024overPI	= ^XF983C4A2

                           0FDA4F49  0000  3400 	LF_BIG		= ^X0FDA4F49	; 2**30 * PI

                           0FDACF49  0000  3500 	LF_NBIG		= ^X0FDACF49	; -2**30 * PI

                                     0000  3600 

                                     0000  3700 

                                     0000  3800 

                                     0000  3900 D_1024_oPI:

                           F98344A2  0000  4000 	.LONG	^XF98344A2

                           44156E4E  0004  4100 	.LONG	^X44156E4E

                                     0008  4200 D_N1024_oPI:

                           F983C4A2  0008  4300 	.LONG	^XF983C4A2

                           44156E4E  000C  4400 	.LONG	^X44156E4E

                                     0010  4500 D_4_oPI:

                           F98340A2  0010  4600 	.LONG	^XF98340A2

                           44156E4E  0014  4700 	.LONG	^X44156E4E

                                     0018  4800 D_N4_oPI:

                           F983C0A2  0018  4900 	.LONG	^XF983C0A2

                           44156E4E  001C  5000 	.LONG	^X44156E4E

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page   4

1-10            DECLARATIONS -  Declarative Part of Module                                                                       (4)



                                     0020   100 ;************************************************************

                                     0020   200 

                                     0020   300 	.SBTTL	COEFFICIENT TABLES	-	Series Coefficients

                                     0020   400 

                                     0020   500 

                                     0020   600 ; BIGTAB COEFFICIENTS FOR FHI =	8

                                     0020   700  

                                     0020   800 BIGTAB:

                          FC16 2D6F  0020   900 	.WORD	^O26557,^O176026	;DECIMAL:	0.3410388E-11

                          21EF 31FD  0024  1000 	.WORD	^O30775,^O20757		;DECIMAL:	0.1841782E-08

                          E4A9 B791  0028  1100 	.WORD	^O133621,^O162251	;DECIMAL:	-0.4347956E-05

                          E2DA BB99  002C  1200 	.WORD	^O135631,^O161332	;DECIMAL:	-0.1174058E-02

                          35E8 3E48  0030  1300 	.WORD	^O37110,^O32750		;DECIMAL:	0.4887953E-01

                          0000 4060  0034  1400 	.WORD	^O40140,^O0		;DECIMAL:	0.8750000E+00

                          0000 C060  0038  1500 	.WORD	^O140140,^O0		;DECIMAL:	-0.8750000E+00

                          0000 0000  003C  1600 	.WORD	^O0,^O0			;DECIMAL:	0.0000000E+00

                                     0040  1700   

                                     0040  1800   

                                     0040  1900 ; BIGTAB COEFFICIENTS FOR FHI =	9

                                     0040  2000  

                          D16D 2D6A  0040  2100 	.WORD	^O26552, ^O150555	;DECIMAL:	0.3336965E-11

                          6827 320D  0044  2200 	.WORD	^O31015,^O64047		;DECIMAL:	0.2057740E-08

                          C095 B78E  0048  2300 	.WORD	^O133616,^O140225	;DECIMAL:	-0.4254349E-05

                          EE1B BBAB  004C  2400 	.WORD	^O135653,^O167033	;DECIMAL:	-0.1311723E-02

                          7AF4 3DED  0050  2500 	.WORD	^O36755,^O75364		;DECIMAL:	0.2898929E-01

                          0000 4060  0054  2600 	.WORD	^O40140, ^O0		;DECIMAL:	0.8750000E+00

                          0000 C060  0058  2700 	.WORD	^O140140, ^O0		;DECIMAL:	-0.8750000E+00

                          0000 0000  005C  2800 	.WORD	^O0,^O0			;DECIMAL:	0.0000000E+00

                                     0060  2900   

                                     0060  3000   

                                     0060  3100 ; BIGTAB COEFFICIENTS FOR FHI =  10

                                     0060  3200  

                          15F2 2D65  0060  3300 	.WORD	^O26545,^O12762		;DECIMAL:	0.3255504E-11

                          E821 321B  0064  3400 	.WORD	^O31033,^O164041	;DECIMAL:	0.2268742E-08

                          4476 B78B  0068  3500 	.WORD	^O133613,^O42166	;DECIMAL:	-0.4150493E-05

                          8F54 BBBD  006C  3600 	.WORD	^O135675,^O107524	;DECIMAL:	-0.1446227E-02

                          CBC6 3CE2  0070  3700 	.WORD	^O36342,^O145706	;DECIMAL:	0.6921264E-02

                          0000 4060  0074  3800 	.WORD	^O40140,^O0		;DECIMAL:	0.8750000E+00

                          0000 C060  0078  3900 	.WORD	^O140140,^O0		;DECIMAL:	-0.8750000E+00

                          0000 0000  007C  4000 	.WORD	^O0,^O0			;DECIMAL:	0.0000000E+00

                                     0080  4100   

                                     0080  4200   

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page   5

1-10            COEFFICIENT TABLES - Series Coefficients                                                                         (5)



                                     0080   100 ; BIGTAB COEFFICIENTS FOR FHI =  11

                                     0080   200  

                          CD2F 2D5E  0080   300 	.WORD	^O26536,^O146457	;DECIMAL:	0.3166200E-11

                          07F4 322A  0084   400 	.WORD	^O31052,^O3764		;DECIMAL:	0.2474278E-08

                          7273 B787  0088   500 	.WORD	^O133607,^O71163	;DECIMAL:	-0.4036637E-05

                          BBA5 BBCE  008C   600 	.WORD	^O135716,^O135645	;DECIMAL:	-0.1577248E-02

                          41A3 3E39  0090   700 	.WORD	^O37071,^O40643		;DECIMAL:	0.4522861E-01

                          0000 4050  0094   800 	.WORD	^O40120,^O0		;DECIMAL:	0.8125000E+00

                          0000 C050  0098   900 	.WORD	^O140120,^O0		;DECIMAL:	-0.8125000E+00

                          0000 0000  009C  1000 	.WORD	^O0,	^O0		;DECIMAL:	0.0000000E+00

                                     00A0  1100   

                                     00A0  1200   

                                     00A0  1300 ; BIGTAB COEFFICIENTS FOR FHI =  12

                                     00A0  1400  

                          FB04 2D57  00A0  1500 	.WORD	^O26527,^O175404	;DECIMAL:	0.3069268E-11

                          BEEA 3237  00A4  1600 	.WORD	^O31067,^O137352	;DECIMAL:	0.2673853E-08

                          4CE8 B783  00A8  1700 	.WORD	^O133603,^O46350	;DECIMAL:	-0.3913057E-05

                          6876 BBDF  00AC  1800 	.WORD	^O135737,^O64166	;DECIMAL:	-0.1704468E-02

                          6629 3D9B  00B0  1900 	.WORD	^O36633,^O63051		;DECIMAL:	0.1896961E-01

                          0000 4050  00B4  2000 	.WORD	^O40120,^O0		;DECIMAL:	0.8125000E+00

                          0000 C050  00B8  2100 	.WORD	^O140120,^O0		;DECIMAL:	-0.8125000E+00

                          0000 0000  00BC  2200 	.WORD	^O0,	^O0		;DECIMAL:	0.0000000E+00

                                     00C0  2300   

                                     00C0  2400   

                                     00C0  2500 ; BIGTAB COEFFICIENTS FOR FHI =  13

                                     00C0  2600  

                          A3A5 2D50  00C0  2700 	.WORD	^O26520,^O121645	;DECIMAL:	0.2964942E-11

                          048E 3245  00C4  2800 	.WORD	^O31105,^O2216		;DECIMAL:	0.2866986E-08

                          ACC6 B77D  00C8  2900 	.WORD	^O133575,^O126306	;DECIMAL:	-0.3780051E-05

                          8B7F BBEF  00CC  3000 	.WORD	^O135757,^O105577	;DECIMAL:	-0.1827583E-02

                          F024 3E59  00D0  3100 	.WORD	^O37131,^O170044	;DECIMAL:	0.5320753E-01

                          0000 4040  00D4  3200 	.WORD	^O40100,^O0		;DECIMAL:	0.7500000E+00

                          0000 C040  00D8  3300 	.WORD	^O140100,^O0		;DECIMAL:	-0.7500000E+00

                          0000 0000  00DC  3400 	.WORD	^O0,	^O0		;DECIMAL:	0.0000000E+00

                                     00E0  3500   

                                     00E0  3600   

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page   6

1-10            COEFFICIENT TABLES - Series Coefficients                                                                         (6)



                                     00E0   100 ; BIGTAB COEFFICIENTS FOR FHI =  14

                                     00E0   200  

                          CB9A 2D48  00E0   300 	.WORD	^O26510,^O145632	;DECIMAL:	0.2853473E-11

                          D0B0 3251  00E4   400 	.WORD	^O31121,^O150260	;DECIMAL:	0.3053213E-08

                          2349 B774  00E8   500 	.WORD	^O133564,^O21511	;DECIMAL:	-0.3637937E-05

                          1ACC BBFF  00EC   600 	.WORD	^O135777,^O15314	;DECIMAL:	-0.1946294E-02

                          806B 3DBC  00F0   700 	.WORD	^O36674,^O100153	;DECIMAL:	0.2301045E-01

                          0000 4040  00F4   800 	.WORD	^O40100,^O0		;DECIMAL:	0.7500000E+00

                          0000 C040  00F8   900 	.WORD	^O140100,^O0		;DECIMAL:	-0.7500000E+00

                          0000 0000  00FC  1000 	.WORD	^O0,	^O0		;DECIMAL:	0.0000000E+00

                                     0100  1100   

                                     0100  1200   

                                     0100  1300 ; BIGTAB COEFFICIENTS FOR FHI =  15

                                     0100  1400 BIGTAB15:

                          77B9 2D40  0100  1500 	.WORD	^O26500,^O73671		;DECIMAL:	0.2735130E-11

                          1B6C 325E  0104  1600 	.WORD	^O31136,^O15554		;DECIMAL:	0.3232084E-08

                          033B B76A  0108  1700 	.WORD	^O133552,^O1473		;DECIMAL:	-0.3487060E-05

                          0662 BC07  010C  1800 	.WORD	^O136007,^O3142		;DECIMAL:	-0.2060317E-02

                          EF91 3E5A  0110  1900 	.WORD	^O37132,^O167621	;DECIMAL:	0.5345112E-01

                          0000 4030  0114  2000 	.WORD	^O40060,^O0		;DECIMAL:	0.6875000E+00

                          0000 C030  0118  2100 	.WORD	^O140060,^O0		;DECIMAL:	-0.6875000E+00

                          0000 0000  011C  2200 	.WORD	^O0,	^O0		;DECIMAL:	0.0000000E+00

                                     0120  2300   

                                     0120  2400   

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page   7

1-10            COEFFICIENT TABLES - Series Coefficients                                                                         (8)



                                     0120   100 

                                     0120   200 ; COEFFICIENTS FOR CSTB1 ARE:

                                     0120   300 CSTB1:	

                          E0F8 3D81  0120   400 	.WORD	^O36601,^O160370	;DECIMAL:	0.1585434E-01

                          E9E6 BF9D  0124   500 	.WORD	^O137635,^O164746	;DECIMAL:	-0.3084251E+00

                          0000 4080  0128   600 	.WORD	^O40200,^O0		;DECIMAL:	0.1000000E+01

                                     012C   700   

                                     012C   800   

                                     012C   900 ; COEFFICIENTS FOR NCSTB1 ARE:

                                     012C  1000 NCSTB1:	

                          E0F8 BD81  012C  1100 	.WORD	^O136601,^O160370	;DECIMAL:	-0.1585434E-01

                          E9E6 3F9D  0130  1200 	.WORD	^O37635,^O164746	;DECIMAL:	0.3084251E+00

                          0000 C080  0134  1300 	.WORD	^O140200,^O0		;DECIMAL:	-0.1000000E+01

                                     0138  1400   

                                     0138  1500   

                                     0138  1600 ; COEFFICIENTS FOR SNTB1 ARE:

                                     0138  1700 SNTB1:	

                          35E3 3C23  0138  1800 	.WORD	^O36043,^O32743		;DECIMAL:	0.2490395E-02

                          5DE7 BEA5  013C  1900 	.WORD	^O137245,^O56747	;DECIMAL:	-0.8074551E-01

                          0FDB 4049  0140  2000 	.WORD	^O40111,^O7733		;DECIMAL:	0.7853982E+00

                                     0144  2100   

                                     0144  2200   

                                     0144  2300 ; COEFFICIENTS FOR NSNTB1 ARE:

                                     0144  2400 NSNTB1:	

                          35E3 BC23  0144  2500 	.WORD	^O136043,^O32743	;DECIMAL:	-0.2490395E-02

                          5DE7 3EA5  0148  2600 	.WORD	^O37245,^O56747		;DECIMAL:	0.8074551E-01

                          0FDB C049  014C  2700 	.WORD	^O140111,^O7733		;DECIMAL:	-0.7853982E+00

                                     0150  2800 

                                     0150  2900 ; COEFFICIENTS FOR SNTB ARE:

                                     0150  3000 SNTB:	

                          CDBE 9D16  0150  3100 	.WORD	^O116426,^O146676	;DECIMAL:	-0.4989675E-21

                          2F62 2823  0154  3200 	.WORD	^O24043,^O27542		;DECIMAL:	0.2264648E-14

                          5DDD B2A5  0158  3300 	.WORD	^O131245,^O56735	;DECIMAL:	-0.4812803E-08

                          FDA9 3A10  015C  3400 	.WORD	^O35020,^O176651	;DECIMAL:	0.1382741E-03

                                     0160  3500  

                                     0160  3600   

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page   8

1-10            COEFFICIENT TABLES - Series Coefficients                                                                         (9)



                                     0160   100 ; COEFFICIENTS FOR SINTB2 ARE:

                                     0160   200 SINTB2:	

                          9C51 BA4E  0160   300 	.WORD	^O135116,^O116121	;DECIMAL:	-0.1970392E-03

                          87A2 3D08  0164   400 	.WORD	^O36410,^O103642	;DECIMAL:	0.8333119E-02

                          AAAA BF2A  0168   500 	.WORD	^O137452,^O125252	;DECIMAL:	-0.1666667E+00

                          0000 0000  016C   600 	.WORD	^O0,^O0			;DECIMAL:	0.0000000E+00

                                     0170   700   

                                     0170   800   

                                     0170   900 ; COEFFICIENTS FOR CSTB ARE:

                                     0170  1000 CSTB:	

                          F97E A2A9  0170  1100 	.WORD	^O121251,^O174576	;DECIMAL:	-0.1151793E-17

                          E062 2D81  0174  1200 	.WORD	^O26601,^O160142	;DECIMAL:	0.3691312E-11

                          E9E6 B79D  0178  1300 	.WORD	^O133635,^O164746	;DECIMAL:	-0.4706194E-05

                          0000 4080  017C  1400 	.WORD	^O40200,^O0		;DECIMAL:	0.1000000E+01

                                     0180  1500  

                                     0180  1600   

                                     0180  1700 ; COEFFICIENTS FOR NGCSTB ARE:

                                     0180  1800 NGCSTB:	

                                     0180  1900 

                          F97E 22A9  0180  2000 	.WORD	^O21251,^O174576	;DECIMAL:	0.1151793E-17

                          E062 AD81  0184  2100 	.WORD	^O126601,^O160142	;DECIMAL:	-0.3691312E-11

                          E9E6 379D  0188  2200 	.WORD	^O33635,^O164746	;DECIMAL:	0.4706194E-05

                          0000 C080  018C  2300 	.WORD	^O140200,^O0		;DECIMAL:	-0.1000000E+01

                                     0190  2400   

                                     0190  2500   

                                     0190  2600 ; COEFFICIENTS FOR CSTB2 ARE:

                                     0190  2700 CSTB2:	

                          6CE6 BBB4  0190  2800 	.WORD	^O135664,^O66346	;DECIMAL:	-0.1376536E-02

                          A8A5 3E2A  0194  2900 	.WORD	^O37052,^O124245	;DECIMAL:	0.4166474E-01

                          FFFD BFFF  0198  3000 	.WORD	^O137777,^O177775	;DECIMAL:	-0.4999999E+00

                          4FBB 247C  019C  3100 	.WORD	^O22174,^O047673	;LOW OF C0 = 1.

                          FFFF 407F  01A0  3200 	.WORD	^O40177,^O177777	;HIGH OF C0 = 1.

                                     01A4  3300 

                                     01A4  3400 

                                     01A4  3500 

                                     01A4  3600 

                                     01A4  3700 ;

                                     01A4  3800 ; INPUT PARAMETERS:

                                     01A4  3900 ;

                           00000004  01A4  4000 	LONG = 4

                           00000004  01A4  4100 	x = 1*LONG		; x is input angle in radians

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page   9

1-10            MTH$COS - Standard Single Precision osine                                                                       (10)



                                     01A4   100 	.SBTTL	MTH$COS	-	Standard Single Precision osine

                               001C' 01A4   200 	.ENTRY	MTH$COS,ACMASK		; Standard call-by-reference entry

            54         04 BC     50  01A6   300 	MOVF	@x(AP),R4		; R4 = argument (test for reserved operand)

                          04     10  01AA   400 	BSB	COSINE			; Subroutine to calculate Cosine

                                 04  01AC   500 	RET

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  10

1-10            MTH$COS_R4  - Special cosine routine                                                                            (11)



                                     01AD   100 	.SBTTL	MTH$COS_R4  -	Special cosine routine

                                     01AD   200 MTH$COS_R4::			; Special JSB entry point

            54            50     50  01AD   300 	MOVF	R0,R4		; R4 = argument (test for reserved op)

                                     01B0   400 	.SBTTL	SIN/COSINE  - Calculate SIN/COS

            54   00008000 8F     CA  01B0   500 COSINE:	BICL	#^X8000,R4	; R4 = |argument|

            54       4000 8F     A3  01B7   550 	SUBW3	#^X4000,R4,R1	;Unbias EXP(|ARG|).

                          51         01BC       

            51       0200 8F     B1  01BD   600 	CMPW	#^X0200,R1	;Compare unbiased EXP with 4

                          34     19  01C2   700 	BLSS	LARGE_COS	;Branch if exp >= 3

         6E 8F   F98344A2 8F     54  01C4   800 	EMODF	#LF_1024overPI, #^O156,R4,R1,R3

            51            54         01CC       

                          53         01CE       

            51       0208 8F     A1  01CF   900 	ADDW3	#^X208,R1,R2	;Check range of integer portion

                          52         01D4       

            52       03F0 8F     B3  01D5  1000 	BITW	#^X3F0,R2	;Mask out the octant bits

                          26     13  01DA  1100 	BEQL	COS_CLOSE_PI

                                     01DC  1200 COSINE1:			; back here from LARGE_COS

            51            18     9C  01DC  1300 	ROTL	#32-8,R1,R2	;Octant bits to R2<2:0>

                          52         01DF       

            52         F8 8F     8A  01E0  1400 	BICB	#^XF8,R2	;Keep just the octant bits.

            00            52     8F  01E4  1500 	CASEB	R2,#0,#7	;8 way branch on octant bits.

                          07         01E7       

                                     01E8  1600 COCTAB:

                               002A' 01E8  1700 	.WORD	COS000-COCTAB	;Refer to octant bit table

                               005E' 01EA  1800 	.WORD	COS001-COCTAB	;  above for actions to be taken

                               008F' 01EC  1900 	.WORD	COS010-COCTAB	;  for the various branches.

                               00C0' 01EE  2000 	.WORD	COS011-COCTAB

                               010E' 01F0  2100 	.WORD	COS100-COCTAB

                               0144' 01F2  2200 	.WORD	COS101-COCTAB

                               0174' 01F4  2300 	.WORD	COS110-COCTAB

                               01A4' 01F6  2400 	.WORD	COS111-COCTAB

                                     01F8  2500 

                                     01F8  2600 LARGE_COS:

            51       0B80 8F     B1  01F8  2700 	CMPW	#^X0B80,R1	;Compare unbiased EXP with 23

                          03     18  01FD  2800 	BGEQ	COS_CLOSE_PI

                          01D4   31  01FF  2900 	BRW	CMORE		;  Branch if < 0, or >/= 23.

                                     0202  3000 

                                     0202  3100 ;Main Flow:	-1 < unbiased EXP(ARG) < 23

                                     0202  3200 ;  No underflow or overflow can occur on EMOD.

                                     0202  3300 ;  EMOD will return 9 to 31 valid fraction bits.

                                     0202  3400 COS_CLOSE_PI:

            52            54     56  0202  3500 	CVTFD	R4, R2

            2A       FDF7 CF     74  0205  3600 	EMODD	D_1024_oPI, #^X2A, R2,R1,R2	;Get ARG*(1024/PI)

            51            52         020A       

                          52         020C       

                                     020D  3700 				;  with number of revs in R1<15:11>

                                     020D  3800 				;  octant bits in R1<10:8>

                                     020D  3900 				;  FHI in R1<7:4>, FMED in R1<3:0>

            53            52     76  020D  4000 	CVTDF	R2,R3		; R3 = rounded FLO*2**8

                          CA     11  0210  4100 	BRB	COSINE1		; branch back to main flow

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  11

1-10            SIN/COSINE  - Calculate SIN/COS                                                                                 (12)



                                     0212   100 COS000:

            51            07     E0  0212   200 	BBS	#7,R1,LK000	;To table look-up for RARG>PI/8

                          10         0215       

            51            51     4C  0216   300 	CVTBF	R1,R1		;RARG small; float FHIMED

            53            51     40  0219   400 	ADDF	R1,R3		;Add to FLO

            53            53     44  021C   500 	MULF	R3,R3		;RARG**2 for POLY

            03            53     55  021F   600 	POLYF	R3,#COSLEN-1,CSTB	;Chebyshev 3 MUL

                     FF4B CF         0222       

                                     0225   700 				;  approximation. No exceptions.

                                 05  0225   800 	RSB			;14 instructions to here for COS

                                     0226   900 				;  entry; 15 for SIN entry.

                                     0226  1000 				;  4 MULFs, 1EMODF

                                     0226  1100 

            51         F0 8F     8B  0226  1200 LK000:	BICB3	#^XF0,R1,R2	;FMED to R2

                          52         022A       

            51   FFFFFF8F 8F     CA  022B  1300 	BICL	#^XFFFFFF8F,R1	;FHI<2:0>*16 to R1

            51       FDE9 CF41   3E  0232  1400 	MOVAW	BIGTAB[R1],R1	;Set up table select for POLY.

            52            52     4C  0238  1500 	CVTBF	R2,R2		;Float FMED (Table look-up?)

            53            52     40  023B  1600 	ADDF	R2,R3		;  and add to FLO

            04            53     55  023E  1700 	POLYF	R3,#BTLEN-1,(R1)	;Special series for

                          61         0241       

                                     0242  1800 				;COS(FHI+FMEDLO)*PI/4

            50            63     40  0242  1900 	ADDF	(R3),R0		;Add last term with 3 bit overhang.

                                 05  0245  2000 	RSB			;17 instructions to here for COS

                                     0246  2100 				;  entry; 18 for SIN entry.

                                     0246  2200 				;  4 MULFs, 1 EMODF.

                                     0246  2300 

                                     0246  2400 

            51       FF00 8F     A8  0246  2500 COS001:	BISW	#^XFF00,R1	;FHIMED-1 to R1

            7E            51     4D  024B  2600 	CVTWF	R1,-(SP)	;Float FHIMED - 1  on stack

            6E            53     41  024E  2700 	ADDF3	R3,(SP),R4	;FHIMEDLO - 1 to R4

                          54         0251       

            54            54     45  0252  2800 	MULF3	R4,R4,R0	;RARG**2 for POLY

                          50         0255       

            53   0000BC40 8F     45  0256  2900 	MULF3	#^XBC40,R3,-(SP)	;-FLO*(3/4)*2**-8

                          7E         025D       

            03            50     55  025E  3000 	POLYF	R0,#SINLEN-1,SNTB	;Chebyshev with 3 MULs. The

                     FEEC CF         0261       

                                     0264  3100 				;  coefficients include scaling, and

                                     0264  3200 				;  are also multiplied by 4 for SM

                                     0264  3300 				;  and by 2**(-8) for ACC.

                                     0264  3400 				;  No exceptions in POLY.

            50            54     44  0264  3500 	MULF	R4,R0		;Final MUL by RARG

            8E            50     43  0267  3600 	SUBF3	R0,(SP)+,R0	;Subtract from -3*FLO and

                          50         026A       

            8E   0000BC40 8F     45  026B  3700 	MULF3	#^XBC40,(SP)+,R2	;(1-FHIMED)*(3/4)*2**-8

                          52         0272       

            50            52     40  0273  3800 	ADDF	R2,R0		;  add result to 3*(1-FHIMED)

                                     0276  3900 				;  with 3 bit overhang.

                                 05  0276  4000 	RSB			;For SM:	22 instructions for COS

                                     0277  4100 				;  entry; 23 for SIN entry.

                                     0277  4200 				;	5 MULFs and 1 EMOD

                                     0277  4300 				;  For ACC 19 instructions for COS

                                     0277  4400 				;  entry; 20 for SIN entry.

                                     0277  4500 				;  7 MULFs and 1 EMODF.

                                     0277  4600 

                                     0277  4700 

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  12

1-10            SIN/COSINE  - Calculate SIN/COS                                                                                 (13)



            51       FF00 8F     AA  0277   100 COS010:	BICW	#^XFF00,R1	;We can't use CVTBF because the

                                     027C   200 				;  sign could come out wrong.

            7E            51     4D  027C   300 	CVTWF	R1,-(SP)	;Float FHIMED on stack

            6E            53     41  027F   400 	ADDF3	R3,(SP),R4	;FHIMEDLO to R4

                          54         0282       

            54            54     45  0283   500 	MULF3	R4,R4,R0	;RARG**2 for POLY

                          50         0286       

            53   0000BC40 8F     45  0287   600 	MULF3	#^XBC40,R3,-(SP)	;-FLO*(3/4)*2**-8

                          7E         028E       

            03            50     55  028F   700 	POLYF	R0,#SINLEN-1,SNTB	;Chebyshev with 3 MULs. The

                     FEBB CF         0292       

                                     0295   800 				;  coefficients include powers of

                                     0295   900 				;  (PI/4)*(2**(-8)). They

                                     0295  1000 				;  are also multiplied by 4 for SM

                                     0295  1100 				;  and by 2**(-8) for ACC.

                                     0295  1200 				;  No exceptions in POLY.

            50            54     44  0295  1300 	MULF	R4,R0		;Final MUL by RARG

            8E            50     43  0298  1400 	SUBF3	R0,(SP)+,R0	;Subtract from -FLO*(3/4) and

                          50         029B       

            8E   0000BC40 8F     45  029C  1500 	MULF3	#^XBC40,(SP)+,R2	;(1-FHIMED)*(3/4)*2**-8

                          52         02A3       

            50            52     40  02A4  1600 	ADDF	R2,R0		;  add result to -FHIMED*(3/4)

                                     02A7  1700 				;  with 3 bit overhang.

                                 05  02A7  1800 	RSB			;For SM:	22 instructions for COS

                                     02A8  1900 				;  entry; 23 for SIN entry.

                                     02A8  2000 				;	5 MULFs and 1 EMOD

                                     02A8  2100 				;  For ACC 19 instructions for COS

                                     02A8  2200 				;  entry; 20 for SIN entry.

                                     02A8  2300 				;	7 MULFs and 1 EMODF.

                                     02A8  2400 

                                     02A8  2500 

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  13

1-10            SIN/COSINE  - Calculate SIN/COS                                                                                 (14)



            51            51     9B  02A8   100 COS011:	MOVZBW	R1,R1		;Isolate low byte of integer

            51            51     AE  02AB   200 	MNEGW	R1,R1		;1-FHIMED to R1

                          51     95  02AE   300 	TSTB	R1

                          10     15  02B0   400 	BLEQ	LK011		;  To table look-up if it is </= 0.

            51            51     4C  02B2   500 	CVTBF	R1,R1		;RARG small; float (1-f)HIMED

            51            53     42  02B5   600 	SUBF	R3,R1		;(1-f)HIMEDLO to R1

            51            51     44  02B8   700 	MULF	R1,R1		;RARG**2 for POLY

            03            51     55  02BB   800 	POLYF	R1,#COSLEN-1,NGCSTB	;Chebyshev with 3 MULs

                     FEBF CF         02BE       

                                     02C1   900 				;  Coefficients are negated.

                                     02C1  1000 				;  No exceptions.

                                 05  02C1  1100 	RSB			;15 instructions to here for COS

                                     02C2  1200 				;  entry; 16 for SIN entry.

                                     02C2  1300 				;  4 MULFs, 1 EMODF

                                     02C2  1400 

                          22     13  02C2  1500 LK011:	BEQL	HIZ011		;1 - FHIMED = 1, FHIMED = 0

            51         F0 8F     8B  02C4  1600 	BICB3	#^XF0,R1,R2	;FMED to R2

                          52         02C8       

            51   FFFFFF8F 8F     CA  02C9  1700 	BICL	#^XFFFFFF8F,R1	;FHI<2:0>*16 to R1

            51       FD4B CF41   3E  02D0  1800 	MOVAW	BIGTAB[R1],R1	;Set up table select for POLY.

            52            52     4C  02D6  1900 	CVTBF	R2,R2		;Float FMED

            52            53     42  02D9  2000 	SUBF	R3,R2		;  and subtract FLO from it.

            04            52     55  02DC  2100 	POLYF	R2,#BTLEN-1,(R1)	;Special series for

                          61         02DF       

                                     02E0  2200 				;COS(FHI+FMEDLO)*PI/4

         04 A3            50     43  02E0  2300 	SUBF3	R0,4(R3),R0	;Subtract from -(COS(FHI))HI

                          50         02E4       

                                     02E5  2400 				;  with 3 bit overhang.

                                 05  02E5  2500 	RSB			;19 instructions to here for COS

                                     02E6  2600 				;  entry; 20 for SIN entry.

                                     02E6  2700 				;  4 MULFs, 1 EMODF.

                                     02E6  2800 

            28            53     43  02E6  2900 HIZ011:	SUBF3	R3,#^X4280,R3	;Subtract FRAC from 16

                          53         02E9       

            04            53     55  02EA  3000 	POLYF	R3,#BTLEN-1,BIGTAB15	;Index into

                     FE10 CF         02ED       

                                     02F0  3100 				;  BIGTAB with 7 to get special

                                     02F0  3200 				;  series for COS(FHI+FMEDLO)*PI/4

         04 A3            50     43  02F0  3300 	SUBF3	R0,4(R3),R0	;Subtract from -(COS(FHI))HI

                          50         02F4       

                                     02F5  3400 

                                     02F5  3500 				;  with 3 bit overhang.

                                 05  02F5  3600 	RSB			;15 instructions to here for COS

                                     02F6  3700 				;  entry; 16 for SIN entry.

                                     02F6  3800 				;  4 MULFs, 1 EMODF.

                                     02F6  3900 

                                     02F6  4000 

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  14

1-10            SIN/COSINE  - Calculate SIN/COS                                                                                 (15)



            51            07     E0  02F6   100 COS100:	BBS	#7,R1,LK100	;To table look-up for RARG>PI/8

                          10         02F9       

                                     02FA   200 				;  In Version 4:	LK100 same as LK011

                                     02FA   300 

            51            51     4C  02FA   400 	CVTBF	R1,R1		;RARG small; float FHIMED

            53            51     40  02FD   500 	ADDF	R1,R3		;Add to FLO

            53            53     44  0300   600 	MULF	R3,R3		;RARG**2 for POLY

            03            53     55  0303   700 	POLYF	R3,#COSLEN-1,NGCSTB	;Chebyshev with 3 MULs

                     FE77 CF         0306       

                                     0309   800 				;  Coefficients are negated.

                                     0309   900 				;  No exceptions.

                                 05  0309  1000 	RSB			;14 instructions to here for COS

                                     030A  1100 				;  entry; 15 for SIN entry.

                                     030A  1200 				;  4 MULFs, 1EMODF

                                     030A  1300 

            51         F0 8F     8B  030A  1400 LK100:	BICB3	#^XF0,R1,R2	;FMED to R2

                          52         030E       

            51   FFFFFF8F 8F     CA  030F  1500 	BICL	#^XFFFFFF8F,R1	;FHI<2:0>*16 to R1

            51       FD05 CF41   3E  0316  1600 	MOVAW	BIGTAB[R1],R1	;Set up table select for POLY.

            52            52     4C  031C  1700 	CVTBF	R2,R2		;Float FMED

            53            52     40  031F  1800 	ADDF	R2,R3		;  and add to FLO

            04            53     55  0322  1900 	POLYF	R3,#BTLEN-1,(R1)	;Special series for

                          61         0325       

                                     0326  2000 				;COS(FHI+FMEDLO)*PI/4

         04 A3            50     43  0326  2100 	SUBF3	R0,4(R3),R0	;Subtract from -(COS(FHI))HI

                          50         032A       

                                     032B  2200 				;  with 3 bit overhang.

                                 05  032B  2300 	RSB			;17 instructions to here for COS

                                     032C  2400 				;  entry; 18 for SIN entry..

                                     032C  2500 				;  4 MULFs, 1 EMODF.

                                     032C  2600 

                                     032C  2700 

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  15

1-10            SIN/COSINE  - Calculate SIN/COS                                                                                 (16)



            51       FF00 8F     A8  032C   100 COS101:	BISW	#^XFF00,R1	;FHIMED - 1 to R1.

            7E            51     4D  0331   200 	CVTWF	R1,-(SP)	;Float FHIMED - 1  on stack

            6E            53     41  0334   300 	ADDF3	R3,(SP),R4	;FHIMEDLO - 1 to R4

                          54         0337       

            54            54     45  0338   400 	MULF3	R4,R4,R0	;RARG**2 for POLY

                          50         033B       

            53   00003C40 8F     45  033C   500 	MULF3	#^X3C40,R3,-(SP)	;FLO*(3/4)*2**-8

                          7E         0343       

            03            50     55  0344   600 	POLYF	R0,#SINLEN-1,SNTB	;Chebyshev with 3 MULs. The

                     FE06 CF         0347       

                                     034A   700 				;  coefficients include scaling, and

                                     034A   800 				;  are also multiplied by 4 for SM

                                     034A   900 				;  and by 2**(-8) for ACC.

                                     034A  1000 				;  No exceptions in POLY.

            50            54     44  034A  1100 	MULF	R4,R0		;Final MUL by RARG

            50            8E     40  034D  1200 	ADDF	(SP)+,R0	;Add in -3*FLO and

            8E   00003C40 8F     45  0350  1300 	MULF3	#^X3C40,(SP)+,R2	;(FHIMED-1)*(3/4)*2**-8

                          52         0357       

            50            52     40  0358  1400 	ADDF	R2,R0		;  add result to 3*(1-FHIMED)

                                     035B  1500 				;  with 3 bit overhang.

                                 05  035B  1600 	RSB			;For SM:	22 instructions for COS

                                     035C  1700 				;  entry; 23 for SIN entry.

                                     035C  1800 				;	5 MULFs and 1 EMOD

                                     035C  1900 				;  For ACC 19 instructions for

                                     035C  2000 				;  COS entry; 20 for SIN entry.

                                     035C  2100 				;	7 MULFs and 1 EMODF.

                                     035C  2200 

                                     035C  2300 

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  16

1-10            SIN/COSINE  - Calculate SIN/COS                                                                                 (17)



            51       FF00 8F     AA  035C   100 COS110:	BICW	#^XFF00,R1	;We can't use CVTBF because

                                     0361   200 				;  the sign could come out wrong.

            7E            51     4D  0361   300 	CVTWF	R1,-(SP)	;Float FHIMED on stack

            6E            53     41  0364   400 	ADDF3	R3,(SP),R4	;FHIMEDLO to R4

                          54         0367       

            54            54     45  0368   500 	MULF3	R4,R4,R0	;RARG**2 for POLY

                          50         036B       

            53   00003C40 8F     45  036C   600 	MULF3	#^X3C40,R3,-(SP)	;FLO*(3/4)*2**-8

                          7E         0373       

            03            50     55  0374   700 	POLYF	R0,#SINLEN-1,SNTB	;Chebyshev with 3 MULs. The

                     FDD6 CF         0377       

                                     037A   800 				;  coefficients include powere of

                                     037A   900 				;  (PI/4)*(2**(-8)). They

                                     037A  1000 				;  are also multiplied by 4 for SM

                                     037A  1100 				;  and by 2**(-8) for ACC.

                                     037A  1200 				;  No exceptions in POLY.

            50            54     44  037A  1300 	MULF	R4,R0		;Final MUL by RARG

            50            8E     40  037D  1400 	ADDF	(SP)+,R0	;Add in 3*FLO and

            8E   00003C40 8F     45  0380  1500 	MULF3	#^X3C40,(SP)+,R2	;FHIMED*(3/4)*2**-8

                          52         0387       

            50            52     40  0388  1600 	ADDF	R2,R0		;  add result to 3*FHIMED

                                     038B  1700 				;  with 3 bit overhang.

                                 05  038B  1800 	RSB			;For SM:	22 instructions for COS

                                     038C  1900 				;  entry; 23 for SIN entry.

                                     038C  2000 				;	5 MULFs and 1 EMOD

                                     038C  2100 				;  For ACC 19 instructions for

                                     038C  2200 				;  COS entry; 20 for SIN entry.

                                     038C  2300 				;	7 MULFs and 1 EMODF.

                                     038C  2400 

                                     038C  2500 

            51            51     9B  038C  2600 COS111:	MOVZBW	R1,R1		;Isolate low byte of integer

            51            51     AE  038F  2700 	MNEGW	R1,R1		;1-FHIMED to R1

                          51     95  0392  2800 	TSTB	R1

                          10     15  0394  2900 	BLEQ	LK111		;To table look-up if </= 0.

            51            51     4C  0396  3000 	CVTBF	R1,R1		;RARG small; float (1-f)HIMED

            51            53     42  0399  3100 	SUBF	R3,R1		;(1-f)HIMEDLO to R1

            51            51     44  039C  3200 	MULF	R1,R1		;RARG**2 for POLY

            03            51     55  039F  3300 	POLYF	R1,#COSLEN-1,CSTB	;Chebyshev with 3 MULs

                     FDCB CF         03A2       

                                     03A5  3400 				;  No exceptions.

                                 05  03A5  3500 	RSB			;15 instructions to here for COS

                                     03A6  3600 				;  entry; 16 for SIN entry.

                                     03A6  3700 				;  4 MULFs, 1 EMODF

                                     03A6  3800 

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  17

1-10            SIN/COSINE  - Calculate SIN/COS                                                                                 (18)



                          20     13  03A6   100 LK111:	BEQL	HIZ111		;FHIMED = 0; 1-FHIMED = 1.

            51         F0 8F     8B  03A8   200 	BICB3	#^XF0,R1,R2	;FMED to R2

                          52         03AC       

            51   FFFFFF8F 8F     CA  03AD   300 	BICL	#^XFFFFFF8F,R1	;FHI<2:0>*16 to R1

            51       FC67 CF41   3E  03B4   400 	MOVAW	BIGTAB[R1],R1	;Set up table select for POLY.

                                     03BA   500 

            52            52     4C  03BA   600 	CVTBF	R2,R2		;Float FMED

            52            53     42  03BD   700 	SUBF	R3,R2		;  and subtract FLO from it

            04            52     55  03C0   800 	POLYF	R2,#BTLEN-1,(R1)	;Special series for

                          61         03C3       

                                     03C4   900 				;COS(FHI+FMEDLO)*PI/4

            50            63     40  03C4  1000 	ADDF	(R3),R0		;Add last term with 3 bit overhang.

                                 05  03C7  1100 	RSB			;19 instructions for COS

                                     03C8  1200 				;  entry; 20 for SIN entry to here.

                                     03C8  1300 				;  4 MULFs, 1 EMODF.

                                     03C8  1400 

            28            53     43  03C8  1500 HIZ111:	SUBF3	R3,#^X4280,R3	;Subtract FRAC from 16

                          53         03CB       

            04            53     55  03CC  1600 	POLYF	R3,#BTLEN-1,BIGTAB15	;Index into

                     FD2E CF         03CF       

                                     03D2  1700 				;  BIGTAB with 7 to get special

                                     03D2  1800 				;  series for (COS(FHI+FMEDLO))*(PI/4)

            50            63     40  03D2  1900 	ADDF	(R3),R0		;Add to (COS(FHI))HI

                                     03D5  2000 				;  with three bit overhang.

                                 05  03D5  2100 	RSB			;15 instructions to here for COS

                                     03D6  2200 				;  entry; 16 for SIN entry

                                     03D6  2300 				;  4 MULFs, 1 EMODF

                                     03D6  2400  

                                     03D6  2500 

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  18

1-10            SIN/COSINE  - Calculate SIN/COS                                                                                 (19)



                                     03D6   100 ;Special cases for large and small arguments on COS entry

                                     03D6   200 ;start here.

                                     03D6   300 

            51            0F     E1  03D6   400 CMORE:	BBC	#15, R1, CBIG	;Branch for large |ARG|.

                          19         03D9       

            51       FA00 8F     B1  03DA   500 	CMPW	#^XFA00,R1	;Is POLY necessary?

                          0E     14  03DF   600 	BGTR	CANS1		;  No, return answer of 1

                                     03E1   700 				;  Now no underflow on POLY.

            54            54     45  03E1   800 	MULF3	R4,R4,R0	;Get |ARG|**2 for POLY

                          50         03E4       

            03            50     55  03E5   900 	POLYF	R0,#COSLN2-1,CSTB2	;Chebyshev with 3 MULs

                     FDA5 CF         03E8       

                                     03EB  1000 				;  No exceptions.

            50            63     40  03EB  1100 	ADDF	(R3),R0		;Add last term with 3 bit overhang.

                                 05  03EE  1200 	RSB			;10 instructions to here

                                     03EF  1300 				;  4 MULFs, no EMODF.

                                     03EF  1400 

            50            08     50  03EF  1500 CANS1:	MOVF	#^F1,R0		;Return answer of 1.

                                 05  03F2  1600 	RSB			;9 instructions to here

                                     03F3  1700 				;  No MULFs, no EMODF, no POLYF.

                                     03F3  1800 

   0FDA4F49 8F            54     51  03F3  1900 CBIG:	CMPF	R4,#LF_BIG	;Overflow on EMOD?

                                     03FA  2000 				;  BIG = (2**30)*PI

                          03     15  03FA  2100 	BLEQ	5$		;Branch if no overflow

                          0093   31  03FC  2200 	BRW	COVFL		;  Yes, go process it

            52            54     56  03FF  2300 5$:	CVTFD	R4,R2

            2A       FC0A CF     74  0402  2400 	EMODD	D_4_oPI, #^X2A, R2,R1,R2	;Get ARG*(1024/PI)

            51            52         0407       

                          52         0409       

                                     040A  2500 				;  with number of revs in R1<30:3>

                                     040A  2600 				;  octant bits in R1<2:0>

                                     040A  2700 				;  fraction in R4 with 8 or

                                     040A  2800 				;  fewer valid bits.

            54            52     76  040A  2900 	CVTDF	R2,R4		; R4 = rounded 

            51         F8 8F     8A  040D  3000 	BICB	#^XF8,R1	;Keep just octant bits

            00            51     8F  0411  3100 	CASEB	R1,#0,#7	;8 way branch on octant bits

                          07         0414       

                                     0415  3200 

                                     0415  3300 CBGTAB:

                               0010' 0415  3400 	.WORD	CBG000-CBGTAB

                               001A' 0417  3500 	.WORD	CBG001-CBGTAB

                               002C' 0419  3600 	.WORD	CBG010-CBGTAB

                               003A' 041B  3700 	.WORD	CBG011-CBGTAB

                               0047' 041D  3800 	.WORD	CBG100-CBGTAB

                               0051' 041F  3900 	.WORD	CBG101-CBGTAB

                               0062' 0421  4000 	.WORD	CBG110-CBGTAB

                               0070' 0423  4100 	.WORD	CBG111-CBGTAB

                                     0425  4200 

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  19

1-10            SIN/COSINE  - Calculate SIN/COS                                                                                 (20)



                                     0425   100 ;Three term Taylor series' will be sufficient to preserve

                                     0425   200 ;  the accuracy of the 8 or fewer bits left in RARG by EMODF.

                                     0425   300 

            54            54     44  0425   400 CBG000:	MULF	R4,R4		;Get RARG**2 for POLY

            02            54     55  0428   500 	POLYF	R4,#COSLN1-1,CSTB1	;3 term Taylor series.

                     FCF2 CF         042B       

                                 05  042E   600 	RSB			;13 instructions to here for COS

                                     042F   700 				;  entry; 14 for SIN entry.

                                     042F   800 				;  3 MULFs, 1 EMODF.

                                     042F   900 

            08            54     43  042F  1000 CBG001:	SUBF3	R4,#^F1,R4	;Get 1 - FRAC

                          54         0432       

            54            54     45  0433  1100 	MULF3	R4,R4,R0	;Get RARG**2 for POLY

                          50         0436       

            02            50     55  0437  1200 	POLYF	R0,#SINLN1-1,SNTB1	;3 term Taylor series.

                     FCFB CF         043A       

            50            54     44  043D  1300 	MULF	R4,R0		;Final MUL by RARG.

                                 05  0440  1400 	RSB			;15 instructions to here for COS

                                     0441  1500 				;  entry; 16 for SIN entry.

                                     0441  1600 				;  4 MULFs, 1 EMODF.

                                     0441  1700 

            54            54     45  0441  1800 CBG010:	MULF3	R4,R4,R0	;Get RARG**2 for POLY

                          50         0444       

            02            50     55  0445  1900 	POLYF	R0,#SINLN1-1,NSNTB1	;3 term Taylor series with

                     FCF9 CF         0448       

                                     044B  2000 				;  coefficients negated.

            50            54     44  044B  2100 	MULF	R4,R0		;Final MUL by RARG

                                 05  044E  2200 	RSB			;14 instructions to here for COS

                                     044F  2300 				;  entry; 15 for SIN entry.

                                     044F  2400 				;  4 MULFs, 1 EMODF.

                                     044F  2500 

            54            08     42  044F  2600 CBG011:	SUBF	#^F1,R4		;Get RARG - 1; "-" disappears

            54            54     44  0452  2700 	MULF	R4,R4		;  when we get RARG**2.

            02            54     55  0455  2800 	POLYF	R4,#COSLN1-1,NCSTB1	;3 term Taylor series with

                     FCD1 CF         0458       

                                     045B  2900 				;  coefficients negated.

                                 05  045B  3000 	RSB			;14 instructions to here for COS

                                     045C  3100 				;  entry; 15 for SIN entry.

                                     045C  3200 				;  3 MULFs, 1 EMODF

                                     045C  3300 

            54            54     44  045C  3400 CBG100:	MULF	R4,R4		;Get RARG**2 for POLY

            02            54     55  045F  3500 	POLYF	R4,#COSLN1-1,NCSTB1	;3 term Taylor series with

                     FCC7 CF         0462       

                                     0465  3600 				;  coefficients negated.

                                 05  0465  3700 	RSB			;13 instructions to here for COS

                                     0466  3800 				;  entry; 14 for SIN entry.

                                     0466  3900 				;  3 MULFs, 1 EMODF

                                     0466  4000 

            54            08     42  0466  4100 CBG101:	SUBF	#^F1,R4		;Get FRAC - 1; "-" disappears

            54            54     45  0469  4200 	MULF3	R4,R4,R0	;  when we ger RARG**2 for POLY.

                          50         046C       

            02            50     55  046D  4300 	POLYF	R0,#SINLN1-1,SNTB1	;3 term Taylor series

                     FCC5 CF         0470       

            50            54     44  0473  4400 	MULF	R4,R0		;Final MUL by RARG = FRAC -1,

                                     0476  4500 				;  to get desired negative result.

                                 05  0476  4600 	RSB			;15 instructions to here for COS

                                     0477  4700 				;  entry; 16 for SIN entry.

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  20

1-10            SIN/COSINE  - Calculate SIN/COS                                                                                 (22)



                                     0477   100 

                                     0477   200 				;  4 MULFs, 1 EMODF

                                     0477   300 

            54            54     45  0477   400 CBG110:	MULF3	R4,R4,R0	;Get RARG**2 for POLY.

                          50         047A       

            02            50     55  047B   500 	POLYF	R0,#SINLN1-1,SNTB1	;3 term Taylor series.

                     FCB7 CF         047E       

            50            54     44  0481   600 	MULF	R4,R0		;Final MUL by RARG.

                                 05  0484   700 	RSB			;14 instructions to here for COS

                                     0485   800 				;  entry; 15 for SIN entry

                                     0485   900 				;  4 MULFs, 1 EMODF

                                     0485  1000 

            54            08     42  0485  1100 CBG111:	SUBF	#^F1,R4		;Get FRAC - 1. "-" disappears

            54            54     44  0488  1200 	MULF	R4,R4		;  when we get RARG**2 for POLY.

            02            54     55  048B  1300 	POLYF	R4,#COSLN1-1,CSTB1	;3 term Taylor series.

                     FC8F CF         048E       

                                 05  0491  1400 	RSB			;14 instructions to here for COS

                                     0492  1500 				;  entry; 15 for SIN entry.

                                     0492  1600 				;  3 MULFs, 1 EMODF

                                     0492  1700 COVFL:	;Do the right things for integer overflow on EMODF

                                     0492  1800 	;No valid fraction bits will be left for RARG.

                          6E     DD  0492  1900 	PUSHL	(SP)		; return PC from JSB routine

            7E         57 8F     9A  0494  2000 	MOVZBL	#MTH__SINSIGLOS, -(SP)

                                     0498  2100 				; condition value

            01            0F     78  0498  2200 	ASHL	#15, #1, R0	; R0 = result = reserved operand -0.0

                          50         049B       

                                     049C  2300 				; goes to signal mechanism vector

                                     049C  2400 				; (CHF$L_MCH_R0/R1) so error handler

                                     049C  2500 				; can modify the result

       0000'CF            02     FB  049C  2600 	CALLS	#2, W^MTH$$SIGNAL

                                     04A1  2700 				; signal error and use real user's PC

                                     04A1  2800 				; independent of CALL vs JSB

                                     04A1  2900 				; return -R0 restored from CHF$L_MCH_R0/R1

                                     04A1  3000 

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  21

1-10            MTH$SIN - Standard Single Precision Sine                                                                        (23)



                                     04A1   100 	.SBTTL	MTH$SIN	-	Standard Single Precision Sine

                                     04A1   200 ;The code for SIN entry starts here.

                                     04A1   300 

                               001C' 04A1   400 	.ENTRY	MTH$SIN, ACMASK	; Standard call-by-reference entry

            54         04 BC     50  04A3   500 	MOVF	@x(AP),R4	;Get argument for SIN entry

                          04     10  04A7   600 	BSB	SINE		;Calculate Sine of argument

                                 04  04A9   700 	RET

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  22

1-10            MTH$SIN_R4  - Special Sine JSB-Routine                                                                          (24)



                                     04AA   100 	.SBTTL	MTH$SIN_R4  -	Special Sine JSB-Routine

                                     04AA   200 MTH$SIN_R4::

            54            50     50  04AA   300 	MOVF	R0,R4		;R4 gets argument

                          56     19  04AD   400 SINE:	BLSS	NEGARG		;To separate code for negative.

            54       4000 8F     A3  04AF   500 	SUBW3	#^X4000,R4,R1	;Unbias EXP(ARG).

                          51         04B4       

            51       0200 8F     B1  04B5   600 	CMPW	#^X0200,R1	;Compare unbiased exponent with 3

                          32     19  04BA   700 	BLSS	LARGE_SIN	;Use EMODD if exp>3

         6E 8F   F98344A2 8F     54  04BC   800 	EMODF	#LF_1024overPI, #^O156, R4, R1, R3

            51            54         04C4       

                          53         04C6       

            51            08     A1  04C7   900 	ADDW3	#^X8,R1,R2

                          52         04CA       

            52       03F0 8F     B3  04CB  1000 	BITW	#^X3F0,R2

                          23     13  04D0  1100 	BEQL	CLOSE_PI

            51            18     9C  04D2  1200 SINE1:	ROTL	#32-8,R1,R2	;Octant bits to R2<2:0>

                          52         04D5       

            52         F8 8F     8A  04D6  1300 	BICB	#^XF8,R2	;Keep just the octant bits.

            00            52     8F  04DA  1400 	CASEB	R2,#0,#7	;8 way branch on octant bits.

                          07         04DD       

                                     04DE  1500 

                                     04DE  1600 SOCTB1:

                               FE7E  04DE  1700 	.WORD	COS110-SOCTB1	;Refer to octant bit table

                               FEAE  04E0  1800 	.WORD	COS111-SOCTB1	;  above for actions to be taken

                               FD34  04E2  1900 	.WORD	COS000-SOCTB1	;  for the various branches.

                               FD68  04E4  2000 	.WORD	COS001-SOCTB1

                               FD99  04E6  2100 	.WORD	COS010-SOCTB1

                               FDCA  04E8  2200 	.WORD	COS011-SOCTB1

                               FE18  04EA  2300 	.WORD	COS100-SOCTB1

                               FE4E  04EC  2400 	.WORD	COS101-SOCTB1

                                     04EE  2500 

                                     04EE  2600 LARGE_SIN:

            51       0B80 8F     B1  04EE  2700 	CMPW	#^X0B80,R1	;Compare unbiased EXP with 23

                          66     1F  04F3  2800 	BLSSU	SMORE1		;  Branch if < 0, or >/= 23.

                                     04F5  2900 

                                     04F5  3000 

                                     04F5  3100 ;Main Flow:	-1 < unbiased EXP(ARG) < 23

                                     04F5  3200 ;  No underflow or overflow can occur on EMOD.

                                     04F5  3300 ;  EMOD will return 9 to 31 valid fraction bits.

                                     04F5  3400 

                                     04F5  3500 

                                     04F5  3600 CLOSE_PI:

            52            54     56  04F5  3700 	CVTFD	R4,R2

            2A       FB04 CF     74  04F8  3800 	EMODD	D_1024_oPI, #^X2A, R2, R1, R2	;Get ARG*(1024/PI)

            51            52         04FD       

                          52         04FF       

                                     0500  3900 				;  with number of revs in R1<15:11>

                                     0500  4000 				;  octant bits in R1<10:8>

                                     0500  4100 				;  FHI in R1<7:4>, FMED in R1<3:0>

            53            52     76  0500  4200 	CVTDF	R2,R3		; R3 = rounded FLO*2**8

                          CD     11  0503  4300 	BRB	SINE1		;Rejoin basic flow

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  23

1-10            MTH$SIN_R4  - Special Sine JSB-Routine                                                                          (25)



            54       C000 8F     A3  0505   100 NEGARG:	SUBW3	#^XC000,R4,R1	;Unbias EXP(|ARG|).

                          51         050A       

            51       0200 8F     B1  050B   200 	CMPW	#^X0200,R1	;Compare exponent with 4

                          32     19  0510   300 	BLSS	LARGE_NSINE

         6E 8F   F983C4A2 8F     54  0512   400 	EMODF	#LF_N1024overPI, #^O156,R4,R1,R3

            51            54         051A       

                          53         051C       

            51            08     A1  051D   500 	ADDW3	#^X8,R1,R2

                          52         0520       

            52       03F0 8F     B3  0521   600 	BITW	#^X3F0,R2

                          23     13  0526   700 	BEQL	NSIN_CLOSE_PI

            51            18     9C  0528   800 NSINE1:	ROTL	#32-8,R1,R2	;Octant bits to R2<2:0>

                          52         052B       

            52         F8 8F     8A  052C   900 	BICB	#^XF8,R2	;Keep just the octant bits.

            00            52     8F  0530  1000 	CASEB	R2,#0,#7	;8 way branch on octant bits.

                          07         0533       

                                     0534  1100 

                                     0534  1200 SOCTB2:

                               FD43  0534  1300 	.WORD	COS010-SOCTB2	;Refer to octant bit table

                               FD74  0536  1400 	.WORD	COS011-SOCTB2	;  above for actions to be taken

                               FDC2  0538  1500 	.WORD	COS100-SOCTB2	;  for the various branches.

                               FDF8  053A  1600 	.WORD	COS101-SOCTB2

                               FE28  053C  1700 	.WORD	COS110-SOCTB2

                               FE58  053E  1800 	.WORD	COS111-SOCTB2

                               FCDE  0540  1900 	.WORD	COS000-SOCTB2

                               FD12  0542  2000 	.WORD	COS001-SOCTB2

                                     0544  2100 

                                     0544  2200 LARGE_NSINE:

            51       0B80 8F     B1  0544  2300 	CMPW	#^X0B80,R1	;Compare unbiased EXP with 23

                          2C     1F  0549  2400 	BLSSU	SMORE2		;  Branch if < 0, or > 23.

                                     054B  2500 

                                     054B  2600 

                                     054B  2700 ;Main Flow:	-1 < unbiased EXP(ARG) < 8

                                     054B  2800 ;  No underflow or overflow can occur on EMOD.

                                     054B  2900 ;  EMOD will return 24 to 31 valid fraction bits.

                                     054B  3000 

                                     054B  3100 

                                     054B  3200 NSIN_CLOSE_PI:

            52            54     56  054B  3300 	CVTFD	R4, R2

            2A       FAB6 CF     74  054E  3400 	EMODD	D_N1024_oPI, #^X2A, R2,R1,R2	;Get ARG*(1024/PI)

            51            52         0553       

                          52         0555       

                                     0556  3500 				;  with number of revs in R1<15:11>

                                     0556  3600 				;  octant bits in R1<10:8>

                                     0556  3700 				;  FHI in R1<7:4>, FMED in R1<3:0>

            53            52     76  0556  3800 	CVTDF	R2,R3		; R3 = rounded FLO*2**8

                          CD     11  0559  3900 	BRB	NSINE1		;Rejoin basic flow

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  24

1-10            MTH$SIN_R4  - Special Sine JSB-Routine                                                                          (26)



            51            0F     E1  055B   100 SMORE1:	BBC	#15, R1, SBIG1	;Branch for large |ARG|.

                          38         055E       

            51       FA00 8F     B1  055F   200 	CMPW	#^XFA00,R1	;Is POLY necessary?

                          2D     14  0564   300 	BGTR	ANSARG		;  No, answer is ARG.

                                     0566   400 				;Now no underflow in POLY.

            54            54     45  0566   500 	MULF3	R4,R4,R0	; Get ARG**2 for POLY

                          50         0569       

            03            50     55  056A   600 	POLYF	R0,#SINLN2-1,SINTB2	;Chebyshev with 3 MULs

                     FBF0 CF         056D       

                                     0570   700 				;  The last coefficient is 0 to

                                     0570   800 				;  permit MUL followed by ADD with

                                     0570   900 				;  overhang at the end.

            50            54     44  0570  1000 	MULF	R4,R0		;Final MUL by ARG

            50            54     40  0573  1100 	ADDF	R4,R0		;  followed by final ADD

                                     0576  1200 				;  with 3 bit overhang.

                                 05  0576  1300 	RSB			;13 instructions to here

                                     0577  1400 				;  with 5 MULFs and no EMODF.

                                     0577  1500 

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  25

1-10            MTH$SIN_R4  - Special Sine JSB-Routine                                                                          (27)



            51            0F     E1  0577   100 SMORE2:	BBC	#15, R1, SBIG2	;Branch for large |ARG|.

                          4B         057A       

            51       FA00 8F     B1  057B   200 	CMPW	#^XFA00,R1	;Is POLY necessary?

                          11     14  0580   300 	BGTR	ANSARG		;  No, answer is ARG.

                                     0582   400 				;Now no underflow in POLY.

            54            54     45  0582   500 	MULF3	R4,R4,R0	; Get ARG**2 for POLY

                          50         0585       

            03            50     55  0586   600 	POLYF	R0,#SINLN2-1,SINTB2	;Chebyshev with 3 MULs.

                     FBD4 CF         0589       

                                     058C   700 				;  The last coefcicient is 0 to

                                     058C   800 				;  permit MUL followed by ADD with

                                     058C   900 

                                     058C  1000 					

                                     058C  1100 				;  overhang at the end.

            50            54     44  058C  1200 	MULF	R4,R0		;Final MUL by ARG

            50            54     40  058F  1300 	ADDF	R4,R0		;  followed by final ADD

                                     0592  1400 				;  with 3 bit overhang.

                                 05  0592  1500 	RSB			;13 instructions to here

                                     0593  1600 				;  with 5 MULFs and no EMODF.

                                     0593  1700 

            50            54     50  0593  1800 ANSARG:	MOVF	R4,R0		;Answer is ARG for both positive

                                     0596  1900 				;  and negative arguments.

                                 05  0596  2000 	RSB			;7 instructions to here with

                                     0597  2100 				;  no MULFs, no EMODF.

   0FDA4F49 8F            54     51  0597  2200 SBIG1:	CMPF	R4,#LF_BIG	;Overflow on EMOD?

                                     059E  2300 				;  BIG = (2**30)*PI

                          55     14  059E  2400 	BGTR	SOVFL		;  Yes, go process it

            52            54     56  05A0  2500 	CVTFD	R4, R2

            2A       FA69 CF     74  05A3  2600 	EMODD	D_4_oPI, #^X2A, R2,R1,R2	;Get ARG*(1024/PI)

            51            52         05A8       

                          52         05AA       

                                     05AB  2700 				;  with number of revs in R1<30:3>

                                     05AB  2800 				;  octant bits in R1<2:0>

                                     05AB  2900 				;  fraction in R4 with 8 or

                                     05AB  3000 				;  fewer valid bits.

            54            52     76  05AB  3100 	CVTDF	R2,R4		; R4 = rounded

            51         F8 8F     8A  05AE  3200 	BICB	#^XF8,R1	;Keep just octant bits

            00            51     8F  05B2  3300 	CASEB	R1,#0,#7	;8 way branch on octant bits

                          07         05B5       

                                     05B6  3400 

                                     05B6  3500 SBGTB1:

                               FEC1  05B6  3600 	.WORD	CBG110-SBGTB1		;Refer to octant bit table

                               FECF  05B8  3700 	.WORD	CBG111-SBGTB1		;  above for actions to be taken

                               FE6F  05BA  3800 	.WORD	CBG000-SBGTB1		;  for the various branches.

                               FE79  05BC  3900 	.WORD	CBG001-SBGTB1

                               FE8B  05BE  4000 	.WORD	CBG010-SBGTB1

                               FE99  05C0  4100 	.WORD	CBG011-SBGTB1

                               FEA6  05C2  4200 	.WORD	CBG100-SBGTB1

                               FEB0  05C4  4300 	.WORD	CBG101-SBGTB1

                                     05C6  4400 

                                     05C6  4500 

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  26

1-10            MTH$SIN_R4  - Special Sine JSB-Routine                                                                          (28)



   0FDACF49 8F            54     51  05C6   100 SBIG2:	CMPF	R4,#LF_NBIG	;Overflow on EMOD?

                                     05CD   200 				;  NBIG = -(2**30)*PI

                          26     19  05CD   300 	BLSS	SOVFL		;  Yes, go process it

            52            54     56  05CF   400 	CVTFD	R4, R2

            2A       FA42 CF     74  05D2   500 	EMODD	D_N4_oPI, #^X2A, R2,R1,R2	;Get ARG*(1024/PI)

            51            52         05D7       

                          52         05D9       

                                     05DA   600 				;  with number of revs in R1<30:3>

                                     05DA   700 				;  octant bits in R1<2:0>

                                     05DA   800 				;  fraction in R4 with 8 or

                                     05DA   900 				;  fewer valid bits.

            54            52     76  05DA  1000 	CVTDF	R2,R4		; R4 = rounded

            51         F8 8F     8A  05DD  1100 	BICB	#^XF8,R1	;Keep just octant bits

            00            51     8F  05E1  1200 	CASEB	R1,#0,#7	;8 way branch on octant bits

                          07         05E4       

                                     05E5  1300 

                                     05E5  1400 

                                     05E5  1500 SBGTB2:

                               FE5C  05E5  1600 	.WORD	CBG010-SBGTB2		;Refer to octant bit table

                               FE6A  05E7  1700 	.WORD	CBG011-SBGTB2		;  above for actions to be taken

                               FE77  05E9  1800 	.WORD	CBG100-SBGTB2		;  for the various branches.

                               FE81  05EB  1900 	.WORD	CBG101-SBGTB2

                               FE92  05ED  2000 	.WORD	CBG110-SBGTB2

                               FEA0  05EF  2100 	.WORD	CBG111-SBGTB2

                               FE40  05F1  2200 	.WORD	CBG000-SBGTB2

                               FE4A  05F3  2300 	.WORD	CBG001-SBGTB2

                                     05F5  2400 

                                     05F5  2500 SOVFL:	;Do the right things for integer overflow on EMODF

                                     05F5  2600 	;No valid fraction bits will be left for RARG.

                          FE9A   31  05F5  2700 	BRW	COVFL

                                     05F8  2800 

                                     05F8  2900 	.END

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  27

SYMBOL TABLE                                                                                                                    (28)



ACMASK         = 0000001C            LONG           = 00000004            

ANSARG           00000593 R     02   MTH$$SIGNAL      ********   X   02   

BIGTAB           00000020 R     02   MTH$COS          000001A4 RG    02   

BIGTAB15         00000100 R     02   MTH$COS_R4       000001AD RG    02   

BTLEN          = 00000005            MTH$K_ERR_PREFX= 00000016            

CANS1            000003EF R     02   MTH$SIN          000004A1 RG    02   

CBG000           00000425 R     02   MTH$SIN_R4       000004AA RG    02   

CBG001           0000042F R     02   MTH__FLOOVEMAT = 00000058            

CBG010           00000441 R     02   MTH__FLOUNDMAT = 00000059            

CBG011           0000044F R     02   MTH__INVARG    = 00000051            

CBG100           0000045C R     02   MTH__LOGZERNEG = 00000053            

CBG101           00000466 R     02   MTH__SINSIGLOS = 00000057            

CBG110           00000477 R     02   MTH__SQUROONEG = 00000054            

CBG111           00000485 R     02   MTH__UNDEXP    = 00000052            

CBGTAB           00000415 R     02   MTH__WRONUMARG = 00000050            

CBIG             000003F3 R     02   NCSTB1           0000012C R     02   

CLOSE_PI         000004F5 R     02   NEGARG           00000505 R     02   

CMORE            000003D6 R     02   NGCSTB           00000180 R     02   

COCTAB           000001E8 R     02   NSINE1           00000528 R     02   

COS000           00000212 R     02   NSIN_CLOSE_PI    0000054B R     02   

COS001           00000246 R     02   NSNTB1           00000144 R     02   

COS010           00000277 R     02   SBGTB1           000005B6 R     02   

COS011           000002A8 R     02   SBGTB2           000005E5 R     02   

COS100           000002F6 R     02   SBIG1            00000597 R     02   

COS101           0000032C R     02   SBIG2            000005C6 R     02   

COS110           0000035C R     02   SINE             000004AD R     02   

COS111           0000038C R     02   SINE1            000004D2 R     02   

COSINE           000001B0 R     02   SINLEN         = 00000004            

COSINE1          000001DC R     02   SINLN1         = 00000003            

COSLEN         = 00000004            SINLN2         = 00000004            

COSLN1         = 00000003            SINTB2           00000160 R     02   

COSLN2         = 00000004            SMORE1           0000055B R     02   

COS_CLOSE_PI     00000202 R     02   SMORE2           00000577 R     02   

COVFL            00000492 R     02   SNTB             00000150 R     02   

CSTB             00000170 R     02   SNTB1            00000138 R     02   

CSTB1            00000120 R     02   SOCTB1           000004DE R     02   

CSTB2            00000190 R     02   SOCTB2           00000534 R     02   

D_1024_OPI       00000000 R     02   SOVFL            000005F5 R     02   

D_4_OPI          00000010 R     02   X              = 00000004            

D_N1024_OPI      00000008 R     02   

D_N4_OPI         00000018 R     02   

FOR$K_ERR_PREFX= 00000018            

HIZ011           000002E6 R     02   

HIZ111           000003C8 R     02   

LARGE_COS        000001F8 R     02   

LARGE_NSINE      00000544 R     02   

LARGE_SIN        000004EE R     02   

LF_1024OVERPI  = F98344A2            

LF_4OVERPI     = F98340A2            

LF_BIG         = 0FDA4F49            

LF_N1024OVERPI = F983C4A2            

LF_N4OVERPI    = F983C0A2            

LF_NBIG        = 0FDACF49            

LK000            00000226 R     02   

LK011            000002C2 R     02   

LK100            0000030A R     02   

LK111            000003A6 R     02   

MTH$SINCOS      ; Floating Point Sine and Cosine Functions       21-AUG-1978 19:08:35   VAX-11 MACRO X0.3-11               Page  28

PROGRAM SECTION SYNOPSIS                                                                                                        (28)







PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        00000000      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

MTH$CODE         000005F8      02       PIC   USR   CON   REL   LCL   SHR   EXE   RD  NOWRT LONG  





THERE WERE NO ERRORS OR WARNINGS.

26610. BYTES LEFT IN FREE MEMORY POOL.

OBJ$:MTHSINCOS,LIS$:MTHSINCOS/-SP=LIB$:S/ML,SRC$:P,MTHSINCOS

0 MLB DIR RDS - 0 GETS TO DEFINE 0 MACROS. 11 INTER. FILE WRITES. 

