HP OpenVMS Systems Documentation

Content starts here

OpenVMS VAX RTL Mathematics (MTH$) Manual


Previous Contents Index


MTH$HLOG2

The Base 2 Logarithm (H-Floating Value) routine returns the base 2 logarithm of the input value specified by floating-point-input-value as an H-floating value.

Format

MTH$HLOG2 h-log2 ,floating-point-input-value


RETURNS

None.


Arguments

h-log2


OpenVMS usage: floating_point
type: H_floating
access: write only
mechanism: by reference

Base 2 logarithm of floating-point-input-value. The h-log2 argument is the address of an H-floating number that is this base 2 logarithm. MTH$HLOG2 writes the address of this logarithm into h-log2.

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 input value. For MTH$HLOG2, floating-point-input-value specifies an H-floating 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 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.

MTH$HLOG10

The Common Logarithm (H-Floating Value) routine returns the common (base 10) logarithm of the input argument as an H-floating value.

Format

MTH$HLOG10 h-log10 ,floating-point-input-value

Corresponding JSB Entry Point

MTH$HLOG10_R8


RETURNS

None.


Arguments

h-log10


OpenVMS usage: floating_point
type: H_floating
access: write only
mechanism: by reference

Common logarithm of the input value specified by floating-point-input-value. The h-log10 argument is the address of an H-floating number that is this common logarithm. MTH$HLOG10 writes the address of the common logarithm into h-log10.

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$HLOG10, floating-point-input-value specifies an H-floating 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 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.

MTH$HSIN

The Sine of Angle Expressed in Radians (H-Floating Value) routine returns the sine of a given angle (in radians) as an H-floating value.

Format

MTH$HSIN h-sine ,angle-in-radians

Corresponding JSB Entry Point

MTH$HSIN_R5


RETURNS

None.


Arguments

h-sine


OpenVMS usage: floating_point
type: H_floating
access: write only
mechanism: by reference

The sine of the angle specified by angle-in-radians. The h-sine argument is the address of an H-floating number that is this sine. MTH$HSIN writes the address of the sine into h-sine.

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 that is this angle. For MTH$HSIN, angle-in-radians specifies an H-floating 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 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$HSIND

The Sine of Angle Expressed in Degrees (H-Floating Value) routine returns the sine of a given angle (in degrees) as an H-floating value.

Format

MTH$HSIND h-sine ,angle-in-degrees

Corresponding JSB Entry Point

MTH$HSIND_R5


RETURNS

None.


Arguments

h-sine


OpenVMS usage: floating_point
type: H_floating
access: write only
mechanism: by reference

Sine of the angle specified by angle-in-degrees. MTH$HSIND writes into h-sine the address of an H-floating number that is this sine.

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 an H-floating 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 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$_FLOUNDMAT Floating-point underflow in Math Library. The absolute value of the input angle is less than 180/Pi sign*2 -m (where m = 16,384 for H-floating).

MTH$HSINH

The Hyperbolic Sine (H-Floating Value) routine returns the hyperbolic sine of the input value specified by floating-point-input-value as an H-floating value.

Format

MTH$HSINH h-sinh ,floating-point-input-value


RETURNS

None.


Arguments

h-sinh


OpenVMS usage: floating_point
type: H_floating
access: write only
mechanism: by reference

Hyperbolic sine of the input value specified by floating-point-input-value. The h-sinh argument is the address of an H-floating number that is this hyperbolic sine. MTH$HSINH writes the address of the hyperbolic sine into h-sinh.

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$HSINH, floating-point-input-value specifies an H-floating 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 e-1*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 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 yyy. 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. The value of yyy is approximately 11356.523.

MTH$HSQRT

The Square Root (H-Floating Value) routine returns the square root of the input value floating-point-input-value as an H-floating value.

Format

MTH$HSQRT h-sqrt ,floating-point-input-value

Corresponding JSB Entry Point

MTH$HSQRT_R8


RETURNS

None.


Arguments

h-sqrt


OpenVMS usage: floating_point
type: H_floating
access: write only
mechanism: by reference

Square root of the input value specified by floating-point-input-value. The h-sqrt argument is the address of an H-floating number that is this square root. MTH$HSQRT writes the address of the square root into h-sqrt.

floating-point-input-value


OpenVMS usage: floating_point
type: H_floating
access: read only
mechanism: by reference

Input value. The floating-point-input-value argument is the address of a floating-point number that contains this input value. For MTH$HSQRT, floating-point-input-value specifies an H-floating 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 floating-point data
  F is the fractional part of the floating-point 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 = (K-1)/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] = 2K' * 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 Newton-Raphson iterations are performed:

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

where n = 5 for H-floating.


Condition Values Signaled

SS$_ROPRAND Reserved operand. The MTH$HSQRT 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$_SQUROONEG Square root of negative number. Argument floating-point-input-value is less than 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.

MTH$HTAN

The Tangent of Angle Expressed in Radians (H-Floating Value) routine returns the tangent of a given angle (in radians) as an H-floating value.

Format

MTH$HTAN h-tan ,angle-in-radians

Corresponding JSB Entry Point

MTH$HTAN_R5


RETURNS

None.


Arguments

h-tan


OpenVMS usage: floating_point
type: H_floating
access: write only
mechanism: by reference

Tangent of the angle specified by angle-in-radians. The h-tan argument is the address of an H-floating number that is this tangent. MTH$HTAN writes the address of the tangent into h-tan.

angle-in-radians


OpenVMS usage: floating_point
type: H_floating
access: read only
mechanism: by reference

The input angle (in radians). The angle-in-radians argument is the address of a floating-point number that is this angle. For MTH$HTAN, angle-in-radians specifies an H-floating number.

Description

When the input argument is expressed in radians, the tangent function is computed as follows:
  1. If |X| < 2(-f/2) , then zTAN(X) = X (see the section on MTH$zCOSH for the definition of f)
  2. Otherwise, call MTH$zSINCOS to obtain zSIN(X) and zCOS(X); then
    1. If zCOS(X) = 0 , signal overflow
    2. Otherwise, zTAN(X) = zSIN(X)/zCOS(X)

Condition Values Signaled

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

MTH$HTAND

The Tangent of Angle Expressed in Degrees (H-Floating Value) routine returns the tangent of a given angle (in degrees) as an H-floating value.

Format

MTH$HTAND h-tan ,angle-in-degrees

Corresponding JSB Entry Point

MTH$HTAND_R5


RETURNS

None.


Arguments

h-tan


OpenVMS usage: floating_point
type: H_floating
access: write only
mechanism: by reference

Tangent of the angle specified by angle-in-degrees. The h-tan argument is the address of an H-floating number that is this tangent. MTH$HTAND writes the address of the tangent into h-tan.

angle-in-degrees


OpenVMS usage: floating_point
type: H_floating
access: read only
mechanism: by reference

The input angle (in degrees). The angle-in-degrees argument is the address of a floating-point number that is this angle. For MTH$HTAND, angle-in-degrees specifies an H-floating number.

Description

When the input argument is expressed in degrees, the tangent function is computed as follows:
  1. If |X| < (180/Pi sign)*2(-2/(e-1)) and underflow signaling is enabled, underflow is signaled (see the section on MTH$zCOSH for the definition of e).
  2. 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.
  3. Otherwise, call MTH$zSINCOSD to obtain zSIND(X) and zCOSD(X).
    1. Then, if zCOSD(X) = 0 , signal overflow
    2. Else, zTAND(X) = zSIND(X)/zCOSD(X)

Condition Values Signaled

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


Previous Next Contents Index