List of usage examples for java.lang StrictMath cbrt
public static double cbrt(double a)
From source file:Main.java
public static void main(String[] args) { double d1 = 9.00, d2 = 123, d3 = 0; System.out.println("Cube root of " + d1 + " = " + StrictMath.cbrt(d1)); System.out.println("Cube root of " + d2 + " = " + StrictMath.cbrt(d2)); System.out.println("Cube root of " + d3 + " = " + StrictMath.cbrt(d3)); }
From source file:org.esa.beam.util.math.FastMathPerformance.java
public void testCbrt() { System.gc();/*from w w w . j ava 2s . c om*/ double x = 0; long time = System.nanoTime(); for (int i = 0; i < RUNS; i++) x += StrictMath.cbrt(i * F1); long strictTime = System.nanoTime() - time; System.gc(); double y = 0; time = System.nanoTime(); for (int i = 0; i < RUNS; i++) y += FastMath.cbrt(i * F1); long fastTime = System.nanoTime() - time; System.gc(); double z = 0; time = System.nanoTime(); for (int i = 0; i < RUNS; i++) z += Math.cbrt(i * F1); long mathTime = System.nanoTime() - time; report("cbrt", x + y + z, strictTime, fastTime, mathTime); }