Remove methods that were calling the "Math" implementation.
This commit is contained in:
parent
22753536f4
commit
e052d9dc53
|
@ -375,15 +375,6 @@ public final class AccurateMath {
|
||||||
return Double.longBitsToDouble(xl);
|
return Double.longBitsToDouble(xl);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Compute the square root of a number.
|
|
||||||
* <p><b>Note:</b> this implementation currently delegates to {@link Math#sqrt}
|
|
||||||
* @param a number on which evaluation is done
|
|
||||||
* @return square root of a
|
|
||||||
*/
|
|
||||||
public static double sqrt(final double a) {
|
|
||||||
return Math.sqrt(a);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Compute the hyperbolic cosine of a number.
|
/** Compute the hyperbolic cosine of a number.
|
||||||
* @param x number on which evaluation is done
|
* @param x number on which evaluation is done
|
||||||
* @return hyperbolic cosine of x
|
* @return hyperbolic cosine of x
|
||||||
|
@ -705,7 +696,7 @@ public final class AccurateMath {
|
||||||
* @return inverse hyperbolic cosine of a
|
* @return inverse hyperbolic cosine of a
|
||||||
*/
|
*/
|
||||||
public static double acosh(final double a) {
|
public static double acosh(final double a) {
|
||||||
return AccurateMath.log(a + AccurateMath.sqrt(a * a - 1));
|
return AccurateMath.log(a + Math.sqrt(a * a - 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Compute the inverse hyperbolic sine of a number.
|
/** Compute the inverse hyperbolic sine of a number.
|
||||||
|
@ -721,7 +712,7 @@ public final class AccurateMath {
|
||||||
|
|
||||||
double absAsinh;
|
double absAsinh;
|
||||||
if (a > 0.167) {
|
if (a > 0.167) {
|
||||||
absAsinh = AccurateMath.log(AccurateMath.sqrt(a * a + 1) + a);
|
absAsinh = AccurateMath.log(Math.sqrt(a * a + 1) + a);
|
||||||
} else {
|
} else {
|
||||||
final double a2 = a * a;
|
final double a2 = a * a;
|
||||||
if (a > 0.097) {
|
if (a > 0.097) {
|
||||||
|
@ -820,14 +811,6 @@ public final class AccurateMath {
|
||||||
return nextAfter(a, Float.NEGATIVE_INFINITY);
|
return nextAfter(a, Float.NEGATIVE_INFINITY);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Returns a pseudo-random number between 0.0 and 1.0.
|
|
||||||
* <p><b>Note:</b> this implementation currently delegates to {@link Math#random}
|
|
||||||
* @return a random number between 0.0 and 1.0
|
|
||||||
*/
|
|
||||||
public static double random() {
|
|
||||||
return Math.random();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Exponential function.
|
* Exponential function.
|
||||||
*
|
*
|
||||||
|
@ -2801,7 +2784,7 @@ public final class AccurateMath {
|
||||||
|
|
||||||
/* Square root */
|
/* Square root */
|
||||||
double y;
|
double y;
|
||||||
y = sqrt(za);
|
y = Math.sqrt(za);
|
||||||
temp = y * HEX_40000000;
|
temp = y * HEX_40000000;
|
||||||
ya = y + temp - temp;
|
ya = y + temp - temp;
|
||||||
yb = y - ya;
|
yb = y - ya;
|
||||||
|
@ -2876,7 +2859,7 @@ public final class AccurateMath {
|
||||||
za = temp;
|
za = temp;
|
||||||
|
|
||||||
/* Square root */
|
/* Square root */
|
||||||
double y = sqrt(za);
|
double y = Math.sqrt(za);
|
||||||
temp = y * HEX_40000000;
|
temp = y * HEX_40000000;
|
||||||
ya = y + temp - temp;
|
ya = y + temp - temp;
|
||||||
yb = y - ya;
|
yb = y - ya;
|
||||||
|
@ -3682,7 +3665,7 @@ public final class AccurateMath {
|
||||||
final double scaledY = scalb(y, -middleExp);
|
final double scaledY = scalb(y, -middleExp);
|
||||||
|
|
||||||
// compute scaled hypotenuse
|
// compute scaled hypotenuse
|
||||||
final double scaledH = sqrt(scaledX * scaledX + scaledY * scaledY);
|
final double scaledH = Math.sqrt(scaledX * scaledX + scaledY * scaledY);
|
||||||
|
|
||||||
// remove scaling
|
// remove scaling
|
||||||
return scalb(scaledH, middleExp);
|
return scalb(scaledH, middleExp);
|
||||||
|
|
|
@ -284,7 +284,7 @@ public final class JdkMath {
|
||||||
NEXTUP_FLOAT = AccurateMath::nextUp;
|
NEXTUP_FLOAT = AccurateMath::nextUp;
|
||||||
NEXTUP_DOUBLE = AccurateMath::nextUp;
|
NEXTUP_DOUBLE = AccurateMath::nextUp;
|
||||||
POW = AccurateMath::pow;
|
POW = AccurateMath::pow;
|
||||||
RANDOM = AccurateMath::random;
|
RANDOM = Math::random; // Not implemented.
|
||||||
RINT = AccurateMath::rint;
|
RINT = AccurateMath::rint;
|
||||||
ROUND_DOUBLE = AccurateMath::round;
|
ROUND_DOUBLE = AccurateMath::round;
|
||||||
ROUND_FLOAT = AccurateMath::round;
|
ROUND_FLOAT = AccurateMath::round;
|
||||||
|
@ -292,7 +292,7 @@ public final class JdkMath {
|
||||||
SCALB_FLOAT = AccurateMath::scalb;
|
SCALB_FLOAT = AccurateMath::scalb;
|
||||||
SIGNUM_DOUBLE = AccurateMath::signum;
|
SIGNUM_DOUBLE = AccurateMath::signum;
|
||||||
SIGNUM_FLOAT = AccurateMath::signum;
|
SIGNUM_FLOAT = AccurateMath::signum;
|
||||||
SQRT = AccurateMath::sqrt;
|
SQRT = Math::sqrt; // Not implemented.
|
||||||
SIN = AccurateMath::sin;
|
SIN = AccurateMath::sin;
|
||||||
SINH = AccurateMath::sinh;
|
SINH = AccurateMath::sinh;
|
||||||
SUBTRACTEXACT_INT = AccurateMath::subtractExact;
|
SUBTRACTEXACT_INT = AccurateMath::subtractExact;
|
||||||
|
|
Loading…
Reference in New Issue