Simplified. Check if the evaluation at x is infinite.
@override bool isInfinity(dynamic x) { return evaluate(x).isInfinite; }