def absmax(i):
    """
    Returns the largest absolute value present in an array in its raw form
    (e.g. in [-2, 0, 1] it returns -2, in [-2,0,3] it returns 3.)
    """
    # Use the absolute largest value in its raw form
    if max(i) > abs(min(i)):
        return max(i) 
    elif abs(min(i)) >= max(i):
        return min(i)
    else:
        raise ValueError()