Building each reflection's Gaussian profile was a third of the CPU pass B's samples (cytochrome C),
one scalar BraggExp per cell. BraggExp branched to its two ends before the arithmetic, and the
branches - with GCC's -ftrapping-math, which forbids running float arithmetic on a path that does not
need it - kept every loop over it scalar. It now tells the ends apart on the bits of x, an integer
comparison, runs the same arithmetic on x (or on 0 out of range) and masks the result: the same bits for
every float but NaN, checked over all 2^32 inputs against the old function, scalar and vectorised.
The cells are filled a row at a time and summed afterwards in the same order, so the loop vectorises
(8 lanes, AVX2) and the profile is unchanged. BraggScale2 chooses its operands instead of a branch;
scaling by 1 is exact. The Metal kernel shares the header and gets the same arithmetic.
cytochrome C --no-gpu: p.hkl and MTZ data identical; user cycles -7% against the previous commit on
the same (loaded, load 16-32) machine.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>