User defined linesearch method

Brent's with golden section search

Tracker item: 3696