
OpenVMS VAX RTL Mathematics (MTH$) Manual
MTH$HLOG2
The Base 2 Logarithm (HFloating Value) routine returns the base 2
logarithm of the input value specified by
floatingpointinputvalue as an Hfloating value.
Format
MTH$HLOG2 hlog2 ,floatingpointinputvalue
RETURNS
None.
Arguments
hlog2
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Base 2 logarithm of floatingpointinputvalue. The
hlog2 argument is the address of an Hfloating number
that is this base 2 logarithm. MTH$HLOG2 writes the address of this
logarithm into hlog2.
floatingpointinputvalue
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
The input value. The floatingpointinputvalue
argument is the address of a floatingpoint number that is this input
value. For MTH$HLOG2, floatingpointinputvalue
specifies an Hfloating number.
Description
The base 2 logarithm function is computed as follows: zLOG2(X) =
zLOG2(E) * zLOG(X)
Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HLOG2 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$_LOGZERNEG

Logarithm of zero or negative value. Argument
floatingpointinputvalue is less than or equal to
0.0. 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$HLOG10
The Common Logarithm (HFloating Value) routine returns the common
(base 10) logarithm of the input argument as an Hfloating value.
Format
MTH$HLOG10 hlog10 ,floatingpointinputvalue
Corresponding JSB Entry Point
MTH$HLOG10_R8
RETURNS
None.
Arguments
hlog10
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Common logarithm of the input value specified by
floatingpointinputvalue. The
hlog10 argument is the address of an Hfloating
number that is this common logarithm. MTH$HLOG10 writes the address of
the common logarithm into hlog10.
floatingpointinputvalue
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
The input value. The floatingpointinputvalue
argument is the address of a floatingpoint number. For MTH$HLOG10,
floatingpointinputvalue specifies an Hfloating
number.
Description
The common logarithm function is computed as follows: zLOG10(X) =
zLOG10(E) * zLOG(X)
Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HLOG10 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$_LOGZERNEG

Logarithm of zero or negative value. Argument
floatingpointinputvalue is less than or equal to
0.0. 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$HSIN
The Sine of Angle Expressed in Radians (HFloating Value) routine
returns the sine of a given angle (in radians) as an Hfloating value.
Format
MTH$HSIN hsine ,angleinradians
Corresponding JSB Entry Point
MTH$HSIN_R5
RETURNS
None.
Arguments
hsine
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
The sine of the angle specified by angleinradians.
The hsine argument is the address of an Hfloating
number that is this sine. MTH$HSIN writes the address of the sine into
hsine.
angleinradians
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
Angle (in radians). The angleinradians argument is
the address of a floatingpoint number that is this angle. For
MTH$HSIN, angleinradians specifies an Hfloating
number.
Description
See MTH$xSINCOS for the algorithm used to compute this sine.
Condition Value Signaled
SS$_ROPRAND

Reserved operand. The MTH$HSIN 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$HSIND
The Sine of Angle Expressed in Degrees (HFloating Value) routine
returns the sine of a given angle (in degrees) as an Hfloating value.
Format
MTH$HSIND hsine ,angleindegrees
Corresponding JSB Entry Point
MTH$HSIND_R5
RETURNS
None.
Arguments
hsine
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Sine of the angle specified by angleindegrees.
MTH$HSIND writes into hsine the address of an
Hfloating number that is this sine.
angleindegrees
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
Angle (in degrees). The angleindegrees argument is
the address of an Hfloating number that is this angle.
Description
See MTH$xSINCOSD for the algorithm used to compute the sine.
Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HSIND 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$_FLOUNDMAT

Floatingpoint underflow in Math Library. The absolute value of the
input angle is less than 180/Pi sign*2
^{m} (where m = 16,384 for Hfloating).

MTH$HSINH
The Hyperbolic Sine (HFloating Value) routine returns the hyperbolic
sine of the input value specified by
floatingpointinputvalue as an Hfloating value.
Format
MTH$HSINH hsinh ,floatingpointinputvalue
RETURNS
None.
Arguments
hsinh
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Hyperbolic sine of the input value specified by
floatingpointinputvalue. The
hsinh argument is the address of an Hfloating number
that is this hyperbolic sine. MTH$HSINH writes the address of the
hyperbolic sine into hsinh.
floatingpointinputvalue
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
The input value. The floatingpointinputvalue
argument is the address of a floatingpoint number that is this value.
For MTH$HSINH, floatingpointinputvalue specifies an
Hfloating number.
Description
Computation of the hyperbolic sine function depends on the magnitude of
the input argument. The range of the function is partitioned using
three data type dependent constants: a(z), b(z), and c(z). The
subscript z indicates the data type. The constants depend on
the number of exponent bits (e) and the number of fraction
bits (f) associated with the data type (z).
The values of e and f are as follows: e = 15
f = 113
The values of the constants in terms of e and f are:
Variable 
Value 
a(z)

2
^{(f/2)}

b(z)

(f+1)/2*ln(2)

c(z)

2
^{e1}*ln(2)

Based on the above definitions, zSINH(X) is computed as follows:
Value of X 
Value Returned 
X
< a(z)

X

a(z)
<= X
< 1.0

zSINH(X) is computed using a power series expansion in X
^{2}

1.0
<= X
< b(z)

(zEXP(X)  zEXP(X))/2

b(z)
<= X
< c(z)

SIGN(X)*zEXP(X)/2

c(z)
<= X

Overflow occurs

Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HSINH 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$_FLOOVEMAT

Floatingpoint overflow in Math Library: the absolute value of
floatingpointinputvalue is greater than
yyy. 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. The value of
yyy is approximately 11356.523.

MTH$HSQRT
The Square Root (HFloating Value) routine returns the square root of
the input value floatingpointinputvalue as an
Hfloating value.
Format
MTH$HSQRT hsqrt ,floatingpointinputvalue
Corresponding JSB Entry Point
MTH$HSQRT_R8
RETURNS
None.
Arguments
hsqrt
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Square root of the input value specified by
floatingpointinputvalue. The
hsqrt argument is the address of an Hfloating number
that is this square root. MTH$HSQRT writes the address of the square
root into hsqrt.
floatingpointinputvalue
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
Input value. The floatingpointinputvalue argument
is the address of a floatingpoint number that contains this input
value. For MTH$HSQRT, floatingpointinputvalue
specifies an Hfloating number.
Description
The square root of X is computed as follows:

If X
< 0 , an error is signaled.


Let X = 2
^{K} * F


where:


K is the exponential part of the floatingpoint data


F is the fractional part of the floatingpoint data


If K is even:
X = 2
^{(2*P)} * F,
zSQRT(X) = 2
^{P} * zSQRT(F),
1/2
<= F
< 1 , where P = K/2


If K is odd:
X = 2
^{(2*P+1)} * F = 2
^{(2*P+2)} * (F/2) ,
zSQRT(X) = 2
^{(P+1)} * zSQRT(F/2),
1/4
<= F/2
< 1/2 , where p = (K1)/2


Let F' = A*F + B, when K is even:


A = 0.95F6198 (hex)


B = 0.6BA5918 (hex)


Let F' = A* (F/2) + B, when K is odd:


A = 0.D413CCC (hex)


B = 0.4C1E248 (hex)


Let K' = P, when K is even


Let K' = P+1, when K is odd

Let Y[0] = 2^{K'} * F' be a straight line approximation within
the given interval using coefficients A and B, which minimize the
absolute error at the midpoint and endpoint.
Starting with Y[0], n NewtonRaphson iterations are performed:

Y[n+1] = 1/2 * (Y[n] + X/Y[n])

where n = 5 for Hfloating.
Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HSQRT 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$_SQUROONEG

Square root of negative number. Argument
floatingpointinputvalue is less than 0.0.
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$HTAN
The Tangent of Angle Expressed in Radians (HFloating Value) routine
returns the tangent of a given angle (in radians) as an Hfloating
value.
Format
MTH$HTAN htan ,angleinradians
Corresponding JSB Entry Point
MTH$HTAN_R5
RETURNS
None.
Arguments
htan
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Tangent of the angle specified by angleinradians.
The htan argument is the address of an Hfloating
number that is this tangent. MTH$HTAN writes the address of the tangent
into htan.
angleinradians
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
The input angle (in radians). The angleinradians
argument is the address of a floatingpoint number that is this angle.
For MTH$HTAN, angleinradians specifies an Hfloating
number.
Description
When the input argument is expressed in radians, the tangent function
is computed as follows:
 If X < 2^{(f/2)} , then zTAN(X) = X (see the section on
MTH$zCOSH for the definition of f)
 Otherwise, call MTH$zSINCOS to obtain zSIN(X) and zCOS(X); then
 If zCOS(X) = 0 , signal overflow
 Otherwise, zTAN(X) = zSIN(X)/zCOS(X)
Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HTAN 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$_FLOOVEMAT

Floatingpoint overflow in Math Library.

MTH$HTAND
The Tangent of Angle Expressed in Degrees (HFloating Value) routine
returns the tangent of a given angle (in degrees) as an Hfloating
value.
Format
MTH$HTAND htan ,angleindegrees
Corresponding JSB Entry Point
MTH$HTAND_R5
RETURNS
None.
Arguments
htan
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by reference 
Tangent of the angle specified by angleindegrees.
The htan argument is the address of an Hfloating
number that is this tangent. MTH$HTAND writes the address of the
tangent into htan.
angleindegrees
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by reference 
The input angle (in degrees). The angleindegrees
argument is the address of a floatingpoint number that is this angle.
For MTH$HTAND, angleindegrees specifies an
Hfloating number.
Description
When the input argument is expressed in degrees, the tangent function
is computed as follows:
 If X < (180/Pi sign)*2^{(2/(e1))} and underflow
signaling is enabled, underflow is signaled (see the section on
MTH$zCOSH for the definition of e).
 Otherwise, if X < (180/Pi sign)*2^{(f/2)} , then
zTAND(X) = (Pi sign/180)*X . See the description of MTH$zCOSH for the
definition of f.
 Otherwise, call MTH$zSINCOSD to obtain zSIND(X) and zCOSD(X).
 Then, if zCOSD(X) = 0 , signal overflow
 Else, zTAND(X) = zSIND(X)/zCOSD(X)
Condition Values Signaled
SS$_ROPRAND

Reserved operand. The MTH$HTAND 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$_FLOOVEMAT

Floatingpoint overflow in Math Library.

