You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 88eaea9
Browse filesBrowse the repository at this point in the historyBrowse files
# see https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm
272
+
mean=0.0
273
+
m2=0.0
274
+
275
+
forninrange(1, max_rounds+1):
276
+
duration=runner(loops_range)
277
+
stats.update(duration)
278
+
279
+
delta=duration-mean
280
+
mean+=delta/n
281
+
m2+=delta* (duration-mean)
282
+
283
+
ifn>=self._min_roundsandn>=2andmean>0:
284
+
stddev=sqrt(m2/ (n-1))
285
+
rel_margin=z*stddev/sqrt(n) /mean
286
+
ifrel_margin<=precision:
287
+
self._logger.debug(
288
+
f' Reached precision ±{rel_margin:.2%} (target ±{precision:.2%}) after {n} rounds.',
0 commit comments