SED navigation bar go to SED home page go to Dataplot home page go to NIST home page SED Home Page SED Staff SED Projects SED Products and Publications Search SED Pages
Dataplot Vol 2 Vol 1

PERCERR

Name:
    PERCERR (LET)
Type:
    Library Function
Purpose:
    Return the percent error of two numbers.
Description:
    The definition of the percent error between a "true" value Xt and an observed value Xo used by Dataplot is:

      Percent Error = 100*(X(t) - X(o))/X(t)

    with Xt denoting the "true" (or "accepted") value and Xo denoting the observed (or measured) value.

    There may be some slight differences for this formula in other sources. Specifically,

    1. Some sources take the absolute value of the above quantity. In Dataplot, you can use the ABS function to obtain this form.

    2. Some sources may reverse the order of the Xt and Xo values. This changes the sign of the result, but not the magnitude.
Syntax:
    LET <y> = PERCERR(<y1>,<y2>)       <SUBSET/EXCEPT/FOR qualification>
    where <y1> is a variable or a parameter;
                <y2> is a variable or a parameter;
                <y> is a variable or a parameter (depending on what <y1> and <y2> are) where the computed percent error values are stored;
    and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
    LET A = PERCERR(14,10)
    LET A = PERCERR(A1,A2)
    LET X2 = PERCERR(X1,X4)
    LET X2 = PERCERR(X1-4,X2+6)
Default:
    None
Synonyms:
    None
Related Commands:
    PERCDIF = Compute the percent difference of two numbers.
    RELDIF = Compute the relative difference of two numbers.
    RELERR = Compute the relative error of two numbers.
    MIN = Compute the minimum of two numbers.
    MAX = Compute the maximum of two numbers.
    ABS = Compute the absolute value of a number.
Applications:
    Data Management
Implementation Date:
    2011/1
Program:
     
    LET X = SEQUENCE 0.1  0.1  3
    LET Y1 = X**2
    LET Y2 = X**(1/2)
    LET Y3 = PERCERR(Y1,Y2)
    SET WRITE DECIMALS 5
    PRINT Y1 Y2 Y3
        
    The following output is generated:
    ---------------------------------------------
                 Y1             Y2             Y3
    ---------------------------------------------
            0.01000        0.31622    -3062.27766
            0.04000        0.44721    -1018.03398
            0.09000        0.54772     -508.58061
            0.16000        0.63245     -295.28470
            0.25000        0.70710     -182.84271
            0.36000        0.77459     -115.16574
            0.49000        0.83666      -70.74694
            0.64000        0.89442      -39.75424
            0.81000        0.94868      -17.12139
            1.00000        1.00000        0.00000
            1.21000        1.04880       13.32158
            1.44000        1.09544       23.92742
            1.69000        1.14017       32.53399
            1.96000        1.18321       39.63183
            2.25000        1.22474       45.56689
            2.56000        1.26491       50.58941
            2.89000        1.30384       54.88441
            3.24000        1.34164       58.59133
            3.61000        1.37840       61.81703
            4.00000        1.41421       64.64466
            4.41000        1.44913       67.13973
            4.84000        1.48323       69.35455
            5.29000        1.51657       71.33128
            5.76000        1.54919       73.10428
            6.25000        1.58113       74.70177
            6.76000        1.61245       76.14716
            7.29000        1.64316       77.45997
            7.84000        1.67332       78.65663
            8.41000        1.70293       79.75102
        

Date created: 01/06/2011
Last updated: 01/06/2011
Please email comments on this WWW page to alan.heckert@nist.gov.