Element-wise leaky ReLU function:<br>
out = x if x >= 0.0<br>
out = alpha * x if x < cutoff<br>
Alpha value is most commonly set to 0.01

@param x     Input variable
@param alpha Cutoff - usually 0.0
@return Output variable
8464
public SDVariable leakyRelu(String name, SDVariable x, double alpha) {
        validateFloatingPoint("leaky ReLU", x);
        SDVariable result = f().leakyRelu(x, alpha);
        return updateVariableNameAndReference(result, name);
    }
1223638
def _call(self, x):
        """"""
        if self.exponent == 0:
            return self.domain.one().inner(np.not_equal(x, 0))
        elif self.exponent == 1:
            return x.ufuncs.absolute().inner(self.domain.one())
        elif self.exponent == 2:
            return np.sqrt(x.inner(x))
        elif np.isfinite(self.exponent):
            tmp = x.ufuncs.absolute()
            tmp.ufuncs.power(self.exponent, out=tmp)
            return np.power(tmp.inner(self.domain.one()), 1 / self.exponent)
        elif self.exponent == np.inf:
            return x.ufuncs.absolute().ufuncs.max()
        elif self.exponent == -np.inf:
            return x.ufuncs.absolute().ufuncs.min()
        else:
            raise RuntimeError('unknown exponent')
664730
public static double Function(double x) {
        double[] P =
                {
                        1.60119522476751861407E-4,
                        1.19135147006586384913E-3,
                        1.04213797561761569935E-2,
                        4.76367800457137231464E-2,
                        2.07448227648435975150E-1,
                        4.94214826801497100753E-1,
                        9.99999999999999996796E-1
                };
        double[] Q =
                {
                        -2.31581873324120129819E-5,
                        5.39605580493303397842E-4,
                        -4.45641913851797240494E-3,
                        1.18139785222060435552E-2,
                        3.58236398605498653373E-2,
                        -2.34591795718243348568E-1,
                        7.14304917030273074085E-2,
                        1.00000000000000000320E0
                };

        double p, z;

        double q = Math.abs(x);

        if (q > 33.0) {
            if (x < 0.0) {
                p = Math.floor(q);

                if (p == q) {
                    try {
                        throw new ArithmeticException("Overflow");
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }

                z = q - p;
                if (z > 0.5) {
                    p += 1.0;
                    z = q - p;
                }
                z = q * Math.sin(Math.PI * z);

                if (z == 0.0) {
                    try {
                        throw new ArithmeticException("Overflow");
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }

                z = Math.abs(z);
                z = Math.PI / (z * Stirling(q));

                return -z;
            } else {
                return Stirling(x);
            }
        }

        z = 1.0;
        while (x >= 3.0) {
            x -= 1.0;
            z *= x;
        }

        while (x < 0.0) {
            if (x == 0.0) {
                throw new ArithmeticException();
            } else if (x > -1.0E-9) {
                return (z / ((1.0 + 0.5772156649015329 * x) * x));
            }
            z /= x;
            x += 1.0;
        }

        while (x < 2.0) {
            if (x == 0.0) {
                throw new ArithmeticException();
            } else if (x < 1.0E-9) {
                return (z / ((1.0 + 0.5772156649015329 * x) * x));
            }

            z /= x;
            x += 1.0;
        }

        if ((x == 2.0) || (x == 3.0)) return z;

        x -= 2.0;
        p = Special.Polevl(x, P, 6);
        q = Special.Polevl(x, Q, 7);
        return z * p / q;

    }
504435
def sg_leaky_relu(x, opt):
    
    """
    return tf.where(tf.greater(x, 0), x, 0.01 * x, name=opt.name)
1364849
public Version cutoff(int index) {
        if (!isBeyondBounds(index)) {
            labels = labels.subList(--index, labels.size());
            numbers = numbers.subList(index, numbers.size());
        }
        return this;
    }
698732
def lnlike(self, X):
        
        return -3.5*np.log(self._interpolant(X[0], X[1], grid=False))
1304409
public static double asin(double x) {
      if (x != x) {
          return Double.NaN;
      }

      if (x > 1.0 || x < -1.0) {
          return Double.NaN;
      }

      if (x == 1.0) {
          return Math.PI/2.0;
      }

      if (x == -1.0) {
          return -Math.PI/2.0;
      }

      if (x == 0.0) { // Matches +/- 0.0; return correct sign
          return x;
      }

      /* Compute asin(x) = atan(x/sqrt(1-x*x)) */

      /* Split x */
      double temp = x * HEX_40000000;
      final double xa = x + temp - temp;
      final double xb = x - xa;

      /* Square it */
      double ya = xa*xa;
      double yb = xa*xb*2.0 + xb*xb;

      /* Subtract from 1 */
      ya = -ya;
      yb = -yb;

      double za = 1.0 + ya;
      double zb = -(za - 1.0 - ya);

      temp = za + yb;
      zb += -(temp - za - yb);
      za = temp;

      /* Square root */
      double y;
      y = sqrt(za);
      temp = y * HEX_40000000;
      ya = y + temp - temp;
      yb = y - ya;

      /* Extend precision of sqrt */
      yb += (za - ya*ya - 2*ya*yb - yb*yb) / (2.0*y);

      /* Contribution of zb to sqrt */
      double dx = zb / (2.0*y);

      // Compute ratio r = x/y
      double r = x/y;
      temp = r * HEX_40000000;
      double ra = r + temp - temp;
      double rb = r - ra;

      rb += (x - ra*ya - ra*yb - rb*ya - rb*yb) / y;  // Correct for rounding in division
      rb += -x * dx / y / y;  // Add in effect additional bits of sqrt.

      temp = ra + rb;
      rb = -(temp - ra - rb);
      ra = temp;

      return atan(ra, rb, false);
    }
1004974
def gamma(x, context=None):
    
    return _apply_function_in_current_context(
        BigFloat,
        mpfr.mpfr_gamma,
        (BigFloat._implicit_convert(x),),
        context,
    )
826201
private static double scalbn(double x, int n) {
        int hx = hi(x);
        int lx = lo(x);
        int k = (hx & 0x7ff00000) >> 20;         // extract exponent
        if (k == 0) {                          // 0 or subnormal x
            if ((lx | (hx & 0x7fffffff)) == 0) {
                return x; // +-0
            }
            x *= two54;
            hx = hi(x);
            k = ((hx & 0x7ff00000) >> 20) - 54;
            if (n < -50000) {
                return tiny * x;                   // underflow
            }
        }
        if (k == 0x7ff) {
            return x + x;                        // NaN or Inf
        }
        k = k + n;
        if (k > 0x7fe) {
            return huge * copysign(huge, x);      // overflow
        }
        if (k > 0) {
            // normal result
            return fromhilo((hx & 0x800fffff) | (k << 20), lo(x));
        }
        if (k <= -54) {
            if (n > 50000) {
                // in case integer overflow in n+k
                return huge * copysign(huge, x);  // overflow
            }
            else {
                return tiny * copysign(tiny, x);    // underflow
            }
        }
        k += 54;                             // subnormal result
        x = fromhilo((hx & 0x800fffff) | (k << 20), lo(x));
        return x * twom54;
    }
805609
@ColorInt
    public static int getAlphaColor(@ColorInt int color, @IntRange(from = 0, to = 255) int alpha) {
        int red = Color.red(color);
        int green = Color.green(color);
        int blue = Color.blue(color);
        return Color.argb(alpha, red, green, blue);
    }
377501
def _compute_intra_event_alpha(self, C, vs30, pga1100):
        
        alpha = np.zeros_like(vs30, dtype=float)
        idx = vs30 < C['k1']
        if np.any(idx):
            temp1 = (pga1100[idx] +
                     C['c'] * (vs30[idx] / C['k1']) ** C['n']) ** -1.
            temp1 = temp1 - ((pga1100[idx] + C['c']) ** -1.)
            alpha[idx] = C['k2'] * pga1100[idx] * temp1

        return alpha
380453
public static double regularizedIncompleteBetaFunction(double alpha, double beta, double x) {
        if (x < 0.0 || x > 1.0) {
            throw new IllegalArgumentException("Invalid x: " + x);
        }

        double ibeta = 0.0;
        if (x == 0.0) {
            ibeta = 0.0;
        } else {
            if (x == 1.0) {
                ibeta = 1.0;
            } else {
                // Term before continued fraction
                ibeta = Math.exp(Gamma.lgamma(alpha + beta) - Gamma.lgamma(alpha) - Gamma.lgamma(beta) + alpha * Math.log(x) + beta * Math.log(1.0D - x));
                // Continued fraction
                if (x < (alpha + 1.0) / (alpha + beta + 2.0)) {
                    ibeta = ibeta * incompleteFractionSummation(alpha, beta, x) / alpha;
                } else {
                    // Use symmetry relationship
                    ibeta = 1.0 - ibeta * incompleteFractionSummation(beta, alpha, 1.0 - x) / beta;
                }
            }
        }
        return ibeta;
    }
114757
def _alpha_eff(self, r_eff, n_sersic, k_eff):
        
        b = self.b_n(n_sersic)
        alpha_eff = n_sersic * r_eff * k_eff * b**(-2*n_sersic) * np.exp(b) * special.gamma(2*n_sersic)
        return -alpha_eff
1024545
public static float ulp(float x) {
        if (Float.isInfinite(x)) {
            return Float.POSITIVE_INFINITY;
        }
        return abs(x - Float.intBitsToFloat(Float.floatToIntBits(x) ^ 1));
    }
46633
public static double inverseRegularizedIncompleteBetaFunction(double alpha, double beta, double p) {
        final double EPS = 1.0E-8;

        double pp, t, u, err, x, al, h, w, afac;
        double a1 = alpha - 1.;
        double b1 = beta - 1.;

        if (p <= 0.0) {
            return 0.0;
        }

        if (p >= 1.0) {
            return 1.0;
        }

        if (alpha >= 1. && beta >= 1.) {
            pp = (p < 0.5) ? p : 1. - p;
            t = Math.sqrt(-2. * Math.log(pp));
            x = (2.30753 + t * 0.27061) / (1. + t * (0.99229 + t * 0.04481)) - t;
            if (p < 0.5) {
                x = -x;
            }
            al = (x * x - 3.) / 6.;
            h = 2. / (1. / (2. * alpha - 1.) + 1. / (2. * beta - 1.));
            w = (x * Math.sqrt(al + h) / h) - (1. / (2. * beta - 1) - 1. / (2. * alpha - 1.)) * (al + 5. / 6. - 2. / (3. * h));
            x = alpha / (alpha + beta * Math.exp(2. * w));
        } else {
            double lna = Math.log(alpha / (alpha + beta));
            double lnb = Math.log(beta / (alpha + beta));
            t = Math.exp(alpha * lna) / alpha;
            u = Math.exp(beta * lnb) / beta;
            w = t + u;
            if (p < t / w) {
                x = Math.pow(alpha * w * p, 1. / alpha);
            } else {
                x = 1. - Math.pow(beta * w * (1. - p), 1. / beta);
            }
        }
        afac = -Gamma.lgamma(alpha) - Gamma.lgamma(beta) + Gamma.lgamma(alpha + beta);
        for (int j = 0; j < 10; j++) {
            if (x == 0. || x == 1.) {
                return x;
            }
            err = regularizedIncompleteBetaFunction(alpha, beta, x) - p;
            t = Math.exp(a1 * Math.log(x) + b1 * Math.log(1. - x) + afac);
            u = err / t;
            x -= (t = u / (1. - 0.5 * Math.min(1., u * (a1 / x - b1 / (1. - x)))));
            if (x <= 0.) {
                x = 0.5 * (x + t);
            }
            if (x >= 1.) {
                x = 0.5 * (x + t + 1.);
            }
            if (Math.abs(t) < EPS * x && j > 0) {
                break;
            }
        }
        return x;
    }
519225
public static double rint(double x) {
        double y = floor(x);
        double d = x - y;

        if (d > 0.5) {
            if (y == -1.0) {
                return -0.0; // Preserve sign of operand
            }
            return y+1.0;
        }
        if (d < 0.5) {
            return y;
        }

        /* half way, round to even */
        long z = (long) y;
        return (z & 1) == 0 ? y : y + 1.0;
    }
294421
public SDVariable rsub(SDVariable x) {
        return rsub(sameDiff.generateNewVarName(RSubOp.OP_NAME,0),x);
    }