docs: def erf(x):
      """ Error function.
  
      Works for floats, |GVar|\s, and :mod:`numpy` arrays.
      """
      try:
          return math.erf(x)
      except TypeError:
          pass
      if isinstance(x, GVar):
          f = math.erf(x.mean)
          dfdx = 2. * math.exp(- x.mean ** 2) / math.sqrt(math.pi)
          return gvar_function(x, f, dfdx)
      else:
          x = numpy.asarray(x)
          ans = numpy.empty(x.shape, x.dtype)
          for i in range(x.size):
              try:
                  ans.flat[i] = erf(x.flat[i])
              except TypeError:
                  xi = x.flat[i]
                  f = math.erf(xi.mean)
                  dfdx = 2. * math.exp(- xi.mean ** 2) / math.sqrt(math.pi)
                  ans.flat[i] = gvar_function(xi, f, dfdx)
          return ans