A An example of a multi-variate expression

Parsing tree for the multi-variate expression f(x1,x2) = x1×x2+x1 x2 is shown in Fig. 2. The sequence of operations at the stages marked by 1,2 and 3 are as follows. In the following, <variablename>.rms() and <variablename>.ID refers to the random error and the ID associated with the variable respectively.


PIC

Figure 2: The parsing tree for f(x1,x2) = x1×x2+x1 x2


  1. Stage 1:

    The IDs of x1 and x2 are set to 0 and 1 respectively and they are pushed on the VMS. x1.rms() and x2.rms() are copied in ME[0] and ME[1] respectively, while a value of 1 is pushed on DS[0] and DS[1].

    Operator '⋆' pops two values (say L and R) from the VMS. A value L⋆R with an ID equal to L.ID   R.ID is pushed on the VMS and a list of common IDs is made as IDList = L.IDList  R.IDList (here, an empty list). Next, for all IDs in L, a value is poped from DS[L.ID] (say, dx), and dx⋆R is pushed back on DS[L.ID]. Similar operation is done for all IDs in R.

    Top of DS[0] and DS[1] now has x2 and x1 respectively, while the top of the VMS has the value x1×x2 with an IDList={1,0}.

  2. Stage 2:

    x1 is pushed on the VMS, its ID is set to zero, x1.rms() is copied to ME[0] (a redundant operation) and a value of 1 is pushed on DS[0].

    Operator ’+’ pops two values (L and R) from the VMS (these have values x1×x2 and x1). L+R with an IDList= L.ID   R.ID is pushed back on the VMS. This IDList will be {0,1}. For IDs common between L and R (here {0}), two values are poped from the DS, and their addition pushed back on the DS. The common ID is then removed from the ID list of both operands. For the remaining IDs in L (R has no IDs left), values are poped from the corresponding DS, added together and pushed back on the appropriate DS.

    Hence, at the end of the operator '+', DS[0] will have x2+1 and DS[1] will have x1. Top of the VMS has the value x1×x2+x1.

  3. Stage 3:

    x2 is pushed on the VMS, x2.rms() is copied in ME[1] (another redundant operation) and a value of 1 is pushed on DS[1].

    Operator '/' pops two values (L and R) from the VMS. A value of L/R with an IDList=L.ID   R.ID ({0, 1}∪{0}) is pushed on the VMS. A list of common IDs between L and R is made using IDList = L.IDList   R.IDList. For all IDs in IDList, two values are poped from the corresponding DS (say, dxR (=x1) and dxL (=1)) and (R⋆dxL - L⋆dxR)/(R⋆R) pushed back on the same DS. The corresponding IDs are then removed from L and R.

    Next, for all the remaining IDs in L, a value is poped (say dx) from DS[L.ID] and dx/R is pushed back on the same DS. Similarly, for all IDs in R, a value from DS[R.ID] is poped into dx and -L⋆dx/(R⋆R) is pushed back on the same DS.

    At the end of this stage, DS[0] has the value 1+1/x2 and DS[1] has the value -x1/x22. VMS now has x1×x2+x1 x2 .

Finally, the values from the top of all DSs are multiplied with corresponding values in ME table, squared, added and the square root of the final result is taken. That value will be ∘  ----------------------------------
   [(    -1)      ]2   [  x1      ]2
     1 + x2  × δx1   +  - x22 × δx2. This is the final error propagated through the expression.