Description
When there are multiple equal elements that could have their index returned, the one with the smallest index is supposed to be returned. But it isn't always.
Reproduction Steps
using System.Numerics.Tensors;
ReadOnlySpan<float> floats = [10f, -20f, -30f, 1f, 1f, -40f];
Console.WriteLine(TensorPrimitives.IndexOfMinMagnitude(floats));
or
using System.Numerics.Tensors;
ReadOnlySpan<float> floats = [10f, 20f, 30f, 1f, 1f, 40f];
Console.WriteLine(TensorPrimitives.IndexOfMin(floats));
Expected behavior
Those should both print 3.
Actual behavior
They print 4.
Regression?
No
Known Workarounds
No response
Configuration
System.Numerics.Tensors v8.0.0 nuget package
Other information
No response