I'm writing a function which uses mpfr_t as its main data type. In this function, there will be long chains of operations which need temporary variables to store intermediate results. I'd like to minimize the number of temporary variables I'll need, so I'm doing something like this:
mpfr_t tmp1;
mpfr_t tmp2;
mpfr_sub(tmp1, a, b, MPFR_RNDN);
mpfr_mul(tmp2, c, d, MPFR_RNDN);
mpfr_add(tmp2, tmp1, a, MPFR_RNDN);
Then later in the function:
mpfr_mul(tmp1, e, f, MPFR_RNDN);
Can I rely on the prior value of tmp1 being completely cleared from the variable when it is reassigned with e*f
?