Next: , Up: Examples   [Contents][Index]


3.1 Algebraic forms

In the following examples, various functions are written in different algebraic forms and the results for the different forms is shown to be exactly same (e.g. \cos(x) vs. \sqrt{1-\sin^2(x)}, \tan(x) vs. \sin(x)/\cos(x)). These examples also verify that the combination of a function and its inverse simply returns the argument (e.g \arcsin(\sin(x))=x), as well as functions like \sinh(x)/((\exp(x)-\exp(-x))/2) (which is really a complicated way of writing 1!) returns a value of 1 with no error. However, if the values of two independent variates x_1 and x_2 and their corresponding errors are same, the value of expressions like \sin^2(x_1) + \cos^2(x_2) will be 1 but the error will not be zero.

   Value of x         =  1.00000 +/- 0.10000
   Value of y         =  2.00000 +/- 0.20000
   Value of x1        =  1.00000 +/- 0.10000
   Value of x2        =  1.00000 +/- 0.10000

   sin(x)             =  0.84147 +/-  0.05403
   sqrt(1-sin(x)^2)   =  0.54030 +/-  0.08415
   cos(x)             =  0.54030 +/-  0.08415

   tan(x)             =  1.55741 +/-  0.34255
   sin(x)/cos(x)      =  1.55741 +/-  0.34255

   sinh(x)            =  1.17520 +/-  0.15431
   (exp(x)-exp(-x))/2 =  1.17520 +/-  0.15431

   sin(x1)*sin(x1)       =  0.70807 +/- 0.09093
   sin(x1)*sin(x2)       =  0.70807 +/- 0.06430

   /* Expressions that evaluate to just x */

   asin(sin(x))       =  1.00000 +/-  0.10000
   asinh(sinh(x))     =  1.00000 +/-  0.10000
   atanh(tanh(x))     =  1.00000 +/-  0.10000
   exp(ln(x))         =  1.00000 +/-  0.10000

   /* Complicated ways of computing 1.0! */

   sinh(x)/((exp(x)-exp(-x))/2) =  1.00000 
   x/exp(ln(x))                 =  1.00000

   /* Complicated ways of computing 1.0 with single and multiple variates! */

   sin(x1)^2+cos(x1)^2   =  1.00000 +/- 0.00000
   sin(x1)^2+cos(x2)^2   =  1.00000 +/- 0.12859