A computational system that tries to work around data loss in arithmetic operations
I'm working on experimental computational system that doesn't lose data on operations with 0, where a \* 0 is invertible and where a / 0 is not causing system to crash, while still giving the arithmetically correct result. It's building on Euler's notion that infinitesimals are actually zeros with different ratios.
My attempt is doing this by treating zeros as infinitesimals, defining data structure to carry those hybrid "numbers" and then doing polynomial arithmetic operations on them.
The system builds on similar concepts as seen in dual numbers, forward-mode automatic differentiation and it uses taylor arithmetic/ laurent polynomials as a basis, but it has a twist. It is basically a computational Levi Civita field that has positive dimensions, and where zeros are infinitesimals.
So, those numbers are sparse dicts mapping dimensions to coefficients. A dimension is currently an integer, or a vector over an iterated-logarithm basis when log-scale terms are in play. Dimension 0 is the value. Negative dimensions store derivative info or rates of vanishing. Positive dimensions store rate of blowing up to "undefinedness". Multiply dimensions and it turns out that's the same thing as the product rule and chain rule, just expressed as data structure operations.
This gives us derivatives, integrals, and limits as a side effect of normal computation. Without symbolic engine, or graph or tape. You tag a number, do your math, read the results off the dimensional coefficients. You can also calculate straight through some simple singularities and get correct results out of it.
To achieve this the system is giving up additive identity (actually it's working around it) by converting zeros to infinitesimals, then calculating as usual.
I have built a working prototype in python (as a numerical analysis toy lab) to help me experiment with it and explore different behaviors. It seems it is holding up and not blowing up in my face;P. What I mean is that it can actually be used and give sensible results out. If anyone would like to play with it or take a look the repo is here: https://github.com/tmilovan/composite-machine xamples under demos and tests.
I'll be happy if you take a look at it and comment:).
Keep in mind: this is still highly experimental and for sure still contains misconceptions and a lot of edge cases and other bugs. The purpose of the library is to showcase what is possible and to serve as a baseline for further exploration.
It will also make me really happy if this does not get moderated out:)). #technology source e