lmcurve() and lmcurve_tyd() wrap the more generic minimization function lmmin(), for use in curve fitting.

lmcurve() determines a vector par that minimizes the sum of squared elements of a residue vector r[i] := y[i] - f(t[i];par). Typically, lmcurve() is used to approximate a data set t,y by a parametric function f(ti;par). On success, par represents a local minimum, not necessarily a global one; it may depend on its starting value.

lmcurve_tyd() does the same for a data set t,y,dy, where dy represents the standard deviation of empirical data y. Residues are computed as r[i] := (y[i] - f(t[i];par))/dy[i]. Users must ensure that all dy[i] are positive.

Parameter collection for tuning the fit procedure. In most cases, the default &lm_control_double is adequate. If f is only computed with single-precision accuracy, &lm_control_float should be used. Parameters are explained in lmmin(3).