Logo

Numerical examples





The gaussian method

In this example, CADNA is able to provide correct results which were impossible to be obtained with the standard floating point arithmetic.

The following linear system is solved with the Gaussian elimination method with partial pivoting. The system is A.X=B with:

\begin{displaymath}A=\pmatrix{
21 & 130 & 0 & 2.1 \cr
13 & 80 & 4.74\: 10^{8} & ...
... \
B=
\pmatrix{
153.1\cr
849.74\cr
7.7816\cr
2.6\: 10^{-8}\cr}\end{displaymath}

Without CADNA:

x_sol(1) = 0.6261987E+02 (exact value : 0.1000000E+01)
x_sol(2) = -0.8953979E+01 (exact value : 0.1000000E+01)
x_sol(3) = 0.0000000E+00 (exact value : 0.9999999E-08)
x_sol(4) = 0.9999999E+00 (exact value : 0.1000000E+01)

With CADNA:

-----------------------------------------------------
CADNA software --- University P. et M. Curie --- LIP6
Self-validation detection: ON
Mathematical instabilities detection : ON
Branching instabilities detection : ON
Intrinsic instabilities detection : ON
Cancellation instabilities detection : ON
-----------------------------------------------------
x_sol(1) = 0.999E+00 (exact value : 0.1000000E+01)
x_sol(2) = 0.1000E+01 (exact value : 0.1000000E+01)
x_sol(3) = 0.999999E-08 (exact value : 0.1000000E-07)
x_sol(4) = 0.1000000E+01 (exact value : 0.1000000E+01)
-----------------------------------------------------
CADNA software --- University P. et M. Curie --- LIP6
There are 3 numerical instabilities
0 UNSTABLE DIVISION(S)
0 UNSTABLE POWER FUNCTION(S)
0 UNSTABLE MULTIPLICATION(S)
1 UNSTABLE BRANCHING(S)
0 UNSTABLE MATHEMATICAL FUNCTION(S)
1 UNSTABLE INTRINSIC FUNCTION(S)
1 UNSTABLE CANCELLATION(S)

Comments

During the reduction of the third column, A(3,3) is equal to 4864. But the exact value of A(3,3) is zero. The standard foating point arithmetic cannot detect that A(3,3) is not significant. This value is chosen as pivot. That leads to erroneous results.

CADNA detects the no significant value of A(3,3). This value is eliminated as pivot. That leads to satisfying results.


the classical FORTRAN source code..

the FORTRAN source code with CADNA..


More information can be requested to the CADNA team
Thanks to Baptiste Mary for the CADNA logo