HP OpenVMS Systems Documentation

Content starts here

OpenVMS VAX RTL Mathematics (MTH$) Manual


Previous Contents Index


MTH$HACOS

Given the cosine of an angle, the Arc Cosine of Angle Expressed in Radians (H-Floating Value) routine returns that angle (in radians) in H-floating-point precision.

Format

MTH$HACOS h-radians ,cosine

Corresponding JSB Entry Point

MTH$HACOS_R8


RETURNS

None.


Arguments

h-radians


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

Angle (in radians) whose cosine is specified by cosine. The h-radians argument is the address of an H-floating number that is this angle. MTH$HACOS writes the address of the angle into h-radians.

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 floating-point number that is this cosine. The absolute value of cosine must be less than or equal to 1. For MTH$HACOS, cosine specifies an H-floating 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(1-X 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(1-X 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 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. The absolute value of cosine is greater than 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$HACOSD

Given the cosine of an angle, the Arc Cosine of Angle Expressed in Degrees (H-Floating Value) routine returns that angle (in degrees) as an H-floating value.

Format

MTH$HACOSD h-degrees ,cosine

Corresponding JSB Entry Point

MTH$HACOSD_R8


RETURNS

None.


Arguments

h-degrees


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

Angle (in degrees) whose cosine is specified by cosine. The h-degrees argument is the address of an H-floating number that is this angle. MTH$HACOSD writes the address of the angle into h-degrees.

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 floating-point number that is this cosine. The absolute value of cosine must be less than or equal to 1. For MTH$HACOSD, cosine specifies an H-floating 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(1-X 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(1-X 2)/X) + 180
1 < |X| The error MTH$_INVARGMAT is signaled

Condition Values Signaled

SS$_ROPRAND Reserved operand. The MTH$HACOSD 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. The absolute value of cosine is greater than 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$HASIN

Given the sine of an angle, the Arc Sine in Radians (H-Floating Value) routine returns that angle (in radians) as an H-floating value.

Format

MTH$HASIN h-radians ,sine

Corresponding JSB Entry Point

MTH$HASIN_R8


RETURNS

None.


Arguments

h-radians


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

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

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 floating-point number that is this sine. The absolute value of sine must be less than or equal to 1. For MTH$HASIN, sine specifies an H-floating 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(1-X 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 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. The absolute value of sine is greater than 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$HASIND

Given the sine of an angle, the Arc Sine in Degrees (H-Floating Value) routine returns that angle (in degrees) as an H-floating value.

Format

MTH$HASIND h-degrees ,sine

Corresponding JSB Entry Point

MTH$HASIND_R8


RETURNS

None.


Arguments

h-degrees


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

Angle (in degrees) whose sine is specified by sine. The h-degrees argument is the address of an H-floating number that is this angle. MTH$HASIND writes the address of the angle into h-degrees.

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 floating-point number that is this sine. The absolute value of sine must be less than or equal to 1. For MTH$HASIND, sine specifies an H-floating 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(1-X 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 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. The absolute value of sine is greater than 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$HATAN

Given the tangent of an angle, the Arc Tangent in Radians (H-Floating Value) routine returns that angle (in radians) as an H-floating value.

Format

MTH$HATAN h-radians ,tangent

Corresponding JSB Entry Point

MTH$HATAN_R8


RETURNS

None.


Arguments

h-radians


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

Angle (in radians) whose tangent is specified by tangent. The h-radians argument is the address of an H-floating number that is this angle. MTH$HATAN writes the address of the angle into h-radians.

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 floating-point number that is this tangent. For MTH$HATAN, tangent specifies an H-floating 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((X-A)/(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 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$HATAND

Given the tangent of an angle, the Arc Tangent in Degrees (H-Floating Value) routine returns that angle (in degrees) as an H-floating value.

Format

MTH$HATAND h-degrees ,tangent

Corresponding JSB Entry Point

MTH$HATAND_R8


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 tangent. The h-degrees argument is the address of an H-floating number that is this angle. MTH$HATAND writes the address of the angle into h-degrees.

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 floating-point number that is this tangent. For MTH$HATAND, tangent specifies an H-floating 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 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$HATAN2

Given sine and cosine, the Arc Tangent in Radians (H-Floating Value) with Two Arguments routine returns the angle (in radians) as an H-floating value whose tangent is given by the quotient of sine and cosine (sine/cosine).

Format

MTH$HATAN2 h-radians ,sine ,cosine


RETURNS

None.


Arguments

h-radians


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

Angle (in radians) whose tangent is specified by (sine/cosine). The h-radians argument is the address of an H-floating number that is this angle. MTH$HATAN2 writes the address of the angle into h-radians.

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$HATAN2, 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$HATAN2, cosine specifies an H-floating 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 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.


Previous Next Contents Index