NLopt - Same complex clalculations in objetive function and nonlinear constraints

Yes, it looks like it is the way to go.