For completeness, this is based on `pinv`. The docstring suggests that `pinv_smooth` performs better in general.