calculates quadratic formula in java