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

Method testDigamma

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

Test of digamma method, of class FastMath.

()

Source from the content-addressed store, hash-verified

197 * Test of digamma method, of class FastMath.
198 */
199 @Test
200 public void testDigamma()
201 {
202 System.out.println("digamma");
203 DoubleList relErrs = new DoubleList();
204 int trials = 10000;
205 for(int i = 0; i < trials; i++)
206 {
207 double x = rand.nextDouble()*50;
208 relErrs.add(relErr(SpecialMath.digamma(x), FastMath.digamma(x)));
209 }
210 Collections.sort(relErrs);
211 assertTrue(relErrs.get((int) (trials*.95)) <= 1e-3);
212 }
213}

Callers

nothing calls this directly

Calls 7

addMethod · 0.95
relErrMethod · 0.95
digammaMethod · 0.95
digammaMethod · 0.95
getMethod · 0.95
nextDoubleMethod · 0.45
sortMethod · 0.45

Tested by

no test coverage detected