import math


def dict_isclose(d1, d2, rel_tol=1e-9, abs_tol=1e-12):
    """Return True if nested dicts d1 and d2 are close, False otherwise."""
    if isinstance(d1, dict) and isinstance(d2, dict):
        return d1.keys() == d2.keys() and all(
            dict_isclose(d1[k], d2[k], rel_tol=rel_tol, abs_tol=abs_tol) for k in d1
        )
    elif isinstance(d1, list) and isinstance(d2, list):
        return all(
            dict_isclose(l1, l2, rel_tol=rel_tol, abs_tol=abs_tol)
            for l1, l2 in zip(d1, d2)
        )
    elif isinstance(d1, (int, float)) and isinstance(d2, (int, float)):
        return math.isclose(d1, d2, rel_tol=rel_tol, abs_tol=abs_tol)
    else:
        return d1 == d2