This one might be faster reducing allocations amount.
Also some naming issues were fixed.
// avoid using fields where possible, it makes the code portable and reusable
public void MainAlgorithm(List<double> xs, List<double> ys)
//this line replaces GetSmallestArray method, Linq is fine here while xs.Count isn't a large number
I am going to expand upon @OlivierJacot-Descombes answer and offer an alternative. You do not have to limit yourself to a single method signature. And you do not have to use a BitArray. My answer is strictly offered as an alternative but I make no claim as to performance. But since the backing data storage to a BitArray is an internal int, much of the ...
You could use a params array to pass the parameters
public void SetConfiguration(params bool modes)
var setBits = new BitArray(8);
for (int i = 0; i < modes.Length; i++)
byte byteSet = new byte;
_mode = byteSet;
You might want to add tests to ...
You don't need to use Regex for this, and your regex doesn't cover most of cases anyway. You can simply splitting the input and try parse them into decimals. If they contains any invalid inputs then return three spaces (" ") otherwise print it in "00.000/00.000" format.
Function StringFormatting(input As String) As String
Dim parts = ...
It really depends, how far you want to go with this.
Maybe the most common suggestion that I can give is that what you are doing is called Memory Caching. It's good to call things with a name that is widely understood.
Read this article about In memory caching in Asp.net core.
Just to give you an example, what can be a possible issue with your code. Let's ...