def _initialize_range_params(param_dict):
    """
    Helper function that initializes the range-related parameters
    """
    pd = param_dict
    init = pd.get('init', 1)
    pd.setdefault('min', min(0.8 * init, 1.2 * init))
    pd.setdefault('max', max(0.8 * init, 1.2 * init))
    pd.setdefault('init', (pd['max'] - pd['min']) * 0.5 + pd['min'])
    if 'pm' in pd and 'init' in pd:
        pd['min'] = pd['init'] - abs(pd['pm'])
        pd['max'] = pd['init'] + abs(pd['pm'])
    elif 'pm_pct' in pd and 'init' in pd:
        diff = abs(pd['init'] * pd['pm_pct'] / 100.0)
        pd['min'] = pd['init'] - diff
        pd['max'] = pd['init'] + diff
    elif 'min' in pd:
        if 'max' in pd:
            if 'init' not in pd:
                pd['init'] = (pd['max'] - pd['min']) * 0.5
            else:
                pass
        elif 'init' in pd:
            pd['max'] = pd['min'] + 2 * (pd['init'] - pd['min'])
        else:
            pd['init'] = max(pd['min'] / 0.8, pd['min'] / 1.2)
            pd['max'] = max(pd['init'] * 1.2, pd['init'] * 0.8)
    elif 'max' in pd:
        if 'init' in pd:
            pd['min'] = pd['max'] - 2 * (pd['max'] - pd['init'])
        else:
            pd['init'] = min(pd['max'] / 1.2, pd['max'] / 0.8)
            pd['min'] = min(pd['init'] * 0.8, pd['init'] * 1.2)
    elif 'init' in pd:
        pd['min'] = min(pd['init'] * 0.8, pd['init'] * 1.2)
        pd['max'] = max(pd['init'] * 1.2, pd['init'] * 0.8)
    else:
        pd['min'] = 0.0
        pd['init'] = 0.5
        pd['max'] = 1.0
    try:
        units = pd['init'].units
        pd['units'] = pd['init'].units
        pd['init'] = pd['init'].magnitude
        pd['min'] = pd['min'].to(units).magnitude
        pd['max'] = pd['max'].to(units).magnitude
    except AttributeError:
        pass
