Helper function used in penalized test functions (F12, F13). This function applies a penalty when variable values exceed specified bounds.
Ufun(x, a, k, m)Numeric vector of penalty values (same length as x).
Formula: $$u(x_i, a, k, m) = \begin{cases} k(x_i - a)^m & \text{if } x_i > a \\ 0 & \text{if } -a \leq x_i \leq a \\ k(-x_i - a)^m & \text{if } x_i < -a \end{cases}$$
The penalty function is zero within the interval \([-a, a]\) and grows polynomially outside this region. This is used to softly constrain optimization to a bounded region without hard constraints.