diff options
| author | KunoiSayami <[email protected]> | 2022-06-26 20:39:50 +0800 |
|---|---|---|
| committer | KunoiSayami <[email protected]> | 2022-06-26 20:39:50 +0800 |
| commit | e686acb51a836cca58f2043c404ac8d42d12fe5f (patch) | |
| tree | 55a76247e29ee3fff0dafaec93a5fee213577bdb /exp_3.cpp | |
| parent | 79ce6a05c76962a900a20777a838892932aed81b (diff) | |
feat(script): Add E output
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'exp_3.cpp')
| -rw-r--r-- | exp_3.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -12,6 +12,8 @@ int main() { std::vector<long long> vector1, vector2; + std::vector<long double> E; + std::set<long long> set1, set2; FILE *file = fopen("normal_distribution.txt", "r"); @@ -74,9 +76,15 @@ int main() { } // printf("%lld %lld %lld ", *ita, *it, *itb); long double res = (cnt2 + (*iter - *ita) / dx) / (sample_length - 1); - e += std::abs(res - (long double)cnt1 / (length - 1)); + auto single_e = std::abs(res - (long double)cnt1 / (length - 1)); + E.push_back(single_e); + e += single_e; printf("%.4Lf ", res * 100); } printf("\n%.4Lf", e); + for (auto element : E) { + printf("%.8Lf ", element); + } + puts(""); return 0; }
\ No newline at end of file |
