Test your optimization by passing the result directly to the function
optimizee(result.x)
rather than by copying the values of result.x
printed to the console into a new function call.
When the values of result.x
are printed to the console, they are not printed with all significant digits and if your function is very sensitive to its inputs, you could get an unexpected result, as described above.