
OpenVMS VAX RTL Mathematics (MTH$) Manual
MTH$HACOS
Given the cosine of an angle, the Arc Cosine of Angle Expressed in
Radians (HFloating Value) routine returns that angle (in radians) in
Hfloatingpoint precision.
Format
MTH$HACOS hradians ,cosine
Corresponding JSB Entry Point
MTH$HACOS_R8
RETURNS
None.
Arguments
hradians
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Angle (in radians) whose cosine is specified by
cosine. The hradians argument is the
address of an Hfloating number that is this angle. MTH$HACOS writes
the address of the angle into hradians.
cosine
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
The cosine of the angle whose value (in radians) is to be returned. The
cosine argument is the address of a floatingpoint
number that is this cosine. The absolute value of
cosine must be less than or equal to 1. For MTH$HACOS,
cosine specifies an Hfloating number.
Description
The angle in radians whose cosine is X is computed as:
Value of Cosine 
Value Returned 
0

Pi sign/2

1

0

1

Pi sign

0
< X
< 1

zATAN(zSQRT(1X
^{2})/X) , where zATAN and zSQRT are the Math Library arc
tangent and square root routines, respectively, of the appropriate data
type

1
< X
< 0

zATAN(zSQRT(1X
^{2})/X) + Pi sign

1
< X

The error MTH$_INVARGMAT is signaled

Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HACOS routine encountered a floatingpoint
reserved operand due to incorrect user input. A floatingpoint reserved
operand is a floatingpoint datum with a sign bit of 1 and a biased
exponent of 0. Floatingpoint reserved operands are reserved for future
use by Compaq.

MTH$_INVARGMAT

Invalid argument. The absolute value of
cosine is greater than 1. LIB$SIGNAL copies the
floatingpoint reserved operand to the mechanism argument vector
CHF$L_MCH_SAVR0/R1. The result is the floatingpoint reserved operand
unless you have written a condition handler to change
CHF$L_MCH_SAVR0/R1.

MTH$HACOSD
Given the cosine of an angle, the Arc Cosine of Angle Expressed in
Degrees (HFloating Value) routine returns that angle (in degrees) as
an Hfloating value.
Format
MTH$HACOSD hdegrees ,cosine
Corresponding JSB Entry Point
MTH$HACOSD_R8
RETURNS
None.
Arguments
hdegrees
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Angle (in degrees) whose cosine is specified by
cosine. The hdegrees argument is the
address of an Hfloating number that is this angle. MTH$HACOSD writes
the address of the angle into hdegrees.
cosine
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
Cosine of the angle whose value (in degrees) is to be returned. The
cosine argument is the address of a floatingpoint
number that is this cosine. The absolute value of
cosine must be less than or equal to 1. For
MTH$HACOSD, cosine specifies an Hfloating number.
Description
The angle in degrees whose cosine is X is computed as:
Value of Cosine 
Angle Returned 
0

90

1

0

1

180

0
< X
< 1

zATAND(zSQRT(1X
^{2})/X) , where zATAND and zSQRT are the Math Library arc
tangent and square root routines, respectively, of the appropriate data
type

1
< X
< 0

zATAND(zSQRT(1X
^{2})/X) + 180

1
< X

The error MTH$_INVARGMAT is signaled

Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HACOSD routine encountered a floatingpoint
reserved operand due to incorrect user input. A floatingpoint reserved
operand is a floatingpoint datum with a sign bit of 1 and a biased
exponent of 0. Floatingpoint reserved operands are reserved for future
use by Compaq.

MTH$_INVARGMAT

Invalid argument. The absolute value of
cosine is greater than 1. LIB$SIGNAL copies the
floatingpoint reserved operand to the mechanism argument vector
CHF$L_MCH_SAVR0/R1. The result is the floatingpoint reserved operand
unless you have written a condition handler to change
CHF$L_MCH_SAVR0/R1.

MTH$HASIN
Given the sine of an angle, the Arc Sine in Radians (HFloating Value)
routine returns that angle (in radians) as an Hfloating value.
Format
MTH$HASIN hradians ,sine
Corresponding JSB Entry Point
MTH$HASIN_R8
RETURNS
None.
Arguments
hradians
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Angle (in radians) whose sine is specified by sine.
The hradians argument is the address of an Hfloating
number that is this angle. MTH$HASIN writes the address of the angle
into hradians.
sine
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
The sine of the angle whose value (in radians) is to be returned. The
sine argument is the address of a floatingpoint
number that is this sine. The absolute value of sine
must be less than or equal to 1. For MTH$HASIN, sine
specifies an Hfloating number.
Description
The angle in radians whose sine is X is computed as:
Value of Sine 
Angle Returned 
0

0

1

Pi sign/2

1

Pi sign/2

0
< X
< 1

zATAN(X/zSQRT(1X
^{2})) , where zATAN and zSQRT are the Math Library arc tangent
and square root routines, respectively, of the appropriate data type

1
< X

The error MTH$_INVARGMAT is signaled

Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HASIN routine encountered a floatingpoint
reserved operand due to incorrect user input. A floatingpoint reserved
operand is a floatingpoint datum with a sign bit of 1 and a biased
exponent of 0. Floatingpoint reserved operands are reserved for future
use by Compaq.

MTH$_INVARGMAT

Invalid argument. The absolute value of
sine is greater than 1. LIB$SIGNAL copies the
floatingpoint reserved operand to the mechanism argument vector
CHF$L_MCH_SAVR0/R1. The result is the floatingpoint reserved operand
unless you have written a condition handler to change
CHF$L_MCH_SAVR0/R1.

MTH$HASIND
Given the sine of an angle, the Arc Sine in Degrees (HFloating Value)
routine returns that angle (in degrees) as an Hfloating value.
Format
MTH$HASIND hdegrees ,sine
Corresponding JSB Entry Point
MTH$HASIND_R8
RETURNS
None.
Arguments
hdegrees
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Angle (in degrees) whose sine is specified by sine.
The hdegrees argument is the address of an Hfloating
number that is this angle. MTH$HASIND writes the address of the angle
into hdegrees.
sine
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
Sine of the angle whose value (in degrees) is to be returned. The
sine argument is the address of a floatingpoint
number that is this sine. The absolute value of sine
must be less than or equal to 1. For MTH$HASIND, sine
specifies an Hfloating number.
Description
The angle in degrees whose sine is X is computed as:
Value of Sine 
Value Returned 
0

0

1

90

1

90

0
< X
< 1

zATAND(X/zSQRT(1X
^{2})) , where zATAND and zSQRT are the Math Library arc
tangent and square root routines, respectively, of the appropriate data
type

1
< X

The error MTH$_INVARGMAT is signaled

Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HASIND routine encountered a floatingpoint
reserved operand due to incorrect user input. A floatingpoint reserved
operand is a floatingpoint datum with a sign bit of 1 and a biased
exponent of 0. Floatingpoint reserved operands are reserved for future
use by Compaq.

MTH$_INVARGMAT

Invalid argument. The absolute value of
sine is greater than 1. LIB$SIGNAL copies the
floatingpoint reserved operand to the mechanism argument vector
CHF$L_MCH_SAVR0/R1. The result is the floatingpoint reserved operand
unless you have written a condition handler to change
CHF$L_MCH_SAVR0/R1.

MTH$HATAN
Given the tangent of an angle, the Arc Tangent in Radians (HFloating
Value) routine returns that angle (in radians) as an Hfloating value.
Format
MTH$HATAN hradians ,tangent
Corresponding JSB Entry Point
MTH$HATAN_R8
RETURNS
None.
Arguments
hradians
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Angle (in radians) whose tangent is specified by
tangent. The hradians argument is
the address of an Hfloating number that is this angle. MTH$HATAN
writes the address of the angle into hradians.
tangent
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
The tangent of the angle whose value (in radians) is to be returned.
The tangent argument is the address of a
floatingpoint number that is this tangent. For MTH$HATAN,
tangent specifies an Hfloating number.
Description
In radians, the computation of the arc tangent function is based on the
following identities:

arctan(X) = X  X
^{3}/3 + X
^{5}/5  X
^{7}/7 + ...


arctan(X) = X + X*Q(X
^{2}),
where Q(Y) =  Y/3 + Y
^{2}/5  Y
^{3}/7 + ...


arctan(X) = X*P(X
^{2}),
where P(Y) = 1  Y/3 + Y
^{2}/5  Y
^{3}/7 + ...


arctan(X) = Pi/2  arctan(1/X)


arctan(X) = arctan(A) + arctan((XA)/(1+A*X))
for any real A

The angle in radians whose tangent is X is computed as:
Value of X 
Angle Returned 
0
<= X
<= 3/32

X + X * Q(X
^{2})

3/32
< X
<= 11

ATAN(A) + V* (P(V
^{2})) , where A and ATAN(A) are chosen by table lookup and V =
(X  A)/(1 + A*X)

11
< X

Pi sign/2  W* (P(W
^{2})) where W = 1/X

X
< 0

zATAN(X)

Condition Value Signaled
SS$_ROPRAND

Reserved operand. The MTH$HATAN routine encountered a floatingpoint
reserved operand due to incorrect user input. A floatingpoint reserved
operand is a floatingpoint datum with a sign bit of 1 and a biased
exponent of 0. Floatingpoint reserved operands are reserved for future
use by Compaq.

MTH$HATAND
Given the tangent of an angle, the Arc Tangent in Degrees (HFloating
Value) routine returns that angle (in degrees) as an Hfloating value.
Format
MTH$HATAND hdegrees ,tangent
Corresponding JSB Entry Point
MTH$HATAND_R8
RETURNS
None.
Arguments
hdegrees
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Angle (in degrees) whose tangent is specified by
tangent. The hdegrees argument is
the address of an Hfloating number that is this angle. MTH$HATAND
writes the address of the angle into hdegrees.
tangent
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
The tangent of the angle whose value (in degrees) is to be returned.
The tangent argument is the address of a
floatingpoint number that is this tangent. For MTH$HATAND,
tangent specifies an Hfloating number.
Description
The computation of the arc tangent function is based on the following
identities:

arctan(X) = 180/Pi sign* (X  X
^{3}/3 + X
^{5}/5  X
^{7}/7 + ...)


arctan(X) = 64*X + X*Q(X
^{2}),
where Q(Y) = 180/Pi sign*[(1 64*Pi sign/180)  Y/3 +
Y
^{2}/5  Y
^{3}/7 + Y
^{4}/9 ...]


arctan(X) = X*P(X
^{2}),
where P(Y) = 180/Pi sign*[1  Y/3 + Y
^{2}/5  Y
^{3}/7 +
Y
^{4}/9 ...]


arctan(X) = 90  arctan>(1/X)


arctan(X) = arctan(A) + arctan((X  A)/(1 + A*X))

The angle in degrees whose tangent is X is computed as:
Tangent 
Angle Returned 
X
<= 3/32

64*X + X*Q(X
^{2})

3/32
< X
<= 11

ATAND(A) + V*P(V
^{2}) , where A and ATAND(A) are chosen by table lookup and V =
(X  A)/(1 + A*X)

11
< X

90  W * (P(W
^{2})) , where W = 1/X

X
< 0

zATAND(X)

Condition Value Signaled
SS$_ROPRAND

Reserved operand. The MTH$HATAND routine encountered a floatingpoint
reserved operand due to incorrect user input. A floatingpoint reserved
operand is a floatingpoint datum with a sign bit of 1 and a biased
exponent of 0. Floatingpoint reserved operands are reserved for future
use by Compaq.

MTH$HATAN2
Given sine and cosine, the Arc
Tangent in Radians (HFloating Value) with Two Arguments routine
returns the angle (in radians) as an Hfloating value whose tangent is
given by the quotient of sine and
cosine (sine/cosine).
Format
MTH$HATAN2 hradians ,sine ,cosine
RETURNS
None.
Arguments
hradians
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Angle (in radians) whose tangent is specified by
(sine/cosine). The
hradians argument is the address of an Hfloating
number that is this angle. MTH$HATAN2 writes the address of the angle
into hradians.
sine
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
Dividend. The sine argument is the address of a
floatingpoint number that is this dividend. For MTH$HATAN2,
sine specifies an Hfloating number.
cosine
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
Divisor. The cosine argument is the address of a
floatingpoint number that is this divisor. For MTH$HATAN2,
cosine specifies an Hfloating number.
Description
The angle in radians whose tangent is Y/X is computed
as follows, where f is defined in the description of MTH$zCOSH:
Value of Input Arguments 
Angle Returned 
X = 0 or Y/X > 2
^{(f+1)}

Pi sign/2* (sign Y)

X > 0 and Y/X
<= 2
^{(f+1)}

zATAN(Y/X)

X
< 0 and Y/X
<= 2
^{(f+1)}

Pi sign* (sign Y) + zATAN(Y/X)

Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HATAN2 routine encountered a floatingpoint
reserved operand due to incorrect user input. A floatingpoint reserved
operand is a floatingpoint datum with a sign bit of 1 and a biased
exponent of 0. Floatingpoint reserved operands are reserved for future
use by Compaq.

MTH$_INVARGMAT

Invalid argument. Both
cosine and
sine are zero. LIB$SIGNAL copies the floatingpoint
reserved operand to the mechanism argument vector CHF$L_MCH_SAVR0/R1.
The result is the floatingpoint reserved operand unless you have
written a condition handler to change CHF$L_MCH_SAVR0/R1.

