code: function p_t(df, t) {
          var c2, s, p, i;
  
          c2 = df / (df + t * t);
          s = Math.sqrt(1.0 - c2);
  
          if (t < 0.0) { s = -s; }
  
          p = 0.0;
          i = df % 2 + 2;
          while (i <= df) {
              p = p + s;
              s = s * ((i - 1) * c2 / i);
              i = i + 2;
          }
  
          if ((df & 1) !== 0) {
              return 0.5 + (p * Math.sqrt(c2) + Math.atan(t / Math.sqrt(df))) / Math.PI;
          }
  
          return (1.0 + p) / 2.0;
      }
docs: t-distribution ([1]) (-\infty, x]