|
13 | 13 | */ |
14 | 14 |
|
15 | 15 | #include <cmath> |
| 16 | +#include <cstdlib> |
16 | 17 | #include <iostream> |
17 | 18 |
|
18 | 19 | #include <XCFun/xcfun.h> |
@@ -83,7 +84,7 @@ int main(int, char **) { |
83 | 84 | std::cout << "The XC energy density is " << res << std::endl; |
84 | 85 |
|
85 | 86 | // compare with reference |
86 | | - auto diff = std::fabs(-0.86494159400066051 - res); |
| 87 | + auto diff = std::abs(-0.86494159400066051 - res); |
87 | 88 | if (diff > 1.0e-6) |
88 | 89 | std::cout << "derivatives do not match reference numbers" << std::endl; |
89 | 90 | } |
@@ -114,7 +115,7 @@ int main(int, char **) { |
114 | 115 | auto res = derivative(id, vector_length, density); |
115 | 116 |
|
116 | 117 | // compare with reference |
117 | | - auto diff = std::fabs(-5.1509916226154067 - res); |
| 118 | + auto diff = std::abs(-5.1509916226154067 - res); |
118 | 119 | if (diff > 1.0e-6) |
119 | 120 | std::cout << "derivatives do not match reference numbers" << std::endl; |
120 | 121 | } |
@@ -148,7 +149,7 @@ int main(int, char **) { |
148 | 149 | auto res = derivative(id, vector_length, density); |
149 | 150 |
|
150 | 151 | // compare with reference |
151 | | - auto diff = std::fabs(-0.013470456737102541 - res); |
| 152 | + auto diff = std::abs(-0.013470456737102541 - res); |
152 | 153 | if (diff > 1.0e-6) |
153 | 154 | std::cout << "derivatives do not match reference numbers" << std::endl; |
154 | 155 | } |
@@ -186,7 +187,7 @@ int main(int, char **) { |
186 | 187 | auto res = derivative(id, vector_length, density); |
187 | 188 |
|
188 | 189 | // compare with reference |
189 | | - auto diff = std::fabs(-9.4927931153398468 - res); |
| 190 | + auto diff = std::abs(-9.4927931153398468 - res); |
190 | 191 | if (diff > 1.0e-6) |
191 | 192 | std::cout << "derivatives do not match reference numbers" << std::endl; |
192 | 193 | } |
@@ -240,7 +241,7 @@ int main(int, char **) { |
240 | 241 | auto res = derivative(id, vector_length, density); |
241 | 242 |
|
242 | 243 | // compare with reference |
243 | | - auto diff = std::fabs(47.091223089835331 - res); |
| 244 | + auto diff = std::abs(47.091223089835331 - res); |
244 | 245 | if (diff > 1.0e-6) |
245 | 246 | std::cout << "derivatives do not match reference numbers" << std::endl; |
246 | 247 | } |
|
0 commit comments