#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    vector<double> C(4);
    for(auto &c : C) cin >> c;

    double L,R; cin >> L >> R;
    double answer = 1e18;
    for(double x=L; x<=R+1e-5; x+=0.001){
        double now = 0,X = 1;
        for(auto &c : C) now += c*X,X *= x;
        answer = min(answer,abs(now));
    }
    cout << fixed << setprecision(20) << answer << endl;
}