MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)     100  HISTORY	; Detailed Current Edit History

   (3)     100  DECLARATIONS		; Declarative Part of Module

   (4)     100  MTH$DEXP - Standard Double Precision Floating E

   (5)     100  MTH$DEXP_R7 - Special DEXP routine

MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page   1

1-7                                                                                                                              (1)



                                     0000   100 	.TITLE	MTH$DEXP	; Double Precision Floating Exponrntial Function

                                     0000   200 				; (DEXP)

                                     0000   300 	.IDENT /1-7/		; File: MTHDEXP.MAR

                                     0000   400 ;

                                     0000   500 ; Copyright (C) 1977

                                     0000   600 ; Digital Equipment Corporation, Maynard, Massachusetts 01754

                                     0000   700 ;

                                     0000   800 ; This software is furnished under a license for use only on a single

                                     0000   900 ; computer  system  and  may be copied only with the inclusion of the

                                     0000  1000 ; above copyright notice. This software, or any other copies thereof,

                                     0000  1100 ; may not be provided or otherwise made available to any other person

                                     0000  1200 ; except for use on such system and to one who agree to these license 

                                     0000  1300 ; terms.  Title to  and  ownership of the software shall at all times 

                                     0000  1400 ; remain in DEC.

                                     0000  1500 ;

                                     0000  1600 ; The information in the software is subject to change without notice

                                     0000  1700 ; and should  not  be construed  as a commitment by Digital Equipment 

                                     0000  1800 ; Corporation.

                                     0000  1900 ;

                                     0000  2000 ; DEC assumes  no  responsibility  for the use or  reliability of its

                                     0000  2100 ; software on equipment which is not supplied by DEC.

                                     0000  2200 ;

                                     0000  2300 ;

                                     0000  2400 ; FACILITY: MATH LIBRARY

                                     0000  2500 ;++

                                     0000  2600 ; ABSTRACT:

                                     0000  2700 ;

                                     0000  2800 ;	MTH$DEXP is a function which returns the double floating point

                                     0000  2900 ; exponential of its double precision floating point argument.

                                     0000  3000 ; The call is standard call-by-reference.

                                     0000  3100 ;

                                     0000  3200 ;--

                                     0000  3300 ;

                                     0000  3400 ; VERSION: 1

                                     0000  3500 ;

                                     0000  3600 ; HISTORY:

                                     0000  3700 ; AUTHOR:

                                     0000  3800 ;	Peter Yuo, 15-Oct-76: Version 0

                                     0000  3900 ;	Mary Payne and Jud Leonard, 23-JAN-78: Version 1

                                     0000  4000 ;

                                     0000  4100 ; MODIFIED BY:

                                     0000  4200 ;

                                     0000  4300 ;

                                     0000  4400 ;

MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page   2

1-7             HISTORY ; Detailed Current Edit History                                                                          (2)



                                     0000   100 	.SBTTL	HISTORY	; Detailed Current Edit History

                                     0000   200 

                                     0000   300 ; Edit History for Version 1 of MTH$DEXP

                                     0000   400 ;

                                     0000   500 ; 1-1	Split single and double precision routines into two parts;

                                     0000   600 ;	Used more accurate and faster algorithms provided by M. Payne.

                                     0000   700 ;	JMT 23-Jan-78

                                     0000   800 ; 1-3	Fixed bug causing unexpected integer overflow.  JMT 24-Mar-78

                                     0000   900 ; 1-4	Change from rational approx. to Chebyshev approx. for

                                     0000  1000 ;	more accuracy with overhang.  MHP 18-May-78

                                     0000  1100 ; 1-5	Detect underflow properly.  TNH 16-June-78

                                     0000  1200 ; 1-6	Remove extra instruction.  TNH 16-June-78

                                     0000  1300 ; 1-7	Move .ENTRY mask to module header.  TNH 14-Aug-78

MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page   3

1-7             DECLARATIONS  ; Declarative Part of Module                                                                       (3)



                                     0000   100 	.SBTTL	DECLARATIONS		; Declarative Part of Module

                                     0000   200 

                                     0000   300 ;

                                     0000   400 ; INCLUDE FILES:	OTSPARAMS.MAR

                                     0000   500 ;

                                     0000   600 ; EXTERNAL SYMBOLS:	MTH$FLAG_JACKET

                                     0000   700 ;

                                     0000   800 	.DSABL	GBL			; Declare all EXTRNs explicitly

                                     0000   900 	.EXTRN	MTH$$SIGNAL		; SIGNAL SEVERE error

                                     0000  1000 	.EXTRN	MTH$$JACKET_TST		; Test to see if called with CALL or JSB

                                     0000  1100 ; EQUATED SYMBOLS:

                                     0000  1200 

                           000040FC  0000  1250 	ACMASK	= ^M<IV, R2, R3, R4, R5, R6, R7>	; .ENTRY mask + int ovf enable

                           000000BB  0000  1300 	X_273	=	^O273		; Extension for operand in EMODD

                           00004370  0000  1400 	SD_60	=	^F60.

                           00004240  0000  1500 	SD_12	=	^F12.

                           000043F0  0000  1600 	SD_120	=	^F120.

                                     0000  1700 ;

                                     0000  1800 ; MACROS:

                                     0000  1900 	$SFDEF				; define SF$ (stack frame) symbols

                                     0000  2000 ;

                                     0000  2100 ; PSECT DECLARATIONS:

                                     0000  2200 

                                 00000000  2300 	.PSECT	MTH$CODE	PIC,SHR,LONG,EXE,NOWRT

                                     0000  2400 					; program section for math routines

                                     0000  2500 ;

                                     0000  2600 ; OWN STORAGE:	none

                                     0000  2700 ;

                                     0000  2800 ; CONSTANTS:

                                     0000  2900 

                                     0000  3000 ;

                                     0000  3100 ; Table to be used for scaling. These constants here have been

                                     0000  3200 ; verified by M. Payne using her program ROOT16 on PDP-10.

                                     0000  3300 ;

                          0000 4080  0000  3400 TABHI:	.WORD	^O040200,0		; 2**(0/16) = 1.0

                          0000 0000  0004  3500 	.WORD	0,0

                          AAC3 4085  0008  3600 	.WORD	^O040205,^O125303	; 2**(1/16)

                          487B 67CC  000C  3700 	.WORD	^O063714,^O044173

                          95C1 408B  0010  3800 	.WORD	^O040213,^O112701	; 2**(2/16)

                          8BD7 E3EA  0014  3900 	.WORD	^O161752,^O105727

                          C3D3 4091  0018  4000 	.WORD	^O040221,^O141723	; 2**(3/16)

                          11C3 73AB  001C  4100 	.WORD	^O071653,^O010703

                          37F0 4098  0020  4200 	.WORD	^O040230,^O033760	; 2**(4/16)

                          B8A9 518D  0024  4300 	.WORD	^O050615,^O134251

                          F532 409E  0028  4400 	.WORD	^O040236,^O172462	; 2**(5/16)

                          A112 6091  002C  4500 	.WORD	^O060221,^O120422

                          FED6 40A5  0030  4600 	.WORD	^O040245,^O177326	; 2**(6/16)

                          5139 A9B1  0034  4700 	.WORD	^O124661,^O050471

                          583E 40AD  0038  4800 	.WORD	^O040255,^O054076	; 2**(7/16)

                          A14B EA42  003C  4900 	.WORD	^O165102,^O120513

                          04F3 40B5  0040  5000 	.WORD	^O040265,^O002363	; 2**(8/16)

                          DE65 33F9  0044  5100 	.WORD	^O031771,^O157145

                          08A3 40BD  0048  5200 	.WORD	^O040275,^O004243	; 2**(9/16)

                          0C37 9F58  004C  5300 	.WORD	^O117530,^O006067

                          672A 40C5  0050  5400 	.WORD	^O040305,^O063452	; 2**(10/16)

                          06DB 1155  0054  5500 	.WORD	^O010525,^O003333

                          248C 40CE  0058  5600 	.WORD	^O040316,^O022214	; 2**(11/16)

MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page   4

1-7             DECLARATIONS  ; Declarative Part of Module                                                                       (3)



                          8481 151F  005C  5700 	.WORD	^O012437,^O102201

                          44FC 40D7  0060  5800 	.WORD	^O040327,^O042374	; 2**(12/16)

                          9D6B CAD6  0064  5900 	.WORD	^O145326,^O116553

                          CCDE 40E0  0068  6000 	.WORD	^O040340,^O146336	; 2**(13/16)

                          94E1 EC2A  006C  6100 	.WORD	^O166052,^O112341

                          C0C6 40EA  0070  6200 	.WORD	^O040352,^O140306	; 2**(14/16)

                          2439 E7DD  0074  6300 	.WORD	^O163735,^O022071

                          257D 40F5  0078  6400 	.WORD	^O040365,^O022575	; 2**(15/16)

                          86CC 1524  007C  6500 	.WORD	^O012444,^O103314

                                     0080  6600 

                                     0080  6700 

                          0000 0000  0080  6800 TABLO:	.WORD	0,0			; DECIMAL: 0.D0

                          0000 0000  0084  6900 	.WORD	0,0

                          2E48 2326  0088  7000 	.WORD	^O021446,^O027110	; DECIMAL: 0.2252169616881804D-17

                          0000 0000  008C  7100 	.WORD	0,0

                          20D0 A348  0090  7200 	.WORD	^O121510,^O020320	; DECIMAL:-0.2712242510500122D-17

                          0000 0000  0094  7300 	.WORD	0,0

                          3F62 23D8  0098  7400 	.WORD	^O021730,^O037542	; DECIMAL: 0.5861402647731367D-17

                          0000 0000  009C  7500 	.WORD	0,0

                          8D5A 245E  00A0  7600 	.WORD	^O022136,^O106532	; DECIMAL: 0.1206457647223494D-16

                          0000 0000  00A4  7700 	.WORD	0,0

                          BEE1 A424  00A8  7800 	.WORD	^O122044,^O137341	; DECIMAL:-0.8930877995013540D-17

                          0000 0000  00AC  7900 	.WORD	0,0

                          1A10 A32F  00B0  8000 	.WORD	^O121457,^O015020	; DECIMAL:-0.2373071989573779D-17

                          0000 0000  00B4  8100 	.WORD	0,0

                          D9F8 A3E6  00B8  8200 	.WORD	^O121746,^O154770	; DECIMAL:-0.6257240830881880D-17

                          0000 0000  00BC  8300 	.WORD	0,0

                          4D06 A477  00C0  8400 	.WORD	^O122167,^O046406	; DECIMAL:-0.1340620676392399D-16

                          0000 0000  00C4  8500 	.WORD	0,0

                          AF00 A402  00C8  8600 	.WORD	^O122002,^O127400	; DECIMAL:-0.7084371812598154D-17

                          0000 0000  00CC  8700 	.WORD	0,0

                          0756 A38B  00D0  8800 	.WORD	^O121613,^O003526	; DECIMAL:-0.3768379065187162D-17

                          0000 0000  00D4  8900 	.WORD	0,0

                          EE5A A360  00D8  9000 	.WORD	^O121540,^O167132	; DECIMAL:-0.3048384309613603D-17

                          0000 0000  00DC  9100 	.WORD	0,0

                          6580 A2BC  00E0  9200 	.WORD	^O121274,^O062600	; DECIMAL:-0.1276624235300040D-17

                          0000 0000  00E4  9300 	.WORD	0,0

                          32C0 2308  00E8  9400 	.WORD	^O021410,^O031300	; DECIMAL: 0.1845830375854930D-17

                          0000 0000  00EC  9500 	.WORD	0,0

                          40B4 23BB  00F0  9600 	.WORD	^O021673,^O040264	; DECIMAL: 0.5075495866202897D-17

                          0000 0000  00F4  9700 	.WORD	0,0

                          EE77 23B1  00F8  9800 	.WORD	^O021661,^O167167	; DECIMAL: 0.4822843060675619D-17

                          0000 0000  00FC  9900 	.WORD	0,0

                                     0100 10000 

                                     0100 10100 D_16LOG2_E:				; LOG2(E) * 16

                          AA3B 42B8  0100 10200 	.WORD	^O041270,^O125073

                          17F0 295C  0104 10300 	.WORD	^O024534,^O013760

                                     0108 10400 ;

                                     0108 10500 ; Constants used in evaluation of polynomials - small arguments

                                     0108 10600 ;

                          12C8 38D0  0108 10700 DXPTB1:	.WORD	^O034320,^O011310

                          CA18 5B74  010C 10800 	.WORD	^O055564,^O145030	; DECIMAL:   0.2480427857745020D-04

                          1381 3A50  0110 10900 	.WORD	^O035120,^O011601

                          962F 4F31  0114 11000 	.WORD	^O047461,^O113057	; DECIMAL:   0.1984369200268758D-03

                          0B60 3BB6  0118 11100 	.WORD	^O035666,^O005540

                          E338 A1D0  011C 11200 	.WORD	^O120720,^O161470	; DECIMAL:   0.1388888879690042D-02

                          8888 3D08  0120 11300 	.WORD	^O036410,^O104210

MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page   5

1-7             DECLARATIONS  ; Declarative Part of Module                                                                       (3)



                          F3FD 7506  0124 11400 	.WORD	^O072406,^O171775	; DECIMAL:   0.8333333262370290D-02

                          AAAA 3E2A  0128 11500 	.WORD	^O037052,^O125252

                          E477 AAAA  012C 11600 	.WORD	^O125252,^O162167	; DECIMAL:   0.4166666666667950D-01

                          AAAA 3F2A  0130 11700 	.WORD	^O037452,^O125252

                          015D AAAB  0134 11800 	.WORD	^O125253,^O000535	; DECIMAL:   0.1666666666667437D-00

                          0000 4000  0138 11900 	.WORD	^O040000,0

                          0000 0000  013C 12000 	.WORD	0,0			; DECIMAL:   0.5000000000000000D-00

                          FFFF 407F  0140 12100 	.WORD	^O040177,^O177777

                          FFFF FFFF  0144 12200 	.WORD	^O177777,^O177777	; DECIMAL:   0.1000000000000000D+01

                          0000 4080  0148 12300 	.WORD	^O040200,0

                          0000 0000  014C 12400 	.WORD	0,0			; DECIMAL:   0.1000000000000000D+01

                           00000009  0150 12500 DXPLN1=<.-DXPTB1>/8			; no. of entries in table

                                     0150 12600   

                                     0150 12700 ;

                                     0150 12800 ; Constants used in evaluation of polynomial - regular args

                                     0150 12900 ;

                                     0150 13000 

                                     0150 13100 

                          626F 26B1  0150 13200 DXPTAB:	.WORD	^O023261,^O061157

                          AA0E 23F7  0154 13300 	.WORD	^O021767,^O125016	; DECIMAL:   0.3077130709430240D-15

                          E9D5 2A7F  0158 13400 	.WORD	^O025177,^O164725

                          8713 C69F  015C 13500 	.WORD	^O143237,^O103423	; DECIMAL:   0.5682419384166091D-13

                          8489 2E21  0160 13600 	.WORD	^O027041,^O102211

                          AE3D 7811  0164 13700 	.WORD	^O074021,^O127075	; DECIMAL:   0.9181219559808114D-11

                          C3FF 31AE  0168 13800 	.WORD	^O030656,^O141777

                          CEBB 368F  016C 13900 	.WORD	^O033217,^O147273	; DECIMAL:   0.1271587192556359D-08

                          955B 351D  0170 14000 	.WORD	^O032435,^O112533

                          79A5 7DD2  0174 14100 	.WORD	^O076722,^O074645	; DECIMAL:   0.1467610032291993D-06

                          5846 3863  0178 14200 	.WORD	^O034143,^O054106

                          12CC B825  017C 14300 	.WORD	^O134045,^O011314	; DECIMAL:   0.1355080777949815D-04

                          FDEF 3B75  0180 14400 	.WORD	^O035565,^O176757

                          2C76 FC16  0184 14500 	.WORD	^O176026,^O026166	; DECIMAL:   0.9383847928089872D-03

                          7217 3E31  0188 14600 	.WORD	^O037061,^O071027

                          CF7A F7D1  018C 14700 	.WORD	^O173721,^O147572	; DECIMAL:   0.4332169878499658D-01

                          0000 0000  0190 14800 	.WORD	0,0

                          0000 0000  0194 14900 	.WORD	0,0			; DECIMAL:   0

                           00000009  0198 15000 DXPLN=<.-DXPTAB>/8			; no. of entries in table

                                     0198 15100 

MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page   6

1-7             MTH$DEXP - Standard Double Precision Floating E                                                                  (4)



                                     0198   100 	.SBTTL	MTH$DEXP - Standard Double Precision Floating EXP

                                     0198   200 

                                     0198   300 

                                     0198   400 ;++

                                     0198   500 ; FUNCTIONAL DESCRIPTION:

                                     0198   600 ;

                                     0198   700 ; EXP  - Double precision floating point function

                                     0198   800 ;

                                     0198   900 ; Uses a Chebyshev approximation, with overhang on last step.

                                     0198  1000 ;

                                     0198  1100 ;

                                     0198  1200 ; CALLING SEQUENCE:

                                     0198  1300 ;

                                     0198  1400 ;	Exponential.wd.v = MTH$EXP(x.rd.r)

                                     0198  1500 ;

                                     0198  1600 ; INPUT PARAMETERS:

                                     0198  1700 

                           00000004  0198  1800 	LONG = 4			; define longword multiplier

                           00000004  0198  1900 	x = 1 * LONG			; Contents of x is the argument

                                     0198  2000 

                                     0198  2100 ; IMPLICIT INPUTS:	none

                                     0198  2200 ;

                                     0198  2300 ; OUTPUT PARAMETERS:

                                     0198  2400 ;

                                     0198  2500 ;	VALUE:	floating exponential of the argument

                                     0198  2600 ;

                                     0198  2700 ; IMPLICIT OUTPUTS:	none

                                     0198  2800 ;

                                     0198  2900 ; SIDE EFFECTS:

                                     0198  3000 ;

                                     0198  3100 ; Signals: MTH$_FLOOVEMAT if X > 88.028 with reserved operand in R0/R1 (copied

                                     0198  3200 ; to the signal mechanism vector CHF$L_MCH_R0/R1 by LIB$SIGNAL).

                                     0198  3300 ; Associated message is: "FLOATING OVERFLOW IN MATH LIBRARY". Result is reserved

                                     0198  3400 ; operand -0.0 unless a user supplied (or any) error handler changes CHF$L_MCH_R0/R1

                                     0198  3500 ;	MTH$_FLOUNDMAT if X =< -89.416 and caller has hardware enable set.

                                     0198  3600 ; The result is set to +0.0. Associated message is: "FLOATING UNDERFLOW

                                     0198  3700 ; IN MATH LIBRARY"

                                     0198  3800 ;

                                     0198  3900 ; NOTE: This procedure disables floating point underflow, enable integer

                                     0198  4000 ; overflow, causes no floating overflow or other arithmetic traps, and

                                     0198  4100 ; preserves enables across the call.

                                     0198  4200 ;

                                     0198  4300 ;--

                                     0198  4400 

                                     0198  4500 

                               40FC' 0198  4600 	.ENTRY	MTH$DEXP, ACMASK	; standard call-by-reference entry

                                     019A  4700 					; disable DV (and FU), enable IV

                                     019A  4800 	MTH$FLAG_JACKET			; flag that this is a jacket procedure in

                                     019A      

            6D       0000'CF     3E  019A       	MOVAW	W^MTH$$JACKET_HND, (FP)

                                     019F       					; set handler address to jacket

                                     019F       					; handler

                                     019F       

                                     019F  4900 					; case of an error in special JSB routine

            50         04 BC     70  019F  5000 	MOVD	@x(AP), R0		; R0/R1 = user's arg

                          01     10  01A3  5100 	BSBB	MTH$DEXP_R7		; R0/R1 = special EXP(R0/R1)

                                 04  01A5  5200 	RET				; return - result in R0/R1

MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page   7

1-7             MTH$DEXP_R7 - Special DEXP routine                                                                               (5)



                                     01A6   100 	.SBTTL	MTH$DEXP_R7 - Special DEXP routine

                                     01A6   200 

                                     01A6   300 ; Special DEXP - used by the standard, and direct interfaces.

                                     01A6   400 ;

                                     01A6   500 ; CALLING SEQUENCE:

                                     01A6   600 ;	save anything needed in R0:R7

                                     01A6   700 ;	MOVD	...,R0			; input in R0

                                     01A6   800 ;	JSB	MTH$DEXP_R7

                                     01A6   900 ;	return with result in R0/R1

                                     01A6  1000 

                                     01A6  1100 ; Note: This routine is written to avoid causing any integer overflows, floating

                                     01A6  1200 ; overflows, or floating underflows or divide by 0 conditions, whether enabled or

                                     01A6  1300 ; not.

                                     01A6  1400 ;

                                     01A6  1500 ; REGISTERS USED:

                                     01A6  1600 ;	R0/R1 - floating argument, then result

                                     01A6  1700 ;	R2/R3 - temp

                                     01A6  1900 ;	R5 - integer scratch

                                     01A6  1950 ;	R6 - integer part of X * LG2(E) * 16   (16I+J)

                                     01A6  2000 ;	R7 - unused

                                     01A6  2100 

                                     01A6  2400 

                                     01A6  2500 MTH$DEXP_R7::				; special DEXP routine

            50       807F 8F     AB  01A6  2600 	BICW3	#^X807F, R0, R2		; Preliminary test for over/underflow

                          52         01AB       

                                     01AC  2650 					; R2 = exponent bits only

            52       3E00 8F     A3  01AC  2700 	SUBW3	#^X3E00, R2, R3		; R3 = 4 + unbiased exponent

                          53         01B1       

            53       0580 8F     B1  01B2  2800 	CMPW	#^X580, R3		; unsigned compare with 11

                          39     1F  01B7  2900 	BLSSU	SMTST			; to more tests if LSSU

                                     01B9  3000 					;  else, -4 < unbiased exp < 8

                                     01B9  3100 					;  no exceptions in EMODD or APPROX

                                     01B9  3200 

         BB 8F       FF43 CF     74  01B9  3300 	EMODD	D_16LOG2_E, #X_273, R0, R6, R0

            56            50         01BF       

                          50         01C1       

                                     01C2  3400 					; get X*16*LG2(E) with

                                     01C2  3500 					;  integer part in R6 (=16I+J)

                                     01C2  3600 					;  fraction in R0/R1

                                     01C2  3700 

            08            50     75  01C2  3800 APPROX:	POLYD	R0,#DXPLN-1,DXPTAB	; use Chebyshev series

                       89 AF         01C5       

                                     01C7  3900 					;  with last coefficient 0

                                     01C7  4000 					;  so that last ADDD has overhang

                                     01C7  4100 

            56   FFFFFFF0 8F     CB  01C7  4200 	BICL3	#-16, R6, R5		; R5 = J

                          55         01CE       

            50       FE2C CF45   64  01CF  4300 	MULD	TABHI[R5], R0		; else MUL by 2**(J/16)

            50       FEA6 CF45   60  01D5  4400 	ADDD	TABLO[R5], R0		; add in LO of 2**(J/16)

            50       FE20 CF45   60  01DB  4500 	ADDD	TABHI[R5], R0		; and then HI of 2**(J/16)

                                     01E1  4600 

            56            0F     CA  01E1  4700 	BICL	#15, R6			; R6 = I

                          0B     13  01E4  4800 	BEQL	20$			; if I=0, then done

            50            6046   7E  01E6  4900 	MOVAQ	(R0)[R6], R0		; shift I to EXP position

                                     01EA  5000 					; MUL by 2**I by exponent addition

       007F 8F            50     B1  01EA  5100 	CMPW	R0, #^X7F		; test for over/underflow

                          39     15  01EF  5200 	BLEQ	EXCEPT			; see what exception is if neg or = 0

MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page   8

1-7             MTH$DEXP_R7 - Special DEXP routine                                                                               (5)



                                 05  01F1  5300 20$:	RSB				; otherwise return result in R0

                                     01F2  5400 

                                     01F2  5500 SMTST:

                          12     19  01F2  5600 	BLSS	20$			; exception if exp+4 > 11

       2400 8F            52     B1  01F4  5700 	CMPW	R2, #^X2400		; eliminate underflow from APPROX1

                          07     19  01F9  5800 	BLSS	10$			; bypass if E**ARG = 1

                                     01FB  5900 

                                     01FB  6000 ;+

                                     01FB  6100 ; Use Chebyshev series for small arg

                                     01FB  6200 ;APPROX1:

                                     01FB  6300 ;-

                                     01FB  6400 

            08            50     75  01FB  6500 	POLYD	R0,#DXPLN1-1,DXPTB1	;Use Chebyshev series

                     FF07 CF         01FE       

                                     0201  6600 					;  last term is 1; this will

                                     0201  6700 					;  give desired overhang.

                                 05  0201  6800 	RSB				; answer is OK, return

                                     0202  6900 

            50            08     70  0202  7000 10$:	MOVD	S^#1, R0		; E**X is 1, store it

                                 05  0205  7100 	RSB				; and return

                                     0206  7200 

                                     0206  7300 

                                     0206  7400 ;

                                     0206  7500 ; Handlers for software detected over/underflow conditions follow

                                     0206  7600 ;

                          50     73  0206  7700 20$:	TSTD	R0			; if big ARG > 0 goto OVERFLOW

                          24     18  0208  7800 	BGEQ	OVER

                                     020A  7900 ;

                                     020A  8000 ; Underflow; if user has FU set, signal error.  Always return 0.0

                                     020A  8100 ;

                                     020A  8200 UNDER:

                          52     DC  020A  8300 	MOVPSL	R2			; R2 = user's or jacket routine's PSL

       0000'CF            00     FB  020C  8400 	CALLS	#0, W^MTH$$JACKET_TST	; R0 = TRUE if JSB from jacket routine

            04            50     E9  0211  8500 	BLBC	R0, 10$			; branch if user did JSB

            52         04 AD     3C  0214  8600 	MOVZWL	SF$W_SAVE_PSW(FP), R2	; get user PSL saved by CALL

                          50     7C  0218  8700 10$:	CLRQ	R0			; R0 = result. LIB$SIGNAL will save in

                                     021A  8800 					; CHF$L_MCH_R0/R1 so any handler can fixup

            52            06     E1  021A  8900 	BBC	#6, R2, 20$		; has user enabled floating underflow?

                          0B         021D       

                          6E     DD  021E  9000 	PUSHL	(SP)			; yes, return PC from special routine

            7E         59 8F     9A  0220  9100 	MOVZBL	#MTH__FLOUNDMAT, -(SP)	; trap code for hardware floating underflow

                                     0224  9200 					; convert to MTH$_FLOUNDMAT (32-bit VAX-11 

                                     0224  9300 					; exception code)

       0000'CF            02     FB  0224  9400 	CALLS	#2, W^MTH$$SIGNAL	; signal (condition, PC)

                                 05  0229  9500 20$:	RSB				; return

                                     022A  9600 

                                     022A  9700 EXCEPT:

                          56     D5  022A  9800 	TSTL	R6			; test sign of I; if I < 0

                          DC     19  022C  9900 	BLSS	UNDER			; go to underflow handler

                                     022E 10000 ;

                                     022E 10100 ; Signal floating overflow, return reserved operand, -0.0

                                     022E 10200 ;

                                     022E 10300 OVER:					; else process for overflow

                          6E     DD  022E 10400 	PUSHL	(SP)			; return PC from special routine

            7E         58 8F     9A  0230 10500 	MOVZBL	#MTH__FLOOVEMAT, -(SP)	; hardware floating overflow

            01            0F     79  0234 10600 	ASHQ	#15, #1, R0		; R0/R1 = result = reserved operand

                          50         0237       

MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page   9

1-7             MTH$DEXP_R7 - Special DEXP routine                                                                               (5)



                                     0238 10700 					; -0.0. R0/0 will be copied to

                                     0238 10800 					; signal mechanism vector (CHF$L_MCH_R0/R1)

                                     0238 10900 					; so can be fixed up by any error

                                     0238 11000 					; handler

       0000'CF            02     FB  0238 11200 	CALLS	#2, W^MTH$$SIGNAL	; signal (condition, PC)

                                 05  023D 11300 	RSB				; return - R0 restoredd from CHF$L_MCH_R0/R1

                                     023E 11400 

                                     023E 11500 

                                     023E 11600 	.END

MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page  10

SYMBOL TABLE                                                                                                                     (5)



ACMASK         = 000040FC            SF$V_FU        = 00000006            

APPROX           000001C2 R     03   SF$V_IV        = 00000005            

BIT...         = 00000010            SF$V_N         = 00000003            

DXPLN          = 00000009            SF$V_SAVE_MASK = 00000000            

DXPLN1         = 00000009            SF$V_STACKOFFS = 0000000E            

DXPTAB           00000150 R     03   SF$V_TBIT      = 00000004            

DXPTB1           00000108 R     03   SF$V_V         = 00000001            

D_16LOG2_E       00000100 R     03   SF$V_Z         = 00000002            

EXCEPT           0000022A R     03   SF$W_SAVE_MASK   00000006            

FOR$K_ERR_PREFX= 00000018            SF$W_SAVE_PSW    00000004            

GBL...         = 00000000            SMTST            000001F2 R     03   

LONG           = 00000004            TABHI            00000000 R     03   

MTH$$JACKET_HND  ********   X   03   TABLO            00000080 R     03   

MTH$$JACKET_TST  ********   X   01   UNDER            0000020A R     03   

MTH$$SIGNAL      ********   X   01   X              = 00000004            

MTH$DEXP         00000198 RG    03   X_273          = 000000BB            

MTH$DEXP_R7      000001A6 RG    03   

MTH$K_ERR_PREFX= 00000016            

MTH__FLOOVEMAT = 00000058            

MTH__FLOUNDMAT = 00000059            

MTH__INVARG    = 00000051            

MTH__LOGZERNEG = 00000053            

MTH__SINSIGLOS = 00000057            

MTH__SQUROONEG = 00000054            

MTH__UNDEXP    = 00000052            

MTH__WRONUMARG = 00000050            

OVER             0000022E R     03   

SD_12          = 00004240            

SD_120         = 000043F0            

SD_60          = 00004370            

SF$A_HANDLER     00000000            

SF$L_SAVE_AP     00000008            

SF$L_SAVE_FP     0000000C            

SF$L_SAVE_PC     00000010            

SF$L_SAVE_REGS   00000014            

SF$M_C         = 00000001            

SF$M_DV        = 00000080            

SF$M_FU        = 00000040            

SF$M_IV        = 00000020            

SF$M_N         = 00000008            

SF$M_TBIT      = 00000010            

SF$M_V         = 00000002            

SF$M_Z         = 00000004            

SF$S_C         = 00000001            

SF$S_CALLS     = 00000001            

SF$S_DV        = 00000001            

SF$S_FU        = 00000001            

SF$S_IV        = 00000001            

SF$S_N         = 00000001            

SF$S_SAVE_MASK = 0000000C            

SF$S_STACKOFFS = 00000002            

SF$S_TBIT      = 00000001            

SF$S_V         = 00000001            

SF$S_Z         = 00000001            

SF$V_C         = 00000000            

SF$V_CALLS     = 0000000D            

SF$V_DV        = 00000007            

MTH$DEXP        ; Double Precision Floating Exponrntial Functio  21-AUG-1978 19:03:48   VAX-11 MACRO X0.3-11               Page  11

PROGRAM SECTION SYNOPSIS                                                                                                         (5)







PROGRAM SECTION SYNOPSIS



.  ABS  .        00000000      00     NOPIC   USR   CON   ABS   LCL NOSHR NOEXE NORD  NOWRT BYTE  

. BLANK .        00000000      01     NOPIC   USR   CON   REL   LCL NOSHR   EXE   RD    WRT BYTE  

$ABS$            00000018      02     NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT BYTE  

MTH$CODE         0000023E      03       PIC   USR   CON   REL   LCL   SHR   EXE   RD  NOWRT LONG  





THERE WERE NO ERRORS OR WARNINGS.

25378. BYTES LEFT IN FREE MEMORY POOL.

156. BYTES OF RECLAIMED MEMORY.

OBJ$:MTHDEXP,LIS$:MTHDEXP/-SP=LIB$:S/ML,SRC$:P,MTHDEXP

5 MLB DIR RDS - 106 GETS TO DEFINE 8 MACROS. 9 INTER. FILE WRITES. 

