reintroduced checks for NA in double arithmetic as Java does not propagate NaN payloads