Binding for {@link java.lang.Math#expm1(double)}

@param   x   the exponent to raise <i>e</i> to in the computation of
<i>e</i><sup>{@code x}</sup>&nbsp;-1.
@return  the value <i>e</i><sup>{@code x}</sup>&nbsp;-&nbsp;1.
549573
public static DoubleBinding expm1(final ObservableDoubleValue x) {
        return createDoubleBinding(() -> Math.expm1(x.get()), x);
    }
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;

    }
1227696
public static Double evaluate(double x, double y) {
        return (
            0.75 * Math.exp(-Math.pow((9 * x - 2), 2.0) / 4.0 - Math.pow((9 * y - 2), 2.0) / 4.0) +
            0.75 * Math.exp(-Math.pow((9 * x + 1), 2.0) / 49.0 - (9 * y + 1) / 10.0) +
            0.5 * Math.exp(-Math.pow((9 * x - 7), 2.0) / 4.0 - Math.pow((9 * y - 3), 2.0) / 4.0) -
            0.2 * Math.exp(-Math.pow((9 * x - 4), 2.0) - Math.pow((9 * y - 7), 2.0))
        );
    }
40814
public static double round(double x, int decimal) {
        if (decimal < 0) {
            return round(x / pow(10, -decimal)) * pow(10, -decimal);
        } else {
            return round(x * pow(10, decimal)) / pow(10, decimal);
        }
    }
170317
public static double pow2(int x)
    {
        if(x > Double.MAX_EXPONENT)
            return Double.POSITIVE_INFINITY;
        if(x < Double.MIN_EXPONENT)
            return 0;
        return longBitsToDouble((x+1023L)<<52);
    }
528938
public static BigFloat exp(BigFloat x) {
		if(x.isSpecial())
			return x != NEGATIVE_INFINITY ? x : x.context.ZERO;
		return x.context.valueOf(BigDecimalMath.exp(x.value, x.context.mathContext));
	}
1052626
public static double ceil(double x) {
        double y;

        if (x != x) { // NaN
            return x;
        }

        y = floor(x);
        if (y == x) {
            return y;
        }

        y += 1.0;

        if (y == 0) {
            return x*y;
        }

        return y;
    }
397611
@Pure
	public static double fromESRI_x(double x) throws IOException {
		if (Double.isInfinite(x) || Double.isNaN(x)) {
			throw new InvalidNumericValueException(x);
		}
		return x;
	}
1206463
public static double Highprecision_Exp(double x) {
        return (362880 + x * (362880 + x * (181440 + x * (60480 + x * (15120 + x * (3024 + x * (504 + x * (72 + x * (9 + x))))))))) * 2.75573192e-6;
    }
795953
public static double cosh(double x) {
      if (x != x) {
          return x;
      }

      // cosh[z] = (exp(z) + exp(-z))/2

      // for numbers with magnitude 20 or so,
      // exp(-z) can be ignored in comparison with exp(z)

      if (x > 20) {
          if (x >= LOG_MAX_VALUE) {
              // Avoid overflow (MATH-905).
              final double t = exp(0.5 * x);
              return (0.5 * t) * t;
          } else {
              return 0.5 * exp(x);
          }
      } else if (x < -20) {
          if (x <= -LOG_MAX_VALUE) {
              // Avoid overflow (MATH-905).
              final double t = exp(-0.5 * x);
              return (0.5 * t) * t;
          } else {
              return 0.5 * exp(-x);
          }
      }

      final double hiPrec[] = new double[2];
      if (x < 0.0) {
          x = -x;
      }
      exp(x, 0.0, hiPrec);

      double ya = hiPrec[0] + hiPrec[1];
      double yb = -(ya - hiPrec[0] - hiPrec[1]);

      double temp = ya * HEX_40000000;
      double yaa = ya + temp - temp;
      double yab = ya - yaa;

      // recip = 1/y
      double recip = 1.0/ya;
      temp = recip * HEX_40000000;
      double recipa = recip + temp - temp;
      double recipb = recip - recipa;

      // Correct for rounding in division
      recipb += (1.0 - yaa*recipa - yaa*recipb - yab*recipa - yab*recipb) * recip;
      // Account for yb
      recipb += -yb * recip * recip;

      // y = y + 1/y
      temp = ya + recipa;
      yb += -(temp - ya - recipa);
      ya = temp;
      temp = ya + recipb;
      yb += -(temp - ya - recipb);
      ya = temp;

      double result = ya + yb;
      result *= 0.5;
      return result;
    }
1094609
public static double sigmoid(double x) {
    if (x<0) {
      double num = Math.exp(x);
      return num / (1.0 + num);
    }
    else {
      double den = 1.0 + Math.exp(-x);
      return 1.0 / den;
    }
  }
1111658
static public double ackley(double[] x) {

    double sum1 = 0.0;
    double sum2 = 0.0;

    for (int i = 0; i < x.length; i++) {
      sum1 += (x[i] * x[i]);
      sum2 += (Math.cos(PIx2 * x[i]));
    }

    return (-20.0 * Math.exp(-0.2 * Math.sqrt(sum1 / ((double) x.length))) - Math
      .exp(sum2 / ((double) x.length)) + 20.0 + Math.E);
  }
1010103
public static double factorial(int x) {
    double result = 1.0;
    for (int i=x; i>1; i--) {
      result *= i;
    }
    return result;
  }
1025981
@Pure
	public int getColumnFor(double x) {
		final double xx = x - this.bounds.getMinX();
		if (xx >= 0.)  {
			final int idx = (int) (xx / getCellWidth());
			assert idx >= 0;
			if (idx < getColumnCount()) {
				return idx;
			}
			return getColumnCount() - 1;
		}
		return 0;
	}
547159
public static DoubleBinding tanh(final ObservableDoubleValue x) {
        return createDoubleBinding(() -> Math.tanh(x.get()), x);
    }
925304
public static double exp(double x) {
    double val = Math.min(MAX, Math.exp(x));
//    if (val == MAX) Log.warn("Exp overflow: exp(" + x + ") truncated to " + MAX);
    return val;
  }
423807
public static double Log(double x) {
        double p, q, w, z;

        double[] A =
                {
                        8.11614167470508450300E-4,
                        -5.95061904284301438324E-4,
                        7.93650340457716943945E-4,
                        -2.77777777730099687205E-3,
                        8.33333333333331927722E-2
                };

        double[] B =
                {
                        -1.37825152569120859100E3,
                        -3.88016315134637840924E4,
                        -3.31612992738871184744E5,
                        -1.16237097492762307383E6,
                        -1.72173700820839662146E6,
                        -8.53555664245765465627E5
                };

        double[] C =
                {
                        -3.51815701436523470549E2,
                        -1.70642106651881159223E4,
                        -2.20528590553854454839E5,
                        -1.13933444367982507207E6,
                        -2.53252307177582951285E6,
                        -2.01889141433532773231E6
                };

        if (x < -34.0) {
            q = -x;
            w = Log(q);
            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 = p - q;
            }
            z = q * Math.sin(Math.PI * z);

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

            z = Constants.LogPI - Math.log(z) - w;
            return z;
        }

        if (x < 13.0) {
            z = 1.0;
            while (x >= 3.0) {
                x -= 1.0;
                z *= x;
            }
            while (x < 2.0) {
                if (x == 0.0) {
                    try {
                        throw new ArithmeticException("Overflow.");
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }

                z /= x;
                x += 1.0;
            }
            if (z < 0.0) z = -z;
            if (x == 2.0) return Math.log(z);
            x -= 2.0;
            p = x * Special.Polevl(x, B, 5) / Special.P1evl(x, C, 6);
            return (Math.log(z) + p);
        }

        if (x > 2.556348e305) {
            try {
                throw new ArithmeticException("Overflow.");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }

        q = (x - 0.5) * Math.log(x) - x + 0.91893853320467274178;
        if (x > 1.0e8) return (q);

        p = 1.0 / (x * x);
        if (x >= 1000.0) {
            q += ((7.9365079365079365079365e-4 * p
                    - 2.7777777777777777777778e-3) * p
                    + 0.0833333333333333333333) / x;
        } else {
            q += Special.Polevl(p, A, 4) / x;
        }

        return q;
    }