4.8 Getting the Best Efficiency Out of MPFR
Here are a few hints to get the best efficiency out of MPFR:
• you should avoid allocating and clearing variables. Reuse variables whenever possible, allo-
cate or clear outside of loops, pass temporary variables to subroutines instead of allocating
them inside the subroutines;
From the MPFR reference manual (https://www.mpfr.org/mpfr-current/#doc):