GSF : KL Mixture Reduction helpers comments/made code a bit more clear explict.
This MR does not change the actual distance calculation formalism we use.
It adds comments and a struct
to make it easier to follow the formalism used, plus uses
double precision for the calculation involving small/large numbers.
Mentionig @amorley who initially introduced the code.
This is probably a first step to facilitate studying the different methods here https://arxiv.org/pdf/2001.00727.pdf formulas 10-13. Currently we use formula 10 but without accounting for the weights.
Actually, Track Fitting with non-Gaussian noise references the original publication for formula 10 (same author as the arxiv above) but does not include the weights explicitly. So it seems our current implementation does not use them either.
A next step would be to formulate a simple but kind of realistic test of a merging procedure and test alternatives.
Although we merge 72->12 (so we keep relative high numbers) the final result quality is not 100% independent of the method.