def _check_limits(fmin, fmid, fmax, extra='f'):
    """Check for monotonicity."""
    if fmin >= fmid:
        raise ValueError('%smin must be < %smid, got %0.4g >= %0.4g' % (
            extra, extra, fmin, fmid))
    if fmid >= fmax:
        raise ValueError('%smid must be < %smax, got %0.4g >= %0.4g' % (
            extra, extra, fmid, fmax))
