Finished nlopt gradient