How to avoid overflow in expr. A * B – C * D
This seems too trivial I guess. But A*B is the one that could overflow. You could do the following, without losing precision A*B – C*D = A(D+E) – (A+F)D = AD + AE – AD – DF = AE – DF ^smaller quantities E & F E = B – D (hence, far smaller than … Read more