In smoothbadvertex the position of all subsurface bad nodes $ i$ (surface bad nodes are not moved!) is optimized using the optimizer fminsi [65] by minimizing the quality of the ball of $ i$. So we are looking for a minimum of the function:

$\displaystyle \max_{j \in \text{ball}_i} Q_j,$ (717)

by modifying the position of node i, i.e changing its x-, y- and z-coordinates (three parameters).