pow
double x = 7.3;
double y = 4.1;
for (int i = 0; i < 1'000'000; ++i) {
sum += std::pow(x, y);
}
^ This is Faster?
double x = 1e-300;
double y = 1.1;
for (int i = 0; i < 1'000'000; ++i) {
sum += std::pow(x, y);
}
^ This is Faster?
* The benchmark is run under AMD Ryzen 9.
* For the full benchmark code, please refer here.
* For illustration purposes only, see FAQ for more details.