I made a calculator that works over disjoint sets of intervals
Details
- External ID
- 47812341
- Source
- HN
- Company
- —
- Product
- I made a calculator that works over disjoint sets of intervals
- Website domain
- github.io
- Launched
- April 18, 2026
- Cohort
- —
- Upvotes
- 314
- Upvotes percentile
- 0.980719794344473
- Tags
- —
- Fetched at
- Sept. 7, 2026, 9:26 p.m.
- Updated at
- Sept. 7, 2026, 9:26 p.m.
Description
I've been studying interval arithmetic for the past few weeks and it's a really interesting field because while there is a ton of super interesting research published over the past decades, it has never really gotten the recognition that it deserves, IMO.One reason for this is that standard interval arithmetic has really poor handling of division by intervals containing zero. If you compute 1 / [-1, 2] in regular interval arithmetic, you get either [-∞, +∞], or you have to say that the operation is undefined. Both solutions are virtually useless. The real answer of course is [-∞, -1] U [0.5, +∞]: i.e. a union of two disjoint intervals.This is useful because you can confidently exclude a non empty set of the real numbers ([-1, 0.5]) from the set of possible values that you can get by dividing 1 by a number between -1 and 2.But this definition of interval division yields a value that is not an interval. This is a problem if you want to define a closed arithmetic system, where you can build and evaluate arbitrary expression over interval values.(This behavior extends to any non continuous function like tan() for example, which is implemented in my project - not without difficulties!)Well the obvious solution is to define your arithmetic over disjoint unions of intervals. This is the subject of a 2017 paper called "Interval Unions" by by Schichl, H., Domes, F., Montanher, T. and Kofler, K..This open-source project I made implements interval union arithmetic in TypeScript in the form of a simple interactive calculator, so you can try it out for yourself! The underlying TypeScript library is dependency free and implements interval union arithmetic over IEEE 754 double precision floats (JS native number type) with outward rounding. This guarantees accuracy of interval results in the presence of rounding issue inherent to floating point.
Enrichment
- Theme
- specialized calculators and estimation tools
- Vertical
- Horizontal
- Function
- Dev tools
- Audience
- Developer
- AI stance
- Not AI
- Project type
- Hobby / open-source project
- Normalized one-liner
- interval-based calculator
- Manually corrected
- False
Could you build this?
Yes The author implemented interval union arithmetic algorithms into a web-based parser and calculator; the mathematical rules for interval union algebra can be directly implemented in standard TypeScript.
Discussion
20 comments analyzed.
Competitors mentioned: Math::Interval library in Raku, GrafEq, Mathematica, Julia (IEEE 754 rounding mode support)
Concerns raised: Exponential growth in number of intervals with chained operations, Probabilistic calculator would be more useful than interval unions, Unfeasible complexity for abstract interpretation applications, Powerset of intervals domain not novel (known since 1970s), Division interpretation makes 1/S non-distinguishable from 1/([0,0]∪S)
Feature requests: Many-valued functions support (e.g., full set from asin(1)), +- operator for [a-b, a+b] representation, Random example generator, Native datetime type support, Merging/simplification step to cap interval growth
Competitors
Other products that read as similar to this one — 106 launches clear the similarity bar, closest 8 shown.
Attention rank: #1 of 107 (itself plus its competitors, highest first — normalized so YC and Product Hunt are compared fairly).
Launched 140 days after the earliest competitor.
- Sequation · ph · 2026-09-11 · 2 upvotes · similarity 0.48
- break-even-roas-calculator.github.io · github · 2026-09-21 · 10 upvotes · similarity 0.43
- Dozenal · hn · 2026-07-27 · 16 upvotes · similarity 0.43
- Sostactic · hn · 2026-04-18 · 14 upvotes · similarity 0.42
- Calculator · ph · 2026-09-07 · 1 upvotes · similarity 0.40
- FormulaNode · ph · 2026-09-15 · 2 upvotes · similarity 0.40
- Math Adventures for Kids · ph · 2026-09-07 · 1 upvotes · similarity 0.39
- Calculee · ph · 2026-09-29 · 2 upvotes · similarity 0.39
Other launches for this product
- No other launches for this product.
Same idea, different domain
Nobody's really built a dev tools tool for Sales yet.