def METHOD_NAME(n, m, p, with_E, with_R, with_S, trans, solver):
    skip_if_missing_solver(solver)
    if not with_E:
        A = conv_diff_1d_fd(n, 1, 1)
        A = A.todense()
        E = None
    else:
        A, E = conv_diff_1d_fem(n, 1, 1)
        A = A.todense()
        E = E.todense()
    B = np.random.randn(n, m)
    C = np.random.randn(p, n)
    D = np.random.randn(p, m)
    if not trans:
        R0 = np.random.randn(p, p)
        R = D.dot(D.T) + R0.dot(R0.T) if with_R else None
        S = 1e-1 * D @ B.T if with_S else None
    else:
        R0 = np.random.randn(m, m)
        R = D.T.dot(D) + R0.dot(R0.T) if with_R else None
        S = 1e-1 * C.T @ D if with_S else None
    X = solve_ricc_dense(A, E, B, C, R, S, trans=trans, options=solver)
    assert relative_residual(A, E, B, C, R, S, _chol(X), trans) < 1e-8