title: Make C# algorithm more efficient
body: <p>I have a C# method that projects the value of a number from an interval to a target interval.<br>
  <strong>For example:</strong> we have an interval of -1000 and 9000 and a value of 5000; if we want to project this value to an interval of 0..100 we get 60.</p>
  
  <p>Here is the method: </p>
  
  <pre><code>/// &lt;summary&gt;  
  /// Projects a value to an interval
  /// &lt;/summary&gt;
  /// &lt;param name="val"&gt;The value that needs to be projected&lt;/param&gt;  
  /// &lt;param name="min"&gt;The minimum of the interval the value comes from&lt;/param&gt;  
  /// &lt;param name="max"&gt;The maximum of the interval the value comes from&lt;/param&gt;  
  /// &lt;param name="intervalTop"&gt;The minimum of the interval the value will 
  /// be projected to&lt;/param&gt;  
  /// &lt;param name="intervalBottom"&gt;The maximum of the interval the value will 
  /// be projected to&lt;/param&gt;  
  /// &lt;returns&gt;Projected value&lt;/returns&gt; 
  public decimal ProjectValueToInterval(decimal val,  
                                        decimal min,  
                                        decimal max,  
                                        decimal intervalBottom, 
                                        decimal intervalTop)  
  {  
      decimal newMin = Math.Min(0, min);
      decimal valueIntervalSize = Math.Abs(max - newMin);
      decimal targetIntervalSize = Math.Abs(intervalTop - intervalBottom);
  
      decimal projectionUnit = targetIntervalSize / valueIntervalSize;
  
      return (val * projectionUnit) + Math.Abs((newMin * projectionUnit));
  }
  </code></pre>
  
  <p>This method needs to be called for thousands of values.<br>
  I was wondering if there is a more efficient way to do this in C#? If yes, what changes do you suggest?</p>