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/
3•fouronnes3•2h 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•2h 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

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

https://github.com/smol-machines/smolvm
256•binsquare•10h ago•91 comments

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

https://github.com/paniclock/paniclock/
151•seanieb•11h ago•62 comments

Show HN: Sfsym – Export Apple SF Symbols as Vector SVG/PDF/PNG

https://github.com/yapstudios/sfsym
2•olliewagner•7m ago•0 comments

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

https://stagereview.app/
106•cpan22•1d ago•93 comments

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

https://victorpoughon.github.io/interval-calculator/
3•fouronnes3•2h ago•1 comments

Show HN: Pyra – a Python toolchain experiment inspired by uv and Bun

https://github.com/treyorr/pyra
4•trey-orr•6h ago•1 comments

Show HN: Irl.rent – What renters pay, not what's listed in SF

9•rajatady•3h ago•1 comments

Show HN: Cogveo–Schedule AI agents to run Python on your files and email results

https://cogveo.com
2•thrinz•5h ago•0 comments

Show HN: MacMind – A transformer neural network in HyperCard on a 1989 Macintosh

https://github.com/SeanFDZ/macmind
146•hammer32•1d ago•42 comments

Show HN: External admission gate for GitHub Actions before execution

https://ai-admissibility.com/
2•pinfloyd•5h ago•0 comments

Show HN: CodeBurn – Analyze Claude Code token usage by task

https://github.com/AgentSeal/codeburn
102•agentseal•4d ago•24 comments

Show HN: Mind-OS – First free online AI dependency self‑assessment

https://iamalex-afk.github.io/human-os-patch-33-protocols/
3•bitkin_dev•6h ago•0 comments

Show HN: SPICE simulation → oscilloscope → verification with Claude Code

https://lucasgerads.com/blog/lecroy-mcp-spice-demo/
119•_fizz_buzz_•1d ago•30 comments

Show HN: Marky – A lightweight Markdown viewer for agentic coding

https://github.com/GRVYDEV/marky
69•GRVYDEV•1d ago•35 comments

Show HN: web-pinentry: a pinentry program that leverages matrix and http

https://codeberg.org/seanhly/web-pinentry
2•seanhly•8h ago•0 comments

Show HN: Home Memory – A local DB of my house, down to cables and pipes

https://github.com/impactjo/home-memory
49•impactjo•1d ago•12 comments

Show HN: Waputer – The WebAssembly Computer

https://waputer.app
5•marcandrysco•10h ago•0 comments

Show HN: Bookmark Tool in Common Lisp

https://github.com/ediw8311xht/cl-bookmark-tool
2•landdate•10h ago•0 comments

Show HN: Bird, a CLI for Tired Brains

https://github.com/DavidLiedle/bird
4•DavidCanHelp•10h ago•0 comments

Show HN: Libretto – Making AI browser automations deterministic

https://github.com/saffron-health/libretto
129•muchael•2d ago•54 comments

Show HN: I turned my MacBook notch into a live Claude Code dashboard

https://github.com/devmegablaster/Notch-Pilot
2•devmegablaster•12h ago•0 comments

Show HN: SmallDocs - Markdown without the frustrations

35•FailMore•2d ago•20 comments

Show HN: React Email 6.0 – An open-source email editor you can embed in your app

https://github.com/resend/react-email
9•code-in-public•13h ago•0 comments

Show HN: Hiraeth – AWS Emulator

https://github.com/SethPyle376/hiraeth
38•ozarkerD•2d ago•8 comments

Show HN: Noodlist – Letterboxd for Instant Ramen

https://noodl.ist/
6•mkdirpepper•14h ago•9 comments

Show HN: Gave Claude a casino bankroll – it gambles till it's too broke to think

https://letaigamble.com/
37•mackbrowne•2d ago•9 comments

Show HN: XitDB – an immutable single-file database

https://github.com/xit-vcs/xitdb
8•xeubie•14h ago•0 comments

Show HN: Agent-cache – Multi-tier LLM/tool/session caching for Valkey and Redis

17•kaliades•1d ago•6 comments

Show HN: Tracking Top US Science Olympiad Alumni over Last 25 Years

https://www.perplexity.ai/computer/a/us-olympiad-tracker-__5Gzx3tQaKOInGlalN8sQ
5•bkls•1d ago•0 comments

Show HN: Ilha – a UI library that fits in an AI context window

https://ilha.build/
22•ryuzyy•1d ago•9 comments