|
|
|
|
@@ -57,7 +57,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = a[i] + b[i];
|
|
|
|
|
if (c[i] != ref) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -85,7 +85,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = a[i] * b[i];
|
|
|
|
|
if (c[i] != ref) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -113,7 +113,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = a[i] / b[i];
|
|
|
|
|
if (c[i] != ref) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -143,7 +143,7 @@ public:
|
|
|
|
|
auto y = a[i] * b[i];
|
|
|
|
|
auto ref = x + y;
|
|
|
|
|
if (c[i] != ref) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -171,7 +171,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = a[i] + b[i];
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -199,7 +199,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = a[i] - b[i];
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -227,7 +227,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = a[i] * b[i];
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -255,7 +255,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = a[i] * b[i] + 0.5f;
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -283,7 +283,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = a[i] * b[i] - 0.5f;
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -311,7 +311,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = -a[i] * b[i] - 0.5f;
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -339,7 +339,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = -a[i] * b[i] + 0.5f;
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -369,7 +369,7 @@ public:
|
|
|
|
|
auto y = a[i] * b[i] + 0.5f;
|
|
|
|
|
auto ref = x + y;
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -397,7 +397,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = a[i] / b[i];
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -427,7 +427,7 @@ public:
|
|
|
|
|
auto y = b[i] / a[i];
|
|
|
|
|
auto ref = x + y;
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -456,7 +456,7 @@ public:
|
|
|
|
|
for (int i = 0; i < n; ++i) {
|
|
|
|
|
auto ref = sqrt(a[i] * b[i]);
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -485,7 +485,7 @@ public:
|
|
|
|
|
auto x = a[i] + b[i];
|
|
|
|
|
auto ref = (int32_t)x;
|
|
|
|
|
if (c[i] != ref) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -514,7 +514,7 @@ public:
|
|
|
|
|
auto x = a[i] + b[i];
|
|
|
|
|
auto ref = (uint32_t)x;
|
|
|
|
|
if (c[i] != ref) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -543,7 +543,7 @@ public:
|
|
|
|
|
auto x = a[i] + b[i];
|
|
|
|
|
auto ref = (float)x;
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@@ -572,7 +572,7 @@ public:
|
|
|
|
|
auto x = a[i] + b[i];
|
|
|
|
|
auto ref = (float)x;
|
|
|
|
|
if (!almost_equal(c[i], ref)) {
|
|
|
|
|
std::cout << "error at value " << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
std::cout << "error at result #" << i << ": expected " << ref << ", actual " << c[i] << ", a=" << a[i] << ", b=" << b[i] << std::endl;
|
|
|
|
|
++errors;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|