Evaluation of Intrinsic Procedures
by Craig T. Dedo
November 12, 1997
NUMBER: 12
TITLE: Evaluation of Intrinsic Procedures
KEYWORDS: Algorithm, Mathematical, Computational
DEFECT TYPE: Interpretation
STATUS: J3 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 algorithm.
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 computational 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 [98:37-39].
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 [Note 7.24, 99:9-31].
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 [97:1-2, 97:9-27, 98:10-24].
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.4, 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:26, 1:37-38]
EDITS: None.
SUBMITTED BY: Keith H. Bierman
HISTORY: 95-247m134Submitted as F90 interp #202 with proposed response, adopted 9-4
95-256m134Ballot failed, 10-6
95-260m135Proposed response, no action
96-023m136Proposed response, no action
96-054m137Proposed response, no action
96-117 m138 Proposed response, no action
97-259 m143 Re-submitted as F95 interp #12 with proposed response
[End of 97-259]