Esempio n. 1
0
 public static double tanh(double x) {
   if (x == 0.0) {
     return x;
   } else if (Double.isInfinite(x)) {
     return signum(x);
   } else {
     double e2x = NativeMath.exp(2 * x);
     return (e2x - 1) / (e2x + 1);
   }
 }
Esempio n. 2
0
 public static double sinh(double x) {
   return x == 0 ? x : (NativeMath.exp(x) - NativeMath.exp(-x)) / 2;
 }
Esempio n. 3
0
 public static double exp(double x) {
   return NativeMath.exp(x);
 }
Esempio n. 4
0
 public static double expm1(double d) {
   return d == 0 ? d : NativeMath.exp(d) - 1;
 }
Esempio n. 5
0
 public static double cosh(double x) {
   return (NativeMath.exp(x) + NativeMath.exp(-x)) / 2;
 }