from math import sqrt
c0, c1, c2, c3 = map(int, input().split())
l, r = map(int, input().split())
def f(x):
    return c0 + x * (c1 + x * (c2 + x * c3))

cand = [l, r]
# c1+2c2x+3c3x^2
a, b, c = 3 * c3, 2 * c2, c1
if a == 0:
    if b:
        cand.append(-c / b)
else:
    d = b * b - 4 * a * c
    if d >= 0:
        cand.append((-b + sqrt(d)) / (2 * a))
        cand.append((-b - sqrt(d)) / (2 * a))
res = [f(x) for x in cand if l <= x <= r]
mn = min(res)
mx = max(res)
ans = 0 if mn <= 0 <= mx else min(abs(mn), abs(mx))
print(f'{ans:.10f}')