Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __add__(self, dist):
"""
Add two distributions such that sampling is the sum of the samples.
"""
return CombinedDistribution(self, dist, add)
def __truediv__(self, dist):
"""
Divide two distributions such that sampling is the ratio of the samples.
"""
return CombinedDistribution(self, dist, truediv)
def __sub__(self, dist):
"""
Subtract two distributions such that sampling is the difference of the samples.
"""
return CombinedDistribution(self, dist, sub)
def __mul__(self, dist):
"""
Multiply two distributions such that sampling is the product of the samples.
"""
return CombinedDistribution(self, dist, mul)