Show HN: A calculator that does arithmetic over disjoint unions of intervals

What it is
A developer has released a web calculator that computes with unions of intervals instead of single real numbers. Think interval arithmetic, but upgraded: inputs can be disjoint sets like [a, b] U [c, d], and operations return unions when the result naturally splits. It has been reported that the author calls this "Interval Union Arithmetic" and claims it is vastly superior to vanilla interval arithmetic because it stays closed and even supports division by intervals that contain zero — so 2 / [-2, 1] yields [-∞, -1] U [2, +∞]. Neat trick, and a little bit of math theater.
How it works
The tool implements outward rounding on IEEE‑754 doubles, so results are guaranteed to contain the true real-valued result — yes, even for the infamous 0.1 + 0.2 glitch. There’s an inclusion property: pick any real from each input union, compute the expression, and the result is guaranteed to lie inside the returned union. Syntax is straightforward (bracketed intervals, U for union, bare numbers treated as degenerate intervals), and the calculator supports a healthy function set — trig, logs, exp, sqrt, hull/lo/hi helpers, constants like pi and inf, and more. You can nest interval bounds too (e.g., [0, [0,100]] collapses sensibly), which is a nice ergonomic touch for builders.
Why it matters
Who cares? Anyone wrestling with uncertainty, safe numerical code, or formal guarantees: engineers doing robust simulations, people building controllers that must avoid singularities, and researchers exploring validated numerics. It isn’t a magic wand — interval results can be conservative — but union intervals reduce needless over‑approximation. The project is live on the author’s GitHub Pages and was posted as a Show HN link; try dividing through an interval containing zero and see that little emotional payoff when the calculator spits out disjoint infinities. Pretty satisfying.
Sources: victorpoughon.github.io, Hacker News
Comments