
╔══════════════════════════════════════════════════════════════════╗
║              BOUNDED OPTIMIZATION BENCHMARKS                     ║
║              L-BFGS-B native vs others via penalty               ║
╚══════════════════════════════════════════════════════════════════╝

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Himmelblau (bounds inactive)
  Dim: 2 | Type: Bounds should not matter
  Active bounds at optimum: 0/2
  Known min: f = 0 at (3.000, 2.000)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     | Method          | Mode    | Found Value | |Error|  | Dist to Opt | Feas Vio | Conv | Iters | Fn Evals | Time (ms)
  ---+-----------------+---------+-------------+----------+-------------+----------+------+-------+----------+----------
  ✅  | L-BFGS-B        | native  |    2.16e-14 | 2.16e-14 |     3.72e-8 |        0 | yes  |     7 |       65 |       2.4
  ✅  | L-BFGS          | penalty |    6.19e-12 | 6.19e-12 |     3.88e-7 |        0 | yes  |     9 |       57 |       0.4
  ✅  | Adam            | penalty |     3.76e-9 |  3.76e-9 |     1.65e-5 |        0 | yes  |   232 |     1161 |       0.5
  ✅  | GradientDescent | penalty |    1.03e-12 | 1.03e-12 |     1.72e-7 |        0 | yes  |   260 |     1301 |       0.3
  ✅  | PSO             | penalty |    1.85e-13 | 1.85e-13 |     1.02e-7 |        0 | yes  |   135 |     6800 |       2.9
  ✅  | Nelder-Mead     | penalty |    1.43e-10 | 1.43e-10 |     1.90e-6 |        0 | yes  |    86 |      168 |       0.5

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Ackley (bounds inactive)
  Dim: 2 | Type: Multimodal, bounds inactive
  Active bounds at optimum: 0/2
  Known min: f = 0 at (0, 0)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     | Method          | Mode    | Found Value | |Error|  | Dist to Opt | Feas Vio | Conv | Iters | Fn Evals | Time (ms)
  ---+-----------------+---------+-------------+----------+-------------+----------+------+-------+----------+----------
  ✅  | L-BFGS-B        | native  |    2.55e-11 | 2.55e-11 |    9.03e-12 |        0 | yes  |     8 |      140 |       0.5
  ✅  | L-BFGS          | penalty |    1.55e-10 | 1.55e-10 |    5.48e-11 |        0 | yes  |    10 |       73 |       0.1
  ⚠  | Adam            | penalty |      3.5745 |   3.5745 |      1.3697 |        0 | yes  |   117 |      586 |       0.2
  ⚠  | GradientDescent | penalty |      3.5745 |   3.5745 |      1.3696 |        0 | yes  |   198 |      991 |       0.3
  ✅  | PSO             | penalty |    2.40e-10 | 2.40e-10 |    8.48e-11 |        0 | yes  |   188 |     9450 |       4.0
  ⚠  | Nelder-Mead     | penalty |      5.3819 |   5.3819 |      2.1966 |        0 | yes  |    42 |       84 |       0.1

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Bounded Rosenbrock
  Dim: 2 | Type: Upper bound active at solution
  Active bounds at optimum: 1/2
  Known min: f = 0.2500 at (0.500, 0.250)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     | Method          | Mode    | Found Value | |Error| | Dist to Opt | Feas Vio | Conv | Iters | Fn Evals | Time (ms)
  ---+-----------------+---------+-------------+---------+-------------+----------+------+-------+----------+----------
  ✅  | L-BFGS-B        | native  |      0.2500 |       0 |    1.50e-12 |        0 | yes  |     7 |       55 |       0.3
  ❌  | L-BFGS          | penalty |      0.2498 | 2.50e-4 |     7.07e-4 |  5.00e-4 | yes  |    19 |      113 |       0.4
  ❌  | Adam            | penalty |      0.2500 | 7.92e-6 |     9.46e-4 |  7.93e-4 | yes  |   125 |      626 |       0.1
  ❌  | GradientDescent | penalty |      0.2498 | 2.50e-4 |     7.07e-4 |  5.00e-4 | yes  |   227 |     1136 |       0.2
  ❌  | PSO             | penalty |      0.2498 | 2.50e-4 |     7.07e-4 |  4.99e-4 | yes  |   151 |     7600 |       0.7
  ⚠  | Nelder-Mead     | penalty |      0.2516 |  0.0016 |      0.0038 |        0 | yes  |    41 |       78 |       0.1

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Bounded Beale
  Dim: 2 | Type: Upper bound just touches optimum
  Active bounds at optimum: 1/2
  Known min: f = 0 at (3.000, 0.500)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     | Method          | Mode    | Found Value | |Error|  | Dist to Opt | Feas Vio | Conv | Iters | Fn Evals | Time (ms)
  ---+-----------------+---------+-------------+----------+-------------+----------+------+-------+----------+----------
  ✅  | L-BFGS-B        | native  |    3.49e-13 | 3.49e-13 |     1.47e-6 |        0 | yes  |    13 |       80 |       1.3
  ✅  | L-BFGS          | penalty |    5.29e-11 | 5.29e-11 |     1.49e-6 |  3.17e-8 | yes  |    19 |      115 |       0.1
  ✅  | Adam            | penalty |    9.53e-10 | 9.53e-10 |     7.94e-5 |        0 | yes  |   265 |     1326 |       0.5
  ✅  | GradientDescent | penalty |     1.17e-6 |  1.17e-6 |      0.0028 |        0 | yes  |  1528 |     7641 |       0.6
  ✅  | PSO             | penalty |    7.26e-13 | 7.26e-13 |     2.03e-6 |        0 | yes  |   118 |     5950 |       0.8
  ✅  | Nelder-Mead     | penalty |     1.81e-7 |  1.81e-7 |     3.62e-4 |        0 | yes  |    48 |       92 |       0.1

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Fixed Variables Sphere
  Dim: 5 | Type: 2 fixed (l = u), 3 free
  Active bounds at optimum: 2/5
  Known min: f = 5.0000 at (0, 2.000, 0, -1.000, 0)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     | Method          | Mode    | Found Value | |Error|  | Dist to Opt | Feas Vio | Conv | Iters | Fn Evals | Time (ms)
  ---+-----------------+---------+-------------+----------+-------------+----------+------+-------+----------+----------
  ✅  | L-BFGS-B        | native  |      5.0000 | 4.53e-14 |     2.15e-7 |        0 | yes  |     2 |       33 |       0.1
  ❌  | L-BFGS          | penalty |      4.9950 |   0.0050 |      0.0022 |   0.0020 | yes  |    11 |      138 |       0.1
  ❌  | Adam            | penalty |      4.9950 |   0.0050 |      0.0022 |   0.0020 | yes  |   245 |     2696 |       0.5
  ❌  | GradientDescent | penalty |      4.9950 |   0.0050 |      0.0022 |   0.0020 | yes  |   434 |     4775 |       0.3
  ❌  | PSO             | penalty |      4.9950 |   0.0050 |      0.0022 |   0.0020 | yes  |   191 |     9600 |       1.5
  ❌  | Nelder-Mead     | penalty |      4.9950 |   0.0050 |      0.0022 |   0.0020 | yes  |   187 |      315 |       0.2

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Shifted Sphere, half-bounded
  Dim: 4 | Type: Lower-only bound; all coords pinned
  Active bounds at optimum: 4/4
  Known min: f = 4.0000 at (0, 0, 0, 0)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     | Method          | Mode    | Found Value | |Error| | Dist to Opt | Feas Vio | Conv | Iters | Fn Evals | Time (ms)
  ---+-----------------+---------+-------------+---------+-------------+----------+------+-------+----------+----------
  ✅  | L-BFGS-B        | native  |      4.0000 |       0 |           0 |        0 | yes  |     2 |       36 |       0.1
  ❌  | L-BFGS          | penalty |      3.9960 |  0.0040 |      0.0020 |  9.99e-4 | yes  |     9 |      111 |       0.1
  ❌  | Adam            | penalty |      3.9960 |  0.0040 |      0.0020 |  9.99e-4 | yes  |   177 |     1594 |       0.1
  ❌  | GradientDescent | penalty |      3.9960 |  0.0040 |      0.0020 |  9.80e-4 | yes  |   158 |     1423 |       0.1
  ❌  | PSO             | penalty |      3.9960 |  0.0040 |      0.0020 |  9.99e-4 | yes  |   196 |     9850 |       1.4
  ❌  | Nelder-Mead     | penalty |      4.3195 |  0.3195 |      0.1411 |   0.0038 | yes  |   205 |      350 |       0.1

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Bounded Sphere (all pinned)
  Dim: 5 | Type: All lower bounds active
  Active bounds at optimum: 5/5
  Known min: f = 1.2500 at (0.500, 0.500, 0.500, 0.500, 0.500)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
     | Method          | Mode    | Found Value | |Error| | Dist to Opt | Feas Vio | Conv | Iters | Fn Evals | Time (ms)
  ---+-----------------+---------+-------------+---------+-------------+----------+------+-------+----------+----------
  ✅  | L-BFGS-B        | native  |      1.2500 |       0 |           0 |        0 | yes  |     1 |       33 |       0.1
  ❌  | L-BFGS          | penalty |      1.2488 |  0.0012 |      0.0011 |  5.00e-4 | yes  |     4 |       66 |       0.0
  ⚠  | Adam            | penalty |      1.2901 |  0.0401 |      0.0178 |        0 | yes  |    55 |      606 |       0.0
  ❌  | GradientDescent | penalty |      1.2488 |  0.0012 |      0.0011 |  5.03e-4 | yes  |   154 |     1695 |       0.1
  ❌  | PSO             | penalty |      1.2488 |  0.0012 |      0.0011 |  5.00e-4 | yes  |   210 |    10550 |       1.8
  ❌  | Nelder-Mead     | penalty |      1.7046 |  0.4546 |      0.2720 |  3.91e-4 | yes  |   825 |     1333 |       0.3

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  Success summary (feasible + accurate):
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  L-BFGS-B              7/7
  L-BFGS                3/7
  PSO                   3/7
  Adam                  2/7
  GradientDescent       2/7
  Nelder-Mead           2/7

  Notes:
  · Success = (converged) ∧ (feas_vio < 1e-6) ∧ (|Error| < 1e-3 ∨ Dist < 1e-3)
  · "Mode": native = L-BFGS-B via settings.bounds (geometric);
            penalty = other optimizers via boxConstraints (quadratic).
  · Feas Vio = max overshoot past the bound in any coordinate.
  · ❌ iff infeasible OR did not converge. ⚠ = converged but wrong answer.
