From ce965859e0156c50ae4ee82be053d18d248e5e10 Mon Sep 17 00:00:00 2001 From: Ben Date: Tue, 22 Aug 2023 17:03:01 +0200 Subject: [PATCH] bugfix(prob) fix issue #78 --- estimator/prob.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/estimator/prob.py b/estimator/prob.py index 3ffca9e..10b92b2 100644 --- a/estimator/prob.py +++ b/estimator/prob.py @@ -124,5 +124,8 @@ def amplify_sigma(target_advantage, sigma, q): sigma = sum(sigma_**2 for sigma_ in sigma).sqrt() except TypeError: pass + if sigma > 16 * q: + return oo + advantage = float(exp(-float(pi) * (float(sigma / q) ** 2))) return amplify(target_advantage, advantage, majority=True)