from math import sqrt C0,C1,C2,C3=map(int,input().split()) L,R=map(int,input().split()) def f(x): return C0+C1*x+C2*x**2+C3*x**3 def absf(x): return abs(C0+C1*x+C2*x**2+C3*x**3) if C3!=0: if C2**2-3*C1*C3>=0: X1=(-C2+sqrt(C2**2-3*C1*C3))/3/C3 X2=(-C2-sqrt(C2**2-3*C1*C3))/3/C3 X=[] if L<=X1<=R: X.append(X1) if L<=X2<=R: X.append(X2) flag=True for x in X: if not(f(L)>0 and f(R)>0 and f(x)>0) or not(f(L)<0 and f(R)<0 and f(x)<0) : flag=False if flag: print(0) exit() else: ans=min(absf(L),absf(R)) for x in X: ans=min(ans,absf(x)) print(ans) exit() else: ans=min(absf(L),absf(R)) print(ans) exit() else: if C2!=0: ans=min(absf(L),absf(R)) X=-C1/2/C2 if L<=X<=R: ans=min(ans,absf(X)) else: if C1!=0: ans=min(absf(L),absf(R)) else: ans=0 print(ans)