## 4 Opposite Normalized Trust-Region Reflective (ONTRR) Algorithm
### Main Routine of the Proposed ONTRR Algorithm
```
Input: the only control parameter: MaxNFEs
1 mg('default'); % For reproducibility and fair comparison
2 Get the problem details: ObjFun, LB, UB, dim
3 forrun = 1 to 1000 do % For higher confidence level
4 % Step 1: Random opposite initialization
5 \(X\) = LB + rand(dim,1)*(UB - LB); \(X_{\pi}\) = LB + UB - \(X\);
6 [RMSE, \(F_{\gamma}\)] = ObjFun(\(X\)); \(Iter\) = 0; \(\Delta\) = 10;
7 [RMSE, \(F_{\gamma}\), \(F_{\gamma}\)] = ObjFun(\(X_{\pi}\)); \(S\) = [ ]; \(nmssx\) = 1;
8 ifRMSE\({}_{\pi}<RMSE\)then
9 \(X\) = \(X_{\pi i}\); \(RMSE\) = \(RMSE_{\pi i}\); \(F\) = \(F_{\pi i}\); \(f\) = \(f_{\pi i}\);
10 [U, g] = JacobianG(\(X\), \(f\), LB, UB); \(NF_{\pi}\) = 1 + 1 + dim;
11 whileNFEs < MaxNFEs do
12 % Step 2: min-max normalization to update v, C D, \(\theta\)
13\(X_{\pi}\) = (\(X\) - LB); \(\mathbf{lb}\) = zeros(dim, 1);
14 ub = ones(dim, 1); [v, \(dv\)] = define(y, \(X_{\pi}\), \(\mathbf{lb}\), \(\mathbf{ub}\));
15 C = sparse(diag(g)*diag(sign(g))); \(D\) = diag(\(\left\lfloor v\right\rfloor^{0.9}\));
16\(\theta\) = max(0.95, 1 - norm(\(v\)*g, inf)); \(Iter\) = \(Iter+1\);
17 % Step 3: Construct the 2-dimensional subspace S
18 ifisempty(\(S\))then
19 \(S\) = SubSpace(\(C\), \(D\), \(J\), \(g\), dim);
20 % Step 4: Determine trial step \(s\) from three directions
21 [\(s\), \(s\), \(\mathit{s}\)] = TrialStep(\(\mathbf{X_{\pi}}\), \(\mathbf{lb}\), \(\mathbf{ub}\), \(C\), \(D\), \(J\), \(g\), \(S\), \(\Delta\), \(\theta\));
22 % Step 5: Perturb and evaluate the trial point
23\(\mathit{newX_{\pi}}\) = \(X_{\pi}\) + \(s\); \(\mathrm{del}\) = 100*eps;
24 ifmin(\(\mathit{newX_{\pi}}-\mathbf{lb}\)) < \(\mathrm{del}\) or min(\(\mathrm{ub}-\mathit{newX_{\pi}}\)) < \(\mathrm{del}\)then
25\(l\) = (\(\mathit{newX_{\pi}}-\mathbf{lb}\)) < \(\mathrm{del}\); \(\mathit{newX_{\pi}}\) (\(l\)) = \(\mathit{newX_{\pi}}\) (\(l\)) + \(\mathrm{del}\);
26 \(u\) = (\(\mathrm{ub}-\mathit{newX_{\pi}}\)) < \(\mathrm{del}\); \(\mathit{newX_{\pi}}\) (\(u\)) = \(\mathit{newX_{\pi}}\) (\(u\)) - \(\mathrm{del}\);
27\(\mathit{newX}\) = LB + \(\mathit{newX_{\pi}}\)*(UB - LB);
28[\(\mathit{newRMSE}\), \(\mathit{newF}\), \(\mathit{newF}\)] = ObjFun(\(\mathit{newX}\));
29[\(\mathit{newF}\), \(\mathit{newF}\)] = JacobianG(\(\mathit{newX}\), \(\mathit{newF}\), LB, UB);
30 NFE\({}_{\pi}\) = NFE\(s+1\) + dim;
31 % Step 6: Update trust region radius \(\Delta\)
32\(\mathit{nmrsx}\) = norm(\(\mathit{s}\), \(\mathrm{c}\) = C*ones(dim,1);
33\(\rho\) = (0.5*(\(\mathit{newF}-F\)) + 0.5*\(\mathit{s}\),\(\mathit{s}\))/*(C.*\(\mathit{s}\),\(\mathit{s}\)))/*s;
34 if\(\rho\) \(\geq\) 0.75&&\(\mathit{nrmrsx}\) \(\geq\) 0.9\(\Delta\)then
35\(\Delta\) = 2\(\Delta\);
36 elseif\(\rho\) \(\leq\) 0.1
37 \(\Delta\) = min(\(\mathit{nrmrsx}\)/4, \(\Delta\)/4);
38% Step 7: Accept or reject the trial point
39 ifnewRMSE < RMSE then
30\(X\) = \(\mathit{newX}\); \(F\) = \(\mathit{newF}\); \(RMSE\) = \(\mathit{newRMSE}\);
31 \(\mathit{-}\) = \(g\) = \(\mathit{newg}\); \(J\) = \(\mathit{new}\); \(S\) = [ ];
32 Results(\(\mathit{run}\), \(\mathit{:}\)) = [\(X\), \(RMSE\), \(NFE\)s];
```  
**Output:** the results of 1000 independent runs  
**Algorithm 1**Opposite normalized trust-region reflective