MATH-840
Fixed invalid argument to "asin" and "acos". git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@1369514 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b6e62ab83a
commit
4104b21368
|
@ -209,19 +209,19 @@ public class FastMathTestPerformance {
|
||||||
double x = 0;
|
double x = 0;
|
||||||
long time = System.nanoTime();
|
long time = System.nanoTime();
|
||||||
for (int i = 0; i < RUNS; i++)
|
for (int i = 0; i < RUNS; i++)
|
||||||
x += StrictMath.asin(i / 10000000.0);
|
x += StrictMath.asin(i / (double) RUNS);
|
||||||
long strictTime = System.nanoTime() - time;
|
long strictTime = System.nanoTime() - time;
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
time = System.nanoTime();
|
time = System.nanoTime();
|
||||||
for (int i = 0; i < RUNS; i++)
|
for (int i = 0; i < RUNS; i++)
|
||||||
x += FastMath.asin(i / 10000000.0);
|
x += FastMath.asin(i / (double) RUNS);
|
||||||
long fastTime = System.nanoTime() - time;
|
long fastTime = System.nanoTime() - time;
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
time = System.nanoTime();
|
time = System.nanoTime();
|
||||||
for (int i = 0; i < RUNS; i++)
|
for (int i = 0; i < RUNS; i++)
|
||||||
x += Math.asin(i / 10000000.0);
|
x += Math.asin(i / (double) RUNS);
|
||||||
long mathTime = System.nanoTime() - time;
|
long mathTime = System.nanoTime() - time;
|
||||||
|
|
||||||
report("asin",strictTime,fastTime,mathTime);
|
report("asin",strictTime,fastTime,mathTime);
|
||||||
|
@ -257,19 +257,19 @@ public class FastMathTestPerformance {
|
||||||
double x = 0;
|
double x = 0;
|
||||||
long time = System.nanoTime();
|
long time = System.nanoTime();
|
||||||
for (int i = 0; i < RUNS; i++)
|
for (int i = 0; i < RUNS; i++)
|
||||||
x += StrictMath.acos(i / 10000000.0);
|
x += StrictMath.acos(i / (double) RUNS);
|
||||||
long strictTime = System.nanoTime() - time;
|
long strictTime = System.nanoTime() - time;
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
time = System.nanoTime();
|
time = System.nanoTime();
|
||||||
for (int i = 0; i < RUNS; i++)
|
for (int i = 0; i < RUNS; i++)
|
||||||
x += FastMath.acos(i / 10000000.0);
|
x += FastMath.acos(i / (double) RUNS);
|
||||||
long fastTime = System.nanoTime() - time;
|
long fastTime = System.nanoTime() - time;
|
||||||
|
|
||||||
x = 0;
|
x = 0;
|
||||||
time = System.nanoTime();
|
time = System.nanoTime();
|
||||||
for (int i = 0; i < RUNS; i++)
|
for (int i = 0; i < RUNS; i++)
|
||||||
x += Math.acos(i / 10000000.0);
|
x += Math.acos(i / (double) RUNS);
|
||||||
long mathTime = System.nanoTime() - time;
|
long mathTime = System.nanoTime() - time;
|
||||||
report("acos",strictTime,fastTime,mathTime);
|
report("acos",strictTime,fastTime,mathTime);
|
||||||
Assert.assertTrue(!Double.isNaN(x));
|
Assert.assertTrue(!Double.isNaN(x));
|
||||||
|
|
Loading…
Reference in New Issue