X3J3/96-054 Date: February 17, 1996 To: X3J3 From: Craig T. Dedo Subject: Evaluation of Intrinsic Procedures NUMBER: 202 TITLE: Evaluation of Intrinsic Procedures KEYWORDS: Algorithm, Mathematical, Computational DEFECT TYPE: Interpretation STATUS: X3J3 Consideration in Progress QUESTION: 1. When the standard specifies an algorithm for computing a mathematical procedure, must a processor use the specified algorithm? Example: ANINT is defined as INT (A + 0.5). On some processors ANINT (16 000 001.0) evaluates to 16 000 002.0 using this algo- rithm. 2. May a processor return a mathematically equivalent result in the evaluation of a numeric intrinsic procedure? Example: If ANINT (16 000 001.0) can be computed as the more expected 16 000 001.0, may a processor do so? ANSWER: 1. No, a processor is not required to use the algorithm from the standard. 2. Yes, a processor may return the mathematically equivalent result in the evaluation of any numeric intrinsic procedure. DISCUSSION: The use or specification of an algorithm in the standard is intended to specify the value and properties of the required end result. It is not intended to require that a processor use a particular method of achieving that result. Thus, an algorithm specifies the mathematical results, not the computa- tional results, of the evaluation of intrinsic procedures. Although the standard does not directly address this issue, one may infer from several passages that the standard intends to permit a processor to use any mathematically equivalent method in the evaluation of intrinsic procedures. This practice is expressly permitted for the evaluation of numeric intrinsic operations in 7.1.7.3 [81:17-19]. The rules given in 7.2.1 specify the interpretation of a numeric intrinsic operation. Once the interpretation has been established in accordance with those rules, the processor may evaluate any mathematically equivalent expression, provided that the integrity of parentheses is not violated. Further into the section are two tables specifying allowable and nonallowable alternative forms for certain mathematical expressions [81:30-40, 82:3-10]. It is true that rule R701 in section 7.1.1.1 defines a <> as a <>. However, section 7.1.7, "Evaluation of operations", contains several references to rules concerning the evaluation of functions [79:40, 80:4- 17, 81:1-8]. Thus the context indicates that the standard intends to permit a processor this freedom of operation in the evaluation of intrinsic procedures as well. The standard intends to permit a processor to use infinite accuracy if available. Section 1.3.2, Exclusions, states in part, "This International Standard does not specify: . . . (6) The physical properties of the representation of quantities and the method of rounding, approximating, or computing numeric values on a particular processor." [1:19, 1:29-30] EDITS: None. SUBMITTED BY: Keith H. Bierman HISTORY: 95-247 m134 Submitted with proposed response, adopted 9-4 95-256 m134 Ballot failed, 10-6 95-260 m135 Proposed response, no action 96-023 m136 Proposed response, no action 96-054 m137 Proposed response [End of 96-054]