docs: public double toPValue(double d, int n) {
      double b = d / 30 + 1. / (36 * n);
      double z = .5 * MathUtil.PISQUARE * MathUtil.PISQUARE * n * b;
  
      // Exponential approximation
      if(z < 1.1 || z > 8.5) {
        double e = FastMath.exp(0.3885037 - 1.164879 * z);
        return (e > 1) ? 1 : (e < 0) ? 0 : e;
      }
      // Tabular approximation
      for(int i = 0; i < 86; i++) {
        if(TABPOS[i] >= z) {
          // Exact table value
          if(TABPOS[i] == z) {
            return TABVAL[i];
          }
          // Linear interpolation
          double x1 = TABPOS[i], x0 = TABPOS[i - 1];
          double y1 = TABVAL[i], y0 = TABVAL[i - 1];
          return y0 + (y1 - y0) * (z - x0) / (x1 - x0);
        }
      }
      return -1;
    }