Skip redundant computations by checking for NaN. Closes #4