Skip to content

Smooth unconstrained optimization ​

Compare gradient-based solvers on the 100-variable chained Rosenbrock problem.

Gradient descent ​

Basin and argmin 0.11.0 use steepest descent with a Moré–Thuente line search on chained Rosenbrock with 100 variables. Both start from the alternating vector (−1.2,1,−1.2,1,…)(-1.2,1,-1.2,1,\ldots). They seek f≤10−10f \le 10^{-10} with a 10000-iteration safety cap.

1e51e31e11e-11e-305101520suboptimality f(x) − f*time (ms)basinargmin
Gradient Descent on Rosenbrock, n = 100. Lower objective gaps and shorter times are better. Time is linear; objective gap is logarithmic.

Read the time at a common objective gap as well as the endpoints: faster iterations alone do not establish a faster solve.

Nonlinear conjugate gradient ​

Basin and argmin 0.11.0 use Polak–Ribière+ on the same 100-variable chained Rosenbrock problem. Both start at (−1.2,1,−1.2,1,…)(-1.2, 1, -1.2, 1, \ldots) and use the same analytic objective and gradient with Vec<f64>. Both aim for an objective of 10−1010^{-10} with a 10,000-iteration safety cap.

Both use Moré–Thuente with sufficient decrease 10−410^{-4}, curvature 0.10.1, initial step 11, relative bracket tolerance 10−1010^{-10}, and step bounds [ϵ,1010][\sqrt{\epsilon}, 10^{10}], where ϵ\epsilon is machine epsilon for f64. Optional restart rules are disabled. Basin still restarts when its direction fails the sufficient descent test and retries a failed conjugate-direction search along the negative gradient. Basin reuses accepted line-search evaluations. Argmin reevaluates the objective and gradient at the accepted point.

1e51e21e-11e-41e-71e-1000.511.52suboptimality f(x) − f*time (ms)basinargmin
Nonlinear CG (PR+) on Rosenbrock, n = 100. Lower objective gaps and shorter times are better. Time is linear; objective gap is logarithmic.
Returned solutions and evaluation counts

basin: TargetCost. Independent accuracy check passed. Returned (1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, …), objective 7.323e-11. 688 iterations; 2777 objective and 2777 gradient calls.

argmin: Terminated(TargetCostReached). Independent accuracy check passed. Returned (1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, …), objective 9.578e-11. 682 iterations; 3411 objective and 3411 gradient calls.

The chart follows the best objective among accepted iterates.

BFGS ​

Basin and argmin's BFGS 0.11.0 solve the same 100-variable chained Rosenbrock problem from the alternating start used for gradient descent. Both use Vec<f64>, analytic gradients, and an identity initial inverse Hessian. The harness disables Basin's default first-update rescaling to match argmin's unscaled identity seed.

Both use a Moré–Thuente line search with sufficient-decrease coefficient 10−410^{-4}, curvature coefficient 0.90.9, relative bracket tolerance 10−1010^{-10}, an initial trial step of 1, and step bounds [ϵ,1010][\sqrt{\epsilon},10^{10}], where ϵ\epsilon is f64 machine epsilon. Basin caps each search at 20 evaluations; argmin exposes no equivalent cap. Both seek f≤10−10f \le 10^{-10} with a 10000-iteration safety cap. Argmin's optional gradient and cost-change stops are zeroed; Basin BFGS has no such optional stops.

1e51e21e-11e-41e-71e-100100200300400suboptimality f(x) − f*time (ms)basinargmin
BFGS on Rosenbrock, n = 100. Lower objective gaps and shorter times are better. Time is linear; objective gap is logarithmic.
Returned solutions and evaluation counts

basin: TargetReached. Independent accuracy check passed. Returned (1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, …), objective 7.984e-11. 425 iterations; 1190 objective and 1190 gradient calls.

argmin: Terminated(TargetCostReached). Independent accuracy check passed. Returned (1.00000, 1.00000, 1.00000, 1.00000, 1.00000, 1.00000, …), objective 1.044e-11. 433 iterations; 767 objective and 1200 gradient calls.

Basin applies the inverse-BFGS update through in-place rank-one operations, requiring quadratic work in the dimension. Argmin 0.11 evaluates the factored update with dense matrix products, requiring cubic work. Curvature safeguards, line-search details, and rounding can also change trajectories. The curves show effectiveness at this dimension, including those implementation differences.

Samples follow initialization and accepted iterates, with an endpoint after solver teardown. The run details report objective and gradient callback counts, including repeated evaluations at line-search endpoints. Independent checks recompute the returned point's objective and require the common target outside the timer. A failed or budget-limited run remains in the data.

L-BFGS ​

L-BFGS uses the same 100-variable Rosenbrock fixture and start as gradient descent. All three retain ten curvature pairs. Basin and argmin use a Moré–Thuente line search. NLopt supplies its bundled L-BFGS implementation, whose line search is not configurable through the harness's API.

All seek f≤10−10f \le 10^{-10}. Basin and argmin have a 10000-iteration safety cap, with argmin's gradient and cost-change tolerances zeroed. NLopt has a 10000-objective-evaluation cap. These limits bound the runs; they do not prescribe equal work.

1e51e21e-11e-41e-71e-1000.511.52suboptimality f(x) − f*time (ms)argminnloptbasin
L-BFGS on Rosenbrock, n = 100. Lower objective gaps and shorter times are better. Time is linear; objective gap is logarithmic.

Benchmark methodology and reproduction

Basin v3.6.0