General-purpose unconstrained non-linear optimization