HP MLIB User's Guide Vol. 2 7th Ed.

846 HP MLIB User’s Guide
vsatan2, vdatan2 The arctangent and quandrant function of the corresponding elements of two vectors
Name vsatan2, vdatan2
The arctangent and quandrant function of the corresponding elements of two
vectors
Purpose vsatan2 and vdatan2 calculate the arctangent function of the quotient of vector
element pairs a(i)/b(i), in the range -Pi to Pi, using the signs of both arguments
to determine the quadrant of the result value:
y(i) = atan2(a(i), b(i)), for 1 <= i <= n
Usage The Fortran include file math.fi declares interfaces for these subroutines,
suitable for both VMATH and VMATH8. The interfaces are compatible with
Intel’s MKL VML (Vector Math Library).
SUBROUTINE vsatan2(n, a, b, y)
INTEGER, INTENT(IN) :: n
REAL (KIND=4), DIMENSION(n), INTENT(IN) :: a, b
REAL (KIND=4), DIMENSION(n), INTENT(OUT):: y
SUBROUTINE vdatan2(n, a, b, y)
INTEGER, INTENT(IN) :: n
REAL (KIND=8), DIMENSION(n), INTENT(IN) :: a, b
REAL (KIND=8), DIMENSION(n), INTENT(OUT):: y
Input n Number of elements to be calculated.
a Array of length at least n, specifying the input vector of
numerators.
b Array of length at least n, specifying the input vector of
denominators.
Output y Array of length at least n specifying the output vector.