In[]:=
f1[x_]:=1/x+Piecewise[{{100,0<x<0.1},{40,0.1<x<0.2},{80,0.2<x<0.3},{70,0.3<x<0.4},{90,0.4<x<0.5}}];​​NArgMin[{f1[maxfacc],0.5>maxfacc>0.01},maxfacc]​​
NArgMin
:Failed to converge to the requested accuracy or precision within 100 iterations.
0.5`(*shouldbe0.2*)