summaryrefslogtreecommitdiff
path: root/exp_3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'exp_3.cpp')
-rw-r--r--exp_3.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/exp_3.cpp b/exp_3.cpp
index a1d55b9..b7598e9 100644
--- a/exp_3.cpp
+++ b/exp_3.cpp
@@ -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