/
/
/	A  C  O  S
/	-  -  -  -
/
/SUBROUTINE	ACOS(X)
/
/ VERSION 5A 4-27-77  PT
/
	SECT	ACOS
	JA	#ACOS
	TEXT	+ACOS  +
ACOSXR,	SETX	XRACOS
	SETB	BPACOS
BPACOS,	FNOP
	0
	0
XRACOS,	F 0.0
ACOS8,	F 0.0
ACOS7,	F 0.0
FPI2AC,	1		/PI OVER 2
	3110
	3755
F1ACOS,	F 1.
FPIACS,	2		/PI
	3110
	3755
	ORG	10*3+BPACOS
	FNOP
	JA	ACOSXR
	0
ACSRTN,	JA	.
	BASE	0
#ACOS,	STARTD
	FLDA	10*3
	FSTA	ACSRTN
	FLDA	0
	SETX	XRACOS
	SETB	BPACOS
	BASE	BPACOS
	LDX	1,1
	FSTA	BPACOS
	FLDA%	BPACOS,1	/ADDR OF X
	FSTA	BPACOS
	STARTF
	FLDA%	BPACOS	/GET X
	FSTA	ACOS8	/SAVE IT
	JEQ	ACOSEQ	/IF 0 RTN PI OVER 2
	LDX	-1,0	/JUMP TIME
	JGE	.+5
	LDX	0,0
	FNEG
	FSUB	F1ACOS	/1-!X!
	JLE	ACOSOK	/IS IT <1.?
	EXTERN	#ARGER
	TRAP4	#ARGER
	JA	ACSRTN	/AND RETURN
ACOSOK,	FLDA	ACOS8	/X
	FMUL	ACOS8	/X^2
	FNEG		/-X^2
	FADD	F1ACOS	/1-X^2
	FSTA	ACOS7
	EXTERN	SQRT
	JSR	SQRT	/CALL SQRT
	JA	.+4	/SQRT (1-X^2)
	JA	ACOS7
	FDIV	ACOS8	/SQRT (1-X^2)/X
	FSTA	ACOS7
	EXTERN	ATAN
	JSR	ATAN	/CALL ATAN
	JA	.+4	/ATAN (SQRT(1-X^2)/X)
	JA	ACOS7
	JXN	ACSRTN,0	/NO SIGN CHG NECESSARY
	FADD	FPIACS	/ADD PI IF MINUE
	JA	ACSRTN
ACOSEQ,	FLDA	FPI2AC	/RTN PI OVER 2 IF 0
	JA	ACSRTN
