added NaN test for log_determinant_spd and fixed error checking to be consistent with double version