Dataplot Vol 2 Vol 1

# RELERR

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

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> = RELERR(<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 relative error values are stored;
and where the <SUBSET/EXCEPT/FOR qualification> is optional.
Examples:
LET A = RELERR(14,10)
LET A = RELERR(A1,A2)
LET X2 = RELERR(X1,X4)
LET X2 = RELERR(X1-4,X2+6)
Default:
None
Synonyms:
None
Related Commands:
 RELDIF = Compute the relative difference of two numbers. PERCDIF = Compute the percent difference of two numbers. PERCERR = Compute the percent 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:
2010/12
Program:
```
LET X = SEQUENCE 0.1  0.1  3
LET Y1 = X**2
LET Y2 = X**(1/2)
LET Y3 = RELERR(Y1,Y2)
SET WRITE DECIMALS 5
PRINT Y1 Y2 Y3
```
The following output is printed:
```---------------------------------------------
Y1             Y2             Y3
---------------------------------------------
0.01000        0.31622      -30.62277
0.04000        0.44721      -10.18033
0.09000        0.54772       -5.08580
0.16000        0.63245       -2.95284
0.25000        0.70710       -1.82842
0.36000        0.77459       -1.15165
0.49000        0.83666       -0.70746
0.64000        0.89442       -0.39754
0.81000        0.94868       -0.17121
1.00000        1.00000        0.00000
1.21000        1.04880        0.13321
1.44000        1.09544        0.23927
1.69000        1.14017        0.32533
1.96000        1.18321        0.39631
2.25000        1.22474        0.45566
2.56000        1.26491        0.50589
2.89000        1.30384        0.54884
3.24000        1.34164        0.58591
3.61000        1.37840        0.61817
4.00000        1.41421        0.64644
4.41000        1.44913        0.67139
4.84000        1.48323        0.69354
5.29000        1.51657        0.71331
5.76000        1.54919        0.73104
6.25000        1.58113        0.74701
6.76000        1.61245        0.76147
7.29000        1.64316        0.77459
7.84000        1.67332        0.78656
8.41000        1.70293        0.79751
```

Date created: 01/06/2011
Last updated: 01/06/2011