Optimize not working with function that has find_zero

Please read Please read: make it easier to help you, particularly about formatting code so that it is readable.

In addition, say what the error you encountered was, and the behavior that you expected.