This is a copy of the issue in the original cpp-roche package trmrsh/cpp-roche/issues/2
It seems that linmin is failing to find the minimum despite it often being within the range, either due to the minimum being very shallow and therefore difficult to detect, or it being missed by the very coarse sampling of the line (NTRY=5). We can potentially use the derivative functions to bracket the minima rather than the values of the potentials which might be more robust to shallow minima and we can maybe just confirm there is a minima within the range and then give the full range to dbrent instead
This is a copy of the issue in the original cpp-roche package trmrsh/cpp-roche/issues/2
It seems that linmin is failing to find the minimum despite it often being within the range, either due to the minimum being very shallow and therefore difficult to detect, or it being missed by the very coarse sampling of the line (NTRY=5). We can potentially use the derivative functions to bracket the minima rather than the values of the potentials which might be more robust to shallow minima and we can maybe just confirm there is a minima within the range and then give the full range to dbrent instead