Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check sum with 2% error instead of abs error. #45

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -425,10 +425,10 @@ void check_solution(const unsigned int ntimes, std::vector<T>& a, std::vector<T>
std::cerr
<< "Validation failed on c[]. Average error " << errC
<< std::endl;
// Check sum to 8 decimal places
if (!triad_only && errSum > 1.0E-8)
// Check percentage error of sum. Should be within 2%.
if (!triad_only && errSum/goldSum > 2.0E-2)
std::cerr
<< "Validation failed on sum. Error " << errSum
<< "Validation failed on sum. Percentage error " << errSum/goldSum * 100.0
<< std::endl << std::setprecision(15)
<< "Sum was " << sum << " but should be " << goldSum
<< std::endl;
Expand Down