import math

K = 4.201
L = 3

try:
    x = float(input("Enter value for x: "))

    if x < 0:
        raise ValueError("ERROR: The negative value in square root!")

    a_calc_part = K * math.sqrt(x) + 2 - (1 / L) * (math.exp(2) - math.exp(-2))
    if a_calc_part < 0:
        raise ValueError("ERROR: The negative value in square root for 'a'!")

    a = math.sqrt(a_calc_part)
    b = math.sin(0.5 * math.atan(-0.25) * math.log(5))

    if a > 2 * b:
        y = math.sqrt(3 * a - 5 * b)
    elif a == 2 * b:
        y = a
    else:
        y_calc_part = 3 * a + 5 * b
        if y_calc_part < 0:
            raise ValueError("ERROR: The negative value in square root for 'y'!")
        y = math.sqrt(y_calc_part)

    print("Result y = {:.4f}".format(y))

except ValueError as e:
    print(e)
except ZeroDivisionError:
    print("ERROR: Division by zero occurred!")
except Exception:
    print("ERROR: An unknown error occurred!")