working on some changes to get rid of map output, since its expensive

so input variables are scalars and vectors
output should be (1) value of function, then
(2) the gradients with respect to each scalar
or vector.

i.e.,

func(s1, s2 float64, v1, v2 []float64) (value float64, ds1, ds2 float64, dv1, dv2 []float64)

where s1 and s2 are scalar vars, with derivatives ds1, ds2; same
for v1 & v2 being slice args, and dv1, dv2 their gradients.

if user just wants a single vector variable, he should write
the formula that way.