       .TITLE .DB    COMPUTE SINE OF ARGUMENT IN FLOATING ACCUMULATOR
/ 
/ 
/                   FIRST PRINTING, FEBRUARY 1974
/ 
/ THE INFORMATION IN THIS DOCUMENT IS SUBJECT TO 
/ CHANGE WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED
/ AS A COMMITMENT BY DIGITAL EQUIPMENT CORPORATION.
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPON-
/ SIBILITY FOR ANY ERRORS THAT MAY APPEAR IN THIS
/ DOCUMENT.
/ 
/ THE SOFTWARE DESCRIBED IN THIS DOCUMENT IS FUR-
/ NISHED TO THE PURCHASER UNDER A LICENSE FOR USE ON
/ A SINGLE COMPUTER SYSTEM AND CAN BE COPIED (WITH
/ INCLUSION OF DIGITAL'S COPYRIGHT NOTICE) ONLY FOR 
/ USE IN SUCH SYSTEM, EXCEPT AS MAY OTHERWISE BE PRO-
/ VIDED IN WRITING BY DIGITAL.
/ 
/ DIGITAL EQUIPMENT CORPORATION ASSUMES NO RESPONSIBILITY
/ FOR THE USE OR RELIABILITY OF ITS SOFTWARE ON EQUIP-
/ MENT THAT IS NOT SUPPLIED BY DIGITAL.
/ 
/ COPYRIGHT (C) 1974, BY DIGITAL EQUIPMENT CORPORATION
/ 
/ 
        .EJECT
/COPYRIGHT 1970,1971, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
/FOR HARDWARE FLOATING POINT PROCESSOR (FPP), DEFINE 90 FPP,
/EDIT 4  2-26-71
       .GLOBL .DB,.AX,.AW,.DC
	.IFUND %FPP
	.GLOBL .AB,.AS,.AP,.AU
	.ENDC
	.IFUND %FPP
	.DEFIN DMP%,A
	JMS* A			/DOUBLE MULTIPLY (.AS)
	.ENDM
	.ENDC
	.IFDEF %FPP
DMP=711540
	.DEFIN DMP%
	DMP
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN UNDST%,A		/UNNORMALIZED
	JMS* A			/DOUBLE STORE (.AP)
	.ENDM
	.ENDC
	.IFDEF %FPP
UNDST=713770
	.DEFIN UNDST%
	UNDST
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN DRS%,A		/DOUBLE REVERSE SUBTRACT
	JMS* A			/(.AV)
	.ENDM
	.ENDC
	.IFDEF %FPP
DRS=711140
	.DEFIN DRS%
	DRS
	.ENDM
	.ENDC
/             CALLING SEQUENCE       (DOUBLE PRECISION)
/      JMS*   (.DB)           SUBR CALL (ARG IN FLT ACC)
/      NEXT   INSTRUCTION     SUBR RETURN (RESULT IN FLT ACC)
/FPP INSTR. ASS.
	.IFDEF %FPP
FCM=713273
FAB=713271
	.ENDC
/
.DB    CAL    0              /ENTRY-EXIT
	.IFDEF %FPP
	UNDST
	SINE20
	LAC SINE21
	DAC SINE03
	FAB		/MAKE FPP POS.
	0
	.ENDC
	.IFUND %FPP
       LAC*   .AB            /GET SIGN WORD (.AB)
       AND    SINE02
       DAC    SINE03         /STORE ANS SIGN
       LAC*   .AB            /MAKE SIGN WORD POSITIVE
       AND    SINE04
       DAC*   .AB
	.ENDC
       DMP%   .AS            /MULTIPLY DOUBLE (.AS)
       .DSA   SINE06         / (2/PI * ARG)
       UNDST%   .AP            /STORE DOUBLE (.AP)
       .DSA   SINE08         / (TEMP)
       JMS*   .AX            /FIX FOR INTEGER (.AX)
       DAC    SINE10         /STORE INTEGER FOR QUADRANT DETERMINATION
       JMS*   .AW            /FLOAT INTEGER ONLY (.AW)
       DRS%   .AU            /REVERSE SUBTRACT DOUBLE (.AU)
       .DSA   SINE08         / (TEMP(ARG*2/P)-ACC(INT ARG*2/P)FOR FRACT
       LAC    SINE10         /GET INTEGER
       RCR                   /B17 TO LINK
       SNL                   /IF SET-COMPUTE 1-F (QUAD II OR IV)
       JMP    SINE13         /OR TEST B16
       DRS%   .AU            /REVERSE SUBTRACT DOUBLE
       .DSA   SINE14         / (1-F)
SINE13 LAC    SINE10         /GET INTEGER AGAIN
       RTR                   /B16 TO LINK
       SNL                   /IF SET-NEGATE ANS SIGN (QUAD III OR IV)
       JMP    SINE15
       LAC    SINE02         /GET SIGN BIT
       XOR    SINE03         /XOR ANS SIGN
       DAC    SINE03         /STORE ANS SIGN
SINE15 JMS*   .DC            /POLYNOMIAL EVALUATE (.DC)
       .DSA   SINE17         /FWA OF CALL SEQUENCE
	.IFDEF %FPP
	LAC SINE03
	SPA
	FCM		/COMPL. FPP AC
	NOP		/FALL THRU
	.ENDC
	.IFUND %FPP
       LAC*   .AB            /GET SIGN WORD OF ANSWER (.AB)
       AND    SINE04         /STRIP SIGN
       XOR    SINE03         /INSERT ANS SIGN
	SAD SINE02		/CHECK FOR -0.0 CASE
	CLA		/YES.  MAKE -0.0 A 0.0
       DAC*   .AB            /RESTORE
	.ENDC
       JMP*   .DB            /EXIT
SINE02        400000
SINE03 CAL    0              /ANS SIGN
SINE04        377777
SINE06        0              / 2/PI (1)  (0.63661977236)
              242763         /      (2)
              015566         /      (3)
SINE08 CAL    0              /TEMP STORAGE (1)
       CAL    0              /             (2)
       CAL    0              /             (3)
SINE10 CAL    0              /INTEGER STORAGE
SINE14        1              /FLOATING 1 (1)
              200000         /           (2)
              0              /           (3)
	.IFDEF %FPP
SINE20	0
SINE21	0
	0
	.ENDC
SINE17        777772         /(N-1) (5)
       777750; 351732; 333236 /0.54465285D-7
       777756; 761211; 460000 /-0.3595184353D-5
       777764; 250166; 553372 /0.16043839964D-3
       777771; 631322; 620016 /-0.4681752998D-2
       777775; 243153; 614634 /+0.796926260D-1
       000000; 645273; 634612 /-0.6459640975D0
       000001; 311037; 552422 /+1.57079632680D0
       .END
