Symbolic Lagrangian formulations of the equations of motion of tree structured constrained mechanical systems have the potential to be both more efficient and more numerically robust than formulations which use nonlinear kinematic constraint equations.
D* is a program for efficiently computing symbolic derivatives, derive a simple recursive factorization of the Lagrangian equations of motion which, along with our extended implementation of the D* symbolic differentiation algorithm, yields empirically measured O(n) inverse dynamics and O(n3) forward dynamics.
More: http://research.microsoft.com/en-us/downloads/4714703d-782c-4e37-830d-0e3b7662f743/default.aspx
See you