Live data from Hacker News

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

victorpoughon.github.io

51–60 of 61 posts

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

#51
post #4

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

Looks like GrafEq?

http://www.peda.com/grafeq/

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

#55

Excellent!! I love interval arithmetic and also wrote a TS implementation for a graphing calculator project. Agree that it's very underrated, and I wish that directed rounding was exposed in more languages.

Yeah it's super interesting. Like you said, I learned that the IEEE 754 spec actually requires that complete implementations of floating point numbers expose a way to programmatically choose the rounding mode. As far as I know only C allows you to do that, and even then it depends on hardware support. For JS I had to use ugly typedarray casts. Which kinda only accidentally work due to endianess. But technically there…

Julia supports full IEEE 754 rounding mode support.

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

#56
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.
Post reply on HN