Perform an early output when the input is empty, avoiding division by zero and attempt to run LM solver on an inf values.