added NaN tests for quad_form_diag