MTH$SINH        ; Floating Point Hyperbolic Sine routine         21-AUG-1978 19:08:51   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)      91  HISTORY	; Detailed Current Edit History

   (3)     108  DECLARATIONS	; Declarative Part of Module

   (4)     154  MTH$SINH  - Standard Single Precision Floating 

MTH$SINH        ; Floating Point Hyperbolic Sine routine         21-AUG-1978 19:08:51   VAX-11 MACRO X0.3-11               Page   1

0-4                                                                                                                              (1)



                                     0000     1 	.TITLE	MTH$SINH 	; Floating Point Hyperbolic Sine routine

                                     0000     2 				; (SINH)

                                     0000     3 	.IDENT /0-4/		; File: MTHSINH.MAR

                                     0000     4 ;

                                     0000     5 ; Copyright (C) 1977

                                     0000     6 ; Digital Equipment Corporation, Maynard, Massachusetts 01754

                                     0000     7 ;

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

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

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

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

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

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

                                     0000    14 ; remain in DEC.

                                     0000    15 ;

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

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

                                     0000    18 ; Corporation.

                                     0000    19 ;

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

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

                                     0000    22 ;

                                     0000    23 ;

                                     0000    24 ; FACILITY: MATH LIBRARY

                                     0000    25 ;++

                                     0000    26 ; ABSTRACT:

                                     0000    27 ;

                                     0000    28 ; MTH$SINH is a function  which  returns the floating point hyperbolic sine

                                     0000    29 ; of its single precision floating point argument. The call is standard

                                     0000    30 ; call-by-reference.

                                     0000    31 ;

                                     0000    32 ;--

                                     0000    33 ;

                                     0000    34 ; VERSION: 01

                                     0000    35 ;

                                     0000    36 ; HISTORY:

                                     0000    37 ; AUTHOR:

                                     0000    38 ;	Peter Yuo, 29-Jun-77: Version 01

                                     0000    39 ;

                                     0000    40 ; MODIFIED BY:

                                     0000    41 ;

                                     0000    42 ;

                                     0000    43 ;

MTH$SINH        ; Floating Point Hyperbolic Sine routine         21-AUG-1978 19:08:51   VAX-11 MACRO X0.3-11               Page   2

0-4             HISTORY ; Detailed Current Edit History                                                                          (2)



                                     0000    45 	.SBTTL	HISTORY	; Detailed Current Edit History

                                     0000    46 

                                     0000    47 

                                     0000    48 ; ALGORITHMIC DIFFERENCES FROM FP-11/C ROUTINE:	none

                                     0000    49 ;

                                     0000    50 ; Edit History for Version 01 of MTH$SINH 

                                     0000    51 ;

                                     0000    52 ; 0-2	MTH$$ERROR changed to MTH$$SIGNAL.

                                     0000    53 ;	MTH$_... changed to MTH__....

                                     0000    54 ;	Changed error handling mechanism. Put error result in R0 before 

                                     0000    55 ;	calling MTH$$SIGNAL in order to allow user modify error result.

                                     0000    56 ;

                                     0000    57 ; 0-3	Six term Taylor series, in powers of the argument, replaced

                                     0000    58 ;	by four term Chebyshev series, in powers of ARG**2, with

                                     0000    59 ;	overhang, for small arguments; this improves accuracy.

                                     0000    60 ;	18-May-1978; Mary Payne

MTH$SINH        ; Floating Point Hyperbolic Sine routine         21-AUG-1978 19:08:51   VAX-11 MACRO X0.3-11               Page   3

0-4             DECLARATIONS ; Declarative Part of Module                                                                        (3)



                                     0000    62 	.SBTTL	DECLARATIONS	; Declarative Part of Module

                                     0000    63 

                                     0000    64 ;

                                     0000    65 ; INCLUDE FILES:	OTSPARAMS.MAR

                                     0000    66 ;

                                     0000    67 ; EXTERNAL SYMBOLS:	MTH$JACKET_HDLR

                                     0000    68 ;

                                     0000    69 ; EQUATED SYMBOLS:

                                     0000    70 

                           00003F80  0000    71 	LF_0.25	= 0@16 + ^X3F80		; 0.25

                           000043AE  0000    72 	LF_87.0	= 0@16 + ^O041656	; 87.0

                           00003B00  0000    73 	LF_2_POWER_M11	= 0@16 + ^X3B00	; 2**-11

                           72184031  0000    74 	LF_LOG_2	= ^O071030@16 + ^O040061

                                     0000    75 					; LOG(2)

                           00004000  0000    76 	SF_0.5	= ^F0.5			; 0.5

                           00004080  0000    77 	SF_1.0	= ^F1.0			; 1.0

                           00000004  0000    78 	value	= 4			; value.rf.r

                                     0000    79 

                                     0000    80 ;

                                     0000    81 ; MACROS:	none

                                     0000    82 ;

                                     0000    83 

                                     0000    84 

                                     0000    85 	$SRMDEF				; SRM$ symbol definitions

                                     0000    86 

                                     0000    87 ;

                                     0000    88 ; PSECT DECLARATIONS:

                                     0000    89 

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

                                     0000    91 					; program section for math routines

                                     0000    92 ;

                                     0000    93 ; OWN STORAGE:	none

                                     0000    94 ;

                                     0000    95 ;

                                     0000    96 ; CONSTANTS:

                                     0000    97 ;

                                     0000    98 

                                     0000    99 

                                     0000   100 SINHTAB:

                          698B 3A50  0000   101 	.WORD	^O035120,^O064613	; DECIMAL:    0.1987574E-03

                          887A 3D08  0004   102 	.WORD	^O036410,^O104172	; DECIMAL:    0.8333320E-02

                          AAAB 3F2A  0008   103 	.WORD	^O037452,^O125253	; DECIMAL:    0.1666667E+00

                          0000 0000  000C   104 	.WORD	0,0			; DECIMAL: 0.D0

                           00000004  0010   105 SINHLEN	= .- SINHTAB/4

                                     0010   106 

MTH$SINH        ; Floating Point Hyperbolic Sine routine         21-AUG-1978 19:08:51   VAX-11 MACRO X0.3-11               Page   4

0-4             MTH$SINH  - Standard Single Precision Floating                                                                   (4)



                                     0010   108 	.SBTTL	MTH$SINH  - Standard Single Precision Floating SINH

                                     0010   109 

                                     0010   110 

                                     0010   111 ;++

                                     0010   112 ; FUNCTIONAL DESCRIPTION:

                                     0010   113 ;

                                     0010   114 ; SINH  - single precision floating point function

                                     0010   115 ;

                                     0010   116 ; SINH(X) is computed as:

                                     0010   117 ;

                                     0010   118 ;	If |X| < 2**-11, SINH(X) = X.

                                     0010   119 ;	IF 2**-11 =< |X| < 0.25, SINH(X) = Chebyshev Series

                                     0010   120 ;	If 0.25 =< |X| =< 87.0, SINH(X) = (EXP(X) - EXP(-X))/2

                                     0010   121 ;	If 87.0 < |X| and |X| - LOG(2) < 87, then SINH(X) = sign(X)* EXP(|X|-LOG(2)).

                                     0010   122 ;	If 87.0 < |X| and |X| - LOG(2) = 87, then overflow.

                                     0010   123 ;

                                     0010   124 ; CALLING SEQUENCE:

                                     0010   125 ;

                                     0010   126 ;	SINH.wf.v = MTH$SINH(x.rf.r)

                                     0010   127 ;

                                     0010   128 ; INPUT PARAMETERS:

                                     0010   129 

                           00000004  0010   130 	LONG = 4			; define longword multiplier

                           00000004  0010   131 	x = 1 * LONG			; Contents of x is the argument

                                     0010   132 

                                     0010   133 ; IMPLICIT INPUTS:	none

                                     0010   134 ;

                                     0010   135 ; OUTPUT PARAMETERS:

                                     0010   136 ;

                                     0010   137 ;	VALUE:	floating hyperbolic sine of the argument

                                     0010   138 ;

                                     0010   139 ; IMPLICIT OUTPUTS:	none

                                     0010   140 ;

                                     0010   141 ; COMPLETION CODES:	none

                                     0010   142 ;

                                     0010   143 ; SIDE EFFECTS:

                                     0010   144 ;

                                     0010   145 ; Signal: MTH$_FLOOVEMAT if 87+LOG(2) < |X| with reserved operand in R0 (copied

                                     0010   146 ; to the signal mechanism vector CHF$L_MCH_R0/R1 by LIB$SIGNAL). Associated

                                     0010   147 ; message is: "FLOATING OVERFLOW IN MATH LIBRARY". Result is reserved operand -0.0

                                     0010   148 ; unless a user supplied (or any) error handler changes CHF$L_MCH_R0/R1.

                                     0010   149 ;

                                     0010   150 ; NOTE: This procedure disables floating point underflow, enables integer

                                     0010   151 ; overflow.

                                     0010   152 ;

                                     0010   153 ;---

                                     0010   154 

                                     0010   155 

                               403C' 0010   156 	.ENTRY	MTH$SINH, ^M<IV, R2, R3, R4, R5>

                                     0012   157 					; standard call-by-reference entry

                                     0012   158 					; disable DV (and FU), enable IV

                                     0012   159 	MTH$FLAG_JACKET			; flag that this is a jacket procedure in

                                     0012      

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

                                     0017       					; set handler address to jacket

                                     0017       					; handler

                                     0017       

MTH$SINH        ; Floating Point Hyperbolic Sine routine         21-AUG-1978 19:08:51   VAX-11 MACRO X0.3-11               Page   5

0-4             MTH$SINH  - Standard Single Precision Floating                                                                   (4)



                                     0017   160 					; case of an error in routine

                                     0017   161 					; If an error, convert signal to user PC

                                     0017   162 					; and resignal

            55         04 BC     50  0017   163 	MOVF	@value(AP), R5		; R5 = X = @value(AP)

            50            55     50  001B   164 	MOVF	R5, R0

            50       8000 8F     AA  001E   165 	BICW2	#^X8000, R0		; R0 = |X|

       3F80 8F            50     B1  0023   166 	CMPW	R0, #^X3F80		; compare |X| with 0.25

                          1A     18  0028   167 	BGEQ	GEQ_TO_0.25		; branch if |X| >= 0.25

                                     002A   168 

                                     002A   169 ;

                                     002A   170 ; |X| < 0.25

                                     002A   171 ;

                                     002A   172 

       3B00 8F            50     B1  002A   173 	CMPW	R0, #^X3B00		; compare |X| with 2**-11

                          04     18  002F   174 	BGEQ	GEQ_TO_2M11		; branch if |X| >= 2**-11

                                     0031   175 

                                     0031   176 ;

                                     0031   177 ; |X| < 2**-11

                                     0031   178 ;

                                     0031   179 

            50            55     50  0031   180 	MOVF	R5, R0		; R0 = X

                                 04  0034   181 	RET				; return with result = Argument

                                     0035   182 

                                     0035   183 ;

                                     0035   184 ; 2**-11 =< |X| < 0.25

                                     0035   185 ;

                                     0035   186 

                                     0035   187 GEQ_TO_2M11:

            50            50     44  0035   188 	MULF	R0, R0			;Get ARG**2 for POLYF

            03            50     55  0038   189 	POLYF	R0, #SINHLEN-1, SINHTAB	; R0 = SUM(Ci*X**(2*i))

                       C3 AF         003B       

                                     003D   190 					;  Last coefficient is zero

            50            55     44  003D   191 	MULF	R5, R0			;MUL by ARG and then

            50            55     40  0040   192 	ADDF	R5, R0			;  add in ARG with overhang

                                 04  0043   193 	RET				; return with result in R0

                                     0044   194 

                                     0044   195 ;

                                     0044   196 ; 0.25 =< |X|

                                     0044   197 ;

                                     0044   198 

                                     0044   199 GEQ_TO_0.25:

   000043AE 8F            50     51  0044   200 	CMPF	R0, #LF_87.0		; compare |X| with 87.0

                          1C     14  004B   201 	BGTR	GTR_THAN_87.0		; branch if X > 87.0

                                     004D   202 

                                     004D   203 ;

                                     004D   204 ; 0.25 =< |X| =< 87.0

                                     004D   205 ;

                                     004D   206 

            50            55     50  004D   207 	MOVF	R5, R0			; R0 = X

                 00000000'EF     16  0050   208 	JSB	MTH$EXP_R4		; R0 = EXP(X)

                          50     DD  0056   209 	PUSHL	R0			; push EXP(X) on stack

            50            55     52  0058   210 	MNEGF	R5, R0			; R0 = -X

                 00000000'EF     16  005B   211 	JSB	MTH$EXP_R4		; R0 = EXP(-X)

            8E            50     43  0061   212 	SUBF3	R0, (SP)+, R0		; R0 = EXP(X) - EXP(-X)

                          50         0064       

            50            00     44  0065   213 	MULF	S^#SF_0.5, R0		; R0 = (EXP(X) - EXP(-X))/2

                                 04  0068   214 	RET				; return with result in R0

MTH$SINH        ; Floating Point Hyperbolic Sine routine         21-AUG-1978 19:08:51   VAX-11 MACRO X0.3-11               Page   6

0-4             MTH$SINH  - Standard Single Precision Floating                                                                   (4)



                                     0069   215 

                                     0069   216 ;

                                     0069   217 ; 87.0 < |X|

                                     0069   218 ;

                                     0069   219 

                                     0069   220 GTR_THAN_87.0:

            50   72184031 8F     42  0069   221 	SUBF	#LF_LOG_2, R0		; R0 = |X| - LOG(2)

   000043AE 8F            50     51  0070   222 	CMPF	R0, #LF_87.0		; compare |X| - LOG(2) with 87.0

                          0E     18  0077   223 	BGEQ	ERROR			; branch to ERROR if |X| - LOG(2) >= 87.0

                                     0079   224 

                                     0079   225 

                                     0079   226 ;

                                     0079   227 ; 87.0 < |X| < 87.0 + LOG(2)

                                     0079   228 ;

                                     0079   229 

                 00000000'EF     16  0079   230 	JSB	MTH$EXP_R4		; R0 = EXP(|X|-LOG(2))

                          55     53  007F   231 	TSTF	R5			; test the sign of X

                          03     18  0081   232 	BGEQ	10$			; branch if X >= 0

            50            50     52  0083   233 	MNEGF	R0, R0			; R0 = sign(X) * EXP(|X|-LOG(2))

                                 04  0086   234 10$:	RET				; return with result in R0

                                     0087   235 

                                     0087   236 ;

                                     0087   237 ; 87.0 + LOG(2) =< |X|, error

                                     0087   238 ;

                                     0087   239 

            7E         58 8F     9A  0087   240 ERROR:	MOVZBL	#MTH__FLOOVEMAT, -(SP)	; condition value

            01            0F     78  008B   241 	ASHL	#15, #1, R0		; R0 = result = reserved operand -0.0

                          50         008E       

                                     008F   242 					; goes to signal mechanism vector

                                     008F   243 					; (CHF$L_MCH_R0/R1) so error handler

                                     008F   244 					; can modify the result.

       0000'CF            01     FB  008F   245 	CALLS	#1, W^MTH$$SIGNAL	; signal error and use real user's PC

                                     0094   246 					; independent of CALL vs JSB

                                 04  0094   247 	RET				; return - R0 restored from CHF$L_MCH_R0/R1

                                     0095   248 

                                     0095   249 

                                     0095   250 

                                     0095   251 	.END

MTH$SINH        ; Floating Point Hyperbolic Sine routine         21-AUG-1978 19:08:51   VAX-11 MACRO X0.3-11               Page   7

SYMBOL TABLE                                                                                                                     (4)



ERROR            00000087 R     03   

FOR$K_ERR_PREFX= 00000018            

GBL...         = 00000000            

GEQ_TO_0.25      00000044 R     03   

GEQ_TO_2M11      00000035 R     03   

GTR_THAN_87.0    00000069 R     03   

LF_0.25        = 00003F80            

LF_2_POWER_M11 = 00003B00            

LF_87.0        = 000043AE            

LF_LOG_2       = 72184031            

LONG           = 00000004            

MTH$$JACKET_HND  ********   X   03   

MTH$$SIGNAL      ********   X   03   

MTH$EXP_R4       ********   X   03   

MTH$K_ERR_PREFX= 00000016            

MTH$SINH         00000010 RG    03   

MTH__FLOOVEMAT = 00000058            

MTH__FLOUNDMAT = 00000059            

MTH__INVARG    = 00000051            

MTH__LOGZERNEG = 00000053            

MTH__SINSIGLOS = 00000057            

MTH__SQUROONEG = 00000054            

MTH__UNDEXP    = 00000052            

MTH__WRONUMARG = 00000050            

SF_0.5         = 00004000            

SF_1.0         = 00004080            

SINHLEN        = 00000004            

SINHTAB          00000000 R     03   

SRM$K_DEC_OVF_T= 00000006            

SRM$K_FLT_DIV_T= 00000004            

SRM$K_FLT_OVF_T= 00000003            

SRM$K_FLT_UND_T= 00000005            

SRM$K_INT_DIV_T= 00000002            

SRM$K_INT_OVF_T= 00000001            

SRM$K_SUB_RNG_T= 00000007            

VALUE          = 00000004            

X              = 00000004            





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$            00000000      02     NOPIC   USR   CON   ABS   LCL NOSHR   EXE   RD    WRT BYTE  

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





THERE WERE NO ERRORS OR WARNINGS.

26906. BYTES LEFT IN FREE MEMORY POOL.

8. BYTES OF RECLAIMED MEMORY.

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

5 MLB DIR RDS - 38 GETS TO DEFINE 5 MACROS. 3 INTER. FILE WRITES. 

