Any idea what the expense of this test is?  Testing for NaN is the sort of thing we'd usually turn off for opt mode... although I do suspect that in this case it would probably be negligible compared to the cost of parse tree evaluation.