MCPcopy Index your code
hub / github.com/EdwardRaff/JSAT / testLog2_2pd1

Method testLog2_2pd1

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

Test of log2_2pd1 method, of class FastMath.

()

Source from the content-addressed store, hash-verified

72 * Test of log2_2pd1 method, of class FastMath.
73 */
74 @Test
75 public void testLog2_2pd1()
76 {
77 System.out.println("log2_2pd1");
78 DoubleList relErrs = new DoubleList();
79 int trials = 10000;
80 for(int i = 0; i < trials; i++)
81 {
82 double x = rand.nextDouble()*1000;
83 relErrs.add(relErr(Math.log(x)/Math.log(2), FastMath.log2_2pd1(x)));
84 }
85 Collections.sort(relErrs);
86 assertTrue(relErrs.get((int) (trials*.95)) <= 1e-3);
87 }
88
89 /**
90 * Test of log2_c11 method, of class FastMath.

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected