This leads to three different cases depending on (j < l), (j = l), or (j > l). Each case is discussed individually in Appendix A (equations 22, 24, and 25). The symbolically evaluated derivatives ∂M(X R ) ∂X R are given in the supporting information. They were calculated using the symbolic algebra package sympy. With all equations at hand we can formulate the combined algorithm 2.