Logo

Numerical examples





A second order equation

The roots of the following second order equation are computed: 0.3x2 - 2.1x + 3.675 = 0.
The exact values are: Discriminant d=0, x1=x2=3.5

Without CADNA:

d = -3.8146972E-06
There are two conjugate complex roots:
z1 = 0.3499999E+01 + i * 0.9765625E-03
z2 = 0.3499999E+01 + i * -.9765625E-03

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
-----------------------------------------------------
d = @.0
Discriminant is zero.
The double solution is 0.349999E+01
-----------------------------------------------------
CADNA software --- University P. et M. Curie --- LIP6
There is 1 numerical instability
0 UNSTABLE DIVISION(S)
0 UNSTABLE POWER FUNCTION(S)
0 UNSTABLE MULTIPLICATION(S)
0 UNSTABLE BRANCHING(S)
0 UNSTABLE MATHEMATICAL FUNCTION(S)
0 UNSTABLE INTRINSIC FUNCTION(S)
1 UNSTABLE CANCELLATION(S)

Comments

The standard floating point arithmetic cannot detect that d=0. The wrong branching is performed and the result is false.

The CADNA software takes the accuracy of operands into account in the order relations or in the equality relation and, therefore, the good branching is performed and the exact result is obtained.

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