Replace numeric solver function with faster one.

Avoid displaying result when any input is invalid.