PDIP seems to work on simple example
linesearch changed slightly, according to experience with PDIP method