Adding minmaxElement to Phobos?
gregormueckl at gmx.de
Fri Sep 6 15:29:51 UTC 2019
On Wednesday, 4 September 2019 at 22:12:28 UTC, Per Nordlöw wrote:
> I just learned the reason for C++11 having
> Calculating the min and max simultaneously reduces the number
> of comparisons with 1/4.
> Should we add a minmaxElement alongside minElement and
Side note: a stride of two as in the StackOverflow example code
would be suboptimal as this should prevent vectorization of the
loop. The stride probably needs to be the width of a SIMD
register to gain any advantage over the naive loop.
More information about the Digitalmars-d