       .TITLE .DF    COMPUTE NATURAL EXPONENTIAL (E**ARG) (DOUBLE PREC)
/ 
/ 
/                   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 1  1-25-71
/FOR HARDWARE FLOATING POINT PROCESSOR (FPP), DEFINE %FPP,
       .GLOBL .DF,.AX,.AW,.ER
	.IFUND %FPP
	.GLOBL .AS,.AP,.AU,.AO,.AB
	.GLOBL .AQ,.AV
	.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
	.IFUND %FPP
	.DEFIN DLD%,A
	JMS* A			/DOUBLE LOAD (.AO)
	.ENDM
	.ENDC
	.IFDEF %FPP
DLD=713150
	.DEFIN DLD%
	DLD
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN DAD%,A		/DOUBLE ADD (.AQ)
	JMS* A
	.ENDM
	.ENDC
	.IFDEF %FPP
DAD=716140
	.DEFIN DAD%
	DAD
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN DRD%,A		/DOUBLE REVERSE DIVIDE
	JMS* A			/(.AV)
	.ENDM
	.ENDC
	.IFDEF %FPP
DRD=712560
	.DEFIN DRD%
	DRD
	.ENDM
	.ENDC
	.IFUND %FPP
	.DEFIN GETHOM
	LAC* .AB
	.ENDM
	.ENDC
	.IFDEF %FPP
	.GLOBL .ZA
	.DEFIN GETHOM
	JMS* .ZA
	.ENDM
	.ENDC
/             CALLING SEQUENCE
/      JMS*   (.DF)           SUBR CALL (ARG IN FLOATING ACC)
/      NEXT   INSTRUCTION     SUBR RETURN (RESULT IN FLOATING ACC)
/FPP INSTR. ASS.
	.IFDEF %FPP
FAB=713271
	.ENDC
/
.DF    CAL    0              /ENTRY-EXIT
       GETHOM   .AB            /GET SIGN WORD (.AB)
       DAC    EXPF09         /SAVE SIGN OF ARG
	.IFDEF %FPP
	FAB		/MAKE FPP AC POS.
	0		/NOT USED
	.ENDC
	.IFUND %FPP
       AND    (377777)       /MAKE FAC POSITIVE
       DAC*   .AB
	.ENDC
       DMP%   .AS            /MULTIPLY DOUBLE (.AS)
       .DSA   EXPF02         / (ARG*LOG2(E))
       UNDST%   .AP            /STORE DOUBLE (.AP)
       .DSA   EXPF04         / (TEMP)
       JMS*   .AX            /FIX (.AX)
       DAC    EXPF06         /STORE INTEGER AS ANSWER EXPONENT
       ISZ    EXPF06         / BUMP EXPONENT FOR .5 SCALING
       JMS*   .AW            /FLOAT INTEGER (.AW)
       DRS%   .AU            /REVERSE SUBTRACT DOUBLE  (.AU)
       .DSA   EXPF04         / (TEMP-ACC) FRACTION ONLY (F)
       UNDST%   .AP            /STORE DOUBLE (.AP)
       .DSA   EXPF04         /(F INTO TEMP)
       LAW    -10            / SET ITERATION COUNT FOR 9 PASSES
       DAC    EXPF11         /STORE CNTR
       LAC    EXPF21         /GET ADDR OF C9
       DAC    EXPF14         / INTO PTR
       DLD%   .AO            /LOAD DOUBLE (.AO)
       .DSA   EXPF20         / (C9) AS TERM
EXPF12 DMP%   .AS            /MULTIPLY DOUBLE (.AS)
       .DSA   EXPF04         / (F * TERM)
EXPF13 ISZ    EXPF14         /PTR = PTR +3
       ISZ    EXPF14
       ISZ    EXPF14
       DAD%   .AQ            /ADD DOUBLE (.AQ)
       .DSA   EXPF14+400000  / C(PTR) AS NEW TERM
       ISZ    EXPF11         /CNTR = CNTR +1
       JMP    EXPF12         /CYCLE
       UNDST%   .AP            /DONE-STORE DOUBLE (.AP)
       .DSA   EXPF04         / (RESULT TO TEMP)
       DMP%   .AS            /MULTIPLY DOUBLE (.AS)
       .DSA   EXPF04         / (RESULT * RESULT =(RESULT)**2)
       DMP%   .AS            / MULTIPLY DOUBLE
       .DSA   EXPF06         / (EXPONENT * FINAL RESULT)
       LAC    EXPF09         /IF ARG WAS NEGATIVE, TAKE
       SMA                   /RECIPROCAL OF ANSWER BEFORE EXIT
       JMP*   .DF
       DRD%   .AV
       .DSA   EXPF21-3
       JMP*   .DF
EXPF09 .DSA   0
EXPF02  .DSA 000001		/LOG2(E) (1) (1.442695041D0)
        .DSA 270524		/ (2)
        .DSA 354514		/ (3)
EXPF04 CAL    0              /TEMP  (1)
       CAL    0              /      (2)
       CAL    0              /      (3)
EXPF06 CAL    0              /ANS EXP
              200000         / EXPONENT STORAGE (2)
              0              /EXPONENT STORAGE (3)
EXPF11 CAL    0              /CNTR
EXPF14 CAL    0              /PTR
EXPF20 777745; 261767; 414110 /0.5180D-8
       777752; 200334; 225756 /0.119610D-6
       777756; 241410; 444530 /0.2406787D-5
       777762; 256607; 213216 /0.41667033D-4
       777766; 235452; 556272	/0.601133075D-3
       777771; 343260; 433536	/0.6938013677D-2
       777774; 365773; 677740	/0.6005662674D-1
       777777; 261344; 137700	/0.3465735903D0
       000001; 200000; 000000 /1.0D0
EXPF21 .DSA   EXPF20         /ADDR OF C9
       .END
