  Let $WS(X, d)$ be the class of ultrametric spaces which are weakly similar to
ultrametric space $(X, d)$. The main results of the paper completely describe
the ultrametric spaces $(X, d)$ for which the equality $$ \rho(x, y) =
f(d(\Phi(x), \Phi(y))) $$ holds for every $(Y, \rho) \in WS(X, d)$, every weak
similarity $\Phi \colon Y \to X$, and all $x$, $y \in Y$ with some ultrametric
(pseudoultrametric) preserving function $f$ depending on $\Phi$.
