8 ms·
You could overload operators like + and / so they evaluate to an AST representing the calculation rather than the actual calculated value. Then you need to do
by initplus 4y ago
You could overload operators like + and / so they evaluate to an AST representing the calculation rather than the actual calculated value.
Then you need to do some analysis on your AST to try and restructure it in a way that preserves as much precision as possible.
You don’t really need Haskell for this though, in theory it will work in any language (but more ergonomically if you have operator overloading).