Algorithms and data structures for automatic precision estimation of neural networks