|
OpenVMS VAX RTL Mathematics (MTH$) Manual
MTH$HATAND2
Given sine and cosine, the Arc
Tangent in Degrees (H-Floating Value) with Two Arguments routine
returns the angle (in degrees) whose tangent is given by the quotient
of sine and cosine
(sine/cosine).
Format
MTH$HATAND2 h-degrees ,sine ,cosine
RETURNS
None.
Arguments
h-degrees
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
write only |
mechanism: |
by reference |
Angle (in degrees) whose tangent is specified by
(sine/cosine). The
h-degrees argument is the address of an H-floating
number that is this angle. MTH$HATAND2 writes the address of the angle
into h-degrees.
sine
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
read only |
mechanism: |
by reference |
Dividend. The sine argument is the address of a
floating-point number that is this dividend. For MTH$HATAND2,
sine specifies an H-floating number.
cosine
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
read only |
mechanism: |
by reference |
Divisor. The cosine argument is the address of a
floating-point number that is this divisor. For MTH$HATAND2,
cosine specifies an H-floating number.
Description
The angle in degrees whose tangent is Y/X is computed
below. The value of f is defined in the description of
MTH$zCOSH.
Value of Input Arguments |
Angle Returned |
X = 0 or Y/X > 2
(f+1)
|
90* (sign Y)
|
X > 0 and Y/X
<= 2
(f+1)
|
zATAND(Y/X)
|
X
< 0 and Y/X
<= 2
(f+1)
|
180 * (sign Y) + zATAND(Y/X)
|
Condition Values Signaled
SS$_ROPRAND
|
Reserved operand. The MTH$HATAND2 routine encountered a floating-point
reserved operand due to incorrect user input. A floating-point reserved
operand is a floating-point datum with a sign bit of 1 and a biased
exponent of 0. Floating-point reserved operands are reserved for future
use by Compaq.
|
MTH$_INVARGMAT
|
Invalid argument. Both
cosine and
sine are zero. LIB$SIGNAL copies the floating-point
reserved operand to the mechanism argument vector CHF$L_MCH_SAVR0/R1.
The result is the floating-point reserved operand unless you have
written a condition handler to change CHF$L_MCH_SAVR0/R1.
|
MTH$HATANH
Given the hyperbolic tangent of an angle, the Hyperbolic Arc Tangent
(H-Floating Value) routine returns the hyperbolic arc tangent (as an
H-floating value) of that angle.
Format
MTH$HATANH h-atanh ,hyperbolic-tangent
RETURNS
None.
Arguments
h-atanh
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
write only |
mechanism: |
by reference |
Hyperbolic arc tangent of the hyperbolic tangent specified by
hyperbolic-tangent. The h-atanh
argument is the address of an H-floating number that is this hyperbolic
arc tangent. MTH$HATANH writes the address of the hyperbolic arc
tangent into h-atanh.
hyperbolic-tangent
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
read only |
mechanism: |
by reference |
Hyperbolic tangent of an angle. The hyperbolic-tangent
argument is the address of a floating-point number that is this
hyperbolic tangent. For MTH$HATANH, hyperbolic-tangent
specifies an H-floating number.
Description
The hyperbolic arc tangent function is computed as follows:
Value of x |
Value Returned |
|X|
< 1
|
zATANH(X) = zLOG((X+1)/(X-1))/2
|
|X| => 1
|
An invalid argument is signaled
|
Condition Values Signaled
SS$_ROPRAND
|
Reserved operand. The MTH$HATANH routine encountered a floating-point
reserved operand due to incorrect user input. A floating-point reserved
operand is a floating-point datum with a sign bit of 1 and a biased
exponent of 0. Floating-point reserved operands are reserved for future
use by Compaq.
|
MTH$_INVARGMAT
|
Invalid argument: |X| => 1. LIB$SIGNAL copies the floating-point
reserved operand to the mechanism argument vector CHF$L_MCH_SAVR0/R1.
The result is the floating-point reserved operand unless you have
written a condition handler to change CHF$L_MCH_SAVR0/R1.
|
MTH$HCOS
The Cosine of Angle Expressed in Radians (H-Floating Value) routine
returns the cosine of a given angle (in radians) as an H-floating value.
Format
MTH$HCOS h-cosine ,angle-in-radians
Corresponding JSB Entry Point
MTH$HCOS_R5
RETURNS
None.
Arguments
h-cosine
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
write only |
mechanism: |
by reference |
Cosine of the angle specified by angle-in-radians. The
h-cosine argument is the address of an H-floating
number that is this cosine. MTH$HCOS writes the address of the cosine
into h-cosine.
angle-in-radians
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
read only |
mechanism: |
by reference |
Angle (in radians). The angle-in-radians argument is
the address of a floating-point number. For MTH$HCOS,
angle-in-radians specifies an H-floating number.
Description
See MTH$xSINCOS for the algorithm used to compute the cosine.
Condition Value Signaled
SS$_ROPRAND
|
Reserved operand. The MTH$HCOS routine encountered a floating-point
reserved operand due to incorrect user input. A floating-point reserved
operand is a floating-point datum with a sign bit of 1 and a biased
exponent of 0. Floating-point reserved operands are reserved for future
use by Compaq.
|
MTH$HCOSD
The Cosine of Angle Expressed in Degrees (H-Floating Value) routine
returns the cosine of a given angle (in degrees) as an H-floating value.
Format
MTH$HCOSD h-cosine ,angle-in-degrees
Corresponding JSB Entry Point
MTH$HCOSD_R5
RETURNS
None.
Arguments
h-cosine
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
write only |
mechanism: |
by reference |
Cosine of the angle specified by angle-in-degrees. The
h-cosine argument is the address of an H-floating
number that is this cosine. MTH$HCOSD writes this cosine into
h-cosine.
angle-in-degrees
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
read only |
mechanism: |
by reference |
Angle (in degrees). The angle-in-degrees argument is
the address of a floating-point number. For MTH$HCOSD,
angle-in-degrees specifies an H-floating number.
Description
See the MTH$SINCOSD routine for the algorithm used to compute the
cosine.
Condition Value Signaled
SS$_ROPRAND
|
Reserved operand. The MTH$HCOSD routine encountered a floating-point
reserved operand due to incorrect user input. A floating-point reserved
operand is a floating-point datum with a sign bit of 1 and a biased
exponent of 0. Floating-point reserved operands are reserved for future
use by Compaq.
|
MTH$HCOSH
The Hyperbolic Cosine (H-Floating Value) routine returns the hyperbolic
cosine of the input value as an H-floating value.
Format
MTH$HCOSH h-cosh ,floating-point-input-value
RETURNS
None.
Arguments
h-cosh
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
write only |
mechanism: |
by reference |
Hyperbolic cosine of the input value specified by
floating-point-input-value. The
h-cosh argument is the address of an H-floating number
that is this hyperbolic cosine. MTH$HCOSH writes the address of the
hyperbolic cosine into h-cosh.
floating-point-input-value
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
read only |
mechanism: |
by reference |
The input value. The floating-point-input-value
argument is the address of this input value. For MTH$HCOSH,
floating-point-input-value specifies an H-floating
number.
Description
Computation of the hyperbolic cosine depends on the magnitude of the
input argument. The range of the function is partitioned using four
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
e-1*ln(2)
|
Based on the above definitions, zCOSH(X) is computed as follows:
Value of X |
Value Returned |
|X|
< a(z)
|
1
|
a(z)
<= |X|
< .25
|
Computed using a power series expansion in |X|
2
|
.25
<= |X|
< b(z)
|
(zEXP(|X|) + 1/zEXP(|X|))/2
|
b(z)
<= |X|
< c(z)
|
zEXP(|X|)/2
|
c(z)
<= |X|
|
Overflow occurs
|
Condition Values Signaled
SS$_ROPRAND
|
Reserved operand. The MTH$HCOSH routine encountered a floating-point
reserved operand due to incorrect user input. A floating-point reserved
operand is a floating-point datum with a sign bit of 1 and a biased
exponent of 0. Floating-point reserved operands are reserved for future
use by Compaq.
|
MTH$_FLOOVEMAT
|
Floating-point overflow in Math Library: the absolute value of
floating-point-input-value is greater than about
yyy; LIB$SIGNAL copies the reserved operand to the signal
mechanism vector. The result is the reserved operand -0.0 unless a
condition handler changes the signal mechanism vector. The value of
yyy is 11356.523.
|
MTH$HEXP
The Exponential (H-Floating Value) routine returns the exponential of
the input value as an H-floating value.
Format
MTH$HEXP h-exp ,floating-point-input-value
Corresponding JSB Entry Point
MTH$HEXP_R6
RETURNS
None.
Arguments
h-exp
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
write only |
mechanism: |
by reference |
Exponential of the input value specified by
floating-point-input-value. The h-exp
argument is the address of an H-floating number that is this
exponential. MTH$HEXP writes the address of the exponential into
h-exp.
floating-point-input-value
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
read only |
mechanism: |
by reference |
The input value. The floating-point-input-value
argument is the address of a floating-point number. For MTH$HEXP,
floating-point-input-value specifies an H-floating
number.
Description
The exponential of x is computed as:
Value of x |
Value Returned |
x > c(z)
|
Overflow occurs
|
x
<= -c(z)
|
0
|
|x|
< 2
-(f+1)
|
1
|
Otherwise
|
2
Y * 2
U * 2
W
|
where: Y = INTEGER(x*ln2(E)) V = FRAC(x*ln2(E)) * 16 U = INTEGER(V)/16
W = FRAC(V)/16 2W = polynomial approximation of degree 14
for z = H.
See also MTH$HCOS for definitions of f and c(z).
Condition Values Signaled
SS$_ROPRAND
|
Reserved operand. The MTH$HEXP routine encountered a floating-point
reserved operand due to incorrect user input. A floating-point reserved
operand is a floating-point datum with a sign bit of 1 and a biased
exponent of 0. Floating-point reserved operands are reserved for future
use by Compaq.
|
MTH$_FLOOVEMAT
|
Floating-point overflow in Math Library:
floating-point-input-value is greater than
yyy; LIB$SIGNAL copies the reserved operand to the signal
mechanism vector. The result is the reserved operand -0.0 unless a
condition handler changes the signal mechanism vector. The value of
yyy is approximately 11355.830 for MTH$HEXP.
|
MTH$_FLOUNDMAT
|
Floating-point underflow in Math Library:
floating-point-input-value is less than or equal to
yyy and the caller (CALL or JSB) has set hardware
floating-point underflow enable. The result is set to 0.0. If the
caller has not enabled floating-point underflow (the default), a result
of 0.0 is returned but no error is signaled. The value of
yyy is approximately --11356.523 for MTH$HEXP.
|
MTH$HLOG
The Natural Logarithm (H-Floating Value) routine returns the natural
(base e) logarithm of the input argument as an H-floating value.
Format
MTH$HLOG h-natlog ,floating-point-input-value
Corresponding JSB Entry Point
MTH$HLOG_R8
RETURNS
None.
Arguments
h-natlog
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
write only |
mechanism: |
by reference |
Natural logarithm of floating-point-input-value. The
h-natlog argument is the address of an H-floating
number that is this natural logarithm. MTH$HLOG writes the address of
this natural logarithm into h-natlog.
floating-point-input-value
OpenVMS usage: |
floating_point |
type: |
H_floating |
access: |
read only |
mechanism: |
by reference |
The input value. The floating-point-input-value
argument is the address of a floating-point number that is this value.
For MTH$HLOG, floating-point-input-value specifies an
H-floating number.
Description
Computation of the natural logarithm routine is based on the following:
- ln(X*Y) = ln(X) + ln(Y)
- ln(1+X) = X - X2/2 + X3/3 - X4/4
...
for |X| < 1
- ln(X) = ln(A) + 2* (V + V3/3 + V5/5 +
V7/7 ...)
where V = (X-A)/(X+A), A > 0,
and p(y) = 2 * (1 + y/3 + y2/5 ...) For x =
2n*f, where n is an integer and f is in the interval of 0.5
to 1, define the following quantities: If n => 1, then N = n-1 and
F = 2f If n <= 0, then N = n and F = f From (1) it
follows that:
- ln(X) = N*ln(2) + ln(F)
Based on the previous relationships, zLOG is computed as follows:
- If |F-1| < 2-5,
zLOG(X) = N*zLOG(2) + W + W*p(W),
where W = F-1.
- Otherwise,
zLOG(X) = N*zLOG(2) + zLOG(A) + V*p(V2),
where V = (F-A)/(F+A) and A and zLOG(A)
are obtained by table lookup.
Condition Values Signaled
SS$_ROPRAND
|
Reserved operand. The MTH$HLOG routine encountered a floating-point
reserved operand due to incorrect user input. A floating-point reserved
operand is a floating-point datum with a sign bit of 1 and a biased
exponent of 0. Floating-point reserved operands are reserved for future
use by Compaq.
|
MTH$_LOGZERNEG
|
Logarithm of zero or negative value. Argument
floating-point-input-value is less than or equal to
0.0. LIB$SIGNAL copies the floating-point reserved operand to the
mechanism argument vector CHF$L_MCH_SAVR0/R1. The result is the
floating-point reserved operand unless you have written a condition
handler to change CHF$L_MCH_SAVR0/R1.
|
|