float x = ...; double y = ...; y = y + (x * x);
(x * x) to float before converting it to double for the add to y.
x to double to compute its square and then adds y.
y.
float x = ...; double y = ...; y = y + ((double_t) x * x);
To guarantee the evaluation of narrow inner subexpressions to a wider type across all platforms, use explicit casting. You can determine the minimum evaluation format of an FPCE-compliant compiler on a particular platform from the macro _MIN_EVAL_FORMAT, which evaluates to 0, 1, or 2 according to whether the format is float, double, or long double.