Optimize code.
Add secant method.