#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

void solve() {
  ll C0, C1, C2, C3, L, R;
  cin >> C0 >> C1 >> C2 >> C3 >> L >> R;
  auto f = [&](double x) -> double {
    double res = double(C0);
    res += double(C1) * x;
    res += double(C2) * x * x;
    res += double(C3) * x * x * x;
    return res;
  };
  vector<double> xs;
  if (C3 != 0) {
    ll a = 3 * C3, b = 2 * C2, c = C1;
    ll d = b * b - 4 * a * c;
    if (d >= 0) {
      double z = sqrt(double(d));
      double x0 = (-double(b) + z) / (2.0 * double(a));
      double x1 = (-double(b) - z) / (2.0 * double(a));
      if (L <= x0 && x0 <= R)
        xs.push_back(x0);
      if (L <= x1 && x1 <= R)
        xs.push_back(x1);
    }
  } else if (C2 != 0) {
    double x0 = (-double(C1) / double(2 * C2));
    if (L <= x0 && x0 <= R)
      xs.push_back(x0);
  }
  xs.push_back(L);
  xs.push_back(R);
  sort(xs.begin(), xs.end());
  double ans = 1e18;
  rep(i, xs.size() - 1) {
    double y0 = f(xs[i]), y1 = f(xs[i + 1]);
    if ((y0 <= 0 && 0 <= y1) || (y0 >= 0 && 0 >= y1)) {
      ans = 0;
    } else {
      ans = min(ans, abs(y0));
      ans = min(ans, abs(y1));
    }
  }
  cout << fixed << setprecision(6) << ans << '\n';
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  int T = 1;
  for (int t = 0; t < T; t++) {
    solve();
  }
  return 0;
}