ELASTIC: Numerical Reasoning with Adaptive Symbolic Compiler