Support RETURN-FROM in DEF%TR forms
[maxima.git] / share / hompack / fortran / mulp.f
blob74f18075de5d591fe27869a4b5e8f006ab3d6925
1 SUBROUTINE MULP(XXXX,YYYY,ZZZZ)
3 C THIS SUBROUTINE PERFORMS MULTIPLICATION OF COMPLEX NUMBERS:
4 C ZZZZ = XXXX*YYYY
6 C NOTE: IN THE CALLING ROUTINE, ZZZZ SHOULD NOT BE THE SAME
7 C AS XXXX OR YYYY. HOWEVER, XXXX MAY BE THE SAME AS YYYY.
8 C THUS, "CALL MULP(X,X,Z)" IS OK, BUT "CALL MULP(X,Y,X)" IS NOT.
10 C ON INPUT:
12 C XXXX IS AN ARRAY OF LENGTH TWO REPRESENTING THE FIRST COMPLEX
13 C NUMBER, WHERE XXXX(1) = REAL PART OF XXXX AND XXXX(2) =
14 C IMAGINARY PART OF XXXX.
16 C YYYY IS AN ARRAY OF LENGTH TWO REPRESENTING THE SECOND COMPLEX
17 C NUMBER, WHERE YYYY(1) = REAL PART OF YYYY AND YYYY(2) =
18 C IMAGINARY PART OF YYYY.
20 C ON OUTPUT:
22 C ZZZZ IS AN ARRAY OF LENGTH TWO REPRESENTING THE RESULT OF
23 C THE MULTIPLICATION, ZZZZ = XXXX*YYYY, WHERE ZZZZ(1) =
24 C REAL PART OF ZZZZ AND ZZZZ(2) = IMAGINARY PART OF ZZZZ.
26 C DECLARATION OF INPUT
27 DOUBLE PRECISION XXXX,YYYY
28 DIMENSION XXXX(2),YYYY(2)
30 C DECLARATION OF OUTPUT
31 DOUBLE PRECISION ZZZZ
32 DIMENSION ZZZZ(2)
34 ZZZZ(1) = XXXX(1)*YYYY(1) - XXXX(2)*YYYY(2)
35 ZZZZ(2) = XXXX(1)*YYYY(2) + XXXX(2)*YYYY(1)
36 RETURN
37 END