title: NMinimize seems to be on crack
body: <p>Say I have a crazy function, <code>f</code>, defined like so:</p>
  
  <pre><code>util[x_, y_, c_] := 0.5*Log[c-x] + 0.5*Log[c-y]
  cost[x_, y_, l_] := c /. First[NSolve[util[x, y, c+l] == Log[10+l], c]]
  prof[x_, y_]   := 0.01*Norm[{x,y}, 2]
  liquid[x_, y_] := 0.01*Norm[{x,y}, 2]
  f[x_, y_, a_, b_] := cost[a, b, liquid[x,y] + liquid[a-x, b-y]] - Max[a,b] 
        - cost[0,0,0] + prof[x,y] + liquid[x,y] + prof[a-x, b-y] + liquid[a-x, b-y]
  </code></pre>
  
  <p>Now I call <code>NMinimize</code> like this:</p>
  
  <pre><code>NMinimize[{f[50, 50, k, j], k &gt;= 49, k &lt;= 51, j &gt;= 49, j &lt;= 51}, {j, k}]
  </code></pre>
  
  <p>Which tells me this:</p>
  
  <pre><code>{-21.0465, {j -&gt; 51., k -&gt; 49.}}
  </code></pre>
  
  <p>But then if I actually check what <code>f[50,50,49,51]</code> is, it's this:</p>
  
  <pre><code>0.489033
  </code></pre>
  
  <p>Which is pretty different from the -21.0465 that NMinimize said.
  Is this par for the course with NMinimize?
  Floating point errors compounding or whatnot?
  Any ideas for beating NMinimize (or some such function) into submission?</p>