To: J3 J3/19-203r1 From: Tom Knox Subject: Degree trigonometric functions (US04) Date: 2019-August-07 Reference: 19-145r2, 18-007r1 1 Introduction Addition of the degree trigonometric functions was given specifications in m218, during which 19-145r2 was passed. This paper makes minor corrections and proposes edits. 2 Specifications These elemental intrinsics are generic and not specific. All would be similar to their radian counterparts except that the argument(s) or return values would be in degrees. 3 Syntax ACOSD (X) Description: Arccosine (inverse cosine) function in degrees. Class: Elemental function. Argument: X shall be of type real with a value that satisfies the inequality |X| <= 1. Result Characteristics: Same as X. Result Value: The result has a value equal to a processor-dependent approximation to arccos(X). The result is expressed in degrees and lies in the range of 0 to 180 (inclusive). ASIND (X) Description: Arcsine (inverse sine) function in degrees. Class: Elemental function. Argument: X shall be of type real with a value that satisfies the inequality |X| <= 1. Result Characteristics: Same as X. Result Value: The result has a value equal to a processor-dependent approximation to arcsin(X). The result is expressed in degrees and lies in the range -90 to 90 (inclusive). ATAND (X) or ATAND (Y,X) Description: Arctangent (inverse tangent) function in degrees. Class: Elemental function. Arguments: Y shall be of type real. X If Y appears, X shall be of type real with the same kind type parameter as Y. If Y has the value zero, X shall not have the value zero. If Y does not appear, X shall be of type real. Result Characteristics: Same as X Result Value: If Y appears, the result is the same as the result of ATAN2D (Y, X). If Y does not appear, the result is expressed in degrees, with a value equal to a processor-dependent approximation to arctan(X), and lies in the range -90 to 90 (inclusive). ATAN2D (Y,X) Description: Arctangent (inverse tangent) function in degrees. Class: Elemental function. Arguments: Y shall be of type real. X X shall be of the same type and kind type parameter as Y. If Y has the value zero, X shall not have the value zero. Result Characteristics: Same as X Result Value: The result is expressed in degrees and has a value equal to a processor-dependent approximation to arctan(Y/X) if X /= 0; it lies in the range -180 to 180 (inclusive). If Y > zero, the result is positive. If Y < zero, the result is negative. If Y = zero, the result is Y (if X > zero), approximately 180 (if X < zero and Y is positive real zero or the processor does not distinguish between positive and negative real zero) or approximately -180 (if Y is negative real zero). If X = zero, the absolute value of the result is approximately 90. COSD (X) Description: Degree cosine function. Class: Elemental function. Argument: X shall be of type real, regarded as a value in degrees. Result Characteristics: Same as X. Result Value: The result has a value equal to a processor-dependent approximation to cos(X), where X is expressed in degrees. SIND (X) Description: Degree sine function. Class: Elemental function. Argument: X shall be of type real, regarded as a value in degrees. Result Characteristics: Same as X. Result Value: The result has a value equal to a processor-dependent approximation to sin(X), where X is expressed in degrees. TAND (X) Description: Degree tangent function. Class: Elemental function. Argument: X shall be of type real, regarded as a value in degrees. Result Characteristics: Same as X. Result Value: The result has a value equal to a processor-dependent approximation to tan(X), where X is expressed in degrees. 4 Edits to 18-007r1 """"""""""""""""""" {add mention of degree trigonometric intrinsics to the introduction} [xiii, "Intrinsic procedures and modules" bullet point] Add: "New intrinsic functions support trigonometric computation in which angles are specified in degrees: ACOSD, ASIND, ATAND, ATAN2D, COSD, SIND, and TAND." {add ACOSD to the table describing standard generic intrinsic procedures} [332:15+, 16.7.2, Table 16.1, below the entry for "ACOS"] add (first field under ?Procedure" in the table, second field under "Arguments" in the table, third field under "Class" in the table, final field under "Description" in the table): "ACOSD (X) E Arccosine (inverse cosine) function in degrees." {add ASIND to the table describing standard generic intrinsic procedures} [333, 16.7.2, Table 16.1, below the entry for "ASIN"] add (first field under "Procedure" in the table, second field under "Arguments" in the table, third field under "Class" in the table, final field under "Description" in the table): "ASIND (X) E Arcsine (inverse sine) function in degrees." {add ATAND to the table describing standard generic intrinsic procedures} [333, 16.7.2, Table 16.1, below the entry for "ATAN2"] add (first field under "Procedure" in the table, second field under "Arguments" in the table, third field under "Class" in the table, final field under "Description" in the table): "ATAND (X) or (Y, X) E Arctangent (inverse tangent) function in degrees." {add ATAN2D to the table describing standard generic intrinsic procedures} [333, 16.7.2, Table 16.1, below the entry for "ATAN2"] add (first field under "Procedure" in the table, second field under "Arguments" in the table, third field under "Class" in the table, final field under "Description" in the table): "ATAN2D (Y, X) E Arctangent (inverse tangent) function in degrees." {add COSD to the table describing standard generic intrinsic procedures} [334, 16.7.2, Table 16.1, below the entry for "COS"] add (first field under "Procedure" in the table, second field under "Arguments" in the table, third field under "Class" in the table, final field under "Description" in the table): "COSD (X) E Cosine function in degrees." {add SIND to the table describing standard generic intrinsic procedures} [337, 16.7.2, Table 16.1, below the entry for "SIN"] add (first field under "Procedure" in the table, second field under "Arguments" in the table, third field under "Class" in the table, final field under "Description" in the table): "SIND (X) E Sine function in degrees." {add TAND to the table describing standard generic intrinsic procedures} [337, 16.7.2, Table 16.1, below the entry for "TAN"] add (first field under "Procedure" in the table, second field under "Arguments" in the table, third field under "Class" in the table, final field under "Description" in the table): "TAND (X) E Tangent function in degrees." {add the description of the ACOSD intrinsic} [340:27+, 16.9.4+] Add a new sub-subsection 16.9.4+: " ACOSD (X) Description. Arccosine (inverse cosine) function in degrees. Class. Elemental function. Argument. X shall be of type real with a value that satisfies the inequality |X| <= 1. Result Characteristics. Same as X. Result Value. The result has a value equal to a processor-dependent approximation to arccos(X). The result is expressed in degrees and lies in the range 0 <= ACOSD (X) <= 180. Example. ACOSD (-1.0) has the value 180.0 (approximately). " {add the description of the ASIND intrinsic} [343:31+, 16.9.14+] Add a new sub-subsection 16.9.14+: " ASIND (X) Description. Arcsine (inverse sine) function in degrees. Class. Elemental function. Argument. X shall be of type real with a value that satisfies the inequality |X| <= 1. Result Characteristics. Same as X. Result Value. The result has a value equal to a processor-dependent approximation to arcsin(X). The result is expressed in degrees and lies in the range -90 <= ASIND (X) <= 90. Example. ASIND (1.0) has the value 90.0 (approximately). " {add the description of the ATAND intrinsic} [345:29+, 16.9.18+] Add a new sub-subsection 16.9.18+: " ATAND (X) or ATAND (Y,X) Description. Arctangent (inverse tangent) function in degrees. Class. Elemental function. Arguments. Y shall be of type real. X If Y appears, X shall be of type real with the same kind type parameter as Y. If Y has the value zero, X shall not have the value zero. If Y does not appear, X shall be of type real. Result Characteristics. Same as X Result Value. If Y appears, the result is the same as the result of ATAN2D (Y, X). If Y does not appear, the result is expressed in degrees, with a value equal to a processor-dependent approximation to arctan(X), and lies in the range -90 <= ATAND (X) <= 90. Example. ATAND (1.0) has the value 45.0 (approximately). " {add the description of the ATAN2D intrinsic} [345:29+, 16.9.18+] Add a new sub-subsection 16.9.18+: " ATAN2D (Y, X) Description. Arctangent (inverse tangent) function in degrees. Class. Elemental function. Arguments. Y shall be of type real. X X shall be of the same type and kind type parameter as Y. If Y has the value zero, X shall not have the value zero. Result Characteristics. Same as X Result Value. The result is expressed in degrees and has a value equal to a processor-dependent approximation to arctan(Y/X) if X /= 0; it lies in the range -180 <= ATAN2D (Y, X) <= 180. If Y > zero, the result is positive. If Y < zero, the result is negative. If Y = zero, the result is Y (if X > zero), approximately 180 (if X < zero and Y is positive real zero or the processor does not distinguish between positive and negative real zero) or approximately -180 (if Y is negative real zero). If X = zero, the absolute value of the result is approximately 90. Example. ATAN2D (1.0, 1.0) has the value 45.0 (approximately). If Y has the value $\begin{array}[cc] 1 & 1 // -1 & -1 \end{array}$ and X has the value $\begin{array}[cc] -1 & 1 // -1 & 1 \end{array}$, the value of ATAN2D (Y, X) is approximately $\begin{array}[cc] 135.0 & 45.0 // -135.0 & -45.0 \end{array}$. " {add the description of the COSD intrinsic} [359:4+, 16.9.53+] Add a new sub-subsection 16.9.53+: " COSD (X) Description. Degree cosine function. Class. Elemental function. Argument. X shall be of type real, regarded as a value in degrees. Result Characteristics. Same as X. Result Value. The result has a value equal to a processor-dependent approximation to cos(X), where X is expressed in degrees. Example. COSD (180.0) has the value -1.0 (approximately). " {add the description of the SIND intrinsic} [416:18+, 16.9.177+] Add a new sub-subsection 16.9.177+: " SIND (X) Description. Degree sine function. Class. Elemental function. Argument. X shall be of type real, regarded as a value in degrees. Result Characteristics. Same as X. Result Value. The result has a value equal to a processor-dependent approximation to sin(X), where X is expressed in degrees. Example. SIND (180.0) has the value 0.0 (approximately). " {add the description of the TAND intrinsic} [420:29+, 16.9.187+] Add a new sub-subsection 16.9.187+: " TAND (X) Description. Degree tangent function. Class. Elemental function. Argument. X shall be of type real, regarded as a value in degrees. Result Characteristics. Same as X. Result Value. The result has a value equal to a processor-dependent approximation to tan(X), where X is expressed in degrees. Example. TAND (180.0) has the value 0.0 (approximately). " ==END==