code: function q_f(df1, df2, f) {
          var cos2, sin2, prob, temp, i;
  
          if (f <= 0.0) { return 1.0; }
          if (df1 % 2 !== 0 && df2 % 2 === 0) { return 1.0 - q_f(df2, df1, 1.0 / f); }
  
          cos2 = 1.0 / (1.0 + df1 * f / df2);
          sin2 = 1.0 - cos2;
  
          if (df1 % 2 === 0) {
              prob = Math.pow(cos2, (df2 / 2.0));
              temp = prob;
  
              i = 2;
              while (i < df1) {
                  temp = temp * ((df2 + i - 2) * sin2 / i);
                  prob = prob + temp;
                  i = i + 2;
              }
  
              return prob;
          }
  
          prob = Math.atan(Math.sqrt(df2 / (df1 * f)));
          temp = Math.sqrt(sin2 * cos2);
          i = 3;
          while (i <= df1) {
              prob = prob + temp;
              temp = temp * ((i - 1) * sin2 / i);
              i = i + 2.0;
          }
  
          temp = temp * df1;
          i = 3;
          while (i <= df2) {
              prob = prob - temp;
              temp = temp * ((df1 + i - 2) * cos2 / i);
              i = i + 2;
          }
  
          return prob * 2.0 / Math.PI;
      }
docs: F-distribution ([1]) [x, \infty)