I asked GPT-4 to explain it to me, and asked if it could identify the algorithm. It didn't do a good job here (returned name of function). But when I told it that it was also called "Shar's algorithm", it immediately identified the author as Andrei Alexandrescu who apparently goes by the pseudonym Shar as well.
> Yes, with the name "Shar's algorithm," I can confirm that this branchless binary search algorithm is indeed known as Shar's algorithm. It's a variation of the Binary Search algorithm that focuses on minimizing branching to improve performance on modern CPUs. The algorithm is named after its creator, Andrei Alexandrescu, who goes by the pseudonym "Shar" on the internet.
replies(2):