MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / testLog2_c11

Method testLog2_c11

JSAT/test/jsat/math/FastMathTest.java:92–105  ·  view source on GitHub ↗

Test of log2_c11 method, of class FastMath.

()

Source from the content-addressed store, hash-verified

90 * Test of log2_c11 method, of class FastMath.
91 */
92 @Test
93 public void testLog2_c11()
94 {
95 System.out.println("log2_c11");
96 DoubleList relErrs = new DoubleList();
97 int trials = 10000;
98 for(int i = 0; i < trials; i++)
99 {
100 double x = rand.nextDouble()*1000;
101 relErrs.add(relErr(Math.log(x)/Math.log(2), FastMath.log2_c11(x)));
102 }
103 Collections.sort(relErrs);
104 assertTrue(relErrs.get((int) (trials*.95)) <= 1e-3);
105 }
106
107 /**
108 * Test of pow2 method, of class FastMath.

Callers

nothing calls this directly

Calls 7

addMethod · 0.95
relErrMethod · 0.95
log2_c11Method · 0.95
getMethod · 0.95
logMethod · 0.80
nextDoubleMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected