TorchLean API

FloatLib.Floats.Formats.BinaryInterchange.Complex.Semantics

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 #

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.

              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.

                  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.

                      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.

                          Instances For

                            Scaled magnitude agrees with its seven scalar rounding sites, or the zero branch.