summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/BS23.cpp4
-rw-r--r--tests/CK45.cpp4
-rw-r--r--tests/Complex.cpp6
-rw-r--r--tests/DP45.cpp6
-rw-r--r--tests/Euler.cpp6
-rw-r--r--tests/HE12.cpp6
-rw-r--r--tests/Heun.cpp6
-rw-r--r--tests/Midpoint.cpp6
-rw-r--r--tests/RK4.cpp6
-rw-r--r--tests/RKF45.cpp6
10 files changed, 28 insertions, 28 deletions
diff --git a/tests/BS23.cpp b/tests/BS23.cpp
index 91a5b67..2c030d6 100644
--- a/tests/BS23.cpp
+++ b/tests/BS23.cpp
@@ -23,11 +23,11 @@
#include <iostream>
#include <iomanip>
-// y' = y (y == C*exp(x))
+// y' = x*y (y == C*exp(x^2/2))
double
f(double x, double y)
{
- return y;
+ return x*y;
}
int
diff --git a/tests/CK45.cpp b/tests/CK45.cpp
index 0d95f67..7d2d390 100644
--- a/tests/CK45.cpp
+++ b/tests/CK45.cpp
@@ -23,11 +23,11 @@
#include <iostream>
#include <iomanip>
-// y' = y (y == C*exp(x))
+// y' = x*y (y == C*exp(x^2/2))
double
f(double x, double y)
{
- return y;
+ return x*y;
}
int
diff --git a/tests/Complex.cpp b/tests/Complex.cpp
index a81deeb..01d850b 100644
--- a/tests/Complex.cpp
+++ b/tests/Complex.cpp
@@ -24,11 +24,11 @@
#include <iostream>
#include <iomanip>
-// y' = -y (y == C*exp(x))
+// y' = x*y (y == C*exp(x^2/2))
std::complex<double>
f(double x, std::complex<double> y)
{
- return y;
+ return x*y;
}
int
@@ -53,7 +53,7 @@ main()
<< "Rejections: " << integrator.rejections() << std::endl;
double error = std::abs(expected - actual)/std::abs(expected);
- if (error > 6.0e-7 || !std::isfinite(error)) {
+ if (error > 5.9e-7 || !std::isfinite(error)) {
std::cerr << "Error: " << 100.0*error << "%" << std::endl;
return EXIT_FAILURE;
} else {
diff --git a/tests/DP45.cpp b/tests/DP45.cpp
index 237672d..2a80ed3 100644
--- a/tests/DP45.cpp
+++ b/tests/DP45.cpp
@@ -23,11 +23,11 @@
#include <iostream>
#include <iomanip>
-// y' = y (y == C*exp(x))
+// y' = x*y (y == C*exp(x^2/2))
double
f(double x, double y)
{
- return y;
+ return x*y;
}
int
@@ -52,7 +52,7 @@ main()
<< "Rejections: " << integrator.rejections() << std::endl;
double error = std::abs(expected - actual)/std::abs(expected);
- if (error > 6.0e-7 || !std::isfinite(error)) {
+ if (error > 5.9e-7 || !std::isfinite(error)) {
std::cerr << "Error: " << 100.0*error << "%" << std::endl;
return EXIT_FAILURE;
} else {
diff --git a/tests/Euler.cpp b/tests/Euler.cpp
index 1741dc8..47b5b55 100644
--- a/tests/Euler.cpp
+++ b/tests/Euler.cpp
@@ -23,11 +23,11 @@
#include <iostream>
#include <iomanip>
-// y' = y (y == C*exp(x))
+// y' = x*y (y == C*exp(x^2/2))
double
f(double x, double y)
{
- return y;
+ return x*y;
}
int
@@ -49,7 +49,7 @@ main()
<< "Iterations: " << integrator.iterations() << std::endl;
double error = std::abs(expected - actual)/std::abs(expected);
- if (error > 0.01 || !std::isfinite(error)) {
+ if (error > 2.3e-2 || !std::isfinite(error)) {
std::cerr << "Error: " << 100.0*error << "%" << std::endl;
return EXIT_FAILURE;
} else {
diff --git a/tests/HE12.cpp b/tests/HE12.cpp
index 8de11e8..c3515c2 100644
--- a/tests/HE12.cpp
+++ b/tests/HE12.cpp
@@ -23,11 +23,11 @@
#include <iostream>
#include <iomanip>
-// y' = y (y == C*exp(x))
+// y' = x*y (y == C*exp(x^2/2))
double
f(double x, double y)
{
- return y;
+ return x*y;
}
int
@@ -52,7 +52,7 @@ main()
<< "Rejections: " << integrator.rejections() << std::endl;
double error = std::abs(expected - actual)/std::abs(expected);
- if (error > 8.7e-7 || !std::isfinite(error)) {
+ if (error > 4.9e-7 || !std::isfinite(error)) {
std::cerr << "Error: " << 100.0*error << "%" << std::endl;
return EXIT_FAILURE;
} else {
diff --git a/tests/Heun.cpp b/tests/Heun.cpp
index 6eca969..f1b4364 100644
--- a/tests/Heun.cpp
+++ b/tests/Heun.cpp
@@ -23,11 +23,11 @@
#include <iostream>
#include <iomanip>
-// y' = y (y == C*exp(x))
+// y' = x*y (y == C*exp(x^2/2))
double
f(double x, double y)
{
- return y;
+ return x*y;
}
int
@@ -49,7 +49,7 @@ main()
<< "Iterations: " << integrator.iterations() << std::endl;
double error = std::abs(expected - actual)/std::abs(expected);
- if (error > 1.4e-4 || !std::isfinite(error)) {
+ if (error > 2.7e-4 || !std::isfinite(error)) {
std::cerr << "Error: " << 100.0*error << "%" << std::endl;
return EXIT_FAILURE;
} else {
diff --git a/tests/Midpoint.cpp b/tests/Midpoint.cpp
index 77c7f68..c6f9ef6 100644
--- a/tests/Midpoint.cpp
+++ b/tests/Midpoint.cpp
@@ -23,11 +23,11 @@
#include <iostream>
#include <iomanip>
-// y' = y (y == C*exp(x))
+// y' = x*y (y == C*exp(x^2/2))
double
f(double x, double y)
{
- return y;
+ return x*y;
}
int
@@ -49,7 +49,7 @@ main()
<< "Iterations: " << integrator.iterations() << std::endl;
double error = std::abs(expected - actual)/std::abs(expected);
- if (error > 1.4e-4 || !std::isfinite(error)) {
+ if (error > 4.6e-4 || !std::isfinite(error)) {
std::cerr << "Error: " << 100.0*error << "%" << std::endl;
return EXIT_FAILURE;
} else {
diff --git a/tests/RK4.cpp b/tests/RK4.cpp
index 9edeb1c..f442a71 100644
--- a/tests/RK4.cpp
+++ b/tests/RK4.cpp
@@ -23,11 +23,11 @@
#include <iostream>
#include <iomanip>
-// y' = y (y == C*exp(x))
+// y' = x*y (y == C*exp(x^2/2))
double
f(double x, double y)
{
- return y;
+ return x*y;
}
int
@@ -49,7 +49,7 @@ main()
<< "Iterations: " << integrator.iterations() << std::endl;
double error = std::abs(expected - actual)/std::abs(expected);
- if (error > 4.2e-8 || !std::isfinite(error)) {
+ if (error > 2.2e-7 || !std::isfinite(error)) {
std::cerr << "Error: " << 100.0*error << "%" << std::endl;
return EXIT_FAILURE;
} else {
diff --git a/tests/RKF45.cpp b/tests/RKF45.cpp
index 164aba3..11ee539 100644
--- a/tests/RKF45.cpp
+++ b/tests/RKF45.cpp
@@ -23,11 +23,11 @@
#include <iostream>
#include <iomanip>
-// y' = y (y == C*exp(x))
+// y' = x*y (y == C*exp(x^2/2))
double
f(double x, double y)
{
- return y;
+ return x*y;
}
int
@@ -52,7 +52,7 @@ main()
<< "Rejections: " << integrator.rejections() << std::endl;
double error = std::abs(expected - actual)/std::abs(expected);
- if (error > 1.7e-6 || !std::isfinite(error)) {
+ if (error > 1.1e-5 || !std::isfinite(error)) {
std::cerr << "Error: " << 100.0*error << "%" << std::endl;
return EXIT_FAILURE;
} else {