Tabnine Logo
Math.exp
Code IndexAdd Tabnine to your IDE (free)

How to use
exp
method
in
java.lang.Math

Best Java code snippets using java.lang.Math.exp (Showing top 20 results out of 9,351)

origin: hankcs/HanLP

/**
 * sigmoid函数
 *
 * @param value
 * @return
 */
public static float sigMoid(float value)
{
  return (float) (1d / (1d + Math.exp(-value)));
}
origin: hankcs/HanLP

private static double toProb(Node n, double Z)
{
  return Math.exp(n.alpha + n.beta - n.cost - Z);
}
origin: hankcs/HanLP

public double prob()
{
  return Math.exp(-cost_ - Z_);
}
origin: scwang90/SmartRefreshLayout

private static float viscousFluid(float x) {
  x *= VISCOUS_FLUID_SCALE;
  if (x < 1.0f) {
    x -= (1.0f - (float)Math.exp(-x));
  } else {
    float start = 0.36787944117f;   // 1/e == exp(-1)
    x = 1.0f - (float)Math.exp(1.0f - x);
    x = start + x * (1.0f - start);
  }
  return x;
}
origin: stanfordnlp/CoreNLP

public static double[] softmax(double[] scales) {
 double[] newScales = new double[scales.length];
 double sum = 0;
 for (int i = 0; i < scales.length; i++) {
  newScales[i] = Math.exp(scales[i]);
  sum += newScales[i];
 }
 for (int i = 0; i < scales.length; i++) {
  newScales[i] /= sum;
 }
 return newScales;
}
origin: apache/incubator-druid

 @Override
 protected ExprEval eval(double param)
 {
  return ExprEval.of(Math.exp(param));
 }
}
origin: hankcs/HanLP

@Override
public void unLog()
{
  super.unLog();
  for (float[][] m : transition_probability2)
  {
    for (float[] v : m)
    {
      for (int i = 0; i < v.length; i++)
      {
        v[i] = (float) Math.exp(v[i]);
      }
    }
  }
}
origin: stanfordnlp/CoreNLP

/**
 * Returns the probability for the given labels (indexed using classIndex),
 * where the last label corresponds to the label at the specified position.
 * For instance if you called prob(5, {1,2,3}) it will return the marginal
 * prob that the label at position 3 is 1, the label at position 4 is 2 and
 * the label at position 5 is 3.
 */
public double prob(int position, int[] labels) {
 return Math.exp(logProb(position, labels));
}
origin: stanfordnlp/CoreNLP

/**
 * returns the probability for the given labels, where the last label
 * corresponds to the label at the specified position. For instance if you
 * called logProb(5, {"O", "PER", "ORG"}) it will return the marginal prob
 * that the label at position 3 is "O", the label at position 4 is "PER" and
 * the label at position 5 is "ORG".
 */
public double prob(int position, E[] labels) {
 return Math.exp(logProb(position, labels));
}
origin: stanfordnlp/CoreNLP

public static double poisson(int x, double lambda) {
 if (x<0 || lambda<=0.0) throw new RuntimeException("Bad arguments: " + x + " and " + lambda);
 double p = (Math.exp(-lambda) * Math.pow(lambda, x)) / factorial(x);
 if (Double.isInfinite(p) || p<=0.0) throw new RuntimeException(Math.exp(-lambda) +" "+ Math.pow(lambda, x) + ' ' + factorial(x));
 return p;
}
origin: google/guava

 static double randomPositiveDouble() {
  return Math.exp(randomDouble(6));
 }
}
origin: prestodb/presto

private static Point tileXYToLatitudeLongitude(int tileX, int tileY, int zoomLevel)
{
  long mapSize = mapSize(zoomLevel);
  double x = (clip(tileX * TILE_PIXELS, 0, mapSize) / mapSize) - 0.5;
  double y = 0.5 - (clip(tileY * TILE_PIXELS, 0, mapSize) / mapSize);
  double latitude = 90 - 360 * Math.atan(Math.exp(-y * 2 * Math.PI)) / Math.PI;
  double longitude = 360 * x;
  return new Point(longitude, latitude);
}
origin: neo4j/neo4j

public static DoubleValue exp( AnyValue in )
{
  if ( in instanceof NumberValue )
  {
    return doubleValue( Math.exp( ((NumberValue) in).doubleValue() ) );
  }
  else
  {
    throw needsNumbers( "exp()" );
  }
}
origin: stanfordnlp/CoreNLP

public static  DoubleAD exp(DoubleAD a){
 DoubleAD c = new DoubleAD();
 c.setval( Math.exp(a.getval()));
 c.setdot(a.getdot() * Math.exp(a.getval()));
 return c;
}
origin: prestodb/presto

@Test
public void testExp()
{
  for (double doubleValue : DOUBLE_VALUES) {
    assertFunction("exp(" + doubleValue + ")", DOUBLE, Math.exp(doubleValue));
    assertFunction("exp(REAL '" + (float) doubleValue + "')", DOUBLE, Math.exp((float) doubleValue));
  }
  assertFunction("exp(NULL)", DOUBLE, null);
}
origin: prestodb/presto

@Description("Euler's number raised to the given power")
@ScalarFunction
@SqlType(StandardTypes.DOUBLE)
public static double exp(@SqlType(StandardTypes.DOUBLE) double num)
{
  return Math.exp(num);
}
origin: prestodb/presto

  @OutputFunction(StandardTypes.REAL)
  public static void output(@AggregationState LongAndDoubleState state, BlockBuilder out)
  {
    long count = state.getLong();
    if (count == 0) {
      out.appendNull();
    }
    else {
      REAL.writeLong(out, floatToRawIntBits((float) Math.exp(state.getDouble() / count)));
    }
  }
}
origin: stanfordnlp/CoreNLP

public static <T> Counter<T> exp(Counter<T> c) {
 Counter<T> d = c.getFactory().create();
 for (T t : c.keySet()) {
  d.setCount(t, Math.exp(c.getCount(t)));
 }
 return d;
}
origin: prestodb/presto

  @OutputFunction(StandardTypes.DOUBLE)
  public static void output(@AggregationState LongAndDoubleState state, BlockBuilder out)
  {
    long count = state.getLong();
    if (count == 0) {
      out.appendNull();
    }
    else {
      DOUBLE.writeDouble(out, Math.exp(state.getDouble() / count));
    }
  }
}
origin: stanfordnlp/CoreNLP

double gprime(double lambdaP, int index) {
 double s = 0.0;
 for (int i = 0; i < p.functions.get(index).len(); i++) {
  int y = ((p.functions.get(index))).getY(i);
  int x = p.functions.get(index).getX(i);
  s = s + p.data.ptildeX(x) * pcond(y, x) * p.functions.get(index).getVal(i) * Math.exp(lambdaP * fnum(x, y)) * fnum(x, y);
 }
 return s;
}
java.langMathexp

Javadoc

Returns the closest double approximation of the raising "e" to the power of the argument. The returned result is within 1 ulp (unit in the last place) of the real result.

Special cases:

  • exp(+infinity) = +infinity
  • exp(-infinity) = +0.0
  • exp(NaN) = NaN

Popular methods of Math

  • min
    Returns the smaller of two long values. That is, the result is the argument closer to the value of L
  • max
    Returns the greater of two long values. That is, the result is the argument closer to the value of L
  • abs
    Returns the absolute value of a long value. If the argument is not negative, the argument is returne
  • round
    Returns the closest int to the argument, with ties rounding up. Special cases: * If the argument is
  • pow
    Returns the value of the first argument raised to the power of the second argument. Special cases: *
  • sqrt
    Returns the correctly rounded positive square root of a double value. Special cases: * If the argume
  • ceil
    Returns the smallest (closest to negative infinity) double value that is greater than or equal to th
  • floor
    Returns the largest (closest to positive infinity) double value that is less than or equal to the ar
  • random
    Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0. Returne
  • sin
    Returns the trigonometric sine of an angle. Special cases: * If the argument is NaN or an infinit
  • cos
    Returns the trigonometric cosine of an angle. Special cases: * If the argument is NaN or an infin
  • log
    Returns the natural logarithm (base e) of a doublevalue. Special cases: * If the argument is NaN
  • cos,
  • log,
  • toRadians,
  • atan2,
  • log10,
  • acos,
  • tan,
  • toDegrees,
  • atan

Popular in Java

  • Making http post requests using okhttp
  • setContentView (Activity)
  • notifyDataSetChanged (ArrayAdapter)
  • compareTo (BigDecimal)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • BoxLayout (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now