Real and complex semantics of ExecComplex #
The component map toComplex interprets finite executable values as mathematical complex numbers.
Addition and subtraction round each component once. Multiplication records all six rounding sites:
four scalar products, the subtraction forming the real component, and the addition forming the
imaginary component. Each intermediate rounding appears in the corresponding theorem.
Division records the chosen component ratio and every subsequent rounding. Squared magnitude records two rounded squares and their rounded sum; magnitude applies this to scaled components. Neither an exact field operation nor a whole-operation error bound is asserted.
The finiteness assumptions rule out overflow to infinity and NaN. They are explicit because the real-number semantics does not assign real values to infinities or NaNs.
Reference #
- N. J. Higham, Accuracy and Stability of Numerical Algorithms, second edition, SIAM, 2002, Section 3.6. https://doi.org/10.1137/1.9780898718027
- IEEE Standard for Floating-Point Arithmetic, IEEE 754-2019. https://doi.org/10.1109/IEEESTD.2019.8766229
Interpret both finite components as real numbers and assemble a mathematical complex value.
Instances For
Componentwise nearest-even semantics for complex addition.
Instances For
Componentwise nearest-even semantics for complex subtraction.
Instances For
The rounded real semantics of the evaluation order used by ExecComplex.mul.
This is not exact complex multiplication: each product is rounded before the final rounded subtraction or addition.
Instances For
Negation of finite executable components agrees exactly with complex negation.
Complex conjugation is exact on finite components, including formats with unsigned zero.
Executable complex addition refines componentwise rounded mathematical addition.
Executable complex subtraction refines componentwise rounded mathematical subtraction.
All scalar intermediates required to interpret one executable complex multiplication over ℝ.
The predicate includes finite inputs, four finite component products, and finite final components. It is the natural domain of the exact evaluation-order refinement theorem below.
Instances For
For an IEEE descriptor and finite inputs, intermediate values, and result, complex multiplication
agrees with roundedMul: four rounded products followed by a rounded subtraction and addition.
Two separately rounded squares followed by a rounded sum.
Instances For
Finite inputs, both rounded squares, and their rounded sum.
Both input components are finite.
The rounded real square is finite.
The rounded imaginary square is finite.
The rounded sum is finite.
Instances For
Squared magnitude agrees with its three scalar rounding sites, including underflow.
The executable pivot comparison agrees with the exact component magnitudes.
Selecting a component and clearing its sign preserves finiteness.
For a finite IEEE complex value, the common scale is the larger absolute component.
The nine scalar rounding sites of ratio division with a real-component pivot.
Instances For
Scalar domain obligations for the selected branch of ratio division.
The pivot used to form the ratio is nonzero.
The rounded component ratio is finite.
The product used to form the denominator is finite.
The rounded denominator is finite.
The rounded denominator used by both final divisions is nonzero.
The product used in the real numerator is finite.
The product used in the imaginary numerator is finite.
The rounded real numerator is finite.
The rounded imaginary numerator is finite.
Both final quotients are finite.
Instances For
The real-pivot division branch evaluates its stated rounded expression when the IEEE inputs and all scalar intermediates are finite, and both the pivot and rounded denominator are nonzero.
Ratio-division semantics, branching on the exact magnitudes of the denominator components.
In the imaginary-dominant branch the final rounded quotient is conjugated, as in the executable
code. This is a rounded expression, not exact division in ℂ.
Instances For
Finite inputs and all scalar domain obligations in the selected division branch.
The pivot and the rounded denominator must both be nonzero; every intermediate and both final quotients must be finite. No obligation is imposed on the branch that is not executed.
Both numerator components are finite.
Both denominator components are finite.
- branch : if Internal.imagDominant y = true then Internal.DivBranchFinite (Internal.swap x) (Internal.swap y) else Internal.DivBranchFinite x y
Domain obligations after choosing the larger denominator component as pivot.
Instances For
The selected division branch produces finite components under DivFinite.
Division agrees with the selected ratio formula and all nine scalar rounding sites.
Infinity determines magnitude when neither component is a signaling NaN.
Rounded semantics of magnitude with the exact scale max |re| |im|.
The two divisions, two squares, sum, square root, and rescaling product each round separately. Zero scale returns zero without any division.
Instances For
Finite input and output of scaled magnitude, with obligations only on the nonzero-scale branch.
The rounded component ratios, their squares, and their sum must be finite. The sum must be a valid scalar square-root input (zero of either sign, or a clear sign bit). Square-root finiteness then follows from the scalar theorem.
These intermediate-range conditions do not follow merely from finite inputs or from the exact norm fitting in the format. The semantic theorem separately requires the conventional IEEE bias.
Both input components are finite.
Restoring the scale gives a finite result.
- scaled : (Internal.magnitudeScale z).isZero = false → (Internal.magnitudeRatios z).NormSqFinite ∧ ((Internal.magnitudeRatios z).normSq.isZero = true ∨ (Internal.magnitudeRatios z).normSq.signBit = false)
Scaled squares and square-root domain, needed only for a nonzero scale.
Instances For
Scaled magnitude agrees with its seven scalar rounding sites, or the zero branch.