TorchLean API

FloatLib.Numerics.Exact.Trigonometric.Runtime

Total comparisons for ordinary trigonometric functions #

These operations compare an exact trigonometric value with a rational boundary. Adaptive rational enclosures determine the ordering; irrationality proves that the search terminates outside the explicitly handled rational values at zero. Prepared comparators share a finite prefix of enclosures across boundary queries, with unrestricted refinement beyond that prefix.

Tangent compares sin x - b * cos x with zero and uses the sign of cosine. Inverse sine and cosine compare through their monotone principal branches, after exact comparisons with π locate the boundary. Their real-domain contract is -1 ≤ argument ≤ 1.

These are ordinary radian functions. No rational-angle equality decision for π-scaled functions is inferred from these searches.

Prepare a total sine comparator, sharing reduced enclosures across rational boundaries.

Instances For

    Prepare a total cosine comparator, including the exact value cos 0 = 1.

    Instances For

      Prepare a total arctangent comparator, with exact equality at zero.

      Instances For

        Compare the sine of any rational argument with any rational boundary.

        Instances For

          Compare the cosine of any rational argument with any rational boundary.

          Instances For

            Compare the arctangent of any rational argument with any rational boundary.

            Instances For

              Prepare tangent comparisons without interval division.

              Rational arguments are never tangent poles. The cosine sign and the cached sine/cosine enclosures are shared across queries, while each boundary determines a different residual.

              Instances For

                Compare the tangent of any rational argument with any rational boundary.

                Instances For

                  Prepare inverse sine comparisons on [-1, 1], sharing the π/4 enclosures.

                  Boundaries outside the principal branch are decided first. Inside it, sine is strictly increasing, so the inverse comparison reduces to a direct sine comparison with reversed order.

                  Instances For

                    Compare inverse sine on its real domain with any rational boundary.

                    Instances For

                      Prepare inverse cosine comparisons on [-1, 1], sharing the π/4 enclosures.

                      The principal branch is [0, π], where cosine is strictly decreasing.

                      Instances For

                        Compare inverse cosine on its real domain with any rational boundary.

                        Instances For