A compiled function generated with EvaluateSymbolically -> True still gives a CompiledFunction symbolic argument error when used as the objective function in FindMinimum
In[1]:= expr =
E^Sin[50 x] + Sin[60 E^y] + Sin[70 Sin[x]] + Sin[Sin[80 y]] -
Sin[10 (x + y)] + 1/4 (x^2 + y^2);
In[2]:= cexpr = Compile[{x, y}, Evaluate[expr]];
In[4]:= FindMinimum[cexpr[x, y], {{x, 1}, {y, 1}}]
During evaluation of In[4]:= CompiledFunction::cfsa: Argument x at position 1 should be a machine-size real number. >>
Out[4]= {-0.342853, {x -> 0.953282, y -> 0.291998}}
In[5]:= cexpr1 =
Compile[{x, y}, Evaluate[expr],
RuntimeOptions -> {"EvaluateSymbolically" -> True}];
In[6]:= FindMinimum[cexpr1[x, y], {{x, 1}, {y, 1}}]
During evaluation of In[6]:= CompiledFunction::cfsa: Argument x at position 1 should be a machine-size real number. >>
Out[6]= {-0.342853, {x -> 0.953282, y -> 0.291998}}