docs: def cos_well(f=Ellipsis, width=np.pi/2, offset=0, scale=1):
      '''
      cos_well() yields a potential function g(x) that calculates 0.5*(1 - cos(x)) for -pi/2 <= x
        <= pi/2 and is 1 outside of that range.
      
      The full formulat of the cosine well is, including optional arguments:
        scale / 2 * (1 - cos((x - offset) / (width/pi)))
  
      The following optional arguments may be given:
        * width (default: pi) specifies that the frequency of the cos-curve should be pi/width; the
          width is the distance between the points on the cos-curve with the value of 1.
        * offset (default: 0) specifies the offset of the minimum value of the coine curve on the
          x-axis.
        * scale (default: 1) specifies the height of the cosine well.
      '''
      f = to_potential(f)
      freq = np.pi/width*2
      (xmn,xmx) = (offset - width/2, offset + width/2)
      F = piecewise(scale, ((xmn,xmx), scale/2 * (1 - cos(freq * (identity - offset)))))
      if   is_const_potential(f):    return const_potential(F.value(f.c))
      elif is_identity_potential(f): return F
      else:                          return compose(F, f)