frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Show HN: I made a calculator that works over disjoint sets of intervals

https://victorpoughon.github.io/interval-calculator/
75•fouronnes3•5h ago
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.

Comments

fouronnes3•5h ago
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

iamwil•1h ago
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

memalign•1h ago
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

_Microft•44m ago
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.

globular-toast•14m ago
I was also a bit confused by this. I thought the standard notation was round brackets, but maybe doesn't work well in ASCII?

Show HN: I made a calculator that works over disjoint sets of intervals

https://victorpoughon.github.io/interval-calculator/
78•fouronnes3•5h ago•5 comments

Claude Design

https://www.anthropic.com/news/claude-design-anthropic-labs
978•meetpateltech•15h ago•642 comments

Towards trust in Emacs

https://eshelyaron.com/posts/2026-04-15-towards-trust-in-emacs.html
79•eshelyaron•2d ago•8 comments

Measuring Claude 4.7's tokenizer costs

https://www.claudecodecamp.com/p/i-measured-claude-4-7-s-new-tokenizer-here-s-what-it-costs-you
582•aray07•15h ago•405 comments

All 12 moonwalkers had "lunar hay fever" from dust smelling like gunpowder (2018)

https://www.esa.int/Science_Exploration/Human_and_Robotic_Exploration/The_toxic_side_of_the_Moon
302•cybermango•12h ago•173 comments

Spending 3 months coding by hand

https://miguelconner.substack.com/p/im-coding-by-hand
174•evakhoury•14h ago•184 comments

A simplified model of Fil-C

https://www.corsix.org/content/simplified-model-of-fil-c
154•aw1621107•8h ago•77 comments

Are the costs of AI agents also rising exponentially? (2025)

https://www.tobyord.com/writing/hourly-costs-for-ai-agents
173•louiereederson•2d ago•41 comments

Isaac Asimov: The Last Question (1956)

https://hex.ooo/library/last_question.html
693•ColinWright•18h ago•273 comments

Show HN: Smol machines – subsecond coldstart, portable virtual machines

https://github.com/smol-machines/smolvm
302•binsquare•13h ago•93 comments

Slop Cop

https://awnist.com/slop-cop
147•ericHosick•15h ago•91 comments

Show HN: PanicLock – Close your MacBook lid disable TouchID –> password unlock

https://github.com/paniclock/paniclock/
173•seanieb•13h ago•67 comments

Brunost: The Nynorsk Programming Language

https://lindbakk.com/blog/introducing-brunost
27•atomfinger•4d ago•4 comments

Hyperscalers have already outspent most famous US megaprojects

https://twitter.com/finmoorhouse/status/2044933442236776794
175•nowflux•14h ago•136 comments

"cat readme.txt" is not safe if you use iTerm2

https://blog.calif.io/p/mad-bugs-even-cat-readmetxt-is-not
158•arkadiyt•11h ago•84 comments

NASA Force

https://nasaforce.gov/
260•LorenDB•14h ago•260 comments

Landmark ancient-genome study shows surprise acceleration of human evolution

https://www.nature.com/articles/d41586-026-01204-5
67•unsuspecting•8h ago•61 comments

Middle schooler finds coin from Troy in Berlin

https://www.thehistoryblog.com/archives/75848
219•speckx•15h ago•99 comments

Casus Belli Engineering

https://marcosmagueta.com/blog/casus-belli-engineering/
27•b-man•5h ago•5 comments

Rewriting Every Syscall in a Linux Binary at Load Time

https://amitlimaye1.substack.com/p/rewriting-every-syscall-in-a-linux
7•riteshnoronha16•4d ago•2 comments

The Unix executable as a Smalltalk method (2025) [video]

https://www.youtube.com/watch?v=sZjPQ7vtLNA
48•surprisetalk•1d ago•2 comments

NIST gives up enriching most CVEs

https://risky.biz/risky-bulletin-nist-gives-up-enriching-most-cves/
191•mooreds•15h ago•44 comments

Making Wax Sealed Letters at Scale

https://waxletter.com/
6•hjconstas•2d ago•8 comments

Introducing: ShaderPad

https://rileyjshaw.com/blog/introducing-shaderpad/
72•evakhoury•2d ago•14 comments

Arc Prize Foundation (YC W26) Is Hiring a Platform Engineer for ARC-AGI-4

https://www.ycombinator.com/companies/arc-prize-foundation/jobs/AKZRZDN-platform-engineer-benchma...
1•gkamradt_•9h ago

Generating a color spectrum for an image

https://amandahinton.com/blog/generating-a-color-spectrum-for-an-image
39•evakhoury•2d ago•5 comments

The GNU libc atanh is correctly rounded

https://inria.hal.science/hal-05591661
77•matt_d•3d ago•17 comments

Ban the sale of precise geolocation

https://www.lawfaremedia.org/article/it-is-time-to-ban-the-sale-of-precise-geolocation
677•hn_acker•16h ago•172 comments

Show HN: Stage – Putting humans back in control of code review

https://stagereview.app/
111•cpan22•1d ago•96 comments

I built a 3D printing business and ran it for 8 months

https://www.wespiser.com/posts/2026-04-12-3D-Printing-Biz.html
105•wespiser_2018•2d ago•92 comments