Is this means you can handle exp(1/exp(1/(x-2)**2 - 1)) ?  I don't think so, you return a wrong answer.