fn line_minimise( cost: &mut CostFn<'_>, p: &[f64; 6], dir: &[f64; 6], ) -> ([f64; 6], f64)
Minimise cost along p + x·dir: bracket the minimum, then Brent.
cost
p + x·dir