def fun_dfun(obj, space, d):
    """
    Computes the posterior predictive and posterior predictive gradients of the
    provided GPyOpt object.

    Parameters
    ----------
    obj: GPyOpt object
        The GPyOpt object with a surrogate probabilistic model.
    space: GPyOpt space
        A GPyOpt object that contains information about the design domain.
    d: np.ndarray
        Proposed design.
    """

    mask = space.indicator_constraints(d)

    pred = obj.model.predict_withGradients(d)[0][0][0]
    d_pred = obj.model.predict_withGradients(d)[2][0]

    return float(pred * mask), d_pred * mask