title: Uncertainty propagation formula in mathematica
body: <p>I'm trying to write a short piece of code that will perform propagation of errors. So far, I can get Mathematica to generate the formula for the error delta_f in a function f(x1,x2,...,xi,...,xn) with errors dx1,dx2,...,dxi,...dxn:</p>
  
  <pre><code>fError[f_, xi__, dxi__] := 
    Sum[(D[f[xi], xi[[i]]]*dxi[[i]])^2, {i, 1, Length[xi]}]^(1/2)
  </code></pre>
  
  <p>where fError requires that the input function f has all of its variables surrounded by {...}. For example,</p>
  
  <pre><code>d[{mv_, Mv_, Av_}] := 10^(1/5 (mv - Mv + 5 - Av))
  FullSimplify[fError[d, {mv, Mv, Av}, {dmv, dMv, dAv}]]
  </code></pre>
  
  <p>returns</p>
  
  <pre><code>2 Sqrt[10^(-(2/5) (Av - mv + Mv)) (dAv^2 + dmv^2 + dMv^2)] Log[10]
  </code></pre>
  
  <p>My question is, how can I evaluate this? Ideally I would like to modify fError to something like:</p>
  
  <pre><code>fError[f_, xi__, nxi__, dxi__]
  </code></pre>
  
  <p>where nxi is the list of actual values of xi (separated since setting the xi's to their numerical values will destroy the differentiation step above.) This function should find the general formula for the error delta_f <em>and then</em> evaluate it numerically, if possible. I think the solution should be as simple as a Hold[] or With[] or something like that, but I can't seem to get it.</p>