code: function(x) {
      if (x >= 2) { return -100; }
      if (x <= 0) { return 100; }
  
      var xx = (x < 1) ? x : 2 - x;
      var t = Math.sqrt(-2 * Math.log(xx / 2));
  
      var r = -0.70711 * ((2.30753 + t * 0.27061) /
              (1 + t * (0.99229 + t * 0.04481)) - t);
  
      for (var j = 0; j < 2; j++) {
        var err = erfc(r) - xx;
        r += err / (1.12837916709551257 * Math.exp(-(r * r)) - r * err);
      }
  
      return (x < 1) ? r : -r;
    }
docs: Inverse complementary error function From Numerical Recipes 3e p265