RegressionSearch provides enhanced speed as an ideal alternative to non-interpolated Binary Search implementations that expect haystack.Length to be greater than 3 on a frequent basis.
RegressionSearch searches for the first occurence of a needle element in a haystack array that contains elements sorted in ascending order, provided the integral data type of each element in haystack matches needle. When an element is found, it returns the index of the found element. When an element isn’t found, it returns -1.