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

Method testDigamma

JSAT/test/jsat/math/SpecialMathTest.java:107–123  ·  view source on GitHub ↗

Test of digamma method, of class SpecialMath.

()

Source from the content-addressed store, hash-verified

105 * Test of digamma method, of class SpecialMath.
106 */
107 @Test
108 public void testDigamma()
109 {
110 System.out.println("digamma");
111 double[] input = new double[]
112 {
113 -77.5, -1.5, 1, 1.4, 2, 5, 6, 9, 20, 100
114 };
115 double[] expected = new double[]
116 {
117 4.356715675057194,0.7031566406452434,-0.5772156649015328,
118 -0.0613845445851161,0.4227843350984672,1.506117668431801,
119 1.7061176684318,2.14064147795561,2.97052399224215,4.600161852738087
120 };
121 for(int i = 0; i < input.length; i++)
122 assertEquals(expected[i], SpecialMath.digamma(input[i]), 1e-14);
123 }
124
125 /**
126 * Test of reLnBn method, of class SpecialMath.

Callers

nothing calls this directly

Calls 1

digammaMethod · 0.95

Tested by

no test coverage detected