maryada

Project

maryada

A no_std binary64 interval arithmetic library conforming to IEEE Std 1788.1-2017.

  • Rust
  • Interval arithmetic
  • no_std
  • IEEE 1788.1

maryada is a no_std binary64 interval arithmetic library conforming to IEEE Std 1788.1-2017. It provides bare and decorated real intervals, outward-rounded elementary operations, and text and binary interchange. Rectangular complex intervals are available through an optional feature.

The conformance claim applies to the real interval API. The rectangular complex interval extension is outside the scope of the standard. The repository’s conformance statement documents the operation accuracy declarations, required features, implementation details, and test coverage.

Finding the deeper well

Interval arithmetic is especially useful when a numerical optimizer needs a global guarantee rather than a promising local answer. The explorer below applies branch-and-bound to a one-dimensional function with two local minima. Each branch is an interval X; evaluating the formula with interval operations produces an enclosure that contains every possible function value on that branch.

Interval arithmetic in practice

Can we certify the deeper well?

Browser illustration · stop when U − L ≤ 0.03

The left minimum is lower, but a local search started on the right would not know that. Branch-and-bound keeps the best sampled value U and compares it with interval lower bounds L. Click a branch to inspect its bounds, then step or play through the search.

Objective

f(x) = (x2 − 1)2 + 0.6x + 2

Search domain

X = [−1.5, 1.5]

Discard test

LU − 0.03

Step 0 · The root interval is ready to split.

Best sample U
3.000
Lowest leaf L
1.100
Gap U − L
1.900
Active / pruned
1 / 0
Branch-and-bound search over a two-well functionInterval enclosures for the root branch and the current best sampled point.
Each translucent box is an interval enclosure f(X); the curve is clipped above 4.7 so both wells remain legible.
  • unresolved branch
  • discarded branch
  • best sample U

Search history

Branch ledger

Click any branch or box to inspect its numbers.

BranchXf(X) enclosuremidpoint samplestate
[−1.500, 1.500][1.100, 4.463]x = 0.000 → 3.000active

At each step, the branch with the smallest lower bound is split. The current candidate is the midpoint sample at x = 0.000.

The important test is L ≥ U − ε: once a branch’s lower bound is too high to improve the incumbent by more than the requested tolerance, the whole branch can be discarded. In a production implementation, outward-rounded interval operations make that enclosure rigorous; this browser illustration mirrors the same natural interval extension and rounds the displayed values for readability.

A small interval

use maryada::Interval;

let x = Interval::new(1.0, 2.0);
let y = x.sqr();

assert_eq!(y.bounds(), (1.0, 4.0));

The optional complex feature enables rectangular complex intervals through ComplexBox; num-complex adds interoperability with num_complex::Complex64. Complex functions transform interval spaces in nontrivial ways, so their results contain the true image but are not guaranteed to equal it under every operation.

Future directions include other complex interval formulations such as disks and polyarcs, linear algebra methods, and potentially Python bindings.