def required_points(order: int, accuracy: int) -> int:
    """Compute the number of points necessary to achieve an approximation of the given accuracy.

    Important note: this function assumes that the points will arranged symmetrically
    around 0. Corollary 7 from https://arxiv.org/pdf/1102.3203.pdf then says that the
    order of accuracy may be boosted by 1 compared to the usual one, which is exploited in
    this function to return a lower number of points when possible.

    Args:
        order (int): order of the differential operator
        accuracy (int): desired accuracy (e.g. 2 for approximation to quadratic order)

    Returns:
        number of required sampling points
    """
    # The usual formula for the required number of points:
    N = order + accuracy
    # The remaining question is whether we can reduce this number by
    # 1 and still retain the desired accuracy, an effect called "boosted order of accuracy".
    # Corollary 7 from https://arxiv.org/pdf/1102.3203.pdf says that
    # boosting happens if the number of points minus the order is odd.
    # We want to check whether N - 1 still has the desired accuracy,
    # i.e. whether (N - 1) - order, or simply accuracy - 1, is odd:
    if (accuracy - 1) % 2:
        return N - 1
    return N