Functions
Fast summation, but using f64 as the internal representation so that we don’t have issues with the precision. This way, we can still work with f32 values, but get the correct sum value.
Fast summation, ends up being roughly 8 to 10 times faster than values.iter().copied().sum(). Shamelessly stolen from https://stackoverflow.com/a/67191480
Return the index of the first value in a sorted vector that is greater than a provided value.
Function to compare a value to our split value. Our split value will never be missing (0), thus we don’t have to worry about that.
Naive weighted percentiles calculation.
Provided a list of index values, pivot those values around a specific split value so all of the values less than the split value are on one side, and then all of the values greater than or equal to the split value are above.