From 644ebc40efa699e770a714fb2a2f00e829fa2802 Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Mon, 24 Oct 2016 16:22:35 +0100 Subject: [PATCH] Verify reduction result to 8 decimal places --- main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index 7e0dd22..f717d88 100644 --- a/main.cpp +++ b/main.cpp @@ -273,9 +273,12 @@ void check_solution(const unsigned int ntimes, std::vector& a, std::vector std::cerr << "Validation failed on c[]. Average error " << errC << std::endl; - if (errSum > epsi) + // Check sum to 8 decimal places + if (errSum > 1.0E-8) std::cerr << "Validation failed on sum. Error " << errSum + << std::endl << std::setprecision(15) + << "Sum was " << sum << " but should be " << goldSum << std::endl; }