       .TITLE .ED   COMPUTE ARCTANGENT FOR ARG IN FLOATING ACCUMULATOR L
/ 
/ 
/                   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 1972, DIGITAL EQUIPMENT CORP., MAYNARD, MASS. 01754
/FOR HARDWARE FLOATING POINT PROCESSOR (FPP), DEFINE %FPP,
/EDIT #006    2-18-72
       .GLOBL .ED,.EC
	.IFUND %FPP
	.GLOBL .AB,.AA,.AN,.AM
	.ENDC
	.IFUND %FPP
	.DEFIN FRD%,A		/FLOATING REVERSE DIVIDE
	JMS* A			/(.AN)
	.ENDM
	.ENDC
	.IFDEF %FPP
FRD=712440
	.DEFIN FRD%
	FRD
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN FRS%,A		/FLOATING REVERSE SUBTRACT
	JMS* A			/(.AM)
	.ENDM
	.ENDC
	.IFDEF %FPP
FRS=711040
	.DEFIN FRS%
	FRS
	.ENDM
	.ENDC
/             CALLING SEQUENCE          (SINGLE PRECISION)
/      JMS*   (.ED)           SUBR CALL (ARG IN FLOAT ACC)
/      NEXT   INSTRUCTION     SUBR RETURN (RESULT IN FLOAT ACC)
/FPP INSRT ASS.
	.IFDEF %FPP
BMA=716602		/BR ON MINUS FPP AC
FAB=713271		/MAKE FPP AC POS.
UNDST=713770		/UNN. DOUBLE STR.
	.ENDC
/
.ED    CAL    0              /ENTRY-EXIT
	.IFDEF %FPP
	LAC (1)		/FOR FAB OR FNG
	BMA
	ED13
	CLA			/FAB
ED13	TAD (FAB)		/FNG
	DAC ED12
	.ENDC
	.IFUND %FPP
       LAC*   .AB            /GET SIGN WORD  (.AB)
       DAC    ED02           /SAVE AS ANS SIGN
       AND    ED03           /STRIP SIGN
       DAC*   .AB            /RESTORE IN (.AB)
	.ENDC
	.IFDEF %FPP
	UNDST
	ED15
	FAB		/STRIP SIGN
	0
	LAC ED15
	.ENDC
	.IFUND %FPP
       LAC*   .AA            /GET EXPONENT (.AA)
	.ENDC
       DAC    ED05           /SAVE FOR LATER TEST
       SNA!SPA               /IF EXP .GT. ZERO (ARG .GT. 1) TAKE 1/ARG
       JMP    ED06           /OR SKIP
       FRD%   .AN            /REVERSE DIVIDE REAL (.AN)
       .DSA   ED08           / (1/ARG)
ED06   JMS*   .EC            /POLYNIMIAL EVALUATE (.EC)  0.LT. ARG .LT.
       .DSA   ED11           / (FWA OF CALLING SEQUENCE)
       LAC    ED05           /TEST EXP AGAIN FOR ARG .GT.1 (EXP .GT. 0)
       SNA!SPA
       JMP    ED12           /NOT .GT. 1, SKIP
       FRS%   .AM            /REVERSE SUBTRACT REAL (.AM)
       .DSA   ED14           / (PI/2 - ANS)
	.IFDEF %FPP
ED12	0			/FAB OR FNG
	0			/UNUSED
	.ENDC
	.IFUND %FPP
ED12   LAC    ED02           /GET ORIGINAL SIGN WORD
       AND    ED09           /KEEP SIGN ONLY
       XOR*   .AB            /SET ANS SIGN IN SIGN WORD (.AB)
	SAD ED09		/CHECK FOR -0.0 CASE
	CLA		/YES.  MAKE -0.0 A 0.0
       DAC*   .AB
	.ENDC
       JMP*   .ED            /EXIT
	.IFUND %FPP
ED02   CAL    0              /ANS SIGN
ED03          377777
	.ENDC
ED05   CAL    0              /EXP STORAGE
ED08          1              /FLOATING 1 (1)
              200000         /           (2)
ED09          400000
ED11          777771         / NO OF COEFFICIENTS (6)
              635771         /C6 (1)  (-0.0040540580)
              604657         /    (2)
              507773        /C5 (1)  (0.0218612288)
              263054         /   (2)
              417774         /C4 (1) (-0.0559098861)
              745003         /   (2)
              575775         /C3 (1)  (0.0964200441)
              305357         /   (2)
              613776        /C2 (1)   (-0.1390853351)
              616330         /   (2)
              227776         /C1 (1)   (0.1994653599)
              314201        /      (2)
              160777         /   (1)  (-0.3332985605)
              652514         /   (2)
              723000         /   (1)  (+0.9999993329)
              377777         /   (2)
ED14          553001         / PI/2 (1)  (1.570796327)
              311037         /      (2)
	.IFDEF %FPP
ED15	0
	0
	0
	.ENDC
       .END
