def plus(self, a, b): return logAdd(a, b)
def test_logAdd(self, numPoints=200): for pointIndex in range(numPoints): a = randLogProb() b = randLogProb() r = mathhelp.logAdd(a, b) assert_allclose(np.exp(r), np.exp(a) + np.exp(b))
def test_logAdd(self, numPoints = 200): for pointIndex in range(numPoints): a = randLogProb() b = randLogProb() r = mathhelp.logAdd(a, b) assert_allclose(np.exp(r), np.exp(a) + np.exp(b))