I am trying to use numerical integration to compute the integral $\int_0^1 f(\rho) d\rho$ where $f(\rho)$ is calculated as $\ln f(\rho)$ for improved numerical precision and stability.
At the moment I am exponentiating and then integrating, i.e., numerically solving $\int_0^1 \exp(\ln f(\rho)) d\rho$
Is there another method that can be used so I don't have to exponentiate until after the integral is calculated?
I know this is not a programming board but for reference I am using scipy.integrate.quad in Python at the moment.
Many thanks
EDIT: For further information, $f(\rho)$ is the following:
$f(\rho) = Bin(x_1;N_1,f_1(\rho)) \times Bin(x_2;N_2,f_2(\rho)) \times Bin(x_3;N_3,f_3(\rho))$
CORRECTION:
$f(\rho) = Bin(x_1;N_1,f_1(\rho)) \times Bin(x_2;N_2,f_2(\rho)) \times Bin(x_3;N_3,f_3(\rho)) \times Beta(\rho;\alpha,\beta)$
where $Bin(x;N,f) = \binom{N}{x} f^x (1-f)^{N-x}$
The functions $f_1,f_2,f_3$ are linear with respect to $\rho$, e.g., $f_1(\rho) = \rho(1-\pi)$ where $\pi$ held constant.
The method of integration I believe is QAGS from Fortran QUADPACK (global adaptive quadrature based on 21-point Gauss–Kronrod quadrature within each subinterval, with acceleration by Peter Wynn's epsilon algorithm)