User:Adamarjo/sandbox/Precision Control

Description of the problem
This article is about controlling the precision of results of functions in big projects done by many groups Engineering, Math and Science with the desired number of decimal points before handing the projects or sharing with the groups. The result of the calculations of the same project done two groups or more project matched with the number or number decimals or their value the result is not correct.

The following is the general form of Polynomials: ===$$ f(x_0,x_1 .. ,x_n)= \sum_{i=0}^n a_i \prod_{j=0}^k x_{i,j}^{p_{i,j}} = \begin{cases} \begin{array}{lcl} t_0=a_0 x_{0,0}^{p_{0,0}} \times x_{0,1}^{p_{0,1}}..x_{0,j}^{p_{0,j}}..x_{0,k}^{p_{0,k}} \end{array} \\ \begin{array}{lcl} t_1=a_1 x_{1,0}^{p_{1,0}} \times x_{1,1}^{p_{1,1}} ..x_{1,j}^{p_{1,j}}..x_{1,k}^{p_{1,k}} \end{array} \\ .. \\ \begin{array}{lcl} t_i= \ a_i x_{i,0}^{p_{i,0}} \ \times x_{i,1}^{p_{i,1}} .. x_{i,j}^{p_{i,j}} .. x_{i,n}^{p_{i,n}} \end{array} \\ .. \\ \begin{array}{lcl} t_n=a_n x_{n,0}^{p_{n,0}}\times x_{n,1}^{p_{n,1}}..x_{n,j}^{p_{n,j}}..x_{n,k}^{p_{n,k}} \end{array} \\ \begin{array}{lcl} where: \\ f(x_0,x_1,..,x_n) \ has \ n \ terms \ and \ k \ variables \\ t_i \ is \ the \ term \ i \ of \ the \ funcion \\ t_i=a_i x_{i,j}^{p_{i,j}} \ is \ the \ value \ of \ term \ i \\ x_{i,j} \ is \ a \ variable \ in \ the \ position \ j \ of \ the \ k \ varibels \ of \ term \ i \\ p_{i,j} \ is \ the \ power \ of \ variale \ the \ x_{i,j} \\ \nexists t_i \iff a_i=0 \\ \nexists x_(i,j) \iff p(i,j)=0 \end{array} \end{cases} $$===

Example 1
$$ f(x,y,z) = 4x^6y^4+10xyz+\pi^2 x^2+6y-2 = \sum_{i=0}^{n} = a_i \prod_{j=0}^3 t_{i,j}^{p_{i,j}}= \begin{cases} \begin{array}{lcl} t_0=4^6y^4: \ &a_0=4,t_{(0,0)}\equiv x,&p_{(0,0)}=6&t_{(0,1)}\equiv y&p_{(0,1)}=4\end{array} \\ \begin{array}{lcl}t_1=10xyz:&a_1=10,t_{(1,0)}\equiv x,p_{(1,0)}=1& t_{(1,1)}\equiv y&p_{(1,1)}=1&t_{(1,2)}\equiv z&p_{(1,2)}=1\end{array} \\ \begin{array}{lcl}t_2=\pi x^2:&a_2=10,t_{(2,0)}\equiv x,&p_{(2,0)}=1\end{array} \\ \begin{array}{lcl}t_3=6    y:\ &a_3=6,t_{(3,0)}\equiv y,&p_{(3,0)}=1\end{array} \\ \begin{array}{lcl}t_4=2     :&&a_4=2\end{array} \end{cases} $$

According to the above definition the form for a one variable polygon is $$ y= \sum_{i=0}^n a_i \prod_{j=0}^k t^{P_{j}}=a_0 x^{P_0}+a_1 x^{P_1} .. a_n x^{P_k} $$ where   is the variable in the polygon.

Presenting one Variable Polygons as a Number
Lets use a one variable polygon and show how present as a number.

Example 2
The number 7650 in base 10 is calculated by $$  7650 = 7 \times 1000 + 6 \times 100 + 5 \times 10 + 6 = [7650]_{10} $$

The one variable Polygon $$ Y= \sum_{i=0}^n a_i \prod_{j=0}^k x^{p_{j}}=a_0 x^{p_0}+a_1 x^{p_1}..a_n x^{p_k}= a_0[a_0a_1a_2..a_{n-1}a_n]_x $$ a number is base $$ x $$.

this is if we assume the terms are sorted descending by the powers of $$  x $$ and if $$  a_i=0 $$ the digit at position $$ i  $$ will be zero also.

Examples 3
$$  Y= 5x^4+2x+1 \equiv [50021]_x $$

$$ Y=67 x^6 - x \equiv [(67)00000(-1)0]_x $$ If a coefficient is no integer or symbols or negative is shown inside parentheses.

Lets give you some practical examples:

Example 4
$$ Y=2\pi R $$ is a function to calculate the circumference of a circle with variable radius is a one variable polygon with one term is equivalent to $$  Y=2 \pi R \equiv[(2\pi){(0)}]_R $$ a two digit number in Base R.

Example 5
$$ Y=\pi R^2 $$ is a function to calculate the area of circle with variable R the radius is equivalent to $$ Y= \pi R^2 \equiv [{(\pi)(0)(0)}]_R $$

Example 6
$$ Y=4/3 \pi R^3 $$is function to calculate the volume of a sphere with Radius R is equivalent to $$  Y=(4/3) \times \pi R^3 \equiv [(4/3 \pi)000]_R $$

Example 7
Find the total volume of an Sphere with Radius R and Disk with height one unit and a Ring made of rod with square and thickness one unit.

=
$$ y = f(R)=(4/3) \pi R^3 + \pi R^2 + 2 \pi R = [(4/3)000]_R+[(\pi)00]_R + [(2\pi]_R = [(4/3\pi)(\pi)(2\pi)(0)]=3/4\pi [1360]_R   $$ ======

Theorem
A one variable polygon P presented as $$ P(x) = a_{n-1}x^{n-1}+a_{n-2}x^{n-2}+..+a_1+a_0 $$ as a number presented as  $$  P(x)=[a_{n-1}a_{n-2}..a_1a_0]_x $$

Proof

Is trivial. Consider the polygon $$ P(x)=a_0x^{n-1}+a_1X^{n-2} .. a_1x + a_0 $$ name the coefficient in the reverse order.

Theorem
If we multiplicity or divide a polygon by a number this the same as we multiply or divide all digit  of the polygon.

Proof:

Consider $$ P(x) = [a_{n-1} .. a_0]_x $$ if we multiply both side by a number n then the result is $$ n \times P(x) = n \times [a_{n-1} .. a_0]_x = n \times (a_{n-1} \times x^{n-2} .. a_1 \times x^1 + a_0) $$ or $$ [(n\times a_{n-1}) .. (n\times a_1 \times a^1) + (n\times a_0)]_x $$

Where an-1 the most and a 0 are the most and least significant digits.

Example 8
Consider example 7 the total volume $$ f(R)=[(4/3 \pi)000]_R = (4/3) \times \pi \times R^3 + \pi \times R^2 + 2 \times \pi R^1 $$if we multiply both side by $$ (4/3\times\pi) $$ we get $$ 3/(4\pi)\times P(R) = R^3 + 3 R^2 + 6 R + 0 = [1360]_R $$

Theorem
The operation add, subtract, multiply and divide can be applied to the numbers derived from a one variable polygon P(x).

Proof:

Consider two polygons

$$ \begin{cases} \begin{array}{lcl} P_1(x) = [a_{n-1} a_{n-2} .. a_1a_0]_x\end{array} \\ \begin{array}{lcl} P_2(x) = [\acute{a}_{n-1} \acute{a}_{n-2} .. \acute{a}_1\acute{a}_0]_x\end{array} \end{cases}

\begin{cases} \begin{array}{lcl} P_1(x) = a_{n-1} \times x^{n-1} + a_{n-2} \times x^{n-2} .. a_1 \times x^1 + a_0 \times x^0]_x\end{array} \\ \div \\ \begin{array}{lcl} P_2(x) = \acute{a_{n-1}} \times x^{n-1} + \acute{a_{n-2}} \times x^{n-2} .. \acute{a_1} \times x^1 +\acute{a_0} \times x^0]_x\end{array} \\ \end{cases}

$$=

$$

\begin{cases} \begin{array}{lcl} P_1(x)/P_2(x) = \\ (a_{n-1} \times x^{n-1} + a_{n-2} \times x^{n-2} .. a_1 \times x^1 + a_0 \times x^0)\end{array} \\\div\\ (\acute{a_{n-1}} \times x^{n-1} + \acute{a_{n-2}} \times x^{n-2} .. \acute{a_1} \times x^1 +\acute{a_0} \times x^0) \\ \end{cases}

$$

$$

\begin{array}{lcl} P_1(x)/P_2(x) = (a_{n-1}/\acute{a_{n-1}}) \times x^{n-1} + (a_{n-2}/\acute{a_{n-2}}) \times x^{n-2} .. + (a_1/\acute{a_1}) \times x^1 + (a_0/\acute{a_{0}}) \times x^0\end{array}

$$

Completes the proof. For addition, subtraction and multiplication the proof is similar.