Better_Software_Header_MobileBetter_Software_Header_Web

Find what you need - explore our website and developer resources

FMA Woes

const double scale = 1.0 / i;

for (int j = 0; j <= i; ++j) {
    const double r = 1.0 - j * scale;
    assert(r >= 0);
}
const double scale = 1.0 / i;
const double r = 1.0 - i * scale;
assert(r >= 0);
const double result = std::sqrt(a*a - b*b);
x * y + z
const double scale = 1.0 / i;
const double r = 1.0 - i * scale;
assert(r >= 0);
const double result = std::sqrt(a*a - b*b);
const double scale = 1.0 / i;
const double r = 1.0 - i * scale;
const double scale = 1.0 / i;
const double tmp = i * scale;
const double r = 1.0 - tmp;
cc1plus: sorry, unimplemented: '-fexcess-precision=standard' for C++

About KDAB


4 Comments

25 - Feb - 2023

Stefan Brüns

- const double scale = 1.0 / i;
+ const double scale = 1.0 / (i + 1);

25 - Feb - 2023

Syam Krishnan

const double scale = 1.0 / i;
const double tmp = i * scale;

25 - Feb - 2023

Giuseppe D'Angelo

12 - Jun - 2023

Michael Winking

GiuseppeD'Angelo

Giuseppe D’Angelo

Senior Software Engineer

Learn Modern C++

Learn more