Hacking a complex function with Mathematica