How do I easily remove real or imaginary components throughout the expression that are absolutely below a certain threshold? I would think this would be commonly needed.
I have been unable to find a successful example for doing this with SymbolicUtils rules. Is there an easy way to walk the entire expression tree looking for small constants, even for complex?
For the example expression you gave, the suggestion from @pitsianis seems to work fine – are there example expressions where it doesn’t do the right thing?
It seems to me that complex numbers are always represented as realpart + im * imaginarypart – and also the symbolic expressions get sorted automatically in such a way that the Prewalk already only consumes real numbers, not complex ones.
But probably there a cases I'm not thinking about right now…