Hacker News new | ask | show | jobs
by whyever 3076 days ago
> “In the current art, static error analysis requires significant mathematical analysis and cannot determine actual error in real time,” reads a section of the patent. “This work must be done by highly skilled mathematician programmers. Therefore, error analysis is only used for critical projects because of the greatly increased cost and time required. In contrast, the present invention provides error computation in real time with, at most, a small increase in computation time and a small increase in the maximum number of bits available for the significand.”

I'm not sure how much it increases computation time, but software for exactly this is freely available, see for instance Arb: https://github.com/fredrik-johansson/arb

2 comments

I'm the main author of Arb. Note that it's an arbitrary-precision library. It's ~100x times slower than hardware floating-point because of using arbitrary-precision floating-point numbers implemented entirely in software. But if you have to do arbitrary-precision arithmetic to begin with, Arb's error tracking only adds negligible further overhead.

For machine precision, I believe ordinary interval arithmetic is the best way to go still. Unfortunately, this not only uses twice as much space; the time overhead can be enormous on current processors due switching rounding modes (there are proposed processor improvements that will alleviate this problem). However, the better interval libraries batch operations to minimize such overhead, and it's even possible to write kernel routines for things like matrix multiplication and FFT that run just as fast as the ordinary floating-point versions (if you sacrifice some tightness of the error bounds).

Regarding the article, using a more compact encoding for intervals is a fairly old idea and I'm not really sure what is novel here.

> It's ~100x times slower than hardware floating-point because of using arbitrary-precision floating-point numbers implemented entirely in software.

Thanks for the numbers, how did you get that estimate? Did you consider SIMD?

Does anyone know a similar library for Rust?
Arb depends on lots of other numerical libraries (namely FLINT, MPFR and GMP or MPIR). If you want pure-Rust alternatives, the ecosystem is just not there yet.
It's a plain C library with an API very similar to GMP, so an option would be to wrap it from Rust, which should not be too difficult.