https://9dok.net/document/y6elwnp7-engineering-an-exact-sign-of-sum-algorithm.html