def METHOD_NAME(self, x: mpf, inv: bool):
    d1 = mpmathify(self.d1)
    d2 = mpmathify(self.d2)
    z = d1 * x / (d1 * x + d2)
    if inv is False:
        integral_range = dict(x1=mpf("0"), x2=z)
    else:
        integral_range = dict(x1=z, x2=mpf("1"))
    return mp.betainc(
        d1 / mpf("2"),
        d2 / mpf("2"),
        **integral_range,
        regularized=True,
    )