309
Points
51
Comments
fouronnes3
Author

Top Comments

fouronnes3Apr 18
Author here. Outward rounding to combat precision issues is what interval arithmetic is most known for (try 0.1+0.2 with "full precision mode" enabled), but that's really a shame in my opinion. Outward rounding is cool, but the "inclusion property", as it's known in research papers, works at every scale! This is what enables things like:

     50 * (10 + [-1, 1])
    [450, 550]
which is lovely, I think. Adding the union layer to it enables even cooler things, like the true inverse of the square function. Did you know it's not sqrt? Try 'sqinv(64)'.

I made interval calculator actually mostly as a way to test my implementation of interval union arithmetic [0], which I needed for another project: a backwards updating spreadsheet [1][2].

[0] https://github.com/victorpoughon/not-so-float

[1] https://victorpoughon.github.io/bidicalc/

[2] https://news.ycombinator.com/item?id=46234734

iamwilApr 18
This is great. You might be interested in Matt Keeter's work on Implicit surfaces, and using interval math for its optimization:

https://youtu.be/UxGxsGnbyJ4?si=Oo6Lmc4ACaSr5Dk6&t=1006

memalignApr 18
You might be interested in this graphing calculator I made using interval arithmetic:

https://memalign.github.io/m/formulagraph/index.html

Some detail on how this works, including links to the relevant interval math code:

https://memalign.github.io/p/formulagraph.html

_MicroftApr 18
Very nice, thanks for sharing! Maybe show which upper or lower values are included in the intervals? A notation I am familiar with uses outward facing brackets if the value is not included in the interval. That always applies to infinity.

Applied to the cases here:

]-∞, -1] U [0.5, +∞[

The excluded interval in between becomes ]-1, 0.5[ then.

That’s how min (and analogously max) works, right? min(A, B) = [lo(A,B), lo (hi(A), hi(B))].

Edit: idea: copy a formula from the results section to the input field if the user clicks/taps on it.

akstApr 18
Very cool! I don't entirely understand some of the operations, but for what I do understand its pretty neat.

I wish in classes we were introduced to a notion of arithmetic on intervals as it comes up. Like in basic statistics with confidence intervals there's ±, as well as in the quadratic equation. It found some what dissatisfying we couldn't chain the resulting a series of operations and instead repeat the operations for the 2 seperate values of the ±. I get a teacher would rather not get hung up on this because they want to bring it back to the application generally, like solving a more complicated equation or hypothesis testing in basic stats. I just wish they hinted at the idea we can do arithmetic on these kinds of things more generally.

I realise what you've got here is well beyond this, but seeing this was some level of validation that treating the interval as a piece of data with its own behaviour of certain operations does make some sense.

vishal_chApr 19
The division example is a perfect illustration of why this matters — [-∞, +∞] as an answer is technically correct but operationally useless. The union representation actually preserves information that standard interval arithmetic throws away. Curious about the composition behavior: if you chain multiple operations that each produce disjoint unions, does the number of intervals in the result grow exponentially in the worst case? And how does the implementation handle that — is there a merging/simplification step, or do you let it grow? The tan() implementation must have been painful given the infinite number of discontinuities.
malcolmjuxtApr 18
I wish I had known about interval arithmetic when I first wrote tick, a time interval library in Clojure, which includes a. implementation of Allen's Interval Algebra. It also embraces the notion of sets of discrete intervals which are useful for practical work calculations, like determining the set of intervals of your vacations that are in a particular year (for HR calculations). I accidentally stumbled on benefits of these sets without knowing much beyond Allen's work.

https://github.com/juxt/tick

https://en.wikipedia.org/wiki/Allen's_interval_algebra

wvlia5Apr 18
Hey, what about this idea? redefine interval representation, such that [a, b] means the same if a<b; but if b<a, it means [-∞, b]U[a, +∞]. Then your example would become 1/[-1,2]=[0.5,-1]
Visit the Original Link

Read the full content on victorpoughon.github.io

Source
victorpoughon.github.io
Author
fouronnes3
Posted
April 18, 2026 at 01:15 AM


More Top Stories

qwen.ai Apr 20
Qwen3.6-Max-Preview: Smarter, Sharper, Still Evolving
14060 commentsby mfiguiere
Details
surfacedby.com Apr 20
I prompted ChatGPT, Claude, Perplexity, and Gemini and watched my Nginx logs
402 commentsby startages
Details
letsdatascience.com Apr 20
Atlassian Enables Default Data Collection to Train AI
18345 commentsby kevcampb
Details
theolivepress.es Apr 20
All phones sold in the EU to have replaceable batteries from 2027
393206 commentsby ramonga
Details
opensource.posit.co Apr 20
ggsql: A Grammar of Graphics for SQL
14640 commentsby thomasp85
Details
awesomeagents.ai Apr 20
GitHub's Fake Star Economy
448256 commentsby Liriel
Details
👋 Need help with code?