Implement DoubleDouble
It's way for emulating not quite quad-precision number using two doubles. Algorithms is interesting by itself and could have few uses. But I think its main value is providing example of constant size approximation of real numbers which isn't IEEE754. It would be very useful for implementing type classes for working with low level representations of numbers. Without such examples it's all to easy to assume that only single and double IEEE754 numbers exist
Julia implementation and references could be found here https://github.com/JuliaMath/DoubleDouble.jl
@Shimuuar I am finding some packages that provide long double and arbitrary-precision operations:
- https://hackage.haskell.org/package/long-double (FFI)
- https://hackage.haskell.org/package/numbers-3000.2.0.2/docs/Data-Number-BigFloat.html
numbershas a BigFloat module (native) - https://hackage.haskell.org/package/haskell-mpfr (FFI, maybe bitrotted)
- https://hackage.haskell.org/package/hmpfr (FFI, recently updated)
there's a long-standing GHC ticket to add CLDouble support : https://gitlab.haskell.org/ghc/ghc/issues/3353
DoubleDouble (and triple double) is different approach. It's software emulation of something similar to quad precision.
- Long double (80-bit) has 63-bit mantissa DoubleDouble has 2x (3x) of Double — 106 bit (162 bit). On other hand it doesn't have hardware support
- Unlike arbitrary precision it has fixed size 128 (192) bit and thus could be easily unboxed/
Kahan's compensated summation is special case of this approach. I'm only aware of Julia's implementation of this algorithm
@Shimuuar is this something you know how to implement? In case, would you like to do it?
I have stack of papers on the subject, there's open source Julia implementation and no time to do anything :(