algorithm for correctly rounded floating point radix conversion
In the worst case, you may need very high precision intermediate results. If your problem is limited, for example p ≤ 50 and e ≤ 1,000, it will be possible to prove how much precision is needed at most - with $1000 \cdot 10^{50}$ possible values to convert, 200 bits precision are likely enough.
In practice, some values can be calculated with correct rounding by calculating them with a single floating point operation with exact operands. Many other values can be calculated rounded correctly (including proof) with just a bit of extra precision. So you can do the calculation with relatively few extra bits of precision, check if you have a proven correctly rounded result, and do the same calculation with more bits if needed.
Example: 10.00073 = 1,000,073 / 100,000 Is the quotient of two exact numbers and therefore correctly rounded. 1e30 = 1e15 x 1e15 = product of two exact numbers. 1,000,000,000,000,000,123,456,789,012,345 = FMA (1e15,1e15, 123,456,789,012,344) = fused multiply-add of there exact numbers.