code: def _gaussian_membership_sigma(smoothness, eps = 0.0005): # 275us @ smothness=10
      r
      error = 0
      deltas = [0.1, 0.01, 0.001, 0.0001]
      sigma = smoothness * 0.3
      point = -1. * (smoothness + 0.5)
      for delta in deltas:
          while error < eps:
              sigma += delta
              error = scipy.stats.norm.cdf(0.5, point, sigma) - scipy.stats.norm.cdf(-0.5, point, sigma) # x, mu, sigma
          sigma -= delta
      return sigma
docs: r"""Compute the sigma required for a gaussian, such that in a neighbourhood of
      smoothness the maximum error is 'eps'.
      The error is here the difference between the clipped integral and one.