@Override
    public double logp(double x) {
        return -np * Math.log(1.0 + x * x / nu) + fac - Math.log(Math.sqrt(Math.PI * nu));
    }
@Test
    public void testLogP() {
        System.out.println("logP");
        TDistribution instance = new TDistribution(20);
        instance.rand();
        assertEquals(Math.log(2.660085e-09), instance.logp(-10.0), 1E-5);
        assertEquals(Math.log(0.05808722), instance.logp(-2.0), 1E-5);
        assertEquals(Math.log(0.2360456), instance.logp(-1.0), 1E-5);
        assertEquals(Math.log(0.3939886), instance.logp(0.0), 1E-5);
        assertEquals(Math.log(0.2360456), instance.logp(1.0), 1E-5);
        assertEquals(Math.log(0.05808722), instance.logp(2.0), 1E-5);
        assertEquals(Math.log(2.660085e-09), instance.logp(10.0), 1E-5);
    }