From 4bb76d5d78f5108b2845f4a8bc9a2544e605ec38 Mon Sep 17 00:00:00 2001 From: erg Date: Wed, 29 Sep 2010 20:30:27 +0000 Subject: [PATCH] Remove use of fabs() as this is still buggy in gcc. --- lib/neatogen/stress.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/neatogen/stress.c b/lib/neatogen/stress.c index 41710da63..72e135115 100644 --- a/lib/neatogen/stress.c +++ b/lib/neatogen/stress.c @@ -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++) { -- 2.40.0