I think, the simplify(g - g2d) can't be 0 for g = S.NaN.  So it's a redundant assertion.