fix for eval - tolerates inf and NaN