JS: improve performance of timesInt2#
In !9825 (comment 481071), @clyring proposed an implementation of timesInt2#
that could be faster:
const rl = Math.imul(l1, l2);
const p = l1 * l2 - (rl >>> 0);
// The multiplication can incur a rounding error x of at most one half ULP.
// Then we subtract the lower word and the answer without any intermediate
// rounding error is an exact multiple of 2**32, and thus round-to-even
// works in our favor, but sadly this is not enough: If that exact
// answer is a power of 2, the ULP below it is smaller than the ULP above it.
// So p can be wrong, but if so is only ever too close to zero by one ULP.
// Example: multiply 10000001 by 900719027.
// Compensate for this by multiplying p by a number /very slightly/ greater than 0.5**32.
const rh = (p * 2.328306436809747e-10) | 0;
We should benchmark it against the current implementation that uses 16-bit chunks.