function copysign (x, y) {
  const signx = x > 0 ? true : x < 0 ? false : 1 / x === Infinity
  const signy = y > 0 ? true : y < 0 ? false : 1 / y === Infinity
  return signx ^ signy ? -x : x
}
Returns a value with the magnitude of x and the sign of y.
@param {number} x
@param {number} y
@returns {number}