Op Code (Hex) | Extender | Operand 1 | Operand 2 | Operand 3 | Operand 4 | Operand [5-8] |
---|---|---|---|---|---|---|
CMF2 100C |
| Receiver | Controls | Source 1 | Source 2 |
|
| ||||||
CMF2B 1C0C | Branch options | Receiver | Controls | Source 1 | Source 2 | Branch targets |
| ||||||
CMF2I 180C | Indicator options | Receiver | Controls | Source 1 | Source 2 | Indicator targets |
Operand 2: Character(2) scalar.
Operand 3: Numeric scalar.
Operand 4: Numeric scalar.
Operand 5-8:
The mathematical function, indicated by the controls operand, is performed on the source operand values and the result is placed in the receiver operand.
The calculation is always done in floating-point.
The controls operand must be a character scalar
that specifies which
mathematical function is to be
performed. It must be at least 2 bytes in length and have
the following format:
Offset | |||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Dec | Hex |
| Field Name |
| Data Type and Length | ||||||||
0 | 0 |
| Controls operand |
| Char(2) | ||||||||
|
|
|
| ||||||||||
2 | 2 |
| --- End --- |
|
|
The computation x power y, where x is the first source operand and y is the second source operand, is performed and the result is placed in the receiver operand.
The following chart shows some special cases for certain
arguments of the power function (x**y).
Within the chart, the capitalized letters X and Y refer to the
absolute value of the arguments x and y; that is,
X = |x| and Y = |y|.
y | -inf | y<0 | y<0 | y<0 | -1 | -1/2 | +0 | +1/2 | +1 | y>0 | y>0 | y>0 | +inf | M- | UnM- |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
| y= | y=2n | real |
|
| or |
|
| y= | y=2n | real |
| NaN | NaN |
x |
| 2n+1 |
|
|
|
| -0 |
|
| 2n+1 |
|
|
|
|
|
+inf | +0 | +0 | +0 | +0 | +0 | +0 | +1 | +inf | +inf | +inf | +inf | +inf | +inf | b | A(c) |
x>1 | +0 | +1 ------ X**Y | +1 ------ X**Y | +1 ------ X**Y | +1 ------ X | +1 ---------- SQRT(x) | +1 | SQRT(x) | x | x**y | x**y | x**y | +inf | b | A(c) |
X=+1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | b | A(c) |
0<x<1 | +inf | +1 ------ X**Y | +1 ------ X**Y | +1 ------ X**Y | +1 ------ X | +1 ---------- SQRT(X) | +1 | SQRT(x) | x | x**y | x**y | x**y | +0 | b | A(c) |
x=+0 | E(f) | E(f) | E(f) | E(f) | E(f) | E(f) | +1 | +0 | +0 | +0 | +0 | +0 | +0 | b | A(c) |
x=-0 | E(f) | E(g) | E(f) | E(f) | E(g) | E(g) | +1 | -0 | -0 | -0 | +0 | +0 | +0 | b | A(c) |
0>x>-1 | A(a) | -1 ------ X**Y | +1 ------ X**Y | A(a) | -1 ------ X | A(a) | +1 | A(a) | x | -X**y | X**y | A(a) | A(a) | b | A(c) |
x=-1 | A(a) | -1 | +1 | A(a) | -1 | A(a) | +1 | A(a) | -1 | -1 | +1 | A(a) | A(a) | b | A(c) |
x<-1 | A(a) | -1 ------ X**Y | +1 ------ X**Y | A(a) | -1 ------ X | A(a) | +1 | A(a) | x | -X**y | X**y | A(a) | A(a) | b | A(c) |
x=-inf | A(a) | -0 | +0 | A(a) | -0 | A(a) | +1 | A(a) | -inf | -inf | +inf | A(a) | A(a) | b | A(c) |
Masked Nan | b | b | b | b | b | b | b | b | b | b | b | b | b | d | A(e) |
Unmasked Nan | A(c) | A(c) | A(c) | A(c) | A(c) | A(c) | A(c) | A(c) | A(c) | A(c) | A(c) | A(c) | A(c) | A(e) | A(e) |
Special cases of the power function (x**y) |
Capital letters in the chart indicate the exceptions and small letters indicate the returned results as defined in the following list:
A | Floating-point invalid operand (hex 0C09) exception |
E | Floating-point zero divide (hex 0C0E) exception |
a | Result is the system default masked NaN |
b | Result is the same NaN |
c | Result is the same NaN masked |
d | Result is one of the input NaNs |
e | Result is a masked NAN |
f | Result is +infinity |
g | Result is -infinity |
The following chart provides accuracy data for the mathematical function that can be invoked by this instruction.
+inf | +0 | +0 | +0 | +0 | +0 | +0 | +1 | +inf | +inf | +inf | +inf | +inf | +inf | b | A(c) |
x>1 | +0 | +1
____ x**Y | +1
____ x**Y | +1
____ x**Y | +1
____ x | +1
____ SQRT(x) | +1 | SQRT(x) | x | x**y | x**y | x**y | inf | b | A(c) |
x=+1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | +1 | b | A(c) |
0<x<1 | +inf | +1/x**Y | +1/x**Y | +1/x**Y | +1/x | +1/SQRT(x) | x | x**y | x**y | x**y | +0 | b | A(c) | ||
x=+0 | E(f) | E(f) | E(f) | E(f) | E(f) | E(f) | +1 | +0 | +0 | +0 | +0 | +0 | +0 | b | A(c) |
Special cases of the power function |
---|
Sample Selection | Accuracy data | ||
---|---|---|---|
x | y | MAX(e) | SD(e) |
1/3 | -345 <= y <= 330 | 4.99 * 10**-16 | 1.90 * 10**-16 |
.75 | -1320 <= y <= 1320 | 2.96 * 10**-16 | 2.39 * 10**-16 |
.9 | -3605 <= y <= 3605 | 1.23 * 10**-16 | 1.02 * 10**-16 |
10 | -165 <= y <= 165 | 7.10 * 10**-16 | 3.18 * 10**-16 |
712 | -57 <= y <= 57 | 1.75 * 10**-15 | 7.24 * 10**-16 |
The vertical columns in the accuracy data chart have the following meanings:
where:
f (x)= xg(x,y)= (x**y)**(1/y)
An accuracy sample then, is an evaluation of the degree to which this relation held true.
The range of argument values for x and y were selected such that x was held constant at a particular value and y was uniformly varied throughout a range of values which avoided overflowing or underflowing the result field. The particular values selected are indicated in the subcolumns entitled x and y.
MAX(e) = | MAX( ABS( ( f(x) - g(x) ) / f(x) ) ) where: MAX selects the largest of its arguments and ABS takes the absolute value of its argument. |
SD(e) = | SQR( (1/N) SUMSQ((f(x) - g(x) ) / f(x))) where: SQR takes the square root of its argument and SUMSQ takes the summation of the squares of its arguments over all of the test cases. |
The following are limits that apply to the functions performed by this instruction.
The source and receiver operands must both be specified as floating-point with the same length (4 bytes for short format or 8 bytes for long format).
06 Addressing
08 Argument/Parameter
0C Computation
10 Damage Encountered
1C Machine-Dependent
20 Machine Support
22 Object Access
24 Pointer Specification
2C Program Execution
2E Resource Control Limit
32 Scalar Specification
36 Space Management
44 Protection Violation