title: Find the reverse algorithm to go back to initial value
body: <p>I have a problem and try to solve it for hours. Here is a pseudocode:</p>
  
  <pre><code>x = 30
  
  if x &gt; 100 then max(function_1(x), function_2(x))
  elseif x &gt; 50 then max(function_3(x), function_4(x))
  elseif x &gt; 20 then max(function_5(x), function_6(x))
  elseif x &lt; 10 then function_7(x)
  else function_8(x)
  </code></pre>
  
  <p>This was a code I run with different values of <code>x</code>. Then functions are mathematical formulas. Now, I have the result of the above for each <code>x</code> and I want to revert and go back to <code>x</code> again.</p>
  
  <p>I found all the reversed mathematical formulas of functions. For example for <code>function_1(x)</code>, I have a <code>rev_function_1(y)</code> that will get the result and will give me the initial <code>x</code>.</p>
  
  <p>But, since the original code has a lot of cases, plus the <code>MAX</code>, I am not sure how I can run one code, for every value and return the original one.</p>
  
  <p><strong>Edit:</strong> All the functions are one-to-one</p>
  
  <p><strong>Edit2:</strong> It seems that the whole function is not <code>one-to-one</code> while each of them individually are. As a result, I have two <code>x</code> for every <code>y</code> and I cannot revert it.</p>