code: function q_chi2(df, chi2) {
          var chi, t = 0, k = 0, s = 0;
          if ((df & 1) !== 0) {
              chi = Math.sqrt(chi2);
  
              if (df === 1) { return 2 * normal__x(chi); }
  
              t = chi * Math.exp(-0.5 * chi2) / SQ2PI;
              s = t;
              k = 3;
              while (k < df) {
                  t = t * (chi2 / k);
                  s = s + t;
                  k = k + 2;
              }
  
              return 2 * (normal__x(chi) + s);
          }
  
          t = Math.exp(-0.5 * chi2);
          s = t;
          k = 2;
          while (k < df) {
              t = t * (chi2 / k);
              s = s + t;
              k = k + 2;
          }
  
          return s;
      }
docs: chi-square distribution ([1]) [x, \infty)