MTH$CSINCOS     COMPLEX SINE AND COSINE                          21-AUG-1978 19:03:01   VAX-11 MACRO X0.3-11               Page   0

TABLE OF CONTENTS   



   (2)      91  HISTORY		; Detailed Current Edit History

   (3)      97  DECLARATIONS

   (4)     125  MTH$CSIN - COMPLEX SINE

   (5)     171  MTH$CCOS - COMPLEX COSINE

   (6)     219  WORKER - do all the work

MTH$CSINCOS     COMPLEX SINE AND COSINE                          21-AUG-1978 19:03:01   VAX-11 MACRO X0.3-11               Page   1

0-3                                                                                                                              (1)



                                     0000     1 	.TITLE	MTH$CSINCOS	COMPLEX SINE AND COSINE

                                     0000     2 	.IDENT	/0-3/		; File: MTHCSINCO.MAR

                                     0000     3 

                                     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 ;	Return the SINE of a complex number

                                     0000    28 ;	Return the COSINE of a complex number

                                     0000    29 ;

                                     0000    30 ;

                                     0000    31 ;--

                                     0000    32 ;

                                     0000    33 ; VERSION: 0

                                     0000    34 ;

                                     0000    35 ; HISTORY:

                                     0000    36 ;

                                     0000    37 ; AUTHOR:

                                     0000    38 ;	Jonathan M. Taylor, 19-JUL-77: Version 0

                                     0000    39 ;

                                     0000    40 ; MODIFIED BY:

                                     0000    41 ;

                                     0000    42 ;

                                     0000    43 ;

MTH$CSINCOS     COMPLEX SINE AND COSINE                          21-AUG-1978 19:03:01   VAX-11 MACRO X0.3-11               Page   2

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



                                     0000    45 	.SBTTL	HISTORY		; Detailed Current Edit History

                                     0000    46 

                                     0000    47 

                                     0000    48 ; Edit History for Version 0 of MTH$CSINCO

                                     0000    49 ;

MTH$CSINCOS     COMPLEX SINE AND COSINE                          21-AUG-1978 19:03:01   VAX-11 MACRO X0.3-11               Page   3

0-3             DECLARATIONS                                                                                                     (3)



                                     0000    51 	.SBTTL	DECLARATIONS

                                     0000    52 

                                     0000    53 ;

                                     0000    54 ; INCLUDE FILES:

                                     0000    55 ;	OERR.MAR

                                     0000    56 

                                     0000    57 ;

                                     0000    58 ; EXTERNAL SYMBOLS:

                                     0000    59 	.GLOBL	MTH$SIN_R4

                                     0000    60 	.GLOBL	MTH$COS_R4

                                     0000    61 	.GLOBL	MTH$EXP_R4

                                     0000    62 

                                     0000    63 ;

                                     0000    64 ; MACROS:

                                     0000    65 ;	NONE

                                     0000    66 

                                     0000    67 ;

                                     0000    68 ; PSECT DECLARATIONS:

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

                                     0000    70 

                                     0000    71 ;

                                     0000    72 ; EQUATED SYMBOLS:

                           00000004  0000    73 	argadr	=	4	; offset from AP of arg addr

                                     0000    74 

                                     0000    75 ;

                                     0000    76 ; OWN STORAGE:

                                     0000    77 ;	NONE

MTH$CSINCOS     COMPLEX SINE AND COSINE                          21-AUG-1978 19:03:01   VAX-11 MACRO X0.3-11               Page   4

0-3             MTH$CSIN - COMPLEX SINE                                                                                          (4)



                                     0000    79 	.SBTTL	MTH$CSIN - COMPLEX SINE

                                     0000    80 

                                     0000    81 ;++

                                     0000    82 ; FUNCTIONAL DESCRIPTION:

                                     0000    83 ;

                                     0000    84 ;	MTH$CSIN computes the SINE of a COMPLEX number (r, i) as

                                     0000    85 ;

                                     0000    86 ;	result = (SIN(r) * COSH(i), COS(r) * SINH(i))

                                     0000    87 ;

                                     0000    88 ; CALLING SEQUENCE:

                                     0000    89 ;	Sine.wfc.v	= MTH$CSIN(arg.rfc.r)

                                     0000    90 ;

                                     0000    91 ;

                                     0000    92 ; INPUT PARAMETERS:

                                     0000    93 ;	The one input parameter is the address of a COMPLEX number (r, i),

                                     0000    94 ;	where r and i are both single-precision floating point values.

                                     0000    95 ;

                                     0000    96 ; IMPLICIT INPUTS:

                                     0000    97 ;	NONE

                                     0000    98 ;

                                     0000    99 ; OUTPUT PARAMETERS:

                                     0000   100 ;	NONE

                                     0000   101 ;

                                     0000   102 ; IMPLICIT OUTPUTS:

                                     0000   103 ;	NONE

                                     0000   104 ;

                                     0000   105 ; COMPLETION CODES:

                                     0000   106 ;	NONE

                                     0000   107 ;

                                     0000   108 ; SIDE EFFECTS:

                                     0000   109 ;	Signals:	Reserved Operand if r or i are invalid (-0.0)

                                     0000   110 ;			MTH$_SINSIGLOS if |r| > 2*PI*2**31.

                                     0000   111 ;			Floating Overflow if i > 88.028.

                                     0000   112 ;

                                     0000   113 ;--

                                     0000   114 

                                     0000   115 

                               00FC' 0000   116 	.ENTRY	MTH$CSIN,	^M<R2,R3,R4,R5,R6,R7>

                 00000025'EF     16  0002   117 	JSB	WORKER			; R0 = SIN(r)

                                     0008   118 					; R1 = COS(r)

                                     0008   119 					; R2 = SINH(i)

                                     0008   120 					; R3 = COSH(i)

            50            53     44  0008   121 	MULF	R3, R0			; R0 = SIN(r) * COSH(i)

            51            52     44  000B   122 	MULF	R2, R1			; R1 = COS(r) * SINH(i)

                                 04  000E   123 	RET

MTH$CSINCOS     COMPLEX SINE AND COSINE                          21-AUG-1978 19:03:01   VAX-11 MACRO X0.3-11               Page   5

0-3             MTH$CCOS - COMPLEX COSINE                                                                                        (5)



                                     000F   125 	.SBTTL	MTH$CCOS - COMPLEX COSINE

                                     000F   126 

                                     000F   127 ;++

                                     000F   128 ; FUNCTIONAL DESCRIPTION:

                                     000F   129 ;

                                     000F   130 ;	MTH$CCOS computes the COSINE of COMPLEX number (r, i) as follows:

                                     000F   131 ;

                                     000F   132 ;	result = (COS(r) * COSH(i), -SIN(r) * SINH(-i))

                                     000F   133 ;

                                     000F   134 ; CALLING SEQUENCE:

                                     000F   135 ;	Cosine.wfc.v	= MTH$CCOS (arg.rfc.r)

                                     000F   136 ;

                                     000F   137 ;

                                     000F   138 ; INPUT PARAMETERS:

                                     000F   139 ;	The one input parameter is the address of a COMPLEX number (r, i),

                                     000F   140 ;	where r and i are both single-precision floating point values.

                                     000F   141 ;

                                     000F   142 ; IMPLICIT INPUTS:

                                     000F   143 ;	NONE

                                     000F   144 ;

                                     000F   145 ; OUTPUT PARAMETERS:

                                     000F   146 ;	NONE

                                     000F   147 ;

                                     000F   148 ; IMPLICIT OUTPUTS:

                                     000F   149 ;	NONE

                                     000F   150 ;

                                     000F   151 ; COMPLETION CODES:

                                     000F   152 ;	NONE

                                     000F   153 ;

                                     000F   154 ; SIDE EFFECTS:

                                     000F   155 ;	Signals:	Reserved Operand if r or i are invalid (-0.0)

                                     000F   156 ;			MTH$_SINSIGLOS if |r| > 2*PI*2**31.

                                     000F   157 ;			Floating Overflow if i > 88.028.

                                     000F   158 ;

                                     000F   159 ;--

                                     000F   160 

                                     000F   161 

                               00FC' 000F   162 	.ENTRY	MTH$CCOS,	^M<R2,R3,R4,R5,R6,R7>

                 00000025'EF     16  0011   163 	JSB	WORKER			; R0 = SIN(r)

                                     0017   164 					; R1 = COS(r)

                                     0017   165 					; R2 = SINH(i)

                                     0017   166 					; R3 = COSH(i)

            53            51     44  0017   167 	MULF	R1, R3			; R3 = COS(r) * COSH(i)

            50            50     52  001A   168 	MNEGF	R0, R0			; R0 = -SIN(r)

            52            50     45  001D   169 	MULF3	R0, R2, R1		; R1 = -SIN(r) * SINH(i)

                          51         0020       

            50            53     D0  0021   170 	MOVL	R3, R0			; R0 = COS(r) * COSH(i)

                                 04  0024   171 	RET

MTH$CSINCOS     COMPLEX SINE AND COSINE                          21-AUG-1978 19:03:01   VAX-11 MACRO X0.3-11               Page   6

0-3             WORKER - do all the work                                                                                         (6)



                                     0025   173 	.SBTTL	WORKER - do all the work

                                     0025   174 

                                     0025   175 ;+

                                     0025   176 ; Setup error handler

                                     0025   177 ; Compute:

                                     0025   178 ;	R0 = SIN(r)

                                     0025   179 ;	R1 = COS(r)

                                     0025   180 ;	R2 = SINH(i)

                                     0025   181 ;	R3 = COSH(i)

                                     0025   182 ;-

                                     0025   183 

                                     0025   184 WORKER:

                                     0025   185 	MTH$FLAG_JACKET			; set up error handler

                                     0025      

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

                                     002A       					; set handler address to jacket

                                     002A       					; handler

                                     002A       

            50         04 AC     D0  002A   186 	MOVL	argadr(AP), R0		; R0 -> (r, i)

            50         04 A0     50  002E   187 	MOVF	4(R0), R0		; R0 = i

                 00000000'EF     16  0032   188 	JSB	MTH$EXP_R4		; R0 = EXP(i)

            08            50     47  0038   189 	DIVF3	R0, #1.0, R1		; R1 = EXP(-i)

                          51         003B       

                                     003C   190 

            50            51     43  003C   191 	SUBF3	R1, R0, R5		; R5 = EXP(i) - EXP(-i)

                          55         003F       

            55            00     44  0040   192 	MULF	#0.5, R5		; R5 = (EXP(i) - EXP(-i))/2

                                     0043   193 

            50            51     41  0043   194 	ADDF3	R1, R0, R6		; R6 = EXP(i) + EXP(-i)

                          56         0046       

            56            00     44  0047   195 	MULF	#0.5, R6		; R6 = (EXP(i) + EXP(-i))/2

                                     004A   196 

            50         04 BC     50  004A   197 	MOVF	@argadr(AP), R0		; R0 = r

                 00000000'EF     16  004E   198 	JSB	MTH$COS_R4		; R0 = COS(r)

            57            50     D0  0054   199 	MOVL	R0, R7			; R7 = COS(r)

                                     0057   200 

            50         04 BC     50  0057   201 	MOVF	@argadr(AP), R0		; R0 = r

                 00000000'EF     16  005B   202 	JSB	MTH$SIN_R4		; R0 = SIN(r)

                                     0061   203 

            51            57     D0  0061   204 	MOVL	R7, R1			; R1 = COS(r)

            52            55     D0  0064   205 	MOVL	R5, R2			; R2 = SINH(i)

            53            56     D0  0067   206 	MOVL	R6, R3			; R3 = COSH(i)

                                     006A   207 

                                 05  006A   208 	RSB

                                     006B   209 

                                     006B   210 

                                     006B   211 

                                     006B   212 	.END

MTH$CSINCOS     COMPLEX SINE AND COSINE                          21-AUG-1978 19:03:01   VAX-11 MACRO X0.3-11               Page   7

SYMBOL TABLE                                                                                                                     (6)



ARGADR         = 00000004            

FOR$K_ERR_PREFX= 00000018            

MTH$$JACKET_HND  ********   X   02   

MTH$CCOS         0000000F RG    02   

MTH$COS_R4       ********  GX   01   

MTH$CSIN         00000000 RG    02   

MTH$EXP_R4       ********  GX   01   

MTH$K_ERR_PREFX= 00000016            

MTH$SIN_R4       ********  GX   01   

MTH__FLOOVEMAT = 00000058            

MTH__FLOUNDMAT = 00000059            

MTH__INVARG    = 00000051            

MTH__LOGZERNEG = 00000053            

MTH__SINSIGLOS = 00000057            

MTH__SQUROONEG = 00000054            

MTH__UNDEXP    = 00000052            

MTH__WRONUMARG = 00000050            

WORKER           00000025 R     02   





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  

MTH$CODE         0000006B      02       PIC   USR   CON   REL   LCL   SHR   EXE   RD  NOWRT LONG  





THERE WERE NO ERRORS OR WARNINGS.

27926. BYTES LEFT IN FREE MEMORY POOL.

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

0 MLB DIR RDS - 0 GETS TO DEFINE 0 MACROS. 2 INTER. FILE WRITES. 

