Zaslat SMS: Stable and efficient computation of generalized polar decompositions