def esf(speedup_pass, nthreads_pass):
    """Empirical Serial Fraction, given parallel speedup and number of threads
    (after [Tornatore, 2019])"""

    return ((1.0 / float(speedup_pass)) - (1.0 / float(nthreads_pass))) / (
        1.0 - (1.0 / float(nthreads_pass))
    )