i have a Helmholtz function, that needs to be optimized, but i need to stop the optimization algorithm if the value of the objective function is negative, any ideas?, im using Optim.jl

```
using Optim
N = 10
c = rand(N) .- 0.5
x0 = rand(N)
f(x) = sum(c.*x.^collect(1:length(x))) # a nth grade polinomial as example
#my objetive function is not a polynomial
lb = zeros(N)
ub = ones(N)
#this is straightly copied from the Optim.jl guide
inner_optimizer=GradientDescent(linesearch=LineSearches.BackTracking(order=3))
sol = optimize(f,lb,ub,x0,Fminbox(inner_optimizer)
```