       .TITLE .EE    COMPUTE LOG BASE 2 FOR REAL ARGUMENT
/ 
/ 
/                   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
/EDIT 2  2-26-71
/FOR HARDWARE FLOATING POINT PROCESSOR (FPP), DEFINE %FPP,
       .GLOBL .EE,.AW,.EC,.ER
	.IFUND %FPP
	.GLOBL .AA,.AB,.AH,.AI
	.GLOBL .AJ,.AL
	.ENDC
	.IFUND %FPP
	.DEFIN FST%,A		/FLOATING STORE (.AH)
	JMS* A
	.ENDM
	.ENDC
	.IFDEF %FPP
FST=713640
	.DEFIN FST%
	FST
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN FAD%,A		/FLOATING ADD (.AI)
	JMS* A
	.ENDM
	.ENDC
	.IFDEF %FPP
FAD=716040
	.DEFIN FAD%
	FAD
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN FSB%,A		/FLOATING SUBTRACT (.AJ)
	JMS* A
	.ENDM
	.ENDC
	.IFDEF %FPP
FSB=710440
	.DEFIN FSB%
	FSB
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN FDV%,A		/FLOATING DIVIDE (.AL)
	JMS* A
	.ENDM
	.ENDC
	.IFDEF %FPP
FDV=712040
	.DEFIN FDV%
	FDV
	.ENDM
	.ENDC
/             CALLING SEQUENCE
/      JMS*   (.EE)           SUBR CALL (ARG IN FLOATING ACC)
/      NEXT   INSTRUCTION     SUBR RETURN (RESULT IN FLOATING ACC)
/FPP INSTR. ASS.
	.IFDEF %FPP
BLE=716603		/BR ON LESS OR EQ TO ZERO FPP AC
UNDST=713770		/UNN. DOUBLE STR.
DLD=713150		/DOUBLE LOAD
	.ENDC
/
.EE    CAL    0              /ENTRY-EXIT
	.IFDEF %FPP
	BLE
	EE01
	UNDST
	EE10
	LAW -1
	TAD EE10
	DAC EE02
	LAC EE03
	DAC EE10
	DLD
	EE10
	.ENDC
	.IFUND %FPP
       LAC*   .AB            /GET SIGN WORD
       SNA!SPA               /IF .LE. ZERO
       JMP    EE01           / ERROR
       LAW    -1             /SET EXP = -1
       TAD*   .AA
       DAC    EE02           /STORE FOR INTEGER DETERMINATION
       LAC    EE03           /SET ARG EXP = 1
       DAC*   .AA            / (1 .LE. ARG .LT. 2 ) = F
	.ENDC
       FAD%   .AI            /ADD REAL
       .DSA   EE04           / (F + SQRT(2)
       FST%   .AH            /STORE REAL
       .DSA   EE05           / (F + SQRT(2) TO TEMP)
       FSB%   .AJ            /SUBTRACT REAL
       .DSA   EE06           / (F + SQRT(2) -(2 * SQRT(2))= F - SQRT(2)
       FDV%   .AL            /DIVIDE REAL
       .DSA   EE05           / (F - SQRT(2) / F + SQRT(2))
       JMS*   .EC            /POLYNOMIAL EVALUATE ABOVE
       .DSA   EE07           /ADDR OF CALLING SEQUENCE
       FST%   .AH            /STORE REAL
       .DSA   EE05           / (PARTIAL RESULT TO TEMP)
       LAC    EE02           /GET INTEGER
       STL                   /SET INTEGER = INTEGER + 0.5 (2*INTEGER +1
       RAL                   / (INTEGER * 2)
       JMS*   .AW            /FLOAT INTEGER
	.IFDEF %FPP
	FDV		/DIV BY 2
	EE11
	.ENDC
	.IFUND %FPP
       LAW    -1             /SET EXP = EXP -1 (2 * INTEGER +1 / 2)
       TAD*   .AA
       DAC*   .AA
	.ENDC
       FAD%   .AI            /ADD REAL
       .DSA   EE05           / (PARTIAL RESULT + INTEGER + 0.5)
       JMP*   .EE            /EXIT
EE01   JMS*   .ER            /ERROR ROUTINE
       CAL    13
EE02   CAL    0              /INTEGER STORAGE
EE03          1              /CONSTANT 1
EE05   CAL    0              /TEMP STORAGE (1)
       CAL    0              /             (2)
EE06          715002         / 2 * SQRT(2) (1) (2.284271)
              265011         /             (2)
EE07          777776         /NO OF COEFF (3)
              251000         /C3 (1)  ( 0.59897865)
              231255         /   (2)
              702000         /C2 (1)  ( 0.96147063)
              366105         /   (2)
              401002         /C1 (1)  ( 2.8853913)
              270524         /   (2)
EE04          715001         /SQRT(2) (1)  (1.41421356)
              265011         /        (2)
	.IFDEF %FPP
EE10	0
	0
	0
EE11	000002
	200000
	.ENDC
       .END
