https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116319

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The answer here is correct due to the way arithmetic is done for bfloat16_t.

It is just a storage unit. All math is done in 32bit float.

    const float bb = b;
    const float cc = c;
    const float dd = fma(bb, bb, cc);
    cout << static_cast<double>(dd) << "\n";

So the rounding (5.64062) back to bfloat16_t gives 5.625.

That is there is a double rounding going on.

Reply via email to