Initial commit of functions from github.com/btracey/optimize

What about adding a reasonable minimum step size, which would allow us to fail much earlier when the step gets hopelessly small than if we test against 0. It takes more then 1000 multiplications by 0.5 to go from 1 to 0, but only about 65 to go belwo 1e-20.