]> granicus.if.org Git - graphviz/commitdiff
Remove use of fabs() as this is still buggy in gcc.
authorerg <devnull@localhost>
Wed, 29 Sep 2010 20:30:27 +0000 (20:30 +0000)
committererg <devnull@localhost>
Wed, 29 Sep 2010 20:30:27 +0000 (20:30 +0000)
lib/neatogen/stress.c

index 41710da63aa32ccff7303d543a2c708ae0fbc823..72e135115966fb906b3a3b3819e1c5e37dad90b7 100644 (file)
@@ -1841,9 +1841,11 @@ int stress_majorization_kD_mkernel(vtx_data * graph,     /* Input graph in sparse re
        /* Invariant: old_stress > 0. In theory, old_stress >= new_stress
         * but we use fabs in case of numerical error.
         */
-       converged =
-           (((fabs(old_stress - new_stress) / old_stress) < Epsilon)
-            || (new_stress < Epsilon));
+       {
+           double diff = old_stress - new_stress;
+           double change = ABS(diff);
+           converged = (((change / old_stress) < Epsilon) || (new_stress < Epsilon));
+       }
        old_stress = new_stress;
 
        for (k = 0; k < dim; k++) {