private static float getFloatValueForByteBinaryString(String bits) {
        if (bits.matches("[01]{8}")) {
            int sign = 1;
            if (bits.charAt(0) == '1') {
                sign = -1;
            }
            float result = 0f;

            int exponent = getExcessThreeValue(bits.substring(1, 4));
            StringBuilder mantissaBitsBuilder = new StringBuilder(bits.substring(4));

            if (exponent >= 0) {
                if (exponent > 4) {
                    for (int i = 4; i < exponent; i++) {
                        mantissaBitsBuilder.append('0');
                    }
                }
            } else {
                for (int i = 0; i > exponent; i--) {
                    mantissaBitsBuilder.insert(0, '0');
                }
            }
            String mantissaBits = mantissaBitsBuilder.toString();

            int integerPart = 0;
            if (exponent > 0) {
                integerPart = Integer.parseInt(mantissaBits.substring(0, exponent), 2);
                mantissaBits = mantissaBits.substring(exponent);
            }

            float fractionalPart = Integer.parseInt(mantissaBits, 2) / (float) (Math.pow(2, mantissaBits.length()));
            result = integerPart + fractionalPart;
            return sign * result;
        } else {
            throw new NumberFormatException("Invalid binary representation of a byte containing a float value: " + bits);
        }
    }