Roughly estimating arithmetic operations using floating-point arithmetic

38 Views Asked by At

I am developing an arithmetic library that supports values in the range of $-9999999999999999999$ and $9999999999999999999.$ I'm looking for a fast way to estimate the result of slow elementary operations such as exponentiation, multiplication, and division so that results that fall too far away from this range are never computed. Once the results are always checked against that range, my goal here is just to eliminate cases that are $100$% sure to be out of the range given an error margin. Examples includes $100000 ^{100000}$, $999999999999.9999999999^{2}$, $9999999999999999999 ^{1.5}$.

My first attempt was using 64bits floating-point arithmetic to catch theses cases quickly. However, I'm not sure how to compute the error margin so that I'll never get false positives.

Could you guys help here?