I am doing a calculation where I try to simplify a very complicated complex function. I did this step by step and I checked that the numerical values that the function gets for certain values of the variables that it depends on are equal at each step. After some significant simplification, I wanted to check that the initial and final results give the same answers. The function is purely imaginary, so I did not expect any real part.
The initial numerical evaluation of the function for a set of particular value for its variables returned $1.02798*10^{-11} + 187628i$. The same set values for the variables returned the following for the final form of the function: $4.76837*10^{-7} + 187628i$.
As you can see, they agree on the imaginary part and both give approximately zero for the real part, although their real parts differ by four orders of magnitude. So, finally, I want to ask how much is the acceptable error that we can expect when doing a numerical evaluation and how much is the acceptable error that we should (at most) get when simplifying a function?
Of course, I am aware that this is pretty general and that the error depends on the simplifications done and how complicated an expression is, but I wanted to know whether or not there are some rules of thumb for these things.
$MaxPrecision, $MinPrecision
, rather than relying on automatic options. $\endgroup$