Suppose we have a machine which takes the input $x_{in}$. In this machine the variable $x_{in}$ is converted to $y_{in}$ with the function $f(x)$, $f(x_{in})=y_{in}$. $f(x)$ is a known function, but not very easy to evaluate. 

Secondly the machine is externally measured. This gives a measurement $x_{out}$. Assuming the measurement device has no errors, then there is phenomenon that converts $y_{in}$ to $x_{out}$ by a function, which we call $g(y)$. Since we don't know this phenomenon, $g(y)$ is unknown.

The machine works correct when for every $x_{in} > 0$, $x_{in}$ and $x_{out}$ are close together. To accomplish this, it is possible to set two parameters into the machine. Let's call those parameters $a$ and $b$. These paremeters are used in the following way: we take $y_{in}$ and set $y_{new} = a\times y_{in} + b$.

Since we do not know the function $g(y)$, we do not know what effect those parameters have on the measured output $x_{out}$. So in fact the problem here is about minimizing the following:  
$||x_{in} - x_{out}|| = ||x_{in} - g(a\times y_{in} + b)||$  
over $a$ and $b$, with the unknown function $g(y)$. 

At the moment those parameters are set by using trial and error, but it can take up to two days to get the best set of parameters.

Now I've read some things about

 - Simulated Annealing
 - Black box optimization
 - Surrogate modelling

But I'm not sure if I am looking in the right direction. Or if this problem is even solvable without trial and error. If it is solvable is there someopne who can give me some good referecences to this type of problems?